individual Attributes

I've written some code to import stl-geometries and to visualize them with OCC.
Now i can (interactively) select parts of my "shape" with the mouse, i.E. faces:

//some code-fragments here:
.... //import STL
TopoDS_Shape aShape = ResultShape;
Handle(TopTools_HSequenceOfShape) shapes = new TopTools_HSequenceOfShape();
shapes->Append( aShape );
for ( int i = 1; i Length(); i++ )
myInteractiveContext->Display( new AIS_Shape( shapes->Value( i ) ), false );

//face selection

Now I want to add some Attributes to the selected Faces, like material-informations, elasticity-factors,... . This could be done with edit-masks or sliders (I use qt) connected to the current selection.
I also want to add my selection to different, pre-defined groups.

Is there any guide/example how to do this?
Or has anybody done sth like this before or knows how to start?


Torsten Sadowski's picture

Hi Niko,

what you want to do calls for OCAF. I started by merging the Qt Import/Export Sample with the Windows OCAF Sample.


Roman Lygin's picture

This can be a good advise.

Using OCAF you can make sure your mapping between faces and attributes will be restored from a persistent file. Another advantage is that if you use XML flavor of OCAF persistence - you can view/edit your data in an external application.


taxidriver's picture

Hello Niko,

i try to select interactively select parts of my shape too, i want to change the position by moving the actual point/vertices , can you sentd me your complete example how you use it,

i would appreciate it,