mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025405: STL reader doesn't keep shared nodes
An improved RWSTL::ReadFile() method + a draw-command returning the number of nodes and triangles for a MeshVS_Mesh object based on STL mesh data source. An indexed map of points is replaced by a CellFilter of XYZ objects already implemented in BRepBuilderAPI. Also, BRepBuilderAPI_VertexInspector became exported for TKTopAlgo library (Standard_EXPORT is added for the methods of this class). Standard_EXPORT is removed for in-line methods of BRepBuilderAPI_VertexInspector Test-case for issue #25405 Update of test-cases, according to new behavior
This commit is contained in:
@@ -1185,6 +1185,38 @@ static Standard_Integer tovrml(Draw_Interpretor& di, Standard_Integer argc, cons
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static Standard_Integer meshinfo(Draw_Interpretor& di,
|
||||
Standard_Integer argc,
|
||||
const char** argv)
|
||||
{
|
||||
if ( argc != 2 )
|
||||
{
|
||||
di << "Wrong number of parameters. Use : meshinfo mesh" << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(MeshVS_Mesh) aMesh = getMesh(argv[ 1 ], di);
|
||||
if ( aMesh.IsNull() )
|
||||
{
|
||||
di << "Mesh not found" << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(XSDRAWSTLVRML_DataSource) stlMeshSource = Handle(XSDRAWSTLVRML_DataSource)::DownCast(aMesh->GetDataSource());
|
||||
if (!stlMeshSource.IsNull())
|
||||
{
|
||||
const TColStd_PackedMapOfInteger& nodes = stlMeshSource->GetAllNodes();
|
||||
const TColStd_PackedMapOfInteger& tris = stlMeshSource->GetAllElements();
|
||||
|
||||
di << "Nb nodes = " << nodes.Extent() << "\n";
|
||||
di << "Nb triangles = " << tris.Extent() << "\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands)
|
||||
{
|
||||
const char* g = "XSTEP-STL/VRML"; // Step transfer file commands
|
||||
@@ -1213,6 +1245,7 @@ void XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands)
|
||||
theCommands.Add ("meshtext", "display text labels", __FILE__, meshtext, g );
|
||||
theCommands.Add ("meshdeform", "display deformed mesh", __FILE__, meshdeform, g );
|
||||
theCommands.Add ("mesh_edge_width", "set width of edges", __FILE__, mesh_edge_width, g );
|
||||
theCommands.Add ("meshinfo", "displays the number of nodes and triangles", __FILE__, meshinfo, g );
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
Reference in New Issue
Block a user