From: azv Date: Thu, 16 Mar 2017 12:21:36 +0000 (+0300) Subject: Sketcher: Remove obsolete interfaces. Code cleanup. X-Git-Tag: V_2.7.0~214 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b66c5ad5860a105ae09d519c417e304efe203b95;p=modules%2Fshaper.git Sketcher: Remove obsolete interfaces. Code cleanup. --- diff --git a/src/SketchSolver/CMakeLists.txt b/src/SketchSolver/CMakeLists.txt index d6b370d79..776221aa0 100644 --- a/src/SketchSolver/CMakeLists.txt +++ b/src/SketchSolver/CMakeLists.txt @@ -16,11 +16,8 @@ ENDFUNCTION(TO_FULL_PATH) INCLUDE(Common) SET(SKETCHSOLVER_HEADERS - SketchSolver.h SketchSolver_Error.h SketchSolver_Group.h - SketchSolver_IConstraintWrapper.h - SketchSolver_IEntityWrapper.h SketchSolver_Manager.h SketchSolver_Storage.h ) diff --git a/src/SketchSolver/PlaneGCSSolver/CMakeLists.txt b/src/SketchSolver/PlaneGCSSolver/CMakeLists.txt index 91bc90b79..2891c1209 100644 --- a/src/SketchSolver/PlaneGCSSolver/CMakeLists.txt +++ b/src/SketchSolver/PlaneGCSSolver/CMakeLists.txt @@ -7,7 +7,8 @@ SET(PLANEGCSSOLVER_HEADERS PlaneGCSSolver_Solver.h PlaneGCSSolver_Storage.h PlaneGCSSolver_ConstraintWrapper.h - PlaneGCSSolver_EntityWrapper.h + PlaneGCSSolver_EdgeWrapper.h + PlaneGCSSolver_EdgeWrapper.h PlaneGCSSolver_PointWrapper.h PlaneGCSSolver_ScalarWrapper.h PlaneGCSSolver_AngleWrapper.h @@ -18,7 +19,7 @@ SET(PLANEGCSSOLVER_SOURCES PlaneGCSSolver_Solver.cpp PlaneGCSSolver_Storage.cpp PlaneGCSSolver_ConstraintWrapper.cpp - PlaneGCSSolver_EntityWrapper.cpp + PlaneGCSSolver_EdgeWrapper.cpp PlaneGCSSolver_PointWrapper.cpp PlaneGCSSolver_ScalarWrapper.cpp PlaneGCSSolver_AngleWrapper.cpp diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.h index 216905155..68109420e 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.h @@ -8,15 +8,12 @@ #define PlaneGCSSolver_ConstraintWrapper_H_ #include -#include #include -#include - /** * Wrapper providing operations with PlaneGCS constraints. */ -class PlaneGCSSolver_ConstraintWrapper : public SketchSolver_IConstraintWrapper +class PlaneGCSSolver_ConstraintWrapper { public: PlaneGCSSolver_ConstraintWrapper(const GCSConstraintPtr& theConstraint, @@ -31,6 +28,9 @@ public: void setConstraints(const std::list& theConstraints) { myGCSConstraints = theConstraints; } + /// \brief Return ID of current constraint + const ConstraintID& id() const + { return myID; } /// \brief Change constraint ID virtual void setId(const ConstraintID& theID); @@ -50,9 +50,12 @@ public: { return myValueParam; } private: + ConstraintID myID; SketchSolver_ConstraintType myType; ScalarWrapperPtr myValueParam; std::list myGCSConstraints; }; +typedef std::shared_ptr ConstraintWrapperPtr; + #endif diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Defs.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Defs.h index 5a22cde9e..9274c2878 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Defs.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Defs.h @@ -7,8 +7,6 @@ #ifndef PlaneGCSSolver_Defs_H_ #define PlaneGCSSolver_Defs_H_ -#include - #include #include #include @@ -17,4 +15,58 @@ typedef std::shared_ptr GCSPointPtr; typedef std::shared_ptr GCSCurvePtr; typedef std::shared_ptr GCSConstraintPtr; +// Tolerance for value of parameters +const double tolerance = 1.e-10; + +#define PI 3.1415926535897932 + +// Types for data entities enumeration +typedef int ConstraintID; + +// Predefined values for identifiers +const ConstraintID CID_UNKNOWN = 0; +const ConstraintID CID_MOVEMENT = -1; + +/// Types of entities +enum SketchSolver_EntityType { + ENTITY_UNKNOWN = 0, + ENTITY_SCALAR, + ENTITY_ANGLE, + ENTITY_POINT, + ENTITY_LINE, + ENTITY_CIRCLE, + ENTITY_ARC +}; + +/// Types of constraints +enum SketchSolver_ConstraintType { + CONSTRAINT_UNKNOWN = 0, + CONSTRAINT_COINCIDENCE, // base coincidence if we don't know exact type yet + CONSTRAINT_PT_PT_COINCIDENT, + CONSTRAINT_PT_ON_LINE, + CONSTRAINT_PT_ON_CIRCLE, + CONSTRAINT_MIDDLE_POINT, + CONSTRAINT_DISTANCE, // base distance if we don't know the measured objects yet + CONSTRAINT_PT_PT_DISTANCE, + CONSTRAINT_PT_LINE_DISTANCE, + CONSTRAINT_RADIUS, + CONSTRAINT_ANGLE, + CONSTRAINT_FIXED, + CONSTRAINT_HORIZONTAL, + CONSTRAINT_VERTICAL, + CONSTRAINT_PARALLEL, + CONSTRAINT_PERPENDICULAR, + CONSTRAINT_SYMMETRIC, + CONSTRAINT_EQUAL, // base equality if we don't know the measured objects yet + CONSTRAINT_EQUAL_LINES, + CONSTRAINT_EQUAL_LINE_ARC, + CONSTRAINT_EQUAL_RADIUS, + CONSTRAINT_TANGENT, // base tangency if we don't know the measured objects yet + CONSTRAINT_TANGENT_CIRCLE_LINE, + CONSTRAINT_TANGENT_CIRCLE_CIRCLE, + CONSTRAINT_COLLINEAR, + CONSTRAINT_MULTI_TRANSLATION, + CONSTRAINT_MULTI_ROTATION +}; + #endif diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp new file mode 100644 index 000000000..51cef8c47 --- /dev/null +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp @@ -0,0 +1,22 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: PlaneGCSSolver_EdgeWrapper.cpp +// Created: 14 Dec 2015 +// Author: Artem ZHIDKOV + +#include + +PlaneGCSSolver_EdgeWrapper::PlaneGCSSolver_EdgeWrapper(const GCSCurvePtr theEntity) + : myEntity(theEntity) +{ + std::shared_ptr aLine = std::dynamic_pointer_cast(myEntity); + if (aLine) myType = ENTITY_LINE; + else { + std::shared_ptr anArc = std::dynamic_pointer_cast(myEntity); + if (anArc) myType = ENTITY_ARC; + else { + std::shared_ptr aCircle = std::dynamic_pointer_cast(myEntity); + if (aCircle) myType = ENTITY_CIRCLE; + } + } +} diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.h new file mode 100644 index 000000000..dd843e2cb --- /dev/null +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.h @@ -0,0 +1,37 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: PlaneGCSSolver_EdgeWrapper.h +// Created: 14 Dec 2015 +// Author: Artem ZHIDKOV + +#ifndef PlaneGCSSolver_EdgeWrapper_H_ +#define PlaneGCSSolver_EdgeWrapper_H_ + +#include +#include + +/** + * Wrapper providing operations with PlaneGCS entities (lines, circles and arcs). + */ +class PlaneGCSSolver_EdgeWrapper : public PlaneGCSSolver_EntityWrapper +{ +public: + PlaneGCSSolver_EdgeWrapper(const GCSCurvePtr theEntity); + + /// \brief Return PlaneGCS geometric entity + const GCSCurvePtr& entity() const + { return myEntity; } + /// \brief Return PlaneGCS geometric entity to change + GCSCurvePtr& changeEntity() + { return myEntity; } + + /// \brief Return type of current entity + virtual SketchSolver_EntityType type() const + { return myType; } + +private: + SketchSolver_EntityType myType; + GCSCurvePtr myEntity; +}; + +#endif diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityDestroyer.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityDestroyer.cpp index 697d2db5c..97a3b83f0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityDestroyer.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityDestroyer.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include static void destroyScalar(const EntityWrapperPtr& theEntity, GCS::SET_pD& theParams) { @@ -26,8 +26,8 @@ static void destroyPoint(const EntityWrapperPtr& theEntity, GCS::SET_pD& thePara static void destroyLine(const EntityWrapperPtr& theEntity, GCS::SET_pD& theParams) { - std::shared_ptr anEntity = - std::dynamic_pointer_cast(theEntity); + std::shared_ptr anEntity = + std::dynamic_pointer_cast(theEntity); std::shared_ptr aLine = std::dynamic_pointer_cast(anEntity->entity()); theParams.insert(aLine->p1.x); theParams.insert(aLine->p1.y); @@ -37,8 +37,8 @@ static void destroyLine(const EntityWrapperPtr& theEntity, GCS::SET_pD& theParam static void destroyCircle(const EntityWrapperPtr& theEntity, GCS::SET_pD& theParams) { - std::shared_ptr anEntity = - std::dynamic_pointer_cast(theEntity); + std::shared_ptr anEntity = + std::dynamic_pointer_cast(theEntity); std::shared_ptr aCirc = std::dynamic_pointer_cast(anEntity->entity()); theParams.insert(aCirc->center.x); theParams.insert(aCirc->center.y); @@ -47,8 +47,8 @@ static void destroyCircle(const EntityWrapperPtr& theEntity, GCS::SET_pD& thePar static void destroyArc(const EntityWrapperPtr& theEntity, GCS::SET_pD& theParams) { - std::shared_ptr anEntity = - std::dynamic_pointer_cast(theEntity); + std::shared_ptr anEntity = + std::dynamic_pointer_cast(theEntity); std::shared_ptr anArc = std::dynamic_pointer_cast(anEntity->entity()); theParams.insert(anArc->center.x); theParams.insert(anArc->center.y); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.cpp deleted file mode 100644 index 907ca6167..000000000 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PlaneGCSSolver_EntityWrapper.cpp -// Created: 14 Dec 2015 -// Author: Artem ZHIDKOV - -#include - -PlaneGCSSolver_EntityWrapper::PlaneGCSSolver_EntityWrapper(const GCSCurvePtr theEntity) - : myEntity(theEntity) -{ - std::shared_ptr aLine = std::dynamic_pointer_cast(myEntity); - if (aLine) myType = ENTITY_LINE; - else { - std::shared_ptr anArc = std::dynamic_pointer_cast(myEntity); - if (anArc) myType = ENTITY_ARC; - else { - std::shared_ptr aCircle = std::dynamic_pointer_cast(myEntity); - if (aCircle) myType = ENTITY_CIRCLE; - } - } -} diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h index 38c92198a..b9a3981d0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h @@ -1,37 +1,41 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // File: PlaneGCSSolver_EntityWrapper.h -// Created: 14 Dec 2015 +// Created: 30 Nov 2015 // Author: Artem ZHIDKOV #ifndef PlaneGCSSolver_EntityWrapper_H_ #define PlaneGCSSolver_EntityWrapper_H_ #include -#include + +#include +#include + +#include +#include /** - * Wrapper providing operations with PlaneGCS entities (lines, circles and arcs). + * Wrapper providing operations with entities regardless the solver. */ -class PlaneGCSSolver_EntityWrapper : public SketchSolver_IEntityWrapper +class PlaneGCSSolver_EntityWrapper { public: - PlaneGCSSolver_EntityWrapper(const GCSCurvePtr theEntity); - - /// \brief Return PlaneGCS geometric entity - const GCSCurvePtr& entity() const - { return myEntity; } - /// \brief Return PlaneGCS geometric entity to change - GCSCurvePtr& changeEntity() - { return myEntity; } + PlaneGCSSolver_EntityWrapper() : myExternal(false) {} + virtual ~PlaneGCSSolver_EntityWrapper() {} /// \brief Return type of current entity - virtual SketchSolver_EntityType type() const - { return myType; } + virtual SketchSolver_EntityType type() const = 0; + + /// \brief Change flag indicating the entity cannot be changed in the solver + void setExternal(bool theExternal) { myExternal = theExternal; } + /// \brief Return the External flag + bool isExternal() const { return myExternal; } private: - SketchSolver_EntityType myType; - GCSCurvePtr myEntity; + bool myExternal; }; +typedef std::shared_ptr EntityWrapperPtr; + #endif diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.cpp index a0ffc362f..e9cf468a9 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.cpp @@ -5,7 +5,7 @@ // Author: Artem ZHIDKOV #include -#include +#include #include #include @@ -117,7 +117,7 @@ EntityWrapperPtr createLine(const AttributeEntityMap& theAttributes) aNewLine->p2 = *(aPoint->point()); } - return EntityWrapperPtr(new PlaneGCSSolver_EntityWrapper(aNewLine)); + return EntityWrapperPtr(new PlaneGCSSolver_EdgeWrapper(aNewLine)); } EntityWrapperPtr createCircle(const AttributeEntityMap& theAttributes) @@ -138,7 +138,7 @@ EntityWrapperPtr createCircle(const AttributeEntityMap& theAttributes) } } - return EntityWrapperPtr(new PlaneGCSSolver_EntityWrapper(aNewCircle)); + return EntityWrapperPtr(new PlaneGCSSolver_EdgeWrapper(aNewCircle)); } static double* createParameter(PlaneGCSSolver_Storage* theStorage) @@ -203,7 +203,7 @@ EntityWrapperPtr createArc(const AttributeEntityMap& theAttributes, aNewArc->center, aNewArc->end, aNewArc->endAngle))); } - return EntityWrapperPtr(new PlaneGCSSolver_EntityWrapper(aNewArc)); + return EntityWrapperPtr(new PlaneGCSSolver_EdgeWrapper(aNewArc)); } bool isAttributeApplicable(const std::string& theAttrName, const std::string& theOwnerName) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointWrapper.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointWrapper.h index 6bb2ade7a..4e536d7a0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointWrapper.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointWrapper.h @@ -8,12 +8,12 @@ #define PlaneGCSSolver_PointWrapper_H_ #include -#include +#include /** * Wrapper providing operations with PlaneGCS points. */ -class PlaneGCSSolver_PointWrapper : public SketchSolver_IEntityWrapper +class PlaneGCSSolver_PointWrapper : public PlaneGCSSolver_EntityWrapper { public: PlaneGCSSolver_PointWrapper(const GCSPointPtr thePoint); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ScalarWrapper.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ScalarWrapper.h index f0907a588..2838bb6af 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ScalarWrapper.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ScalarWrapper.h @@ -8,12 +8,12 @@ #define PlaneGCSSolver_ScalarWrapper_H_ #include -#include +#include /** * Wrapper providing operations with PlaneGCS scalars. */ -class PlaneGCSSolver_ScalarWrapper : public SketchSolver_IEntityWrapper +class PlaneGCSSolver_ScalarWrapper : public PlaneGCSSolver_EntityWrapper { public: PlaneGCSSolver_ScalarWrapper(double *const theParam); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h index b019a314c..7037b1a5e 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h @@ -7,8 +7,8 @@ #ifndef PlaneGCSSolver_Solver_H_ #define PlaneGCSSolver_Solver_H_ -#include #include +#include #include diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 073586719..bec4445be 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include @@ -193,8 +193,8 @@ bool PlaneGCSSolver_Storage::update(FeaturePtr theFeature, bool theForce) if (aRelated && aRelated->type() == ENTITY_ARC) { /// TODO: this code should be shared with FeatureBuilder somehow - std::shared_ptr anEntity = - std::dynamic_pointer_cast(aRelated); + std::shared_ptr anEntity = + std::dynamic_pointer_cast(aRelated); std::shared_ptr anArc = std::dynamic_pointer_cast(anEntity->entity()); static std::shared_ptr OX(new GeomAPI_Dir2d(1.0, 0.0)); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h index 752651d33..1855de212 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h @@ -8,8 +8,6 @@ #define PlaneGCSSolver_Storage_H_ #include - -#include #include class PlaneGCSSolver_EntityBuilder; diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp index 3dd68b54b..f90aa3172 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp @@ -5,7 +5,7 @@ // Author: Artem ZHIDKOV #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ #include -#define GCS_ENTITY_WRAPPER(x) std::dynamic_pointer_cast(x) +#define GCS_EDGE_WRAPPER(x) std::dynamic_pointer_cast(x) #define GCS_POINT_WRAPPER(x) std::dynamic_pointer_cast(x) #define GCS_SCALAR_WRAPPER(x) std::dynamic_pointer_cast(x) @@ -53,7 +53,7 @@ static ConstraintWrapperPtr static ConstraintWrapperPtr createConstraintPointOnEntity(const SketchSolver_ConstraintType& theType, std::shared_ptr thePoint, - std::shared_ptr theEntity); + std::shared_ptr theEntity); static ConstraintWrapperPtr createConstraintDistancePointPoint(std::shared_ptr theValue, std::shared_ptr thePoint1, @@ -61,36 +61,36 @@ static ConstraintWrapperPtr static ConstraintWrapperPtr createConstraintDistancePointLine(std::shared_ptr theValue, std::shared_ptr thePoint, - std::shared_ptr theEntity); + std::shared_ptr theEntity); static ConstraintWrapperPtr createConstraintRadius(std::shared_ptr theValue, - std::shared_ptr theEntity); + std::shared_ptr theEntity); static ConstraintWrapperPtr createConstraintAngle(ConstraintPtr theConstraint, std::shared_ptr theValue, - std::shared_ptr theEntity1, - std::shared_ptr theEntity2); + std::shared_ptr theEntity1, + std::shared_ptr theEntity2); static ConstraintWrapperPtr createConstraintHorizVert(const SketchSolver_ConstraintType& theType, - std::shared_ptr theEntity); + std::shared_ptr theEntity); static ConstraintWrapperPtr - createConstraintParallel(std::shared_ptr theEntity1, - std::shared_ptr theEntity2); + createConstraintParallel(std::shared_ptr theEntity1, + std::shared_ptr theEntity2); static ConstraintWrapperPtr - createConstraintPerpendicular(std::shared_ptr theEntity1, - std::shared_ptr theEntity2); + createConstraintPerpendicular(std::shared_ptr theEntity1, + std::shared_ptr theEntity2); static ConstraintWrapperPtr createConstraintEqual(const SketchSolver_ConstraintType& theType, - std::shared_ptr theEntity1, - std::shared_ptr theEntity2, + std::shared_ptr theEntity1, + std::shared_ptr theEntity2, std::shared_ptr theIntermed); static ConstraintWrapperPtr createConstraintTangent(const SketchSolver_ConstraintType& theType, - std::shared_ptr theEntity1, - std::shared_ptr theEntity2); + std::shared_ptr theEntity1, + std::shared_ptr theEntity2); static ConstraintWrapperPtr createConstraintMiddlePoint(std::shared_ptr thePoint, - std::shared_ptr theEntity); + std::shared_ptr theEntity); @@ -155,10 +155,10 @@ ConstraintWrapperPtr PlaneGCSSolver_Tools::createConstraint( break; case CONSTRAINT_PT_ON_LINE: case CONSTRAINT_PT_ON_CIRCLE: - aResult = createConstraintPointOnEntity(theType, aPoint1, GCS_ENTITY_WRAPPER(theEntity1)); + aResult = createConstraintPointOnEntity(theType, aPoint1, GCS_EDGE_WRAPPER(theEntity1)); break; case CONSTRAINT_MIDDLE_POINT: - aResult = createConstraintMiddlePoint(aPoint1, GCS_ENTITY_WRAPPER(theEntity1)); + aResult = createConstraintMiddlePoint(aPoint1, GCS_EDGE_WRAPPER(theEntity1)); break; case CONSTRAINT_PT_PT_DISTANCE: aResult = createConstraintDistancePointPoint(GCS_SCALAR_WRAPPER(theValue), aPoint1, aPoint2); @@ -166,45 +166,45 @@ ConstraintWrapperPtr PlaneGCSSolver_Tools::createConstraint( case CONSTRAINT_PT_LINE_DISTANCE: aResult = createConstraintDistancePointLine(GCS_SCALAR_WRAPPER(theValue), aPoint1, - GCS_ENTITY_WRAPPER(theEntity1)); + GCS_EDGE_WRAPPER(theEntity1)); break; case CONSTRAINT_RADIUS: aResult = createConstraintRadius(GCS_SCALAR_WRAPPER(theValue), - GCS_ENTITY_WRAPPER(theEntity1)); + GCS_EDGE_WRAPPER(theEntity1)); break; case CONSTRAINT_ANGLE: aResult = createConstraintAngle(theConstraint, GCS_SCALAR_WRAPPER(theValue), - GCS_ENTITY_WRAPPER(theEntity1), GCS_ENTITY_WRAPPER(theEntity2)); + GCS_EDGE_WRAPPER(theEntity1), GCS_EDGE_WRAPPER(theEntity2)); break; case CONSTRAINT_FIXED: break; case CONSTRAINT_HORIZONTAL: case CONSTRAINT_VERTICAL: - aResult = createConstraintHorizVert(theType, GCS_ENTITY_WRAPPER(theEntity1)); + aResult = createConstraintHorizVert(theType, GCS_EDGE_WRAPPER(theEntity1)); break; case CONSTRAINT_PARALLEL: - aResult = createConstraintParallel(GCS_ENTITY_WRAPPER(theEntity1), - GCS_ENTITY_WRAPPER(theEntity2)); + aResult = createConstraintParallel(GCS_EDGE_WRAPPER(theEntity1), + GCS_EDGE_WRAPPER(theEntity2)); break; case CONSTRAINT_PERPENDICULAR: - aResult = createConstraintPerpendicular(GCS_ENTITY_WRAPPER(theEntity1), - GCS_ENTITY_WRAPPER(theEntity2)); + aResult = createConstraintPerpendicular(GCS_EDGE_WRAPPER(theEntity1), + GCS_EDGE_WRAPPER(theEntity2)); break; case CONSTRAINT_EQUAL_LINES: anIntermediate = GCS_SCALAR_WRAPPER(theValue); // parameter is used to store length of lines case CONSTRAINT_EQUAL_LINE_ARC: case CONSTRAINT_EQUAL_RADIUS: aResult = createConstraintEqual(theType, - GCS_ENTITY_WRAPPER(theEntity1), - GCS_ENTITY_WRAPPER(theEntity2), + GCS_EDGE_WRAPPER(theEntity1), + GCS_EDGE_WRAPPER(theEntity2), anIntermediate); break; case CONSTRAINT_TANGENT_CIRCLE_LINE: case CONSTRAINT_TANGENT_CIRCLE_CIRCLE: aResult = createConstraintTangent(theType, - GCS_ENTITY_WRAPPER(theEntity1), - GCS_ENTITY_WRAPPER(theEntity2)); + GCS_EDGE_WRAPPER(theEntity1), + GCS_EDGE_WRAPPER(theEntity2)); break; case CONSTRAINT_MULTI_TRANSLATION: case CONSTRAINT_MULTI_ROTATION: @@ -232,8 +232,8 @@ std::shared_ptr PlaneGCSSolver_Tools::line(EntityWrapperPtr theEn if (theEntity->type() != ENTITY_LINE) return std::shared_ptr(); - std::shared_ptr anEntity = - std::dynamic_pointer_cast(theEntity); + std::shared_ptr anEntity = + std::dynamic_pointer_cast(theEntity); std::shared_ptr aLine = std::dynamic_pointer_cast(anEntity->entity()); return std::shared_ptr( new GeomAPI_Lin2d(*(aLine->p1.x), *(aLine->p1.y), *(aLine->p2.x), *(aLine->p2.y))); @@ -278,7 +278,7 @@ ConstraintWrapperPtr createConstraintCoincidence( ConstraintWrapperPtr createConstraintPointOnEntity( const SketchSolver_ConstraintType& theType, std::shared_ptr thePoint, - std::shared_ptr theEntity) + std::shared_ptr theEntity) { GCSConstraintPtr aNewConstr; @@ -305,7 +305,7 @@ ConstraintWrapperPtr createConstraintPointOnEntity( ConstraintWrapperPtr createConstraintMiddlePoint( std::shared_ptr thePoint, - std::shared_ptr theEntity) + std::shared_ptr theEntity) { GCSPointPtr aPoint = thePoint->point(); std::shared_ptr aLine = std::dynamic_pointer_cast(theEntity->entity()); @@ -338,7 +338,7 @@ ConstraintWrapperPtr createConstraintDistancePointPoint( ConstraintWrapperPtr createConstraintDistancePointLine( std::shared_ptr theValue, std::shared_ptr thePoint, - std::shared_ptr theEntity) + std::shared_ptr theEntity) { std::shared_ptr aLine = std::dynamic_pointer_cast(theEntity->entity()); GCSConstraintPtr aNewConstr(new GCS::ConstraintP2LDistance( @@ -351,7 +351,7 @@ ConstraintWrapperPtr createConstraintDistancePointLine( ConstraintWrapperPtr createConstraintRadius( std::shared_ptr theValue, - std::shared_ptr theEntity) + std::shared_ptr theEntity) { std::shared_ptr aCircle = std::dynamic_pointer_cast(theEntity->entity()); @@ -365,8 +365,8 @@ ConstraintWrapperPtr createConstraintRadius( ConstraintWrapperPtr createConstraintAngle( ConstraintPtr theConstraint, std::shared_ptr theValue, - std::shared_ptr theEntity1, - std::shared_ptr theEntity2) + std::shared_ptr theEntity1, + std::shared_ptr theEntity2) { std::shared_ptr aLine1 = std::dynamic_pointer_cast(theEntity1->entity()); bool isLine1Rev = theConstraint->boolean( @@ -391,7 +391,7 @@ ConstraintWrapperPtr createConstraintAngle( ConstraintWrapperPtr createConstraintHorizVert( const SketchSolver_ConstraintType& theType, - std::shared_ptr theEntity) + std::shared_ptr theEntity) { std::shared_ptr aLine = std::dynamic_pointer_cast(theEntity->entity()); GCSConstraintPtr aNewConstr; @@ -404,8 +404,8 @@ ConstraintWrapperPtr createConstraintHorizVert( } ConstraintWrapperPtr createConstraintParallel( - std::shared_ptr theEntity1, - std::shared_ptr theEntity2) + std::shared_ptr theEntity1, + std::shared_ptr theEntity2) { std::shared_ptr aLine1 = std::dynamic_pointer_cast(theEntity1->entity()); std::shared_ptr aLine2 = std::dynamic_pointer_cast(theEntity2->entity()); @@ -416,8 +416,8 @@ ConstraintWrapperPtr createConstraintParallel( } ConstraintWrapperPtr createConstraintPerpendicular( - std::shared_ptr theEntity1, - std::shared_ptr theEntity2) + std::shared_ptr theEntity1, + std::shared_ptr theEntity2) { std::shared_ptr aLine1 = std::dynamic_pointer_cast(theEntity1->entity()); std::shared_ptr aLine2 = std::dynamic_pointer_cast(theEntity2->entity()); @@ -429,8 +429,8 @@ ConstraintWrapperPtr createConstraintPerpendicular( ConstraintWrapperPtr createConstraintEqual( const SketchSolver_ConstraintType& theType, - std::shared_ptr theEntity1, - std::shared_ptr theEntity2, + std::shared_ptr theEntity1, + std::shared_ptr theEntity2, std::shared_ptr theIntermed) { if (theType == CONSTRAINT_EQUAL_LINE_ARC) @@ -468,8 +468,8 @@ ConstraintWrapperPtr createConstraintEqual( ConstraintWrapperPtr createConstraintTangent( const SketchSolver_ConstraintType& theType, - std::shared_ptr theEntity1, - std::shared_ptr theEntity2) + std::shared_ptr theEntity1, + std::shared_ptr theEntity2) { GCSConstraintPtr aNewConstr; if (theType == CONSTRAINT_TANGENT_CIRCLE_LINE) { @@ -509,9 +509,9 @@ bool PlaneGCSSolver_Tools::isArcArcTangencyInternal( EntityWrapperPtr theArc1, EntityWrapperPtr theArc2) { std::shared_ptr aCirc1 = std::dynamic_pointer_cast( - GCS_ENTITY_WRAPPER(theArc1)->entity()); + GCS_EDGE_WRAPPER(theArc1)->entity()); std::shared_ptr aCirc2 = std::dynamic_pointer_cast( - GCS_ENTITY_WRAPPER(theArc2)->entity()); + GCS_EDGE_WRAPPER(theArc2)->entity()); if (!aCirc1 || !aCirc2) return false; diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.cpp index 6e66ae26e..6b1d358cb 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.cpp @@ -5,7 +5,7 @@ // Author: Artem ZHIDKOV #include -#include +#include #include #include @@ -108,7 +108,7 @@ bool PlaneGCSSolver_UpdateCoincidence::isPointOnEntity( if (theEntity->type() == ENTITY_LINE) { std::shared_ptr aLine = std::dynamic_pointer_cast( - std::dynamic_pointer_cast(theEntity)->entity()); + std::dynamic_pointer_cast(theEntity)->entity()); return anIt->isExist(aLine->p1) || anIt->isExist(aLine->p2); } return false; diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h index 9d3b0eb99..558756492 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h @@ -8,7 +8,7 @@ #define PlaneGCSSolver_UpdateCoincidence_H_ #include -#include +#include #include diff --git a/src/SketchSolver/SketchSolver.h b/src/SketchSolver/SketchSolver.h deleted file mode 100644 index 775702389..000000000 --- a/src/SketchSolver/SketchSolver.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -#ifndef SKETCHSOLVER_H -#define SKETCHSOLVER_H - -#include - -/// Tolerance for value of parameters -const double tolerance = 1.e-10; - -#define PI 3.1415926535897932 - -// Types for data entities enumeration -typedef int ConstraintID; - -// Predefined values for identifiers -const ConstraintID CID_UNKNOWN = 0; -const ConstraintID CID_MOVEMENT = -1; - -#endif diff --git a/src/SketchSolver/SketchSolver_Constraint.h b/src/SketchSolver/SketchSolver_Constraint.h index 5c06e0aa5..c0545a520 100644 --- a/src/SketchSolver/SketchSolver_Constraint.h +++ b/src/SketchSolver/SketchSolver_Constraint.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_Constraint_H_ #define SketchSolver_Constraint_H_ -#include "SketchSolver.h" #include #include diff --git a/src/SketchSolver/SketchSolver_ConstraintCoincidence.h b/src/SketchSolver/SketchSolver_ConstraintCoincidence.h index 59061a302..83ec15b40 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCoincidence.h +++ b/src/SketchSolver/SketchSolver_ConstraintCoincidence.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintCoincidence_H_ #define SketchSolver_ConstraintCoincidence_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintCoincidence diff --git a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp index 0d35cf485..32ec0721d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include @@ -13,7 +13,7 @@ static ConstraintWrapperPtr createPointsOnLine( std::shared_ptr thePoint1, std::shared_ptr thePoint2, - std::shared_ptr theLine) + std::shared_ptr theLine) { std::shared_ptr aGCSLine = std::dynamic_pointer_cast(theLine->entity()); @@ -82,7 +82,7 @@ void SketchSolver_ConstraintCollinear::notify(const FeaturePtr& theFeature, bool aConstraintToApply[4] = {false, false, false, false}; ConstraintWrapperPtr aNewConstraint; std::shared_ptr aPoints[2]; - std::shared_ptr aLine; + std::shared_ptr aLine; if (isPointOnOppositeLine[0] || isPointOnOppositeLine[1]) { // one of points of first line is already on the second line, @@ -95,7 +95,7 @@ void SketchSolver_ConstraintCollinear::notify(const FeaturePtr& theFeature, aPoints[i] = std::dynamic_pointer_cast(myPoints[i]); aConstraintToApply[i] = true; } - aLine = std::dynamic_pointer_cast(myAttributes.back()); + aLine = std::dynamic_pointer_cast(myAttributes.back()); } else { // verify second line and add necessary constraints for (int i = 0; i < 2; ++i) { @@ -106,7 +106,7 @@ void SketchSolver_ConstraintCollinear::notify(const FeaturePtr& theFeature, aPoints[i] = std::dynamic_pointer_cast(myPoints[i + 2]); aConstraintToApply[i+2] = true; } - aLine = std::dynamic_pointer_cast(myAttributes.front()); + aLine = std::dynamic_pointer_cast(myAttributes.front()); } bool isNew = false; diff --git a/src/SketchSolver/SketchSolver_ConstraintDistance.h b/src/SketchSolver/SketchSolver_ConstraintDistance.h index 85d540ff7..5dc192a7f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintDistance.h +++ b/src/SketchSolver/SketchSolver_ConstraintDistance.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintDistance_H_ #define SketchSolver_ConstraintDistance_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintDistance diff --git a/src/SketchSolver/SketchSolver_ConstraintEqual.h b/src/SketchSolver/SketchSolver_ConstraintEqual.h index 3741f93dd..3fd677db3 100644 --- a/src/SketchSolver/SketchSolver_ConstraintEqual.h +++ b/src/SketchSolver/SketchSolver_ConstraintEqual.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintEqual_H_ #define SketchSolver_ConstraintEqual_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintEqual diff --git a/src/SketchSolver/SketchSolver_ConstraintFixed.cpp b/src/SketchSolver/SketchSolver_ConstraintFixed.cpp index 73f9808eb..68200eb2e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintFixed.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintFixed.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include @@ -56,8 +56,8 @@ void SketchSolver_ConstraintFixed::process() void SketchSolver_ConstraintFixed::fixFeature(EntityWrapperPtr theFeature) { - std::shared_ptr anEntity = - std::dynamic_pointer_cast(theFeature); + std::shared_ptr anEntity = + std::dynamic_pointer_cast(theFeature); GCS::VEC_pD aParameters; // parameters of entity to be fixed diff --git a/src/SketchSolver/SketchSolver_ConstraintFixed.h b/src/SketchSolver/SketchSolver_ConstraintFixed.h index 35fc651be..61b5ec824 100644 --- a/src/SketchSolver/SketchSolver_ConstraintFixed.h +++ b/src/SketchSolver/SketchSolver_ConstraintFixed.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintFixed_H_ #define SketchSolver_ConstraintFixed_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintFixed diff --git a/src/SketchSolver/SketchSolver_ConstraintLength.h b/src/SketchSolver/SketchSolver_ConstraintLength.h index 3934b59ff..689f4478a 100644 --- a/src/SketchSolver/SketchSolver_ConstraintLength.h +++ b/src/SketchSolver/SketchSolver_ConstraintLength.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintLength_H_ #define SketchSolver_ConstraintLength_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintLength diff --git a/src/SketchSolver/SketchSolver_ConstraintMirror.h b/src/SketchSolver/SketchSolver_ConstraintMirror.h index fe0ea2e9c..8840a3bff 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMirror.h +++ b/src/SketchSolver/SketchSolver_ConstraintMirror.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintMirror_H_ #define SketchSolver_ConstraintMirror_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintMirror diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.h b/src/SketchSolver/SketchSolver_ConstraintMulti.h index b317fc1dc..969b4ae0d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.h +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintMulti_H_ #define SketchSolver_ConstraintMulti_H_ -#include "SketchSolver.h" #include #include diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.h b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.h index faffd9380..48f367deb 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.h +++ b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintMultiRotation_H_ #define SketchSolver_ConstraintMultiRotation_H_ -#include "SketchSolver.h" #include #include "GeomDataAPI_Point2D.h" diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.h b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.h index 6b71d30db..eeeb15f51 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.h +++ b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintMultiTranslation_H_ #define SketchSolver_ConstraintMultiTranslation_H_ -#include "SketchSolver.h" #include #include "GeomDataAPI_Point2D.h" diff --git a/src/SketchSolver/SketchSolver_ConstraintTangent.h b/src/SketchSolver/SketchSolver_ConstraintTangent.h index 221450083..96428b47f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintTangent.h +++ b/src/SketchSolver/SketchSolver_ConstraintTangent.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_ConstraintTangent_H_ #define SketchSolver_ConstraintTangent_H_ -#include "SketchSolver.h" #include /** \class SketchSolver_ConstraintTangent diff --git a/src/SketchSolver/SketchSolver_IConstraintWrapper.h b/src/SketchSolver/SketchSolver_IConstraintWrapper.h deleted file mode 100644 index 52157057e..000000000 --- a/src/SketchSolver/SketchSolver_IConstraintWrapper.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: SketchSolver_IConstraintWrapper.h -// Created: 30 Nov 2015 -// Author: Artem ZHIDKOV - -#ifndef SketchSolver_IConstraintWrapper_H_ -#define SketchSolver_IConstraintWrapper_H_ - -#include - -#include - -#include -#include - -/// Types of constraints -enum SketchSolver_ConstraintType { - CONSTRAINT_UNKNOWN = 0, - CONSTRAINT_COINCIDENCE, // base coincidence if we don't know exact type yet - CONSTRAINT_PT_PT_COINCIDENT, - CONSTRAINT_PT_ON_LINE, - CONSTRAINT_PT_ON_CIRCLE, - CONSTRAINT_MIDDLE_POINT, - CONSTRAINT_DISTANCE, // base distance if we don't know the measured objects yet - CONSTRAINT_PT_PT_DISTANCE, - CONSTRAINT_PT_LINE_DISTANCE, - CONSTRAINT_RADIUS, - CONSTRAINT_ANGLE, - CONSTRAINT_FIXED, - CONSTRAINT_HORIZONTAL, - CONSTRAINT_VERTICAL, - CONSTRAINT_PARALLEL, - CONSTRAINT_PERPENDICULAR, - CONSTRAINT_SYMMETRIC, - CONSTRAINT_EQUAL, // base equality if we don't know the measured objects yet - CONSTRAINT_EQUAL_LINES, - CONSTRAINT_EQUAL_LINE_ARC, - CONSTRAINT_EQUAL_RADIUS, - CONSTRAINT_TANGENT, // base tangency if we don't know the measured objects yet - CONSTRAINT_TANGENT_CIRCLE_LINE, - CONSTRAINT_TANGENT_CIRCLE_CIRCLE, - CONSTRAINT_COLLINEAR, - CONSTRAINT_MULTI_TRANSLATION, - CONSTRAINT_MULTI_ROTATION -}; - -/** - * Wrapper providing operations with constraints regardless the solver. - */ -class SketchSolver_IConstraintWrapper -{ -public: - virtual ~SketchSolver_IConstraintWrapper() {} - - /// \brief Return ID of current constraint - const ConstraintID& id() const - { return myID; } - /// \brief Change constraint ID - virtual void setId( const ConstraintID& theID) = 0; - - /// \brief Return type of current entity - virtual SketchSolver_ConstraintType type() const = 0; - - /// \brief Assign numeric parameter of constraint - virtual void setValue(const double& theValue) = 0; - /// \brief Return numeric parameter of constraint - virtual double value() const = 0; - -protected: - ConstraintID myID; -}; - -typedef std::shared_ptr ConstraintWrapperPtr; - -#endif diff --git a/src/SketchSolver/SketchSolver_IEntityWrapper.h b/src/SketchSolver/SketchSolver_IEntityWrapper.h deleted file mode 100644 index 41f561aba..000000000 --- a/src/SketchSolver/SketchSolver_IEntityWrapper.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: SketchSolver_IEntityWrapper.h -// Created: 30 Nov 2015 -// Author: Artem ZHIDKOV - -#ifndef SketchSolver_IEntityWrapper_H_ -#define SketchSolver_IEntityWrapper_H_ - -#include - -#include -#include - -#include -#include - -/// Types of entities -enum SketchSolver_EntityType { - ENTITY_UNKNOWN = 0, - ENTITY_SCALAR, - ENTITY_ANGLE, - ENTITY_POINT, - ENTITY_LINE, - ENTITY_CIRCLE, - ENTITY_ARC -}; - -/** - * Wrapper providing operations with entities regardless the solver. - */ -class SketchSolver_IEntityWrapper -{ -public: - SketchSolver_IEntityWrapper() : myExternal(false) {} - virtual ~SketchSolver_IEntityWrapper() {} - - /// \brief Return type of current entity - virtual SketchSolver_EntityType type() const = 0; - - /// \brief Change flag indicating the entity cannot be changed in the solver - void setExternal(bool theExternal) { myExternal = theExternal; } - /// \brief Return the External flag - bool isExternal() const { return myExternal; } - -private: - bool myExternal; -}; - -typedef std::shared_ptr EntityWrapperPtr; - -#endif diff --git a/src/SketchSolver/SketchSolver_Manager.h b/src/SketchSolver/SketchSolver_Manager.h index 7d227dee4..d69cccbfd 100644 --- a/src/SketchSolver/SketchSolver_Manager.h +++ b/src/SketchSolver/SketchSolver_Manager.h @@ -7,7 +7,6 @@ #ifndef SketchSolver_Manager_H_ #define SketchSolver_Manager_H_ -#include "SketchSolver.h" #include #include diff --git a/src/SketchSolver/SketchSolver_Storage.h b/src/SketchSolver/SketchSolver_Storage.h index 50d30987c..bfd8bc620 100644 --- a/src/SketchSolver/SketchSolver_Storage.h +++ b/src/SketchSolver/SketchSolver_Storage.h @@ -7,9 +7,8 @@ #ifndef SketchSolver_Storage_H_ #define SketchSolver_Storage_H_ -#include -#include -#include +#include +#include #include #include