SHAPER  9.15.0
SolveSpaceSolver_Builder.h
1 // Copyright (C) 2014-2025 CEA, EDF
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 email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SolveSpaceSolver_Builder_H_
21 #define SolveSpaceSolver_Builder_H_
22 
23 #include <SketchSolver_Builder.h>
24 #include <SketchSolver_Constraint.h>
25 
26 #include <SketchPlugin_Constraint.h>
27 
28 #include <ModelAPI_CompositeFeature.h>
29 
35 {
36 private:
39 
40 public:
42  static BuilderPtr getInstance();
43 
45  virtual StoragePtr createStorage(const GroupID& theGroup) const;
47  virtual SolverPtr createSolver() const;
48 
63  virtual std::list<ConstraintWrapperPtr>
64  createConstraint(ConstraintPtr theConstraint,
65  const GroupID& theGroupID,
66  const EntityID& theSketchID,
67  const SketchSolver_ConstraintType& theType,
68  const double& theValue,
69  const EntityWrapperPtr& theEntity1,
70  const EntityWrapperPtr& theEntity2 = EntityWrapperPtr(),
71  const EntityWrapperPtr& theEntity3 = EntityWrapperPtr(),
72  const EntityWrapperPtr& theEntity4 = EntityWrapperPtr()) const;
73 
86  virtual std::list<ConstraintWrapperPtr>
87  createConstraint(ConstraintPtr theConstraint,
88  const GroupID& theGroupID,
89  const EntityID& theSketchID,
90  const SketchSolver_ConstraintType& theType,
91  const double& theValue,
92  const bool theFullValue,
93  const EntityWrapperPtr& thePoint1,
94  const EntityWrapperPtr& thePoint2,
95  const std::list<EntityWrapperPtr>& theTrsfEnt) const;
96 
98  virtual void adjustConstraint(ConstraintWrapperPtr theConstraint) const;
99 
106  virtual EntityWrapperPtr createFeature(FeaturePtr theFeature,
107  const std::list<EntityWrapperPtr>& theAttributes,
108  const GroupID& theGroupID,
109  const EntityID& theSketchID = EID_UNKNOWN) const;
110 
116  virtual EntityWrapperPtr createAttribute(AttributePtr theAttribute,
117  const GroupID& theGroup,
118  const EntityID& theSketchID = EID_UNKNOWN) const;
119 
120 private:
122  std::list<ConstraintWrapperPtr> createMirror(ConstraintPtr theConstraint,
123  const GroupID& theGroupID,
124  const EntityID& theSketchID,
125  const EntityWrapperPtr& theEntity1,
126  const EntityWrapperPtr& theEntity2,
127  const EntityWrapperPtr& theMirrorLine) const;
128 
133  EntityWrapperPtr createSketchEntity(CompositeFeaturePtr theSketch,
134  const GroupID& theGroupID) const;
135 
141  EntityWrapperPtr createNormal(AttributePtr theNormal,
142  AttributePtr theDirX,
143  const GroupID& theGroupID) const;
144 
150  ParameterWrapperPtr createParameter(const GroupID& theGroup,
151  const double theValue = 0.0,
152  const bool theExpr = false) const;
153 
154 private:
155  static BuilderPtr mySelf;
156 };
157 
158 #endif
Create bridges between SketchPlugin constraints and SolveSpace constraints.
Definition: SolveSpaceSolver_Builder.h:35
virtual EntityWrapperPtr createAttribute(AttributePtr theAttribute, const GroupID &theGroup, const EntityID &theSketchID=EID_UNKNOWN) const
Creates an attribute.
Definition: SolveSpaceSolver_Builder.cpp:373
virtual std::list< ConstraintWrapperPtr > createConstraint(ConstraintPtr theConstraint, const GroupID &theGroupID, const EntityID &theSketchID, const SketchSolver_ConstraintType &theType, const double &theValue, const EntityWrapperPtr &theEntity1, const EntityWrapperPtr &theEntity2=EntityWrapperPtr(), const EntityWrapperPtr &theEntity3=EntityWrapperPtr(), const EntityWrapperPtr &theEntity4=EntityWrapperPtr()) const
Creates new constraint(s) using given parameters.
Definition: SolveSpaceSolver_Builder.cpp:103
virtual EntityWrapperPtr createFeature(FeaturePtr theFeature, const std::list< EntityWrapperPtr > &theAttributes, const GroupID &theGroupID, const EntityID &theSketchID=EID_UNKNOWN) const
Creates a feature using list of already created attributes.
Definition: SolveSpaceSolver_Builder.cpp:318
virtual void adjustConstraint(ConstraintWrapperPtr theConstraint) const
Update flags for several kinds of constraints.
Definition: SolveSpaceSolver_Builder.cpp:304
virtual SolverPtr createSolver() const
Creates specific solver.
Definition: SolveSpaceSolver_Builder.cpp:97
virtual StoragePtr createStorage(const GroupID &theGroup) const
Creates a storage specific for used solver.
Definition: SolveSpaceSolver_Builder.cpp:92
static BuilderPtr getInstance()
Returns single instance of builder.
Definition: SolveSpaceSolver_Builder.cpp:83