
Thu, 01/22/2009 - 14:54
I am using the following code to read STEP files,
Handle(TopTools_HSequenceOfShape) aSequence = CImportExport::ReadSTEP();
After that I am using the following code to extract the shapes,
ShapeExtend_Explorer extendExp;
Handle(TopTools_HSequenceOfShape) vertices=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) edges=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) wires=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) faces=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) shells=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) solids=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) compsols=new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) compounds=new TopTools_HSequenceOfShape;
extendExp.DispatchList(aSequence,vertices,edges,wires,faces,shells,solids,compsols,compounds);
But I am getting only one shape(Compound of solid). How can I get all the shapes from aSequence??
Thu, 01/22/2009 - 14:54
But I am getting only one shape(Compound OR solid). How can I get all the shapes from aSequence??
Fri, 01/23/2009 - 10:27
What you need is specified in the OpenCascade Documentation,
"Modeling Data
User's Guide"
Chapter 5: TOPOLOGY
Tue, 01/27/2009 - 14:12
Could you please give me a sample code......?
Thu, 01/29/2009 - 20:15
Hi,
Not sure if I got your initial query correctly.
To recursively traverse the topology structure you can use TopoDS_Iterator in a way similar to one demonstrated using TopExp_Explorer at http://www.opencascade.org/org/forum/thread_15540/
Another way is to classify everything into sequences with ShapeExtend_Explorer. Then you just iterate over each sequence.
for (i = 1; i <= asequence->Length(); i++) {
const TopoDS_Shape& aShape = asequence->Value(i);
...
}
There is yet another method TopExp::MapShapes() which creates an indexed map of all subshapes (down to the lowest level). Then you iterate over it.
Hope this helps.
Roman
---
opencascade.blogspot.com - blog on Open CASCADE