MIST (Media Integration Standard Toolkit)
修订版 | 7412d1f7b9e344f4b6596e7a0650af3774e23de4 (tree) |
---|---|
时间 | 2019-02-04 12:12:26 |
作者 | yoshihiro13103 <yoshihiro13103@user...> |
Commiter | yoshihiro13103 |
FIX error: declaration of 'P' shadows template parameter
@@ -1,4 +1,4 @@ | ||
1 | -// | |
1 | +?ソ// | |
2 | 2 | // Copyright (c) 2003-2011, MIST Project, Nagoya University |
3 | 3 | // All rights reserved. |
4 | 4 | // |
@@ -28,7 +28,7 @@ | ||
28 | 28 | |
29 | 29 | /// @file mist/config/binary.h |
30 | 30 | //! |
31 | -//! @brief バイナリ演算を行うためのクラス | |
31 | +//! @brief 繝舌う繝翫Μ貍皮ョ励r陦後≧縺溘a縺ョ繧ッ繝ゥ繧ケ | |
32 | 32 | //! |
33 | 33 | |
34 | 34 | #ifndef __INCLUDE_MIST_FACET__ |
@@ -59,55 +59,55 @@ | ||
59 | 59 | #include <deque> |
60 | 60 | #include <algorithm> |
61 | 61 | |
62 | -// mist名前空間の始まり | |
62 | +// mist蜷榊燕遨コ髢薙?蟋九∪繧 | |
63 | 63 | _MIST_BEGIN |
64 | 64 | |
65 | 65 | |
66 | 66 | #define __SHOW_FACET_DEBUG_INFORMATION__ 0 |
67 | 67 | |
68 | -//! @addtogroup facet_group ポリゴンを扱うクラス | |
68 | +//! @addtogroup facet_group 繝昴Μ繧エ繝ウ繧呈桶縺?け繝ゥ繧ケ | |
69 | 69 | //! |
70 | -//! @code 次のヘッダをインクルードする | |
70 | +//! @code 谺。縺ョ繝倥ャ繝?繧偵う繝ウ繧ッ繝ォ繝シ繝峨☆繧 | |
71 | 71 | //! #include <mist/facet.h> |
72 | 72 | //! @endcode |
73 | 73 | //! |
74 | 74 | //! @{ |
75 | 75 | |
76 | -/// @brief ポリゴン(三角形)を扱うクラス | |
76 | +/// @brief 繝昴Μ繧エ繝ウ?井ク芽ァ貞ス「?峨r謇ア縺?け繝ゥ繧ケ | |
77 | 77 | //! |
78 | -//! @param T … 内部で用いるデータ型 | |
78 | +//! @param T 窶ヲ 蜀?Κ縺ァ逕ィ縺?k繝??繧ソ蝙 | |
79 | 79 | //! |
80 | 80 | template < class T > |
81 | 81 | class facet |
82 | 82 | { |
83 | 83 | public: |
84 | - typedef T value_type; ///< @brief MISTのコンテナ内に格納するデータ型.mist::array< data > の data と同じ | |
85 | - typedef size_t size_type; ///< @brief 符号なしの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には size_t 型と同じ | |
86 | - typedef ptrdiff_t difference_type; ///< @brief 符号付きの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には ptrdiff_t 型と同じ | |
87 | - typedef vector3< T > vector_type; ///< @brief 頂点などを表す3次元ベクトル型 | |
88 | - typedef typename float_type< T >::value_type float_type; ///< @brief 長さなどを計算するときに用いる浮動小数点型 | |
84 | + typedef T value_type; ///< @brief MIST縺ョ繧ウ繝ウ繝?リ蜀?↓譬シ邏阪☆繧九ョ繝シ繧ソ蝙具シ士ist::array< data > 縺ョ data 縺ィ蜷後§ | |
85 | + typedef size_t size_type; ///< @brief 隨ヲ蜿キ縺ェ縺励?謨エ謨ー繧定。ィ縺吝梛?弱さ繝ウ繝?リ蜀??隕∫エ?謨ー繧?シ悟推隕∫エ?繧呈欠螳壹☆繧九→縺阪↑縺ゥ縺ォ蛻ゥ逕ィ縺暦シ悟?驛ィ逧?↓縺ッ size_t 蝙九→蜷後§ | |
86 | + typedef ptrdiff_t difference_type; ///< @brief 隨ヲ蜿キ莉倥″縺ョ謨エ謨ー繧定。ィ縺吝梛?弱さ繝ウ繝?リ蜀??隕∫エ?謨ー繧?シ悟推隕∫エ?繧呈欠螳壹☆繧九→縺阪↑縺ゥ縺ォ蛻ゥ逕ィ縺暦シ悟?驛ィ逧?↓縺ッ ptrdiff_t 蝙九→蜷後§ | |
87 | + typedef vector3< T > vector_type; ///< @brief 鬆らせ縺ェ縺ゥ繧定。ィ縺?谺。蜈??繧ッ繝医Ν蝙 | |
88 | + typedef typename float_type< T >::value_type float_type; ///< @brief 髟キ縺輔↑縺ゥ繧定ィ育ョ励☆繧九→縺阪↓逕ィ縺?k豬ョ蜍募ー乗焚轤ケ蝙 | |
89 | 89 | |
90 | 90 | public: |
91 | - vector_type normal; ///< @brief 法線 | |
92 | - vector_type p1; ///< @brief 座標1 | |
93 | - vector_type p2; ///< @brief 座標2 | |
94 | - vector_type p3; ///< @brief 座標3 | |
91 | + vector_type normal; ///< @brief 豕慕キ | |
92 | + vector_type p1; ///< @brief 蠎ァ讓? | |
93 | + vector_type p2; ///< @brief 蠎ァ讓? | |
94 | + vector_type p3; ///< @brief 蠎ァ讓? | |
95 | 95 | |
96 | - /// @brief デフォルトコンストラクタ(全要素をデフォルト値で初期化する) | |
96 | + /// @brief 繝?ヵ繧ゥ繝ォ繝医さ繝ウ繧ケ繝医Λ繧ッ繧ソ?亥?隕∫エ?繧偵ョ繝輔か繝ォ繝亥?、縺ァ蛻晄悄蛹悶☆繧具シ | |
97 | 97 | facet( ) : normal( 0, 0, 1 ){ } |
98 | 98 | |
99 | - /// @brief 指定した値を用いて初期化する | |
99 | + /// @brief 謖?ョ壹@縺溷?、繧堤畑縺?※蛻晄悄蛹悶☆繧 | |
100 | 100 | facet( const vector_type &N, const vector_type &P1, const vector_type &P2, const vector_type &P3 ) : normal( N ), p1( P1 ), p2( P2 ), p3( P3 ){ } |
101 | 101 | |
102 | - /// @brief 指定した値を用いて初期化する(点の並び順は反時計回りを仮定) | |
102 | + /// @brief 謖?ョ壹@縺溷?、繧堤畑縺?※蛻晄悄蛹悶☆繧具シ育せ縺ョ荳ヲ縺ウ鬆??蜿肴凾險亥屓繧翫r莉ョ螳夲シ | |
103 | 103 | facet( const vector_type &P1, const vector_type &P2, const vector_type &P3 ) : normal( ( ( P2 - P1 ).outer( P3 - P1 ) ).unit( ) ), p1( P1 ), p2( P2 ), p3( P3 ){ } |
104 | 104 | |
105 | - /// @brief 他のポリゴンオブジェクトを用いて初期化する | |
105 | + /// @brief 莉悶?繝昴Μ繧エ繝ウ繧ェ繝悶ず繧ァ繧ッ繝医r逕ィ縺?※蛻晄悄蛹悶☆繧 | |
106 | 106 | template < class TT > |
107 | 107 | facet( const facet< TT > &f ) : normal( f.normal ), p1( f.p1 ), p2( f.p2 ), p3( f.p3 ){ } |
108 | 108 | |
109 | 109 | |
110 | - /// @brief 他のポリゴンオブジェクトを代入する | |
110 | + /// @brief 莉悶?繝昴Μ繧エ繝ウ繧ェ繝悶ず繧ァ繧ッ繝医r莉」蜈・縺吶k | |
111 | 111 | template < class TT > |
112 | 112 | const facet &operator =( const facet< TT > &f ) |
113 | 113 | { |
@@ -123,14 +123,14 @@ public: | ||
123 | 123 | }; |
124 | 124 | |
125 | 125 | |
126 | -/// @brief 指定されたストリームに,ポリゴンオブジェクトを整形して出力する | |
126 | +/// @brief 謖?ョ壹&繧後◆繧ケ繝医Μ繝シ繝?縺ォ?後?繝ェ繧エ繝ウ繧ェ繝悶ず繧ァ繧ッ繝医r謨エ蠖「縺励※蜃コ蜉帙☆繧 | |
127 | 127 | //! |
128 | -//! @param[in,out] out … 入力と出力を行うストリーム | |
129 | -//! @param[in] f … ポリゴンオブジェクト | |
128 | +//! @param[in,out] out 窶ヲ 蜈・蜉帙→蜃コ蜉帙r陦後≧繧ケ繝医Μ繝シ繝? | |
129 | +//! @param[in] f 窶ヲ 繝昴Μ繧エ繝ウ繧ェ繝悶ず繧ァ繧ッ繝 | |
130 | 130 | //! |
131 | -//! @return 入力されたストリーム | |
131 | +//! @return 蜈・蜉帙&繧後◆繧ケ繝医Μ繝シ繝? | |
132 | 132 | //! |
133 | -//! @code 出力例 | |
133 | +//! @code 蜃コ蜉帑セ | |
134 | 134 | //! ( 1, 2, 3, 4 ) |
135 | 135 | //! @endcode |
136 | 136 | //! |
@@ -144,9 +144,9 @@ template < class T > inline std::ostream &operator <<( std::ostream &out, const | ||
144 | 144 | } |
145 | 145 | |
146 | 146 | |
147 | -/// @brief ポリゴン(三角形)の集合を扱うクラス | |
147 | +/// @brief 繝昴Μ繧エ繝ウ?井ク芽ァ貞ス「?峨?髮?粋繧呈桶縺?け繝ゥ繧ケ | |
148 | 148 | //! |
149 | -//! @param T … 内部で用いるデータ型 | |
149 | +//! @param T 窶ヲ 蜀?Κ縺ァ逕ィ縺?k繝??繧ソ蝙 | |
150 | 150 | //! |
151 | 151 | template < class T > |
152 | 152 | class facet_list : public std::vector< facet< T > > |
@@ -155,27 +155,27 @@ private: | ||
155 | 155 | typedef std::vector< facet< T > > base; |
156 | 156 | |
157 | 157 | public: |
158 | - typedef facet< T > facet_type; ///< @brief ポリゴンタイプ | |
159 | - typedef size_t size_type; ///< @brief 符号なしの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には size_t 型と同じ | |
160 | - typedef ptrdiff_t difference_type; ///< @brief 符号付きの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には ptrdiff_t 型と同じ | |
161 | - typedef typename facet_type::vector_type vector_type; ///< @brief 頂点などを表す3次元ベクトル型 | |
162 | - typedef typename float_type< T >::value_type float_type; ///< @brief 長さなどを計算するときに用いる浮動小数点型 | |
158 | + typedef facet< T > facet_type; ///< @brief 繝昴Μ繧エ繝ウ繧ソ繧、繝 | |
159 | + typedef size_t size_type; ///< @brief 隨ヲ蜿キ縺ェ縺励?謨エ謨ー繧定。ィ縺吝梛?弱さ繝ウ繝?リ蜀??隕∫エ?謨ー繧?シ悟推隕∫エ?繧呈欠螳壹☆繧九→縺阪↑縺ゥ縺ォ蛻ゥ逕ィ縺暦シ悟?驛ィ逧?↓縺ッ size_t 蝙九→蜷後§ | |
160 | + typedef ptrdiff_t difference_type; ///< @brief 隨ヲ蜿キ莉倥″縺ョ謨エ謨ー繧定。ィ縺吝梛?弱さ繝ウ繝?リ蜀??隕∫エ?謨ー繧?シ悟推隕∫エ?繧呈欠螳壹☆繧九→縺阪↑縺ゥ縺ォ蛻ゥ逕ィ縺暦シ悟?驛ィ逧?↓縺ッ ptrdiff_t 蝙九→蜷後§ | |
161 | + typedef typename facet_type::vector_type vector_type; ///< @brief 鬆らせ縺ェ縺ゥ繧定。ィ縺?谺。蜈??繧ッ繝医Ν蝙 | |
162 | + typedef typename float_type< T >::value_type float_type; ///< @brief 髟キ縺輔↑縺ゥ繧定ィ育ョ励☆繧九→縺阪↓逕ィ縺?k豬ョ蜍募ー乗焚轤ケ蝙 | |
163 | 163 | |
164 | 164 | public: |
165 | - std::string name; ///< @brief 法線 | |
165 | + std::string name; ///< @brief 豕慕キ | |
166 | 166 | |
167 | - /// @brief デフォルトコンストラクタ(全要素をデフォルト値で初期化する) | |
167 | + /// @brief 繝?ヵ繧ゥ繝ォ繝医さ繝ウ繧ケ繝医Λ繧ッ繧ソ?亥?隕∫エ?繧偵ョ繝輔か繝ォ繝亥?、縺ァ蛻晄悄蛹悶☆繧具シ | |
168 | 168 | facet_list( ){ } |
169 | 169 | |
170 | - /// @brief 指定した名前でポリゴン集合を初期化する | |
170 | + /// @brief 謖?ョ壹@縺溷錐蜑阪〒繝昴Μ繧エ繝ウ髮?粋繧貞?譛溷喧縺吶k | |
171 | 171 | facet_list( const std::string &name_ ) : name( name_ ){ } |
172 | 172 | |
173 | - /// @brief 他のポリゴンオブジェクトを用いて初期化する | |
173 | + /// @brief 莉悶?繝昴Μ繧エ繝ウ繧ェ繝悶ず繧ァ繧ッ繝医r逕ィ縺?※蛻晄悄蛹悶☆繧 | |
174 | 174 | template < class TT > |
175 | 175 | facet_list( const facet_list< TT > &f ) : base( f ), name( f.name ){ } |
176 | 176 | |
177 | 177 | |
178 | - /// @brief 他のポリゴンオブジェクトを代入する | |
178 | + /// @brief 莉悶?繝昴Μ繧エ繝ウ繧ェ繝悶ず繧ァ繧ッ繝医r莉」蜈・縺吶k | |
179 | 179 | template < class TT > |
180 | 180 | const facet_list &operator =( const facet_list< TT > &f ) |
181 | 181 | { |
@@ -189,16 +189,16 @@ public: | ||
189 | 189 | }; |
190 | 190 | |
191 | 191 | |
192 | -/// @brief 3角形パッチの集合から頂点集合と三角形パッチを構成するインデックス集合に変換する | |
192 | +/// @brief 3隗貞ス「繝代ャ繝√?髮?粋縺九i鬆らせ髮?粋縺ィ荳芽ァ貞ス「繝代ャ繝√r讒区?縺吶k繧、繝ウ繝?ャ繧ッ繧ケ髮?粋縺ォ螟画鋤縺吶k | |
193 | 193 | //! |
194 | -//! 共通して使用する頂点を全てまとめた頂点集合を作成する. | |
194 | +//! 蜈ア騾壹@縺ヲ菴ソ逕ィ縺吶k鬆らせ繧貞?縺ヲ縺セ縺ィ繧√◆鬆らせ髮?粋繧剃ス懈?縺吶k? | |
195 | 195 | //! |
196 | -//! @param[in] facets … 3角形パッチの集合 | |
197 | -//! @param[in] vertices … 頂点集合 | |
198 | -//! @param[in] faces … 三角形パッチを構成するインデックス集合 | |
199 | -//! @param[in] eps … 同一頂点と判定される頂点の距離 | |
196 | +//! @param[in] facets 窶ヲ 3隗貞ス「繝代ャ繝√?髮?粋 | |
197 | +//! @param[in] vertices 窶ヲ 鬆らせ髮?粋 | |
198 | +//! @param[in] faces 窶ヲ 荳芽ァ貞ス「繝代ャ繝√r讒区?縺吶k繧、繝ウ繝?ャ繧ッ繧ケ髮?粋 | |
199 | +//! @param[in] eps 窶ヲ 蜷御ク?鬆らせ縺ィ蛻、螳壹&繧後k鬆らせ縺ョ霍晞屬 | |
200 | 200 | //! |
201 | -//! @return 頂点集合とインデックス集合の作成に成功したかどうか | |
201 | +//! @return 鬆らせ髮?粋縺ィ繧、繝ウ繝?ャ繧ッ繧ケ髮?粋縺ョ菴懈?縺ォ謌仙粥縺励◆縺九←縺?° | |
202 | 202 | //! |
203 | 203 | template < class T, class T1, class T2 > |
204 | 204 | inline bool convert_to_vertex_face_list( const facet_list< T > &facets, std::vector< vector3< T1 > > &vertices, std::vector< vector3< T2 > > &faces, const double eps = 1.0e-6 ) |
@@ -223,7 +223,7 @@ inline bool convert_to_vertex_face_list( const facet_list< T > &facets, std::vec | ||
223 | 223 | |
224 | 224 | double SCALE = 0.1 / eps; |
225 | 225 | |
226 | - // データをテーブルに登録する | |
226 | + // 繝??繧ソ繧偵ユ繝シ繝悶Ν縺ォ逋サ骭イ縺吶k | |
227 | 227 | for( size_type i = 0 ; i < facets.size( ) ; i++ ) |
228 | 228 | { |
229 | 229 | const typename facet_list< T >::facet_type &f = facets[ i ]; |
@@ -267,7 +267,7 @@ inline bool convert_to_vertex_face_list( const facet_list< T > &facets, std::vec | ||
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
270 | - // 頂点を反時計回りに並べる | |
270 | + // 鬆らせ繧貞渚譎りィ亥屓繧翫↓荳ヲ縺ケ繧 | |
271 | 271 | if( f.normal.inner( ( v[ 1 ] - v[ 0 ] ).outer( v[ 2 ] - v[ 0 ] ) ) < 0 ) |
272 | 272 | { |
273 | 273 | size_type tmp = indx[ 1 ]; |
@@ -427,11 +427,11 @@ namespace __mc__ | ||
427 | 427 | face_lists.clear( ); |
428 | 428 | face_lists.reserve( faces.size( ) ); |
429 | 429 | |
430 | - // ダミーを1つだけ挿入する | |
430 | + // 繝?繝溘?繧?縺、縺?縺第諺蜈・縺吶k | |
431 | 431 | face_lists.push_back( face_type( ) ); |
432 | 432 | edge_lists.push_back( edge_type( ) ); |
433 | 433 | |
434 | - // 辺をテーブルに登録する | |
434 | + // 霎コ繧偵ユ繝シ繝悶Ν縺ォ逋サ骭イ縺吶k | |
435 | 435 | for( size_type i = 1 ; i <= faces.size( ) ; i++ ) |
436 | 436 | { |
437 | 437 | const ivector_type &f = faces[ i - 1 ]; |
@@ -440,14 +440,14 @@ namespace __mc__ | ||
440 | 440 | difference_type key23 = create_key( f.y, f.z, vertices.size( ) ); |
441 | 441 | difference_type key31 = create_key( f.z, f.x, vertices.size( ) ); |
442 | 442 | |
443 | - // 辺1-2を調べる | |
443 | + // 霎コ1-2繧定ェソ縺ケ繧 | |
444 | 444 | iterator ite = table.find( key12 ); |
445 | 445 | if( ite == table.end( ) ) |
446 | 446 | { |
447 | - // 新規に辺と面の対応情報を追加する | |
447 | + // 譁ー隕上↓霎コ縺ィ髱「縺ョ蟇セ蠢懈ュ蝣ア繧定ソス蜉?縺吶k | |
448 | 448 | table[ key12 ] = edge_lists.size( ); |
449 | 449 | |
450 | - // エッジを登録する | |
450 | + // 繧ィ繝?ず繧堤匳骭イ縺吶k | |
451 | 451 | if( f.x < f.y ) |
452 | 452 | { |
453 | 453 | edge_lists.push_back( edge_type( f.x, f.y, i ) ); |
@@ -470,14 +470,14 @@ namespace __mc__ | ||
470 | 470 | std::cerr << "Edge may be shared among more than three faces." << std::endl; |
471 | 471 | } |
472 | 472 | |
473 | - // 辺2-3を調べる | |
473 | + // 霎コ2-3繧定ェソ縺ケ繧 | |
474 | 474 | ite = table.find( key23 ); |
475 | 475 | if( ite == table.end( ) ) |
476 | 476 | { |
477 | - // 新規に辺情報を追加する | |
477 | + // 譁ー隕上↓霎コ諠??ア繧定ソス蜉?縺吶k | |
478 | 478 | table[ key23 ] = edge_lists.size( ); |
479 | 479 | |
480 | - // エッジを登録する | |
480 | + // 繧ィ繝?ず繧堤匳骭イ縺吶k | |
481 | 481 | if( f.y < f.z ) |
482 | 482 | { |
483 | 483 | edge_lists.push_back( edge_type( f.y, f.z, i ) ); |
@@ -500,14 +500,14 @@ namespace __mc__ | ||
500 | 500 | std::cerr << "Edge may be shared among more than three faces." << std::endl; |
501 | 501 | } |
502 | 502 | |
503 | - // 辺2-3を調べる | |
503 | + // 霎コ2-3繧定ェソ縺ケ繧 | |
504 | 504 | ite = table.find( key31 ); |
505 | 505 | if( ite == table.end( ) ) |
506 | 506 | { |
507 | - // 新規に辺情報を追加する | |
507 | + // 譁ー隕上↓霎コ諠??ア繧定ソス蜉?縺吶k | |
508 | 508 | table[ key31 ] = edge_lists.size( ); |
509 | 509 | |
510 | - // エッジを登録する | |
510 | + // 繧ィ繝?ず繧堤匳骭イ縺吶k | |
511 | 511 | if( f.z < f.x ) |
512 | 512 | { |
513 | 513 | edge_lists.push_back( edge_type( f.z, f.x, i ) ); |
@@ -531,7 +531,7 @@ namespace __mc__ | ||
531 | 531 | } |
532 | 532 | } |
533 | 533 | |
534 | - // 面と辺を関連付ける | |
534 | + // 髱「縺ィ霎コ繧帝未騾」莉倥¢繧 | |
535 | 535 | for( size_type i = 1 ; i <= faces.size( ) ; i++ ) |
536 | 536 | { |
537 | 537 | const ivector_type &F = faces[ i - 1 ]; |
@@ -541,7 +541,7 @@ namespace __mc__ | ||
541 | 541 | difference_type key23 = create_key( F.y, F.z, vertices.size( ) ); |
542 | 542 | difference_type key31 = create_key( F.z, F.x, vertices.size( ) ); |
543 | 543 | |
544 | - // 辺1-2を調べる | |
544 | + // 霎コ1-2繧定ェソ縺ケ繧 | |
545 | 545 | iterator ite = table.find( key12 ); |
546 | 546 | if( ite == table.end( ) ) |
547 | 547 | { |
@@ -553,7 +553,7 @@ namespace __mc__ | ||
553 | 553 | f.eid1 = F.x == e.v1 ? ite->second : -ite->second; |
554 | 554 | } |
555 | 555 | |
556 | - // 辺2-3を調べる | |
556 | + // 霎コ2-3繧定ェソ縺ケ繧 | |
557 | 557 | ite = table.find( key23 ); |
558 | 558 | if( ite == table.end( ) ) |
559 | 559 | { |
@@ -565,7 +565,7 @@ namespace __mc__ | ||
565 | 565 | f.eid2 = F.y == e.v1 ? ite->second : -ite->second; |
566 | 566 | } |
567 | 567 | |
568 | - // 辺2-3を調べる | |
568 | + // 霎コ2-3繧定ェソ縺ケ繧 | |
569 | 569 | ite = table.find( key31 ); |
570 | 570 | if( ite == table.end( ) ) |
571 | 571 | { |
@@ -706,18 +706,18 @@ namespace __mc__ | ||
706 | 706 | double a21 = a( 1, 0 ), a22 = a( 1, 1 ), a23 = a( 1, 2 ); |
707 | 707 | double a31 = a( 2, 0 ), a32 = a( 2, 1 ), a33 = a( 2, 2 ); |
708 | 708 | |
709 | - // 共通で利用する係数の計算 | |
709 | + // 蜈ア騾壹〒蛻ゥ逕ィ縺吶k菫よ焚縺ョ險育ョ | |
710 | 710 | double _22x33_23x32_ = a22 * a33 - a23 * a32; |
711 | 711 | double _21x32_22x31_ = a21 * a32 - a22 * a31; |
712 | 712 | double _23x31_21x33_ = a23 * a31 - a21 * a33; |
713 | 713 | |
714 | - // 行列式を計算 | |
714 | + // 陦悟?蠑上r險育ョ | |
715 | 715 | double detA = a11 * _22x33_23x32_ + a13 * _21x32_22x31_ + a12 * _23x31_21x33_; |
716 | 716 | |
717 | - // 逆行列が存在する場合のも逆行列を計算する | |
717 | + // 騾?。悟?縺悟ュ伜惠縺吶k蝣エ蜷医?繧る??。悟?繧定ィ育ョ励☆繧 | |
718 | 718 | if( std::abs( detA ) > eps ) |
719 | 719 | { |
720 | - // 各要素の値を計算 | |
720 | + // 蜷?ヲ∫エ?縺ョ蛟、繧定ィ育ョ | |
721 | 721 | double A11 = _22x33_23x32_; |
722 | 722 | double A12 = a13 * a32 - a12 * a33; |
723 | 723 | double A13 = a12 * a23 - a13 * a22; |
@@ -763,7 +763,7 @@ namespace __mc__ | ||
763 | 763 | typedef Matrix matrix_type; |
764 | 764 | typedef vector3< T1 > vector_type; |
765 | 765 | |
766 | - // 各頂点の誤差評価行列を求める | |
766 | + // 蜷??らせ縺ョ隱、蟾ョ隧穂セ。陦悟?繧呈アゅa繧 | |
767 | 767 | matrix_type QQ = Q[ edge.v1 ] + Q[ edge.v2 ]; |
768 | 768 | matrix_type QQQ = matrix_type::_33( QQ( 0, 0 ), QQ( 0, 1 ), QQ( 0, 2 ), |
769 | 769 | QQ( 1, 0 ), QQ( 1, 1 ), QQ( 1, 2 ), |
@@ -963,7 +963,7 @@ namespace __mc__ | ||
963 | 963 | } |
964 | 964 | |
965 | 965 | |
966 | - // 法線が入れ替わるかどうかをチェックする | |
966 | + // 豕慕キ壹′蜈・繧梧崛繧上k縺九←縺?°繧偵メ繧ァ繝?け縺吶k | |
967 | 967 | for( typename std::set< difference_type >::iterator ite = face_map1.begin( ) ; ite != face_map1.end( ) ; ++ite ) |
968 | 968 | { |
969 | 969 | if( *ite != 0 && face_map2.find( *ite ) == face_map2.end( ) ) |
@@ -1030,25 +1030,25 @@ namespace __mc__ | ||
1030 | 1030 | const edge_type &e = edges[ eid ]; |
1031 | 1031 | if( e.v1 == vs && eid1 == 0 ) |
1032 | 1032 | { |
1033 | - // vs へ接続する辺 | |
1033 | + // vs 縺ク謗・邯壹☆繧玖セコ | |
1034 | 1034 | eid1 = eid; |
1035 | 1035 | vv = e.v2; |
1036 | 1036 | } |
1037 | 1037 | else if( e.v2 == vs && eid1 == 0 ) |
1038 | 1038 | { |
1039 | - // vs へ接続する辺 | |
1039 | + // vs 縺ク謗・邯壹☆繧玖セコ | |
1040 | 1040 | eid1 = eid; |
1041 | 1041 | vv = e.v1; |
1042 | 1042 | } |
1043 | 1043 | else if( e.v1 == vt ) |
1044 | 1044 | { |
1045 | - // vt へ接続する辺 | |
1045 | + // vt 縺ク謗・邯壹☆繧玖セコ | |
1046 | 1046 | eid2 = eid; |
1047 | 1047 | vv = e.v2; |
1048 | 1048 | } |
1049 | 1049 | else if( e.v2 == vt ) |
1050 | 1050 | { |
1051 | - // vt へ接続する辺 | |
1051 | + // vt 縺ク謗・邯壹☆繧玖セコ | |
1052 | 1052 | eid2 = eid; |
1053 | 1053 | vv = e.v1; |
1054 | 1054 | } |
@@ -1071,7 +1071,7 @@ namespace __mc__ | ||
1071 | 1071 | |
1072 | 1072 | if( is_sharp_edge( EDGE ) ) |
1073 | 1073 | { |
1074 | - // 縁に接している辺は削除対象外 | |
1074 | + // 邵√↓謗・縺励※縺?k霎コ縺ッ蜑企勁蟇セ雎。螟 | |
1075 | 1075 | return( false ); |
1076 | 1076 | } |
1077 | 1077 |
@@ -1087,12 +1087,12 @@ namespace __mc__ | ||
1087 | 1087 | const edge_type &e22 = edges[ f2.eid2 < 0 ? -f2.eid2 : f2.eid2 ]; |
1088 | 1088 | const edge_type &e23 = edges[ f2.eid3 < 0 ? -f2.eid3 : f2.eid3 ]; |
1089 | 1089 | |
1090 | - // 面1をチェック | |
1090 | + // 髱「1繧偵メ繧ァ繝?け | |
1091 | 1091 | compute_edge_connections( edges, EID, f1.eid1 < 0 ? -f1.eid1 : f1.eid1, vs, vt, vl, eid[ 0 ], eid[ 1 ] ); |
1092 | 1092 | compute_edge_connections( edges, EID, f1.eid2 < 0 ? -f1.eid2 : f1.eid2, vs, vt, vl, eid[ 0 ], eid[ 1 ] ); |
1093 | 1093 | compute_edge_connections( edges, EID, f1.eid3 < 0 ? -f1.eid3 : f1.eid3, vs, vt, vl, eid[ 0 ], eid[ 1 ] ); |
1094 | 1094 | |
1095 | - // 面2をチェック | |
1095 | + // 髱「2繧偵メ繧ァ繝?け | |
1096 | 1096 | compute_edge_connections( edges, EID, f2.eid1 < 0 ? -f2.eid1 : f2.eid1, vs, vt, vr, eid[ 3 ], eid[ 2 ] ); |
1097 | 1097 | compute_edge_connections( edges, EID, f2.eid2 < 0 ? -f2.eid2 : f2.eid2, vs, vt, vr, eid[ 3 ], eid[ 2 ] ); |
1098 | 1098 | compute_edge_connections( edges, EID, f2.eid3 < 0 ? -f2.eid3 : f2.eid3, vs, vt, vr, eid[ 3 ], eid[ 2 ] ); |
@@ -1111,7 +1111,7 @@ namespace __mc__ | ||
1111 | 1111 | { |
1112 | 1112 | if( ite->second == val ) |
1113 | 1113 | { |
1114 | - // 削除する | |
1114 | + // 蜑企勁縺吶k | |
1115 | 1115 | ite = vertex_edge_map.erase( ite ); |
1116 | 1116 | } |
1117 | 1117 | else |
@@ -1146,11 +1146,11 @@ namespace __mc__ | ||
1146 | 1146 | |
1147 | 1147 | if( is_sharp_edge( EDGE ) ) |
1148 | 1148 | { |
1149 | - // 縁に接している辺は削除対象外 | |
1149 | + // 邵√↓謗・縺励※縺?k霎コ縺ッ蜑企勁蟇セ雎。螟 | |
1150 | 1150 | return( true ); |
1151 | 1151 | } |
1152 | 1152 | |
1153 | - // 処理対象の辺の登録と,テーブル内からの削除等を行う | |
1153 | + // 蜃ヲ逅?ッセ雎。縺ョ霎コ縺ョ逋サ骭イ縺ィ?後ユ繝シ繝悶Ν蜀?°繧峨?蜑企勁遲峨r陦後≧ | |
1154 | 1154 | difference_type vs = EDGE.v1; |
1155 | 1155 | difference_type vt = EDGE.v2; |
1156 | 1156 | difference_type vl, vr; |
@@ -1165,7 +1165,7 @@ namespace __mc__ | ||
1165 | 1165 | return( true ); |
1166 | 1166 | } |
1167 | 1167 | |
1168 | - // 指定した辺を削除した場合にトポロジーが変化するかどうかをチェックする | |
1168 | + // 謖?ョ壹@縺溯セコ繧貞炎髯、縺励◆蝣エ蜷医↓繝医?繝ュ繧ク繝シ縺悟、牙喧縺吶k縺九←縺?°繧偵メ繧ァ繝?け縺吶k | |
1169 | 1169 | if( is_sharp_edge( edges[ eid[ 0 ] ] ) && is_sharp_edge( edges[ eid[ 1 ] ] ) ) |
1170 | 1170 | { |
1171 | 1171 | return( true ); |
@@ -1227,7 +1227,7 @@ namespace __mc__ | ||
1227 | 1227 | { |
1228 | 1228 | if( vertex_list.find( e.v1 ) != vertex_list.end( ) ) |
1229 | 1229 | { |
1230 | - // 面の存在しないループを発見 | |
1230 | + // 髱「縺ョ蟄伜惠縺励↑縺?Ν繝シ繝励r逋コ隕 | |
1231 | 1231 | return( true ); |
1232 | 1232 | } |
1233 | 1233 | } |
@@ -1235,7 +1235,7 @@ namespace __mc__ | ||
1235 | 1235 | { |
1236 | 1236 | if( vertex_list.find( e.v2 ) != vertex_list.end( ) ) |
1237 | 1237 | { |
1238 | - // 面の存在しないループを発見 | |
1238 | + // 髱「縺ョ蟄伜惠縺励↑縺?Ν繝シ繝励r逋コ隕 | |
1239 | 1239 | return( true ); |
1240 | 1240 | } |
1241 | 1241 | } |
@@ -1249,21 +1249,21 @@ namespace __mc__ | ||
1249 | 1249 | } |
1250 | 1250 | } |
1251 | 1251 | |
1252 | -/// @brief 3角形パッチの集合から頂点集合と三角形パッチを構成するインデックス集合に変換する | |
1252 | +/// @brief 3隗貞ス「繝代ャ繝√?髮?粋縺九i鬆らせ髮?粋縺ィ荳芽ァ貞ス「繝代ャ繝√r讒区?縺吶k繧、繝ウ繝?ャ繧ッ繧ケ髮?粋縺ォ螟画鋤縺吶k | |
1253 | 1253 | //! |
1254 | -//! 共通して使用する頂点を全てまとめた頂点集合を作成する. | |
1254 | +//! 蜈ア騾壹@縺ヲ菴ソ逕ィ縺吶k鬆らせ繧貞?縺ヲ縺セ縺ィ繧√◆鬆らせ髮?粋繧剃ス懈?縺吶k? | |
1255 | 1255 | //! |
1256 | -//! - 参考文献 | |
1256 | +//! - 蜿り??枚迪ョ | |
1257 | 1257 | //! - Michael Garland and Paul S. Heckbert, "Surface Simplification Using Quadric Error Metrics," Proceedings of SIGGRAPH 97, pp.209-216, 1997 |
1258 | 1258 | //! - Michael Garland and Paul S. Heckbert, "Simplifying Surfaces with Color and Texture using Quadric Error Metrics," Proceedings of IEEE Visualization conference , pp.263-269, 1998 |
1259 | 1259 | //! |
1260 | -//! @param[in] facets … 3角形パッチの集合 | |
1261 | -//! @param[in] number_of_facets … 削減後の3角形パッチ数 | |
1262 | -//! @param[in] use_optimal_vertex_placement … 辺削除後に最適な位置に頂点を移動させるかどうか(有効にすると場合によってはきれいなメッシュが得られない場合あり) | |
1263 | -//! @param[in] threshold_for_triangle_compactness … 辺削除後に発生する尖った三角形を抑制する(0〜1の間を設定) | |
1264 | -//! @param[in] eps … 同一頂点と判定される頂点の距離 | |
1260 | +//! @param[in] facets 窶ヲ 3隗貞ス「繝代ャ繝√?髮?粋 | |
1261 | +//! @param[in] number_of_facets 窶ヲ 蜑頑ク帛セ後?3隗貞ス「繝代ャ繝∵焚 | |
1262 | +//! @param[in] use_optimal_vertex_placement 窶ヲ 霎コ蜑企勁蠕後↓譛?驕ゥ縺ェ菴咲スョ縺ォ鬆らせ繧堤ァサ蜍輔&縺帙k縺九←縺?°?域怏蜉ケ縺ォ縺吶k縺ィ蝣エ蜷医↓繧医▲縺ヲ縺ッ縺阪l縺?↑繝。繝?す繝・縺悟セ励i繧後↑縺??エ蜷医≠繧奇シ | |
1263 | +//! @param[in] threshold_for_triangle_compactness 窶ヲ 霎コ蜑企勁蠕後↓逋コ逕溘☆繧句ー悶▲縺滉ク芽ァ貞ス「繧呈椛蛻カ縺吶k??縲?縺ョ髢薙r險ュ螳夲シ | |
1264 | +//! @param[in] eps 窶ヲ 蜷御ク?鬆らせ縺ィ蛻、螳壹&繧後k鬆らせ縺ョ霍晞屬 | |
1265 | 1265 | //! |
1266 | -//! @return 3角形パッチす数の削減に成功したかどうか | |
1266 | +//! @return 3隗貞ス「繝代ャ繝√☆謨ー縺ョ蜑頑ク帙↓謌仙粥縺励◆縺九←縺?° | |
1267 | 1267 | //! |
1268 | 1268 | template < class T > |
1269 | 1269 | inline bool surface_simplification( facet_list< T > &facets, size_t number_of_facets, bool use_optimal_vertex_placement = true, double threshold_for_triangle_compactness = 0.0, const double eps = 1.0e-3 ) |
@@ -1284,13 +1284,13 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1284 | 1284 | std::vector< face_type > faces; |
1285 | 1285 | edge_list_type edges; |
1286 | 1286 | |
1287 | - // 頂点と面のリストに変換する | |
1287 | + // 鬆らせ縺ィ髱「縺ョ繝ェ繧ケ繝医↓螟画鋤縺吶k | |
1288 | 1288 | if( !convert_to_vertex_face_list( facets, vertices, face_ids, eps ) ) |
1289 | 1289 | { |
1290 | 1290 | return( false ); |
1291 | 1291 | } |
1292 | 1292 | |
1293 | - // 面情報にエッジ情報を付与する | |
1293 | + // 髱「諠??ア縺ォ繧ィ繝?ず諠??ア繧剃サ倅ク弱☆繧 | |
1294 | 1294 | if( !convert_to_vertex_face_list( vertices, face_ids, faces, edges ) ) |
1295 | 1295 | { |
1296 | 1296 | return( false ); |
@@ -1300,14 +1300,14 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1300 | 1300 | face_ids.clear( ); |
1301 | 1301 | } |
1302 | 1302 | |
1303 | - // Contraction Error を計算するための行列集合を設定する | |
1303 | + // Contraction Error 繧定ィ育ョ励☆繧九◆繧√?陦悟?髮?粋繧定ィュ螳壹☆繧 | |
1304 | 1304 | std::vector< matrix_type > Q( vertices.size( ) ); |
1305 | 1305 | for( size_type i = 0 ; i < Q.size( ) ; i++ ) |
1306 | 1306 | { |
1307 | 1307 | Q[ i ].resize( 4, 4 ); |
1308 | 1308 | } |
1309 | 1309 | |
1310 | - // 接続する頂点の候補集合を求める | |
1310 | + // 謗・邯壹☆繧矩?らせ縺ョ蛟呵」憺寔蜷医r豎ゅa繧 | |
1311 | 1311 | for( size_type i = 1 ; i < faces.size( ) ; i++ ) |
1312 | 1312 | { |
1313 | 1313 | const face_type &f = faces[ i ]; |
@@ -1363,7 +1363,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1363 | 1363 | |
1364 | 1364 | } |
1365 | 1365 | |
1366 | - // 頂点とエッジのテーブルを作成する | |
1366 | + // 鬆らせ縺ィ繧ィ繝?ず縺ョ繝??繝悶Ν繧剃ス懈?縺吶k | |
1367 | 1367 | typedef __mc__::__edge_comp__< edge_type > edge_compare_type; |
1368 | 1368 | typedef std::set< difference_type, edge_compare_type > edge_map_type; |
1369 | 1369 | typedef std::multimap< size_type, difference_type > vertex_edge_map_type; |
@@ -1376,10 +1376,10 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1376 | 1376 | { |
1377 | 1377 | edge_type &e = edges[ i ]; |
1378 | 1378 | |
1379 | - // 削除対象にできるかどうかを判定 | |
1379 | + // 蜑企勁蟇セ雎。縺ォ縺ァ縺阪k縺九←縺?°繧貞愛螳 | |
1380 | 1380 | if( !__mc__::is_sharp_edge( edges[ i ] ) ) |
1381 | 1381 | { |
1382 | - // 各頂点の誤差評価を行う | |
1382 | + // 蜷??らせ縺ョ隱、蟾ョ隧穂セ。繧定。後≧ | |
1383 | 1383 | __mc__::update_edge( vertices, Q, edges[ i ], use_optimal_vertex_placement ); |
1384 | 1384 | edge_map.insert( i ); |
1385 | 1385 | } |
@@ -1390,7 +1390,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1390 | 1390 | |
1391 | 1391 | size_t num_facets = faces.size( ) - 1; |
1392 | 1392 | |
1393 | - // 頂点をコスト順に削減する | |
1393 | + // 鬆らせ繧偵さ繧ケ繝磯??↓蜑頑ク帙☆繧 | |
1394 | 1394 | for( ; num_facets - 2 >= number_of_facets && !edge_map.empty( ) ; num_facets -= 2 ) |
1395 | 1395 | { |
1396 | 1396 | typename edge_map_type::iterator mite = edge_map.end( ); |
@@ -1405,7 +1405,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1405 | 1405 | } |
1406 | 1406 | else if( !__mc__::check_topology_change( vertex_edge_map, faces, edges, *ite ) ) |
1407 | 1407 | { |
1408 | - // 削除可能な辺を発見 | |
1408 | + // 蜑企勁蜿ッ閭ス縺ェ霎コ繧堤匱隕 | |
1409 | 1409 | mite = ite; |
1410 | 1410 | break; |
1411 | 1411 | } |
@@ -1417,7 +1417,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1417 | 1417 | |
1418 | 1418 | if( mite == edge_map.end( ) ) |
1419 | 1419 | { |
1420 | - // 削除できる辺が見つからなかったので終了する | |
1420 | + // 蜑企勁縺ァ縺阪k霎コ縺瑚ヲ九▽縺九i縺ェ縺九▲縺溘?縺ァ邨ゆコ?☆繧 | |
1421 | 1421 | break; |
1422 | 1422 | } |
1423 | 1423 |
@@ -1428,10 +1428,10 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1428 | 1428 | std::cout << "Contraction [" << num_facets << "] : #" << EID << " <" << EDGE.v2 << " -> " << EDGE.v1 << ">" << std::endl; |
1429 | 1429 | #endif |
1430 | 1430 | |
1431 | - // 辺を削除する | |
1431 | + // 霎コ繧貞炎髯、縺吶k | |
1432 | 1432 | edge_map.erase( mite ); |
1433 | 1433 | |
1434 | - // 処理対象の辺の登録と,テーブル内からの削除等を行う | |
1434 | + // 蜃ヲ逅?ッセ雎。縺ョ霎コ縺ョ逋サ骭イ縺ィ?後ユ繝シ繝悶Ν蜀?°繧峨?蜑企勁遲峨r陦後≧ | |
1435 | 1435 | difference_type vs = EDGE.v1; |
1436 | 1436 | difference_type vt = EDGE.v2; |
1437 | 1437 | difference_type vl, vr; |
@@ -1442,21 +1442,21 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1442 | 1442 | break; |
1443 | 1443 | } |
1444 | 1444 | |
1445 | - // 面を削除する | |
1445 | + // 髱「繧貞炎髯、縺吶k | |
1446 | 1446 | face_type &f1 = faces[ EDGE.fid1 ]; |
1447 | 1447 | face_type &f2 = faces[ EDGE.fid2 ]; |
1448 | 1448 | f1.flag = false; |
1449 | 1449 | f2.flag = false; |
1450 | 1450 | |
1451 | - // 頂点を移動させる | |
1451 | + // 鬆らせ繧堤ァサ蜍輔&縺帙k | |
1452 | 1452 | vertices[ EDGE.v1 ] = EDGE.v; |
1453 | 1453 | vertices[ EDGE.v2 ] = EDGE.v; |
1454 | 1454 | |
1455 | - // 辺の付け替えを行う | |
1455 | + // 霎コ縺ョ莉倥¢譖ソ縺医r陦後≧ | |
1456 | 1456 | __mc__::contract_edges( edges, faces, eid[ 0 ], eid[ 1 ], EID, EDGE.fid1, EDGE.fid1 ); |
1457 | 1457 | __mc__::contract_edges( edges, faces, eid[ 3 ], eid[ 2 ], EID, EDGE.fid2, EDGE.fid2 ); |
1458 | 1458 | |
1459 | - // 誤差計算行列を更新する | |
1459 | + // 隱、蟾ョ險育ョ苓。悟?繧呈峩譁ー縺吶k | |
1460 | 1460 | matrix_type QQQ = Q[ EDGE.v1 ] + Q[ EDGE.v2 ]; |
1461 | 1461 | Q[ EDGE.v1 ] = QQQ; |
1462 | 1462 | Q[ EDGE.v2 ] = QQQ; |
@@ -1471,7 +1471,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1471 | 1471 | { |
1472 | 1472 | if( ite->second == EID ) |
1473 | 1473 | { |
1474 | - // 削除する | |
1474 | + // 蜑企勁縺吶k | |
1475 | 1475 | ite = vertex_edge_map.erase( ite ); |
1476 | 1476 | } |
1477 | 1477 | else |
@@ -1492,7 +1492,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1492 | 1492 | { |
1493 | 1493 | if( ite->second == EID ) |
1494 | 1494 | { |
1495 | - // 削除する | |
1495 | + // 蜑企勁縺吶k | |
1496 | 1496 | ite = vertex_edge_map.erase( ite ); |
1497 | 1497 | } |
1498 | 1498 | else |
@@ -1523,15 +1523,15 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1523 | 1523 | } |
1524 | 1524 | } |
1525 | 1525 | |
1526 | - // 不要な辺をすべて削除する | |
1526 | + // 荳崎ヲ√↑霎コ繧偵☆縺ケ縺ヲ蜑企勁縺吶k | |
1527 | 1527 | __mc__::remove_edge_from_map( vertex_edge_map, vl, eid[ 1 ] ); |
1528 | 1528 | __mc__::remove_edge_from_map( vertex_edge_map, vr, eid[ 2 ] ); |
1529 | 1529 | |
1530 | - // 処理対象の枝からも除外する | |
1530 | + // 蜃ヲ逅?ッセ雎。縺ョ譫昴°繧峨b髯、螟悶☆繧 | |
1531 | 1531 | __mc__::remove_edge_from_set( edge_map, eid[ 1 ] ); |
1532 | 1532 | __mc__::remove_edge_from_set( edge_map, eid[ 2 ] ); |
1533 | 1533 | |
1534 | - // 変更された辺を再登録する | |
1534 | + // 螟画峩縺輔l縺溯セコ繧貞?逋サ骭イ縺吶k | |
1535 | 1535 | for( size_type ii = 0 ; ii < combine_edge.size( ) ; ii++ ) |
1536 | 1536 | { |
1537 | 1537 | vertex_edge_map.insert( vertex_edge_map_pair_type( vs, combine_edge[ ii ] ) ); |
@@ -1539,16 +1539,16 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1539 | 1539 | } |
1540 | 1540 | } |
1541 | 1541 | |
1542 | - // 各頂点を共有するエッジを更新する | |
1543 | - // ただし,統合して領域の端に接した場合は以降の対象から除く | |
1542 | + // 蜷??らせ繧貞?譛峨☆繧九お繝?ず繧呈峩譁ー縺吶k | |
1543 | + // 縺溘□縺暦シ檎オア蜷医@縺ヲ鬆伜沺縺ョ遶ッ縺ォ謗・縺励◆蝣エ蜷医?莉・髯阪?蟇セ雎。縺九i髯、縺 | |
1544 | 1544 | for( typename std::set< difference_type >::iterator ite = emap.begin( ) ; ite != emap.end( ) ; ++ite ) |
1545 | 1545 | { |
1546 | 1546 | __mc__::remove_edge_from_set( edge_map, *ite ); |
1547 | 1547 | |
1548 | - // 縁に接しているかどうかを判定する | |
1548 | + // 邵√↓謗・縺励※縺?k縺九←縺?°繧貞愛螳壹☆繧 | |
1549 | 1549 | if( !__mc__::is_sharp_edge( edges[ *ite ] ) ) |
1550 | 1550 | { |
1551 | - // 各辺の評価値を更新する | |
1551 | + // 蜷?セコ縺ョ隧穂セ。蛟、繧呈峩譁ー縺吶k | |
1552 | 1552 | __mc__::update_edge( vertices, Q, edges[ *ite ], use_optimal_vertex_placement ); |
1553 | 1553 | __mc__::apply_penalties( vertex_edge_map, vertices, faces, edges, *ite, threshold_for_triangle_compactness ); |
1554 | 1554 | edge_map.insert( *ite ); |
@@ -1583,7 +1583,7 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1583 | 1583 | } |
1584 | 1584 | } |
1585 | 1585 | |
1586 | - // 面の接続関係が正しく保たれているかどうかをチェックする | |
1586 | + // 髱「縺ョ謗・邯夐未菫ゅ′豁」縺励¥菫昴◆繧後※縺?k縺九←縺?°繧偵メ繧ァ繝?け縺吶k | |
1587 | 1587 | for( size_type i = 1 ; i < faces.size( ) ; i++ ) |
1588 | 1588 | { |
1589 | 1589 | const face_type &f = faces[ i ]; |
@@ -1731,12 +1731,12 @@ inline bool surface_simplification( facet_list< T > &facets, size_t number_of_fa | ||
1731 | 1731 | return( true ); |
1732 | 1732 | } |
1733 | 1733 | |
1734 | -/// @brief 3角形パッチの集合から最大の連結領域のみを取り出し,他を全て削除する | |
1734 | +/// @brief 3隗貞ス「繝代ャ繝√?髮?粋縺九i譛?螟ァ縺ョ騾」邨宣?伜沺縺ョ縺ソ繧貞叙繧雁?縺暦シ御サ悶r蜈ィ縺ヲ蜑企勁縺吶k | |
1735 | 1735 | //! |
1736 | -//! @param[in] facets … 3角形パッチの集合 | |
1737 | -//! @param[in] eps … 同一頂点と判定される頂点の距離 | |
1736 | +//! @param[in] facets 窶ヲ 3隗貞ス「繝代ャ繝√?髮?粋 | |
1737 | +//! @param[in] eps 窶ヲ 蜷御ク?鬆らせ縺ィ蛻、螳壹&繧後k鬆らせ縺ョ霍晞屬 | |
1738 | 1738 | //! |
1739 | -//! @return 最大領域の抽出に成功したかどうか | |
1739 | +//! @return 譛?螟ァ鬆伜沺縺ョ謚ス蜃コ縺ォ謌仙粥縺励◆縺九←縺?° | |
1740 | 1740 | //! |
1741 | 1741 | template < class T > |
1742 | 1742 | inline bool maximum_connected_region( facet_list< T > &facets, const double eps = 1.0e-3 ) |
@@ -1755,14 +1755,14 @@ inline bool maximum_connected_region( facet_list< T > &facets, const double eps | ||
1755 | 1755 | std::vector< vector_type > vertices; |
1756 | 1756 | std::vector< ivector_type > faces; |
1757 | 1757 | |
1758 | - // 頂点と面のリストに変換する | |
1758 | + // 鬆らせ縺ィ髱「縺ョ繝ェ繧ケ繝医↓螟画鋤縺吶k | |
1759 | 1759 | if( !convert_to_vertex_face_list( facets, vertices, faces, eps ) ) |
1760 | 1760 | { |
1761 | 1761 | return( false ); |
1762 | 1762 | } |
1763 | 1763 | |
1764 | 1764 | |
1765 | - // 頂点と面のテーブルを作成する | |
1765 | + // 鬆らせ縺ィ髱「縺ョ繝??繝悶Ν繧剃ス懈?縺吶k | |
1766 | 1766 | typedef std::multimap< size_type, difference_type > vertex_face_map_type; |
1767 | 1767 | typedef typename std::multimap< size_type, difference_type >::iterator iterator; |
1768 | 1768 | typedef std::pair< size_type, difference_type > vertex_face_map_pair_type; |
@@ -1785,7 +1785,7 @@ inline bool maximum_connected_region( facet_list< T > &facets, const double eps | ||
1785 | 1785 | gmap.insert( group_map_type_pair_type( i, i ) ); |
1786 | 1786 | } |
1787 | 1787 | |
1788 | - // 各面をグルーピングしていく | |
1788 | + // 蜷?擇繧偵げ繝ォ繝シ繝斐Φ繧ー縺励※縺?¥ | |
1789 | 1789 | for( size_type i = 0 ; i < faces.size( ) ; i++ ) |
1790 | 1790 | { |
1791 | 1791 | ivector_type &f = faces[ i ]; |
@@ -1994,10 +1994,10 @@ inline bool maximum_connected_region( facet_list< T > &facets, const double eps | ||
1994 | 1994 | } |
1995 | 1995 | |
1996 | 1996 | /// @} |
1997 | -// Marching Cubesグループの終わり | |
1997 | +// Marching Cubes繧ー繝ォ繝シ繝励?邨ゅo繧 | |
1998 | 1998 | |
1999 | 1999 | |
2000 | -// mist名前空間の終わり | |
2000 | +// mist蜷榊燕遨コ髢薙?邨ゅo繧 | |
2001 | 2001 | _MIST_END |
2002 | 2002 | |
2003 | 2003 |
@@ -1,4 +1,4 @@ | ||
1 | -// | |
1 | +?ソ// | |
2 | 2 | // Copyright (c) 2003-2011, MIST Project, Nagoya University |
3 | 3 | // All rights reserved. |
4 | 4 | // |
@@ -28,7 +28,7 @@ | ||
28 | 28 | |
29 | 29 | /// @file mist/marching_cubes.h |
30 | 30 | //! |
31 | -//! @brief Marching Cubes のためのライブラリ | |
31 | +//! @brief Marching Cubes 縺ョ縺溘a縺ョ繝ゥ繧、繝悶Λ繝ェ | |
32 | 32 | //! |
33 | 33 | |
34 | 34 | #ifndef __INCLUDE_MARCHING_CUBES_H__ |
@@ -56,16 +56,16 @@ | ||
56 | 56 | #endif |
57 | 57 | |
58 | 58 | |
59 | -// mist名前空間の始まり | |
59 | +// mist蜷榊燕遨コ髢薙?蟋九∪繧 | |
60 | 60 | _MIST_BEGIN |
61 | 61 | |
62 | 62 | namespace __mc__ |
63 | 63 | { |
64 | - /// @brief cubeの頂点ノードを扱うためのクラス( marching_cubes クラスの内部でのみ利用 ) | |
64 | + /// @brief cube縺ョ鬆らせ繝弱?繝峨r謇ア縺?◆繧√?繧ッ繝ゥ繧ケ? marching_cubes 繧ッ繝ゥ繧ケ縺ョ蜀?Κ縺ァ縺ョ縺ソ蛻ゥ逕ィ ? | |
65 | 65 | //! |
66 | - //! @param V … 頂点の値の型 | |
67 | - //! @param P … 頂点の座標の型 | |
68 | - //! @param N … 頂点の法線ベクトルの型 | |
66 | + //! @param V 窶ヲ 鬆らせ縺ョ蛟、縺ョ蝙 | |
67 | + //! @param P 窶ヲ 鬆らせ縺ョ蠎ァ讓吶?蝙 | |
68 | + //! @param N 窶ヲ 鬆らせ縺ョ豕慕キ壹?繧ッ繝医Ν縺ョ蝙 | |
69 | 69 | //! |
70 | 70 | template< class V, class P > |
71 | 71 | struct node |
@@ -81,10 +81,10 @@ namespace __mc__ | ||
81 | 81 | node( const value_type &vv, const point_type &pp, const point_type &nn ) : v( vv ), p( pp ), n( nn ) { } |
82 | 82 | }; |
83 | 83 | |
84 | - /// @brief 等値面生成結果から3角形パッチの数を計算 | |
84 | + /// @brief 遲牙?、髱「逕滓?邨先棡縺九i3隗貞ス「繝代ャ繝√?謨ー繧定ィ育ョ | |
85 | 85 | //! |
86 | - //! @param[in] sv … サイズ集合(等値面生成結果の1つ) | |
87 | - //! @return 3角形パッチ数 | |
86 | + //! @param[in] sv 窶ヲ 繧オ繧、繧コ髮?粋?育ュ牙?、髱「逕滓?邨先棡縺ョ1縺、? | |
87 | + //! @return 3隗貞ス「繝代ャ繝∵焚 | |
88 | 88 | //! |
89 | 89 | template< typename T > |
90 | 90 | inline size_t number_of_triangles( const std::vector< T > &sv ) |
@@ -307,70 +307,70 @@ namespace __mc__ | ||
307 | 307 | |
308 | 308 | //! @addtogroup marching_cubes_group Marching Cubes |
309 | 309 | //! |
310 | -//! @code 次のヘッダをインクルードする | |
310 | +//! @code 谺。縺ョ繝倥ャ繝?繧偵う繝ウ繧ッ繝ォ繝シ繝峨☆繧 | |
311 | 311 | //! #include <mist/marching_cubes.h> |
312 | 312 | //! @endcode |
313 | 313 | //! |
314 | 314 | //! @{ |
315 | 315 | |
316 | -/// @brief ボリュームデータから等値面を生成するためのクラス | |
316 | +/// @brief 繝懊Μ繝・繝シ繝?繝??繧ソ縺九i遲牙?、髱「繧堤函謌舌☆繧九◆繧√?繧ッ繝ゥ繧ケ | |
317 | 317 | //! |
318 | -//! 区間の集合から2分木を構築し、通常O(n)かかる探索時間をO(log_2(n))に削減する. | |
319 | -//! 線分や面分の重なり判定などに有効. | |
318 | +//! 蛹コ髢薙?髮?粋縺九i2蛻?惠繧呈ァ狗ッ峨@縲??壼ククO(n)縺九°繧区爾邏「譎る俣繧丹(log_2(n))縺ォ蜑頑ク帙☆繧具シ | |
319 | +//! 邱壼?繧?擇蛻??驥阪↑繧雁愛螳壹↑縺ゥ縺ォ譛牙柑? | |
320 | 320 | //! |
321 | -//! @attention mist::arra3< 算術型 > 型を入力とする. | |
322 | -//! @attention ポリゴンの各頂点座標( mist::vector3< 算術型 >型 ),各頂点の法線ベクトル( mist::vector3< 算術型 > 型 ),各ポリゴンの頂点数( size_t 型 )の3つのstd::vectorを等値面生成結果の出力とする. | |
323 | -//! @attention ポリゴンの各頂点座標と各頂点の法線ベクトルは OpenGL の頂点配列として利用可能( GL_POLYGON や GL_TRIANGLE_FAN 等に使える). | |
321 | +//! @attention mist::arra3< 邂苓。灘梛 > 蝙九r蜈・蜉帙→縺吶k? | |
322 | +//! @attention 繝昴Μ繧エ繝ウ縺ョ蜷??らせ蠎ァ讓呻シ mist::vector3< 邂苓。灘梛 >蝙 ?会シ悟推鬆らせ縺ョ豕慕キ壹?繧ッ繝医Ν? mist::vector3< 邂苓。灘梛 > 蝙 ?会シ悟推繝昴Μ繧エ繝ウ縺ョ鬆らせ謨ー? size_t 蝙 ?峨?3縺、縺ョstd::vector繧堤ュ牙?、髱「逕滓?邨先棡縺ョ蜃コ蜉帙→縺吶k? | |
323 | +//! @attention 繝昴Μ繧エ繝ウ縺ョ蜷??らせ蠎ァ讓吶→蜷??らせ縺ョ豕慕キ壹?繧ッ繝医Ν縺ッ OpenGL 縺ョ鬆らせ驟榊?縺ィ縺励※蛻ゥ逕ィ蜿ッ閭ス? GL_POLYGON 繧 GL_TRIANGLE_FAN 遲峨↓菴ソ縺医k?会シ | |
324 | 324 | //! |
325 | -//! @param ARRAY3 … ボリュームデータの型 | |
326 | -//! @param P … 等値面ポリゴンの頂点座標の要素の型 | |
325 | +//! @param ARRAY3 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ縺ョ蝙 | |
326 | +//! @param P 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ蠎ァ讓吶?隕∫エ?縺ョ蝙 | |
327 | 327 | //! |
328 | -//! @code 使用例 | |
329 | -//! // ボリュームデータの用意 | |
328 | +//! @code 菴ソ逕ィ萓 | |
329 | +//! // 繝懊Μ繝・繝シ繝?繝??繧ソ縺ョ逕ィ諢 | |
330 | 330 | //! mist::array3< int > va; |
331 | 331 | //! /* |
332 | -//! * ボリュームデータの作成処理 | |
332 | +//! * 繝懊Μ繝・繝シ繝?繝??繧ソ縺ョ菴懈?蜃ヲ逅 | |
333 | 333 | //! */ |
334 | 334 | //! |
335 | -//! // 等値面生成結果を格納するためのオブジェクトの準備 | |
336 | -//! std::vector< mist::vector3< double > > pv; // double 型の要素を持つ頂点座標の集合 | |
337 | -//! std::vector< mist::vector3< double > > nv; // double 型の要素を持つ法線ベクトルの集合 | |
338 | -//! std::vector< size_t > sv; // 各ポリゴンのサイズ(頂点数)の集合 | |
335 | +//! // 遲牙?、髱「逕滓?邨先棡繧呈?シ邏阪☆繧九◆繧√?繧ェ繝悶ず繧ァ繧ッ繝医?貅門y | |
336 | +//! std::vector< mist::vector3< double > > pv; // double 蝙九?隕∫エ?繧呈戟縺、鬆らせ蠎ァ讓吶?髮?粋 | |
337 | +//! std::vector< mist::vector3< double > > nv; // double 蝙九?隕∫エ?繧呈戟縺、豕慕キ壹?繧ッ繝医Ν縺ョ髮?粋 | |
338 | +//! std::vector< size_t > sv; // 蜷??繝ェ繧エ繝ウ縺ョ繧オ繧、繧コ?磯?らせ謨ー?峨?髮?粋 | |
339 | 339 | //! |
340 | -//! // ボリュームデータの要素が int 型で, | |
341 | -//! // 得られる等値面ポリゴンの頂点座標の要素と法線ベクトルが double 型の | |
342 | -//! // marching_cubes オブジェクトを作成 | |
340 | +//! // 繝懊Μ繝・繝シ繝?繝??繧ソ縺ョ隕∫エ?縺 int 蝙九〒? | |
341 | +//! // 蠕励i繧後k遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ蠎ァ讓吶?隕∫エ?縺ィ豕慕キ壹?繧ッ繝医Ν縺 double 蝙九? | |
342 | +//! // marching_cubes 繧ェ繝悶ず繧ァ繧ッ繝医r菴懈? | |
343 | 343 | //! mist::marching_cubes< mist::array3< int >, double > mcs; |
344 | 344 | //! |
345 | -//! // パラメータ設定( 頂点座標のオフセット値,拡大率,等値面生成のための閾値 ) | |
345 | +//! // 繝代Λ繝。繝シ繧ソ險ュ螳夲シ 鬆らせ蠎ァ讓吶?繧ェ繝輔そ繝?ヨ蛟、?梧僑螟ァ邇?シ檎ュ牙?、髱「逕滓?縺ョ縺溘a縺ョ髢セ蛟、 ? | |
346 | 346 | //! mcs.offset( 0.0, 0.0, 0.0 ); |
347 | 347 | //! mcs.scale( 1.0, 1.0, 1.0 ); |
348 | 348 | //! mcs.threshold( 0.0 ); |
349 | 349 | //! |
350 | -//! // 上記のパラメータで va から等値面ポリゴンを生成し,結果を pv, nv, sv に格納 | |
350 | +//! // 荳願ィ倥?繝代Λ繝。繝シ繧ソ縺ァ va 縺九i遲牙?、髱「繝昴Μ繧エ繝ウ繧堤函謌舌@?檎オ先棡繧 pv, nv, sv 縺ォ譬シ邏 | |
351 | 351 | //! mcs.isosurfacing( va, pv, nv, sv ); |
352 | 352 | //! @endcode |
353 | 353 | //! |
354 | -template< typename ARRAY3, typename P = double > | |
354 | +template< typename ARRAY3, typename VT = double > | |
355 | 355 | class marching_cubes |
356 | 356 | { |
357 | 357 | public: |
358 | - typedef ARRAY3 image_type; ///< @brief ボリュームデータの要素の型 | |
359 | - typedef typename image_type::value_type value_type; ///< @brief ボリュームデータの要素の型 | |
360 | - typedef vector3< short > ivector_type; ///< @brief cube の頂点座標の型 | |
361 | - typedef vector3< P > vector_type; ///< @brief ポリゴンの頂点座標の型 | |
362 | - typedef typename vector_type::value_type float_type; ///< @brief ポリゴンの頂点の法汚染ベクトルの型 | |
363 | - typedef size_t size_type; ///< @brief 各ポリゴンのサイズ(頂点数)の型 | |
364 | - typedef ptrdiff_t difference_type; ///< @brief 各ポリゴンのサイズ(頂点数)の型 | |
365 | - | |
366 | - typedef std::vector< vector_type > vector_list_type; ///< @brief 3次元ベクトルリストを扱う型 | |
367 | - typedef __mc__::node< value_type, ivector_type > node_type; ///< @brief cube の頂点情報を保持する型 | |
358 | + typedef ARRAY3 image_type; ///< @brief 繝懊Μ繝・繝シ繝?繝??繧ソ縺ョ隕∫エ?縺ョ蝙 | |
359 | + typedef typename image_type::value_type value_type; ///< @brief 繝懊Μ繝・繝シ繝?繝??繧ソ縺ョ隕∫エ?縺ョ蝙 | |
360 | + typedef vector3< short > ivector_type; ///< @brief cube 縺ョ鬆らせ蠎ァ讓吶?蝙 | |
361 | + typedef vector3< VT > vector_type; ///< @brief 繝昴Μ繧エ繝ウ縺ョ鬆らせ蠎ァ讓吶?蝙 | |
362 | + typedef typename vector_type::value_type float_type; ///< @brief 繝昴Μ繧エ繝ウ縺ョ鬆らせ縺ョ豕墓ア壽沒繝吶け繝医Ν縺ョ蝙 | |
363 | + typedef size_t size_type; ///< @brief 蜷??繝ェ繧エ繝ウ縺ョ繧オ繧、繧コ?磯?らせ謨ー?峨?蝙 | |
364 | + typedef ptrdiff_t difference_type; ///< @brief 蜷??繝ェ繧エ繝ウ縺ョ繧オ繧、繧コ?磯?らせ謨ー?峨?蝙 | |
365 | + | |
366 | + typedef std::vector< vector_type > vector_list_type; ///< @brief 3谺。蜈??繧ッ繝医Ν繝ェ繧ケ繝医r謇ア縺?梛 | |
367 | + typedef __mc__::node< value_type, ivector_type > node_type; ///< @brief cube 縺ョ鬆らせ諠??ア繧剃ソ晄戟縺吶k蝙 | |
368 | 368 | typedef size_t ( * func_type )( const node_type *, vector_type *, vector_type *, |
369 | - size_type *, float_type, const vector_type &, const vector_type & ); ///< @brief cube 単位での等値面生成関数の型 | |
369 | + size_type *, float_type, const vector_type &, const vector_type & ); ///< @brief cube 蜊倅ス阪〒縺ョ遲牙?、髱「逕滓?髢「謨ー縺ョ蝙 | |
370 | 370 | |
371 | - typedef tagged_section< value_type, size_type > section_type; ///< @brief Interval-tree 用いる区間の型 | |
372 | - typedef typename section_type::min_max_type min_max_type; ///< @brief 区間の最大値,最小値の型 | |
373 | - typedef typename section_type::tag_type tag_type; ///< @brief 区間のタグ情報の型 | |
371 | + typedef tagged_section< value_type, size_type > section_type; ///< @brief Interval-tree 逕ィ縺?k蛹コ髢薙?蝙 | |
372 | + typedef typename section_type::min_max_type min_max_type; ///< @brief 蛹コ髢薙?譛?螟ァ蛟、?梧怙蟆丞?、縺ョ蝙 | |
373 | + typedef typename section_type::tag_type tag_type; ///< @brief 蛹コ髢薙?繧ソ繧ー諠??ア縺ョ蝙 | |
374 | 374 | |
375 | 375 | private: |
376 | 376 | func_type fa_[ 256 ]; |
@@ -388,73 +388,73 @@ private: | ||
388 | 388 | vector_type o_; |
389 | 389 | vector_type s_; |
390 | 390 | |
391 | -public: // コンストラクタとプロパティ関連 | |
392 | - /// @brief コンストラクタ | |
391 | +public: // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺ィ繝励Ο繝代ユ繧」髢「騾」 | |
392 | + /// @brief 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ | |
393 | 393 | marching_cubes( ) : is_preprocessed_( false ), th_( 0 ), o_( 0, 0, 0 ), s_( 1, 1, 1 ) |
394 | 394 | { |
395 | 395 | init_function_array( ); |
396 | 396 | } |
397 | 397 | |
398 | - /// @brief デストラクタ | |
398 | + /// @brief 繝?せ繝医Λ繧ッ繧ソ | |
399 | 399 | ~marching_cubes( ) |
400 | 400 | { |
401 | 401 | } |
402 | 402 | |
403 | - /// @brief 前処理されたデータの有無を返す | |
403 | + /// @brief 蜑榊?逅?&繧後◆繝??繧ソ縺ョ譛臥┌繧定ソ斐☆ | |
404 | 404 | //! |
405 | - //! @return … 前処理が終了していれば真を返す | |
405 | + //! @return 窶ヲ 蜑榊?逅?′邨ゆコ?@縺ヲ縺?l縺ー逵溘r霑斐☆ | |
406 | 406 | //! |
407 | 407 | bool is_preprocessed( ) const { return is_preprocessed_; } |
408 | 408 | |
409 | - /// @brief しきい値パラメータを設定 | |
409 | + /// @brief 縺励″縺??、繝代Λ繝。繝シ繧ソ繧定ィュ螳 | |
410 | 410 | //! |
411 | - //! @param[in] th … 閾値 | |
411 | + //! @param[in] th 窶ヲ 髢セ蛟、 | |
412 | 412 | //! |
413 | 413 | void threshold( float_type th ) { th_ = th; } |
414 | 414 | |
415 | - /// @brief しきい値パラメータを取得設定 | |
415 | + /// @brief 縺励″縺??、繝代Λ繝。繝シ繧ソ繧貞叙蠕苓ィュ螳 | |
416 | 416 | //! |
417 | - //! @return しきい値を取得する | |
417 | + //! @return 縺励″縺??、繧貞叙蠕励☆繧 | |
418 | 418 | //! |
419 | 419 | float_type threshold( ) const { return( th_ ); } |
420 | 420 | |
421 | - /// @brief オフセットパラメータを設定 | |
421 | + /// @brief 繧ェ繝輔そ繝?ヨ繝代Λ繝。繝シ繧ソ繧定ィュ螳 | |
422 | 422 | //! |
423 | - //! @param[in] ox … x 方向オフセット | |
424 | - //! @param[in] oy … y 方向オフセット | |
425 | - //! @param[in] oz … z 方向オフセット | |
423 | + //! @param[in] ox 窶ヲ x 譁ケ蜷代が繝輔そ繝?ヨ | |
424 | + //! @param[in] oy 窶ヲ y 譁ケ蜷代が繝輔そ繝?ヨ | |
425 | + //! @param[in] oz 窶ヲ z 譁ケ蜷代が繝輔そ繝?ヨ | |
426 | 426 | //! |
427 | 427 | void offset( float_type ox, float_type oy, float_type oz ) { o_.x = ox; o_.y = oy; o_.z = oz; } |
428 | 428 | |
429 | - /// @brief オフセットパラメータを取得設定 | |
429 | + /// @brief 繧ェ繝輔そ繝?ヨ繝代Λ繝。繝シ繧ソ繧貞叙蠕苓ィュ螳 | |
430 | 430 | //! |
431 | - //! @return オフセット値を取得する | |
431 | + //! @return 繧ェ繝輔そ繝?ヨ蛟、繧貞叙蠕励☆繧 | |
432 | 432 | //! |
433 | 433 | vector_type offset( ) const { return( o_ ); } |
434 | 434 | |
435 | - /// @brief スケールパラメータを設定 | |
435 | + /// @brief 繧ケ繧ア繝シ繝ォ繝代Λ繝。繝シ繧ソ繧定ィュ螳 | |
436 | 436 | //! |
437 | - //! @param[in] sx … x 方向スケール | |
438 | - //! @param[in] sy … y 方向スケール | |
439 | - //! @param[in] sz … z 方向スケール | |
437 | + //! @param[in] sx 窶ヲ x 譁ケ蜷代せ繧ア繝シ繝ォ | |
438 | + //! @param[in] sy 窶ヲ y 譁ケ蜷代せ繧ア繝シ繝ォ | |
439 | + //! @param[in] sz 窶ヲ z 譁ケ蜷代せ繧ア繝シ繝ォ | |
440 | 440 | //! |
441 | 441 | void scale( float_type sx, float_type sy, float_type sz ) { s_.x = sx; s_.y = sy; s_.z = sz; } |
442 | 442 | |
443 | - /// @brief スケールパラメータを取得設定 | |
443 | + /// @brief 繧ケ繧ア繝シ繝ォ繝代Λ繝。繝シ繧ソ繧貞叙蠕苓ィュ螳 | |
444 | 444 | //! |
445 | - //! @return スケール値を取得する | |
445 | + //! @return 繧ケ繧ア繝シ繝ォ蛟、繧貞叙蠕励☆繧 | |
446 | 446 | //! |
447 | 447 | vector_type scale( ) const { return( s_ ); } |
448 | 448 | |
449 | 449 | |
450 | -public: // 操作関数 | |
450 | +public: // 謫堺ス憺未謨ー | |
451 | 451 | |
452 | - /// @brief 等値面生成(前処理の有無で等値面生成処理を分ける) | |
452 | + /// @brief 遲牙?、髱「逕滓??亥燕蜃ヲ逅??譛臥┌縺ァ遲牙?、髱「逕滓?蜃ヲ逅?r蛻?¢繧具シ | |
453 | 453 | //! |
454 | - //! @param[in] va … ボリュームデータ | |
455 | - //! @param[out] pv … 等値面ポリゴンの頂点座標の集合 | |
456 | - //! @param[out] nv … 等値面ポリゴンの頂点の法線ベクトルの集合 | |
457 | - //! @param[out] sv … 等値面ポリゴンのサイズの集合 | |
454 | + //! @param[in] va 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ | |
455 | + //! @param[out] pv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ蠎ァ讓吶?髮?粋 | |
456 | + //! @param[out] nv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ縺ョ豕慕キ壹?繧ッ繝医Ν縺ョ髮?粋 | |
457 | + //! @param[out] sv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ繧オ繧、繧コ縺ョ髮?粋 | |
458 | 458 | //! |
459 | 459 | void isosurfacing( const image_type &va, vector_list_type &pv, vector_list_type &nv, std::vector< size_type > &sv ) |
460 | 460 | { |
@@ -468,10 +468,10 @@ public: // | ||
468 | 468 | } |
469 | 469 | } |
470 | 470 | |
471 | - /// @brief 等値面生成(前処理の有無で等値面生成処理を分ける) | |
471 | + /// @brief 遲牙?、髱「逕滓??亥燕蜃ヲ逅??譛臥┌縺ァ遲牙?、髱「逕滓?蜃ヲ逅?r蛻?¢繧具シ | |
472 | 472 | //! |
473 | - //! @param[in] va … ボリュームデータ | |
474 | - //! @param[out] facets … 等値面ポリゴンの集合 | |
473 | + //! @param[in] va 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ | |
474 | + //! @param[out] facets 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ髮?粋 | |
475 | 475 | //! |
476 | 476 | template < class T > |
477 | 477 | void isosurfacing( const image_type &va, facet_list< T > &facets ) |
@@ -486,12 +486,12 @@ public: // | ||
486 | 486 | } |
487 | 487 | } |
488 | 488 | |
489 | - /// @brief 等値面生成(前処理有り) | |
489 | + /// @brief 遲牙?、髱「逕滓??亥燕蜃ヲ逅?怏繧奇シ | |
490 | 490 | //! |
491 | - //! @param[in] va … ボリュームデータ | |
492 | - //! @param[out] pv … 等値面ポリゴンの頂点座標の集合 | |
493 | - //! @param[out] nv … 等値面ポリゴンの頂点の法線ベクトルの集合 | |
494 | - //! @param[out] sv … 等値面ポリゴンのサイズの集合 | |
491 | + //! @param[in] va 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ | |
492 | + //! @param[out] pv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ蠎ァ讓吶?髮?粋 | |
493 | + //! @param[out] nv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ縺ョ豕慕キ壹?繧ッ繝医Ν縺ョ髮?粋 | |
494 | + //! @param[out] sv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ繧オ繧、繧コ縺ョ髮?粋 | |
495 | 495 | //! |
496 | 496 | void isosurfacing_with_preprocess( const image_type &va, vector_list_type &pv, vector_list_type &nv, std::vector< size_type > &sv ) |
497 | 497 | { |
@@ -515,12 +515,12 @@ public: // | ||
515 | 515 | } |
516 | 516 | } |
517 | 517 | |
518 | - /// @brief 等値面生成(前処理無し) | |
518 | + /// @brief 遲牙?、髱「逕滓??亥燕蜃ヲ逅?┌縺暦シ | |
519 | 519 | //! |
520 | - //! @param[in] va … ボリュームデータ | |
521 | - //! @param[out] pv … 等値面ポリゴンの頂点座標の集合 | |
522 | - //! @param[out] nv … 等値面ポリゴンの頂点の法線ベクトルの集合 | |
523 | - //! @param[out] sv … 等値面ポリゴンのサイズの集合 | |
520 | + //! @param[in] va 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ | |
521 | + //! @param[out] pv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ蠎ァ讓吶?髮?粋 | |
522 | + //! @param[out] nv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ鬆らせ縺ョ豕慕キ壹?繧ッ繝医Ν縺ョ髮?粋 | |
523 | + //! @param[out] sv 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ繧オ繧、繧コ縺ョ髮?粋 | |
524 | 524 | //! |
525 | 525 | void isosurfacing_without_preprocess( const image_type &va, vector_list_type &pv, vector_list_type &nv, std::vector< size_type > &sv ) |
526 | 526 | { |
@@ -547,10 +547,10 @@ public: // | ||
547 | 547 | } |
548 | 548 | |
549 | 549 | |
550 | - /// @brief 等値面生成(前処理有り) | |
550 | + /// @brief 遲牙?、髱「逕滓??亥燕蜃ヲ逅?怏繧奇シ | |
551 | 551 | //! |
552 | - //! @param[in] va … ボリュームデータ | |
553 | - //! @param[out] facets … 等値面ポリゴンの集合 | |
552 | + //! @param[in] va 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ | |
553 | + //! @param[out] facets 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ髮?粋 | |
554 | 554 | //! |
555 | 555 | template < class T > |
556 | 556 | void isosurfacing_with_preprocess( const image_type &va, facet_list< T > &facets ) |
@@ -574,10 +574,10 @@ public: // | ||
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | - /// @brief 等値面生成(前処理無し) | |
577 | + /// @brief 遲牙?、髱「逕滓??亥燕蜃ヲ逅?┌縺暦シ | |
578 | 578 | //! |
579 | - //! @param[in] va … ボリュームデータ | |
580 | - //! @param[out] facets … 等値面ポリゴンの集合 | |
579 | + //! @param[in] va 窶ヲ 繝懊Μ繝・繝シ繝?繝??繧ソ | |
580 | + //! @param[out] facets 窶ヲ 遲牙?、髱「繝昴Μ繧エ繝ウ縺ョ髮?粋 | |
581 | 581 | //! |
582 | 582 | template < class T > |
583 | 583 | void isosurfacing_without_preprocess( const image_type &va, facet_list< T > &facets ) |
@@ -603,9 +603,9 @@ public: // | ||
603 | 603 | } |
604 | 604 | } |
605 | 605 | |
606 | - /// @brief 前処理(Interval-tree の構築や各格子点の法線ベクトルの計算など) | |
606 | + /// @brief 蜑榊?逅?シ?nterval-tree 縺ョ讒狗ッ峨d蜷??シ蟄千せ縺ョ豕慕キ壹?繧ッ繝医Ν縺ョ險育ョ励↑縺ゥ? | |
607 | 607 | //! |
608 | - //! @param[in] va … 等値面生成処理の対象としているボリュームデータ | |
608 | + //! @param[in] va 窶ヲ 遲牙?、髱「逕滓?蜃ヲ逅??蟇セ雎。縺ィ縺励※縺?k繝懊Μ繝・繝シ繝?繝??繧ソ | |
609 | 609 | //! |
610 | 610 | bool preprocess( const image_type &va ) |
611 | 611 | { |
@@ -626,7 +626,7 @@ public: // | ||
626 | 626 | return( is_preprocessed_ ); |
627 | 627 | } |
628 | 628 | |
629 | - /// @brief 前処理で構築されたデータを破棄 | |
629 | + /// @brief 蜑榊?逅?〒讒狗ッ峨&繧後◆繝??繧ソ繧堤?エ譽 | |
630 | 630 | void de_preprocess( ) |
631 | 631 | { |
632 | 632 | destruct_point_array( ); |
@@ -755,7 +755,7 @@ private: | ||
755 | 755 | if( N.length( ) > 0.0 ) |
756 | 756 | { |
757 | 757 | N = N.unit( ); |
758 | - // 点の並びが反時計回りになるようにする. | |
758 | + // 轤ケ縺ョ荳ヲ縺ウ縺悟渚譎りィ亥屓繧翫↓縺ェ繧九h縺?↓縺吶k? | |
759 | 759 | if( N.inner( ( p2 - p1 ).outer( p3 - p1 ) ) < 0 ) |
760 | 760 | { |
761 | 761 | facets.push_back( typename facet_list< T >::facet_type( N, p1, p3, p2 ) ); |
@@ -1381,9 +1381,9 @@ __MCFUNC12__( f150, y, 2, 0, x, 2, 3, z, 2, 6, x, 1, 0, z, 1, 5, y, 1, 3, z, 4, | ||
1381 | 1381 | |
1382 | 1382 | |
1383 | 1383 | /// @} |
1384 | -// Marching Cubesグループの終わり | |
1384 | +// Marching Cubes繧ー繝ォ繝シ繝励?邨ゅo繧 | |
1385 | 1385 | |
1386 | -// mist名前空間の終わり | |
1386 | +// mist蜷榊燕遨コ髢薙?邨ゅo繧 | |
1387 | 1387 | _MIST_END |
1388 | 1388 | |
1389 | 1389 | #endif // #ifndef __INCLUDE_MARCHING_CUBES_H__ |