Salome HOME
Merge branch 'master' into cgt/devCEA
[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
28 #include <GeomAPI_Ax3.h>
29 #include <GeomAPI_AISObject.h>
30
31 #define GET_CONSTRAINT_PRS(NAME) \
32   static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
33                            const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
34                            AISObjectPtr thePrevious);
35
36 /**
37 * Class which creates constraints presentations
38 */
39 class SKETCHERPRS_EXPORT SketcherPrs_Factory
40 {
41 public:
42   /// Creates coincedent constraint presentation
43   /// \param theConstraint the constraint
44   /// \param thePlane the current sketch plane
45   /// \param thePrevious the previous presentation
46   GET_CONSTRAINT_PRS(coincidentConstraint)
47
48   /// Creates collinear constraint presentation
49   /// \param theConstraint the constraint
50   /// \param thePlane the current sketch plane
51   /// \param thePrevious the previous presentation
52   GET_CONSTRAINT_PRS(collinearConstraint)
53
54   /// Creates parallel constraint presentation
55   /// \param theConstraint the constraint
56   /// \param thePlane the current sketch plane
57   /// \param thePrevious the previous presentation
58   GET_CONSTRAINT_PRS(parallelConstraint)
59
60   /// Creates coincedent perpendicular presentation
61   /// \param theConstraint the constraint
62   /// \param thePlane the current sketch plane
63   /// \param thePrevious the previous presentation
64   GET_CONSTRAINT_PRS(perpendicularConstraint)
65
66   /// Creates rigid constraint presentation
67   /// \param theConstraint the constraint
68   /// \param thePlane the current sketch plane
69   /// \param thePrevious the previous presentation
70   GET_CONSTRAINT_PRS(rigidConstraint)
71
72   /// Creates horizontal constraint presentation
73   /// \param theConstraint the constraint
74   /// \param thePlane the current sketch plane
75   /// \param thePrevious the previous presentation
76   GET_CONSTRAINT_PRS(horisontalConstraint)
77
78   /// Creates vertical constraint presentation
79   /// \param theConstraint the constraint
80   /// \param thePlane the current sketch plane
81   /// \param thePrevious the previous presentation
82   GET_CONSTRAINT_PRS(verticalConstraint)
83
84   /// Creates equal constraint presentation
85   /// \param theConstraint the constraint
86   /// \param thePlane the current sketch plane
87   /// \param thePrevious the previous presentation
88   GET_CONSTRAINT_PRS(equalConstraint)
89
90   /// Creates tangent constraiont presentation
91   /// \param theConstraint the constraint
92   /// \param thePlane the current sketch plane
93   /// \param thePrevious the previous presentation
94   GET_CONSTRAINT_PRS(tangentConstraint)
95
96   /// Creates radius dimension presentation
97   /// \param theConstraint the constraint
98   /// \param thePlane the current sketch plane
99   /// \param thePrevious the previous presentation
100   GET_CONSTRAINT_PRS(radiusConstraint)
101
102   /// Creates length dimension presentation
103   /// \param theConstraint the constraint
104   /// \param thePlane the current sketch plane
105   /// \param thePrevious the previous presentation
106   GET_CONSTRAINT_PRS(lengthDimensionConstraint)
107
108   /// Creates middle constraint presentation
109   /// \param theConstraint the constraint
110   /// \param thePlane the current sketch plane
111   /// \param thePrevious the previous presentation
112   GET_CONSTRAINT_PRS(middleConstraint)
113
114   /// Creates mirror constraint presentation
115   /// \param theConstraint the constraint
116   /// \param thePlane the current sketch plane
117   /// \param thePrevious the previous presentation
118   GET_CONSTRAINT_PRS(mirrorConstraint)
119
120   /// Creates translate constraint presentation
121   /// \param theConstraint the constraint
122   /// \param thePlane the current sketch plane
123   /// \param thePrevious the previous presentation
124   GET_CONSTRAINT_PRS(translateConstraint)
125
126   /// Creates rotate constraint presentation
127   /// \param theConstraint the constraint
128   /// \param thePlane the current sketch plane
129   /// \param thePrevious the previous presentation
130   GET_CONSTRAINT_PRS(rotateConstraint)
131
132   /// Creates angle constraint presentation
133   /// \param theConstraint the constraint
134   /// \param thePlane the current sketch plane
135   /// \param thePrevious the previous presentation
136   GET_CONSTRAINT_PRS(angleConstraint)
137 };
138
139 #endif