For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

OCAF Orientation

Hayashi's picture

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

cout cout cout cout }

Forum supervisor's picture

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's picture

Dear Forum supervisor,
In my application, OCAF is performing only storing of Shapes.
Orientaion will be managed independently.
Thank you