Forum archiveIssue archiveVisualization and 3D Viewer

Archived discussion

Any way to create a gizmo

Visualization and 3D ViewerWed, 05/04/2016 - 09:127 replies

Browse this forum
QuestionAuthor

Hello! 

I need to create a gizmo in the visualizer for selected objects.

Something like in attached picture.

Are there some general tips on how to do this with OpenCASCADE?

Or at least how draw any shape on screen which will be attached to the "camera" and not changes its size when zoomed/rotated?

Discussion

7 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hello!

This may not be the best way

Have a look at OpenGl_Trihedron for drawing it (this doesn't include selection). ViewerTest_OpenGlCommands.cxx has example of using OpenGl_Element.

For creating plane from part transformation

Handle(Geom_Axis2Placement) shapeCoordSystemPlacement = new Geom_Axis2Placement(gp::XOY());

shapeCoordSystemPlacement->Transform(AIS_Shape->Transformation());

Handle(Geom_Plane) axe_xy_plane = new Geom_Plane(shapeCoordSystemPlacement->Location(), shapeCoordSystemPlacement->Direction());

Handle(Geom_Plane) axe_xz_plane = new Geom_Plane(shapeCoordSystemPlacement->Location(), shapeCoordSystemPlacement->YDirection());

Handle(Geom_Plane) axe_yz_plane = new Geom_Plane(shapeCoordSystemPlacement->Location(), shapeCoordSystemPlacement->XDirection());

For other calculations use http://cvl-robot.hateblo.jp/entry/2015/12/07/164319

02Author

Thank you very much, Daniel! You helped me a lot :)

03Commenter-2

Dear Author,

You can try the new interactive object AIS_Manipulator.
This object is not yet available in OCCT master, but it can be retrieved from the branch CR27038_3 of official git repository.
You are welcome to our support services if you need any help!

Best regards
FSR
 

04Author

Oh, that is really great! Thank you all for help!

05Commenter-1

Thats great news

06Commenter-3

AIS_Manipulator sounds exciting indeed...

07Commenter-4

You mean a gimbal.. not a gizmo