Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

OCAF Orientation

OCAF Orientation
Hayashi 2013/03/21 13:50
I try the following code. But the result was not 0101.
What is wrong?
Thank you for your help.

Handle(AppStd_Application) app = new AppStd_Application();
Handle(TDocStd_Document) doc;
app->NewDocument("BinOcaf", doc);
TDF_Label MainLab = doc->Main();

TopoDS_Vertex S1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0,0,0));
TDF_Label child = MainLab.FindChild(1, Standard_True);
TNaming_Builder B(child);
TopoDS_Shape S2 = S1.Reversed();
child = MainLab.FindChild(2, Standard_True);
TNaming_Builder BB(child);

TCollection_ExtendedString TPath("D:\\a.cbf");
TCollection_ExtendedString status;
Standard_Boolean result = app->SaveAs(doc,TPath,status);

child = MainLab.FindChild(1, Standard_False);
TNaming_Iterator itL = TNaming_Iterator(child);
TopoDS_Shape S21 = itL.NewShape();
child = MainLab.FindChild(2, Standard_False);
itL = TNaming_Iterator(child);
TopoDS_Shape S22 = itL.NewShape();

Forum supervisor 2013/03/21 14:22
Dear Hayashi,
In general OCAF component doesn't distinguish shapes
which are the Same (S1.IsSame (S2) == True).
Orientation may be maintained for NamedShapes with
SELECTED evolution only (for all types of shape except VERTEX).
See TNaming_Selector::Select(...) method.
Hayashi 2013/03/22 03:55
Dear Forum supervisor,
In my application, OCAF is performing only storing of Shapes.
Orientaion will be managed independently.
Thank you
Latest news
  • Open CASCADE CAD Assistant for iOS platform is available!
  • Open CASCADE Technology 6.9.0 is available for download!
  • JT Assistant for Android

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map