How to save a Axis system ( corrdinate system ) in OCAF Document?

hi ,

as described in the title of the topic , i am looking for a way to save an Axis system ( Trihedron ) in my OCAF binary

i tried to find an ATTRIBUTE for storing that but noway , my last try was like this :

Handle(XCAFDoc_Datum) AttribDatum = XCAFDoc_Datum::Set(Label);

Handle(XCAFDimTolObjects_DatumObject) DO= new XCAFDimTolObjects_DatumObject();
DO->SetDatumTargetAxis(aAxis);
AttribDatum->SetObject(DO);

Handle(TPrsStd_AISPresentation) OPresentation = TPrsStd_AISPresentation::Set(Label, XCAFDoc_Datum::GetID());

OPresentation->Update();
OPresentation->Display();

doesnt show anything

i added the next function needs a Repes ( TopoDS_Shape )  noway to convert from Geom_Axis2Placement , or gp_Ax2 or AIS_Trihedron to TopoDS_Shape

I even tried to put some random  shape in it to see if it display it but nothing

DO->SetPresentation(Repes, new TCollection_HAsciiString("Axis system"));

a help or an alternative solution will be appriciated , thanks in advance.

Benjamin Bihler's picture

Hi,

I am also storing axis systems with OCAF, but I have created specific attributes for that. See §3.4.6 in occt_ocaf.pdf.

Benjamin

zine zerdoum's picture

thx for answer , any suggestions and tips about the attributes to derive from ?

Benjamin Bihler's picture

I have derived it directly from TDF_Attribute. The axis system is stored as nine double values: three for the origin, three for the z direction and three for the x direction.