0030682: Configuration, qmake - all warnings are suppressed on macOS target
[occt.git] / src / AIS / AIS_EqualDistanceRelation.hxx
1 // Created on: 1998-01-24
2 // Created by: Julia GERASIMOVA
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _AIS_EqualDistanceRelation_HeaderFile
18 #define _AIS_EqualDistanceRelation_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TopoDS_Shape.hxx>
24 #include <gp_Pnt.hxx>
25 #include <AIS_Relation.hxx>
26 #include <PrsMgr_PresentationManager3d.hxx>
27 #include <Standard_Integer.hxx>
28 #include <SelectMgr_Selection.hxx>
29 #include <Prs3d_Drawer.hxx>
30 #include <Standard_Real.hxx>
31 #include <Standard_Boolean.hxx>
32 #include <DsgPrs_ArrowSide.hxx>
33 #include <AIS_TypeOfDist.hxx>
34 class TopoDS_Shape;
35 class Geom_Plane;
36 class Prs3d_Presentation;
37 class Prs3d_Projector;
38 class Geom_Transformation;
39 class TopoDS_Edge;
40 class Bnd_Box;
41 class gp_Pnt;
42 class TopoDS_Vertex;
43
44
45 class AIS_EqualDistanceRelation;
46 DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
47
48 //! A framework to display equivalent distances between
49 //! shapes and a given plane.
50 //! The distance is the length of a projection from the
51 //! shape to the plane.
52 //! These distances are used to compare shapes by this vector alone.
53 class AIS_EqualDistanceRelation : public AIS_Relation
54 {
55
56 public:
57
58   
59   //! Constructs a framework to display equivalent
60   //! distances between the shapes aShape1, aShape2,
61   //! aShape3, aShape4 and the plane aPlane.
62   //! The distance is the length of a projection from the
63   //! shape to the plane.
64   Standard_EXPORT AIS_EqualDistanceRelation(const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle(Geom_Plane)& aPlane);
65   
66
67   //! Sets the shape aShape to be used as the shape
68   //! aShape3 in the framework created at construction time.
69     void SetShape3 (const TopoDS_Shape& aShape);
70   
71
72   //! Returns the shape aShape3 from the framework
73   //! created at construction time.
74     const TopoDS_Shape& Shape3() const;
75   
76
77   //! Sets the shape aShape to be used as the shape
78   //! aShape4 in the framework created at construction time.
79     void SetShape4 (const TopoDS_Shape& aShape);
80   
81
82   //! Returns the shape aShape4 from the framework
83   //! created at construction time.
84     const TopoDS_Shape& Shape4() const;
85   
86   //! Computes the presentation according to a point of view
87   //! given by <aProjector>.
88   //! To be Used when the associated degenerated Presentations
89   //! have been transformed by <aTrsf> which is not a Pure
90   //! Translation. The HLR Prs can't be deducted automatically
91   //! WARNING :<aTrsf> must be applied
92   //! to the object to display before computation  !!!
93   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
94   
95   //! Computes the location of an intreval between
96   //! between two edges. FirstAttach , SecondAttach
97   //! are the returned extreme points of the interval.
98   Standard_EXPORT static void ComputeTwoEdgesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Edge& FirstEdge, const TopoDS_Edge& SecondEdge, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
99   
100   //! Computes the interval position between two vertexs. FirstAttach,
101   //! SecondAttach are the returned extreme points of the interval.
102   Standard_EXPORT static void ComputeTwoVerticesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& SecondVertex, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, const AIS_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
103   
104   //! Compute the interval location between a vertex and an edge. Edge may be
105   //! a line or a circle.
106   Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
107
108
109
110
111   DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
112
113 protected:
114
115
116
117
118 private:
119
120   
121   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
122   
123   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
124   
125   Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
126
127   TopoDS_Shape myShape3;
128   TopoDS_Shape myShape4;
129   gp_Pnt myAttachPoint1;
130   gp_Pnt myAttachPoint2;
131   gp_Pnt myAttachPoint3;
132   gp_Pnt myAttachPoint4;
133   gp_Pnt myPoint1;
134   gp_Pnt myPoint2;
135   gp_Pnt myPoint3;
136   gp_Pnt myPoint4;
137
138
139 };
140
141
142 #include <AIS_EqualDistanceRelation.lxx>
143
144
145
146
147
148 #endif // _AIS_EqualDistanceRelation_HeaderFile