Public 型 | Public メソッド
クラス テンプレート mist::marching_cubes< ARRAY3, P >

ボリュームデータから等値面を生成するためのクラス [詳細]

#include <marching_cubes.h>

Public 型

typedef ARRAY3 image_type
 ボリュームデータの要素の型
typedef image_type::value_type value_type
 ボリュームデータの要素の型
typedef vector3< short > ivector_type
 cube の頂点座標の型
typedef vector3< P > vector_type
 ポリゴンの頂点座標の型
typedef vector_type::value_type float_type
 ポリゴンの頂点の法汚染ベクトルの型
typedef size_t size_type
 各ポリゴンのサイズ(頂点数)の型
typedef ptrdiff_t difference_type
 各ポリゴンのサイズ(頂点数)の型
typedef std::vector< vector_typevector_list_type
 3次元ベクトルリストを扱う型
typedef __mc__::node
< value_type, ivector_type
node_type
 cube の頂点情報を保持する型
typedef size_t(* func_type )(const node_type *, vector_type *, vector_type *, size_type *, float_type, const vector_type &, const vector_type &)
 cube 単位での等値面生成関数の型
typedef tagged_section
< value_type, size_type
section_type
 Interval-tree 用いる区間の型
typedef section_type::min_max_type min_max_type
 区間の最大値,最小値の型
typedef section_type::tag_type tag_type
 区間のタグ情報の型

Public メソッド

 marching_cubes ()
 コンストラクタ
 ~marching_cubes ()
 デストラクタ
bool is_preprocessed () const
 前処理されたデータの有無を返す
void threshold (float_type th)
 しきい値パラメータを設定
float_type threshold () const
 しきい値パラメータを取得設定
void offset (float_type ox, float_type oy, float_type oz)
 オフセットパラメータを設定
vector_type offset () const
 オフセットパラメータを取得設定
void scale (float_type sx, float_type sy, float_type sz)
 スケールパラメータを設定
vector_type scale () const
 スケールパラメータを取得設定
void isosurfacing (const image_type &va, vector_list_type &pv, vector_list_type &nv, std::vector< size_type > &sv)
 等値面生成(前処理の有無で等値面生成処理を分ける)
template<class T >
void isosurfacing (const image_type &va, facet_list< T > &facets)
 等値面生成(前処理の有無で等値面生成処理を分ける)
void isosurfacing_with_preprocess (const image_type &va, vector_list_type &pv, vector_list_type &nv, std::vector< size_type > &sv)
 等値面生成(前処理有り)
void isosurfacing_without_preprocess (const image_type &va, vector_list_type &pv, vector_list_type &nv, std::vector< size_type > &sv)
 等値面生成(前処理無し)
template<class T >
void isosurfacing_with_preprocess (const image_type &va, facet_list< T > &facets)
 等値面生成(前処理有り)
template<class T >
void isosurfacing_without_preprocess (const image_type &va, facet_list< T > &facets)
 等値面生成(前処理無し)
bool preprocess (const image_type &va)
 前処理(Interval-tree の構築や各格子点の法線ベクトルの計算など)
void de_preprocess ()
 前処理で構築されたデータを破棄

説明

template<typename ARRAY3, typename P = double>
class mist::marching_cubes< ARRAY3, P >

ボリュームデータから等値面を生成するためのクラス

区間の集合から2分木を構築し、通常O(n)かかる探索時間をO(log_2(n))に削減する. 線分や面分の重なり判定などに有効.

注意
mist::arra3< 算術型 > 型を入力とする.
ポリゴンの各頂点座標( mist::vector3< 算術型 >型 ),各頂点の法線ベクトル( mist::vector3< 算術型 > 型 ),各ポリゴンの頂点数( size_t 型 )の3つのstd::vectorを等値面生成結果の出力とする.
ポリゴンの各頂点座標と各頂点の法線ベクトルは OpenGL の頂点配列として利用可能( GL_POLYGON や GL_TRIANGLE_FAN 等に使える).
引数
ARRAY3… ボリュームデータの型
P… 等値面ポリゴンの頂点座標の要素の型
使用例
// ボリュームデータの用意
/*
ボリュームデータの作成処理
*/
// 等値面生成結果を格納するためのオブジェクトの準備
std::vector< mist::vector3< double > > pv; // double 型の要素を持つ頂点座標の集合
std::vector< mist::vector3< double > > nv; // double 型の要素を持つ法線ベクトルの集合
std::vector< size_t > sv; // 各ポリゴンのサイズ(頂点数)の集合
// ボリュームデータの要素が int 型で,
// 得られる等値面ポリゴンの頂点座標の要素と法線ベクトルが double 型の
// marching_cubes オブジェクトを作成
// パラメータ設定( 頂点座標のオフセット値,拡大率,等値面生成のための閾値 )
mcs.offset( 0.0, 0.0, 0.0 );
mcs.scale( 1.0, 1.0, 1.0 );
mcs.threshold( 0.0 );
// 上記のパラメータで va から等値面ポリゴンを生成し,結果を pv, nv, sv に格納
mcs.isosurfacing( va, pv, nv, sv );

