SHAPER  9.12.0
ModuleBase_ArrowPrs.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef ModuleBase_ArrowPrs_H
21 #define ModuleBase_ArrowPrs_H
22 
23 #include <ModuleBase.h>
24 #include <GeomAPI_Edge.h>
25 #include <AIS_InteractiveContext.hxx>
26 
27 #include <map>
28 
29 DEFINE_STANDARD_HANDLE(ModuleBase_ArrowPrs, AIS_InteractiveContext)
30 
31 
37 {
38 public:
42  Standard_EXPORT ModuleBase_ArrowPrs(const Handle(V3d_Viewer)& theViewer,
43  const GeomEdgePtr& theEdge);
44 
46  GeomEdgePtr Edge() const { return myEdge; }
47 
49  Standard_EXPORT void DrawArrow(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor);
50 
52  class Comparator
53  {
54  public:
56  MODULEBASE_EXPORT
57  bool operator ()(const std::shared_ptr<GeomAPI_Edge>& theEdge1,
58  const std::shared_ptr<GeomAPI_Edge>& theEdge2) const;
59  };
60 
61  DEFINE_STANDARD_RTTIEXT(ModuleBase_ArrowPrs, AIS_InteractiveContext)
62 
63 private:
64 
66  GeomEdgePtr myEdge;
67 };
68 
69 typedef std::pair<GeomEdgePtr, Handle(ModuleBase_ArrowPrs)> EdgeDirection;
70 typedef std::map<GeomEdgePtr, Handle(ModuleBase_ArrowPrs), ModuleBase_ArrowPrs::Comparator> EdgesDirectionMap;
71 
72 #endif
Compare addresses of edges.
Definition: ModuleBase_ArrowPrs.h:53
A presentation class for displaying a direction of edge.
Definition: ModuleBase_ArrowPrs.h:37
ModuleBase_ArrowPrs(const Handle &&theViewer, const GeomEdgePtr &theEdge)
Constructor.
GeomEdgePtr Edge() const
Returns an edge shape.
Definition: ModuleBase_ArrowPrs.h:46