20 #pragma warning( disable : 4786 )
56 assert( impl != NULL );
70 const std::vector< std::string >& ,
89 std::ofstream file( file_name );
94 file.precision( precision );
98 if( !output_list || !num_sets )
108 for(
int i = 0; i < num_sets; i++ )
112 int numTriangles = triangles.
size();
113 int array_alloc = 3 * numTriangles;
134 for(
int i = 0; i < conn_len; ++i )
135 array[fillA++] = conn[i];
137 if( fillA != array_alloc )
143 std::sort( array, array + array_alloc );
144 int numNodes = std::unique( array, array + array_alloc ) - array;
146 file <<
"#$SMF 1.0\n";
147 file <<
"#$vertices " << numNodes << std::endl;
148 file <<
"#$faces " << numTriangles << std::endl;
150 file <<
"# output from MOAB \n";
157 for(
int i = 0; i < numNodes; i++ )
168 file <<
"v " << coord[0] <<
" " << coord[1] <<
" " << coord[2] << std::endl;
189 for(
int i = 0; i < conn_len; ++i )
191 int indexInArray = std::lower_bound( array, array + numNodes, conn[i] ) - array;
192 file << indexInArray + 1 <<
" ";