関数

template<typename ARRAY3, typename P = double>
bool mist::marching_cubes< ARRAY3, P >::is_preprocessed ( ) const
inline

前処理されたデータの有無を返す

戻り値
… 前処理が終了していれば真を返す
template<typename ARRAY3, typename P = double>
void mist::marching_cubes< ARRAY3, P >::isosurfacing ( const image_type va,
vector_list_type pv,
vector_list_type nv,
std::vector< size_type > &  sv 
)
inline

等値面生成(前処理の有無で等値面生成処理を分ける)

引数
[in]va… ボリュームデータ
[out]pv… 等値面ポリゴンの頂点座標の集合
[out]nv… 等値面ポリゴンの頂点の法線ベクトルの集合
[out]sv… 等値面ポリゴンのサイズの集合
template<typename ARRAY3, typename P = double>
template<class T >
void mist::marching_cubes< ARRAY3, P >::isosurfacing ( const image_type va,
facet_list< T > &  facets 
)
inline

等値面生成(前処理の有無で等値面生成処理を分ける)

引数
[in]va… ボリュームデータ
[out]facets… 等値面ポリゴンの集合
template<typename ARRAY3, typename P = double>
void mist::marching_cubes< ARRAY3, P >::isosurfacing_with_preprocess ( const image_type va,
vector_list_type pv,
vector_list_type nv,
std::vector< size_type > &  sv 
)
inline

等値面生成(前処理有り)

引数
[in]va… ボリュームデータ
[out]pv… 等値面ポリゴンの頂点座標の集合
[out]nv… 等値面ポリゴンの頂点の法線ベクトルの集合
[out]sv… 等値面ポリゴンのサイズの集合
template<typename ARRAY3, typename P = double>
template<class T >
void mist::marching_cubes< ARRAY3, P >::isosurfacing_with_preprocess ( const image_type va,
facet_list< T > &  facets 
)
inline

等値面生成(前処理有り)

引数
[in]va… ボリュームデータ
[out]facets… 等値面ポリゴンの集合
template<typename ARRAY3, typename P = double>
void mist::marching_cubes< ARRAY3, P >::isosurfacing_without_preprocess ( const image_type va,
vector_list_type pv,
vector_list_type nv,
std::vector< size_type > &  sv 
)
inline

等値面生成(前処理無し)

引数
[in]va… ボリュームデータ
[out]pv… 等値面ポリゴンの頂点座標の集合
[out]nv… 等値面ポリゴンの頂点の法線ベクトルの集合
[out]sv… 等値面ポリゴンのサイズの集合
template<typename ARRAY3, typename P = double>
template<class T >
void mist::marching_cubes< ARRAY3, P >::isosurfacing_without_preprocess ( const image_type va,
facet_list< T > &  facets 
)
inline

等値面生成(前処理無し)

引数
[in]va… ボリュームデータ
[out]facets… 等値面ポリゴンの集合
template<typename ARRAY3, typename P = double>
void mist::marching_cubes< ARRAY3, P >::offset ( float_type  ox,
float_type  oy,
float_type  oz 
)
inline

オフセットパラメータを設定

引数
[in]ox… x 方向オフセット
[in]oy… y 方向オフセット
[in]oz… z 方向オフセット
template<typename ARRAY3, typename P = double>
vector_type mist::marching_cubes< ARRAY3, P >::offset ( ) const
inline

オフセットパラメータを取得設定

戻り値
オフセット値を取得する
template<typename ARRAY3, typename P = double>
bool mist::marching_cubes< ARRAY3, P >::preprocess ( const image_type va)
inline

前処理(Interval-tree の構築や各格子点の法線ベクトルの計算など)

引数
[in]va… 等値面生成処理の対象としているボリュームデータ
template<typename ARRAY3, typename P = double>
void mist::marching_cubes< ARRAY3, P >::scale ( float_type  sx,
float_type  sy,
float_type  sz 
)
inline

スケールパラメータを設定

引数
[in]sx… x 方向スケール
[in]sy… y 方向スケール
[in]sz… z 方向スケール
template<typename ARRAY3, typename P = double>
vector_type mist::marching_cubes< ARRAY3, P >::scale ( ) const
inline

スケールパラメータを取得設定

戻り値
スケール値を取得する
template<typename ARRAY3, typename P = double>
void mist::marching_cubes< ARRAY3, P >::threshold ( float_type  th)
inline

しきい値パラメータを設定

引数
[in]th… 閾値
template<typename ARRAY3, typename P = double>
float_type mist::marching_cubes< ARRAY3, P >::threshold ( ) const
inline

しきい値パラメータを取得設定

戻り値
しきい値を取得する

このクラスの説明は次のファイルから生成されました:

Generated on Wed Nov 12 2014 19:44:29 for MIST by doxygen 1.8.1.2