// add triangles
meshgems_integer nbtri = 0;
meshgems_mesh_get_triangle_count( omsh, &nbtri );
- const SMDS_MeshNode* nodes[3];
+ const SMDS_MeshNode* nodes[4];
for ( i = 1; i <= nbtri; ++i )
{
meshgems_mesh_get_triangle_vertices( omsh, i, nodeIDs );
meshDS->AddFace( nodes[0], nodes[1], nodes[2] );
}
+ // add quadrangles
+ meshgems_integer nbquad = 0;
+ meshgems_mesh_get_quadrangle_count( omsh, &nbquad );
+ for ( i = 1; i <= nbquad; ++i )
+ {
+ meshgems_mesh_get_quadrangle_vertices( omsh, i, nodeIDs );
+ for ( int j = 0; j < 4; ++j )
+ {
+ meshgems_mesh_get_vertex_tag( omsh, nodeIDs[j], &nodeID );
+ nodes[j] = meshDS->FindNode( nodeID );
+ }
+ meshDS->AddFace( nodes[0], nodes[1], nodes[2], nodes[3] );
+ }
+
+ if ( _hypothesis )
+ {
+ std::string GMFFileName = _hypothesis->GetGMFFile();
+ if ( !GMFFileName.empty() )
+ {
+ bool asciiFound = (GMFFileName.find(".mesh", GMFFileName.size()-5) != std::string::npos);
+ bool binaryFound = (GMFFileName.find(".meshb",GMFFileName.size()-6) != std::string::npos);
+ if ( !asciiFound && !binaryFound )
+ GMFFileName.append(".mesh");
+ mesh_write_mesh(msh, GMFFileName.c_str());
+ }
+ }
+
cadsurf_regain_mesh(css, omsh);
// as we don't assign the new triangles to a shape (the pseudo-shape),