1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SketcherPrs_Factory_H_
22 #define SketcherPrs_Factory_H_
24 #include "SketcherPrs.h"
26 #include <ModelAPI_Feature.h>
28 #include <GeomAPI_Ax3.h>
29 #include <GeomAPI_AISObject.h>
31 #define GET_CONSTRAINT_PRS(NAME) \
32 static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
33 const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
34 AISObjectPtr thePrevious);
37 * Class which creates constraints presentations
39 class SKETCHERPRS_EXPORT SketcherPrs_Factory
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)