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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #ifndef SketcherPrs_Factory_H_
21 #define SketcherPrs_Factory_H_
23 #include "SketcherPrs.h"
25 #include <ModelAPI_Feature.h>
27 #include <GeomAPI_Ax3.h>
28 #include <GeomAPI_AISObject.h>
30 #define GET_CONSTRAINT_PRS(NAME) \
31 static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
32 const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
33 AISObjectPtr thePrevious);
36 * Class which creates constraints presentations
38 class SKETCHERPRS_EXPORT SketcherPrs_Factory
41 /// Creates coincedent constraint presentation
42 /// \param theConstraint the constraint
43 /// \param thePlane the current sketch plane
44 /// \param thePrevious the previous presentation
45 GET_CONSTRAINT_PRS(coincidentConstraint)
47 /// Creates collinear constraint presentation
48 /// \param theConstraint the constraint
49 /// \param thePlane the current sketch plane
50 /// \param thePrevious the previous presentation
51 GET_CONSTRAINT_PRS(collinearConstraint)
53 /// Creates parallel constraint presentation
54 /// \param theConstraint the constraint
55 /// \param thePlane the current sketch plane
56 /// \param thePrevious the previous presentation
57 GET_CONSTRAINT_PRS(parallelConstraint)
59 /// Creates coincedent perpendicular presentation
60 /// \param theConstraint the constraint
61 /// \param thePlane the current sketch plane
62 /// \param thePrevious the previous presentation
63 GET_CONSTRAINT_PRS(perpendicularConstraint)
65 /// Creates rigid constraint presentation
66 /// \param theConstraint the constraint
67 /// \param thePlane the current sketch plane
68 /// \param thePrevious the previous presentation
69 GET_CONSTRAINT_PRS(rigidConstraint)
71 /// Creates horizontal constraint presentation
72 /// \param theConstraint the constraint
73 /// \param thePlane the current sketch plane
74 /// \param thePrevious the previous presentation
75 GET_CONSTRAINT_PRS(horisontalConstraint)
77 /// Creates vertical constraint presentation
78 /// \param theConstraint the constraint
79 /// \param thePlane the current sketch plane
80 /// \param thePrevious the previous presentation
81 GET_CONSTRAINT_PRS(verticalConstraint)
83 /// Creates equal constraint presentation
84 /// \param theConstraint the constraint
85 /// \param thePlane the current sketch plane
86 /// \param thePrevious the previous presentation
87 GET_CONSTRAINT_PRS(equalConstraint)
89 /// Creates tangent constraiont presentation
90 /// \param theConstraint the constraint
91 /// \param thePlane the current sketch plane
92 /// \param thePrevious the previous presentation
93 GET_CONSTRAINT_PRS(tangentConstraint)
95 /// Creates radius dimension presentation
96 /// \param theConstraint the constraint
97 /// \param thePlane the current sketch plane
98 /// \param thePrevious the previous presentation
99 GET_CONSTRAINT_PRS(radiusConstraint)
101 /// Creates length dimension presentation
102 /// \param theConstraint the constraint
103 /// \param thePlane the current sketch plane
104 /// \param thePrevious the previous presentation
105 GET_CONSTRAINT_PRS(lengthDimensionConstraint)
107 /// Creates middle constraint presentation
108 /// \param theConstraint the constraint
109 /// \param thePlane the current sketch plane
110 /// \param thePrevious the previous presentation
111 GET_CONSTRAINT_PRS(middleConstraint)
113 /// Creates mirror constraint presentation
114 /// \param theConstraint the constraint
115 /// \param thePlane the current sketch plane
116 /// \param thePrevious the previous presentation
117 GET_CONSTRAINT_PRS(mirrorConstraint)
119 /// Creates translate constraint presentation
120 /// \param theConstraint the constraint
121 /// \param thePlane the current sketch plane
122 /// \param thePrevious the previous presentation
123 GET_CONSTRAINT_PRS(translateConstraint)
125 /// Creates rotate constraint presentation
126 /// \param theConstraint the constraint
127 /// \param thePlane the current sketch plane
128 /// \param thePrevious the previous presentation
129 GET_CONSTRAINT_PRS(rotateConstraint)
131 /// Creates angle constraint presentation
132 /// \param theConstraint the constraint
133 /// \param thePlane the current sketch plane
134 /// \param thePrevious the previous presentation
135 GET_CONSTRAINT_PRS(angleConstraint)