1 // Created on: 2016-10-11
2 // Created by: Ilya SEVRIKOV
3 // Copyright (c) 2016 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _V3d_Trihedron_HeaderFile
17 #define _V3d_Trihedron_HeaderFile
19 #include <Graphic3d_Group.hxx>
20 #include <Graphic3d_Structure.hxx>
21 #include <Graphic3d_StructureManager.hxx>
22 #include <Graphic3d_TransformPers.hxx>
23 #include <Prs3d_LineAspect.hxx>
24 #include <Prs3d_ShadingAspect.hxx>
25 #include <Prs3d_TextAspect.hxx>
29 //! Class for presentation of zbuffer trihedron object.
30 class V3d_Trihedron : public Standard_Transient
32 DEFINE_STANDARD_RTTIEXT(V3d_Trihedron, Standard_Transient)
35 //! Creates a default trihedron.
36 Standard_EXPORT V3d_Trihedron();
39 Standard_EXPORT virtual ~V3d_Trihedron();
41 //! Switch wireframe / shaded trihedron.
42 void SetWireframe (const Standard_Boolean theAsWireframe) { myIsWireframe = theAsWireframe; }
44 //! Setup the corner to draw the trihedron.
45 Standard_EXPORT void SetPosition (const Aspect_TypeOfTriedronPosition thePosition);
47 //! Setup the scale factor.
48 Standard_EXPORT void SetScale (const Standard_Real theScale);
50 //! Setup the size ratio factor.
51 Standard_EXPORT void SetSizeRatio (const Standard_Real theRatio);
53 //! Setup the arrow diameter.
54 Standard_EXPORT void SetArrowDiameter (const Standard_Real theDiam);
56 //! Setup the number of facets for tessellation.
57 Standard_EXPORT void SetNbFacets (const Standard_Integer theNbFacets);
59 //! Setup color of text labels.
60 Standard_EXPORT void SetLabelsColor (const Quantity_Color& theColor);
62 //! Setup colors of arrows.
63 Standard_EXPORT void SetArrowsColor (const Quantity_Color& theXColor,
64 const Quantity_Color& theYColor,
65 const Quantity_Color& theZColor);
67 //! Display trihedron.
68 Standard_EXPORT void Display (const V3d_View& theView);
71 Standard_EXPORT void Erase();
75 //! Fills Graphic3d_Group.
76 Standard_EXPORT void compute();
78 //! Invalidates objects. It leads recompute.
81 myToCompute = Standard_True;
84 //! Sets offset 2d for transform persistence.
85 Standard_EXPORT void setOffset2d();
89 //! Custom Graphic3d_Structure implementation.
90 class TrihedronStructure;
94 Handle(Prs3d_ShadingAspect) mySphereShadingAspect;
95 Handle(Prs3d_LineAspect) mySphereLineAspect;
97 Handle(Prs3d_TextAspect) myTextAspect;
99 Handle(Prs3d_ShadingAspect) myArrowShadingAspects[3];
100 Handle(Prs3d_LineAspect) myArrowLineAspects[3];
102 Handle(Graphic3d_Structure) myStructure;
103 Handle(Graphic3d_TransformPers) myTransformPers;
105 Standard_Real myScale;
106 Standard_Real myRatio;
107 Standard_Real myDiameter;
108 Standard_Integer myNbFacettes;
109 Standard_Boolean myIsWireframe;
110 Standard_Boolean myToCompute;
114 DEFINE_STANDARD_HANDLE (V3d_Trihedron, Standard_Transient)