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
Hi,
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);
B.Generated(S1);
TopoDS_Shape S2 = S1.Reversed();
child = MainLab.FindChild(2, Standard_True);
TNaming_Builder BB(child);
BB.Generated(S2);

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();

cout<<S1.Orientation();
cout<<S2.Orientation();
cout<<S21.Orientation();
cout<<S22.Orientation();
}
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.
Regards
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 Technology 6.8.0 is available for download!
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!

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