1 // Copyright (C) 2014-2022 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef ModuleBase_ArrowPrs_H
21 #define ModuleBase_ArrowPrs_H
23 #include <ModuleBase.h>
24 #include <GeomAPI_Edge.h>
25 #include <AIS_InteractiveContext.hxx>
29 DEFINE_STANDARD_HANDLE(ModuleBase_ArrowPrs, AIS_InteractiveContext)
33 * A presentation class for displaying a direction of edge
36 class ModuleBase_ArrowPrs : public AIS_InteractiveContext
40 /// \param theViewer a viewer which theEdge is displaying.
41 /// \param theEdge an edge whose direction to display.
42 Standard_EXPORT ModuleBase_ArrowPrs(const Handle(V3d_Viewer)& theViewer,
43 const GeomEdgePtr& theEdge);
45 /// Returns an edge shape
46 GeomEdgePtr Edge() const { return myEdge; }
48 /// Draw arrow that represent direction of the edge.
49 Standard_EXPORT void DrawArrow(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor);
51 /// \brief Compare addresses of edges
55 /// Return \c true if the address of the first edge is less than the address of the second
57 bool operator ()(const std::shared_ptr<GeomAPI_Edge>& theEdge1,
58 const std::shared_ptr<GeomAPI_Edge>& theEdge2) const;
61 DEFINE_STANDARD_RTTIEXT(ModuleBase_ArrowPrs, AIS_InteractiveContext)
65 /// The edge whose direction to display.
69 typedef std::pair<GeomEdgePtr, Handle(ModuleBase_ArrowPrs)> EdgeDirection;
70 typedef std::map<GeomEdgePtr, Handle(ModuleBase_ArrowPrs), ModuleBase_ArrowPrs::Comparator> EdgesDirectionMap;