Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into Dev_2.8.0
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Factory.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef SketcherPrs_Factory_H_
22 #define SketcherPrs_Factory_H_
23
24 #include "SketcherPrs.h"
25
26 #include <ModelAPI_Feature.h>
27 #include <ModelAPI_CompositeFeature.h>
28
29 #include <GeomAPI_Ax3.h>
30 #include <GeomAPI_AISObject.h>
31
32 #define GET_CONSTRAINT_PRS(NAME) \
33   static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
34                            ModelAPI_CompositeFeature* theSketcher, \
35                            const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
36                            AISObjectPtr thePrevious);
37
38 /**
39 * Class which creates constraints presentations
40 */
41 class SKETCHERPRS_EXPORT SketcherPrs_Factory
42 {
43 public:
44   /// Creates collinear constraint presentation
45   /// \param theConstraint the constraint
46   /// \param thePlane the current sketch plane
47   /// \param thePrevious the previous presentation
48   GET_CONSTRAINT_PRS(collinearConstraint)
49
50   /// Creates parallel constraint presentation
51   /// \param theConstraint the constraint
52   /// \param thePlane the current sketch plane
53   /// \param thePrevious the previous presentation
54   GET_CONSTRAINT_PRS(parallelConstraint)
55
56   /// Creates coincedent perpendicular presentation
57   /// \param theConstraint the constraint
58   /// \param thePlane the current sketch plane
59   /// \param thePrevious the previous presentation
60   GET_CONSTRAINT_PRS(perpendicularConstraint)
61
62   /// Creates rigid constraint presentation
63   /// \param theConstraint the constraint
64   /// \param thePlane the current sketch plane
65   /// \param thePrevious the previous presentation
66   GET_CONSTRAINT_PRS(rigidConstraint)
67
68   /// Creates horizontal constraint presentation
69   /// \param theConstraint the constraint
70   /// \param thePlane the current sketch plane
71   /// \param thePrevious the previous presentation
72   GET_CONSTRAINT_PRS(horisontalConstraint)
73
74   /// Creates vertical constraint presentation
75   /// \param theConstraint the constraint
76   /// \param thePlane the current sketch plane
77   /// \param thePrevious the previous presentation
78   GET_CONSTRAINT_PRS(verticalConstraint)
79
80   /// Creates equal constraint presentation
81   /// \param theConstraint the constraint
82   /// \param thePlane the current sketch plane
83   /// \param thePrevious the previous presentation
84   GET_CONSTRAINT_PRS(equalConstraint)
85
86   /// Creates tangent constraiont presentation
87   /// \param theConstraint the constraint
88   /// \param thePlane the current sketch plane
89   /// \param thePrevious the previous presentation
90   GET_CONSTRAINT_PRS(tangentConstraint)
91
92   /// Creates middle constraint presentation
93   /// \param theConstraint the constraint
94   /// \param thePlane the current sketch plane
95   /// \param thePrevious the previous presentation
96   GET_CONSTRAINT_PRS(middleConstraint)
97
98   /// Creates mirror constraint presentation
99   /// \param theConstraint the constraint
100   /// \param thePlane the current sketch plane
101   /// \param thePrevious the previous presentation
102   GET_CONSTRAINT_PRS(mirrorConstraint)
103
104   /// Creates translate constraint presentation
105   /// \param theConstraint the constraint
106   /// \param thePlane the current sketch plane
107   /// \param thePrevious the previous presentation
108   GET_CONSTRAINT_PRS(translateConstraint)
109
110   /// Creates rotate constraint presentation
111   /// \param theConstraint the constraint
112   /// \param thePlane the current sketch plane
113   /// \param thePrevious the previous presentation
114   GET_CONSTRAINT_PRS(rotateConstraint)
115
116 #define GET_CONSTRAINT2_PRS(NAME) \
117   static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
118                            const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
119                            AISObjectPtr thePrevious);
120
121   /// Creates coincedent constraint presentation
122   /// \param theConstraint the constraint
123   /// \param thePlane the current sketch plane
124   /// \param thePrevious the previous presentation
125   GET_CONSTRAINT2_PRS(coincidentConstraint)
126
127   /// Creates angle constraint presentation
128   /// \param theConstraint the constraint
129   /// \param thePlane the current sketch plane
130   /// \param thePrevious the previous presentation
131   GET_CONSTRAINT2_PRS(angleConstraint)
132
133   /// Creates length dimension presentation
134   /// \param theConstraint the constraint
135   /// \param thePlane the current sketch plane
136   /// \param thePrevious the previous presentation
137   GET_CONSTRAINT2_PRS(lengthDimensionConstraint)
138
139   /// Creates radius dimension presentation
140   /// \param theConstraint the constraint
141   /// \param thePlane the current sketch plane
142   /// \param thePrevious the previous presentation
143   GET_CONSTRAINT2_PRS(radiusConstraint)
144 };
145
146 #endif