1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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
24 #ifndef HYDROGUI_AISTRIHEDRON_H
25 #define HYDROGUI_AISTRIHEDRON_H
27 #include <AIS_Trihedron.hxx>
28 #include <Prs3d_LineAspect.hxx>
34 * \class HYDROGUI_AISTrihedron
35 * \brief AIS trihedron is redefined in order to show U text on the OX axis
36 * and Z text on the OY axis.
38 DEFINE_STANDARD_HANDLE(HYDROGUI_AISTrihedron, AIS_Trihedron)
40 class HYDROGUI_AISTrihedron : public AIS_Trihedron
44 * The struct to contain axis parameters. Save them in order to do not extract them
45 * on each compute call
49 gp_Pnt myPfirst; // the first point of the axis
50 gp_Pnt myPlast; // the last point of the axis
51 Standard_Real myVal; // the axis length
52 Handle(Prs3d_LineAspect) myLineAspect; // the line aspect
53 gp_Dir myDir; // the axis direction
54 Standard_CString myText; // the axis text. This is the main parameter,
55 // that leads to the trihedron redefine
59 HYDROGUI_AISTrihedron( const Handle(Geom_Axis2Placement)& thePlacement );
61 ~HYDROGUI_AISTrihedron() {}
64 * The static method to create filled trihedron. It makes some additional settings
65 * to the trihedron: resize and set color to the axis
67 static Handle(AIS_Trihedron) createTrihedron( double theSize );
70 * Updates the internal axis parameters. Should be called after the axis parameters change
73 void SetAxis2Placement();
76 * AIS trihedron compute method. It removes the parent compute functionality.
77 * It add to the presentation only oX, oY axis with the corrected text, that contains
79 * \param thePresentationManager the prs manager
80 * \param thePresentationManager the presentation
81 * \param theMode the mode
83 void Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
84 const Handle(Prs3d_Presentation)& thePresentation,
85 const Standard_Integer theMode);
88 * AIS trihedron compute method. It is empty. We do not apply the transformation.
89 * \param thePresentationManager the prs manager
90 * \param theTransformation the transformation
91 * \param thePresentationManager the presentation
93 void Compute( const Handle_Prs3d_Projector& theProjector,
94 const Handle_Geom_Transformation& theTransformation,
95 const Handle_Prs3d_Presentation& thePresentation );
98 * AIS trihedron compute selection method. It is empty. We do not select the trihedron
99 * \param theSelection the selection
100 * \param theMode the mode
102 void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection,
103 const Standard_Integer theMode );
107 * It adds the presentation to the DsgPrs_XYZAxisPresentation. It should be called in
108 * compute for displayed axis
109 * \param thePresentation the 3D presentation
110 * \param theParams the axis params, such as text, direction, stand and last points
112 void ComputeAxis( const Handle(Prs3d_Presentation)& thePresentation,
113 const AxisParameters& theParams );
114 void ComputeFields();
116 AxisParameters myUParams; // the parameters for U axis
117 AxisParameters myZParams; // the parameters for Z axis