
Tue, 01/16/2001 - 13:53
Hello all,
Can somebody give me some help on how to create a label that contains only a TDataStd_Point. This is what I have done so far...
In my OCAF_PointCommand class I have the method CreatePoint which takes a gp_Pnt object. The function creates a new child from the main label
TDF_Label label = TDF_TagSource::NewChild(_cMainLabel)
and then creates the child label for the point...
TDataStd_Point::Set(label.FindChild(1),pt);
where pt is the gp_Pnt object.
I then initialise my OCAF_PointDriver class which inherits from TFunction_Driver and call Execute.
I am not sure what to put in the Execute function of my PointDriver class. Looking at the OCAF sample provided, a TNaming_NameShape is created, but I assume this is not done for a pure geometric attribute such as a TDataStd_Point. Is there something equivalent that I must do in the Execute function of my PointDriver ??
Please help me !
Simon
Tue, 01/16/2001 - 14:04
Hi
> TDF_Label label =
> TDF_TagSource::NewChild(_cMainLabel)
> and then creates the child label for the
> point...
> TDataStd_Point::Set(label.FindChild(1),pt);
> where pt is the gp_Pnt object.
Ok, here you have created a Label that contains only a TDataStd_Point! You don't need to define a TFunction_Driver. TFunction_Driver provide a 'service' to manipulate data in OCAF. For example you can define OCAF_PointDriver and define Execute that for instance change the X and Y value of TDataSTd_Point.
Fabrizio