1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_AISTRIHEDRON_H
24 #define HYDROGUI_AISTRIHEDRON_H
26 #include <AIS_Trihedron.hxx>
27 #include <Prs3d_LineAspect.hxx>
33 * \class HYDROGUI_AISTrihedron
34 * \brief AIS trihedron is redefined in order to show U text on the OX axis
35 * and Z text on the OY axis.
37 DEFINE_STANDARD_HANDLE(HYDROGUI_AISTrihedron, AIS_Trihedron)
39 class HYDROGUI_AISTrihedron : public AIS_Trihedron
43 * The struct to contain axis parameters. Save them in order to do not extract them
44 * on each compute call
48 gp_Pnt myPfirst; // the first point of the axis
49 gp_Pnt myPlast; // the last point of the axis
50 Standard_Real myVal; // the axis length
51 Handle(Prs3d_LineAspect) myLineAspect; // the line aspect
52 gp_Dir myDir; // the axis direction
53 Standard_CString myText; // the axis text. This is the main parameter,
54 // that leads to the trihedron redefine
58 HYDROGUI_AISTrihedron( const Handle(Geom_Axis2Placement)& thePlacement );
60 ~HYDROGUI_AISTrihedron() {}
63 * The static method to create filled trihedron. It makes some additional settings
64 * to the trihedron: resize and set color to the axis
66 static Handle(AIS_Trihedron) createTrihedron( double theSize );
69 * Updates the internal axis parameters. Should be called after the axis parameters change
72 void SetAxis2Placement();
75 * AIS trihedron compute method. It removes the parent compute functionality.
76 * It add to the presentation only oX, oY axis with the corrected text, that contains
78 * \param thePresentationManager the prs manager
79 * \param thePresentationManager the presentation
80 * \param theMode the mode
82 void Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
83 const Handle(Prs3d_Presentation)& thePresentation,
84 const Standard_Integer theMode);
87 * AIS trihedron compute method. It is empty. We do not apply the transformation.
88 * \param thePresentationManager the prs manager
89 * \param theTransformation the transformation
90 * \param thePresentationManager the presentation
92 void Compute( const Handle_Prs3d_Projector& theProjector,
93 const Handle_Geom_Transformation& theTransformation,
94 const Handle_Prs3d_Presentation& thePresentation );
97 * AIS trihedron compute selection method. It is empty. We do not select the trihedron
98 * \param theSelection the selection
99 * \param theMode the mode
101 void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection,
102 const Standard_Integer theMode );
106 * It adds the presentation to the DsgPrs_XYZAxisPresentation. It should be called in
107 * compute for displayed axis
108 * \param thePresentation the 3D presentation
109 * \param theParams the axis params, such as text, direction, stand and last points
111 void ComputeAxis( const Handle(Prs3d_Presentation)& thePresentation,
112 const AxisParameters& theParams );
113 void ComputeFields();
115 AxisParameters myUParams; // the parameters for U axis
116 AxisParameters myZParams; // the parameters for Z axis