]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003)
authorazv <azv@opencascade.com>
Sun, 15 Sep 2019 11:08:47 +0000 (14:08 +0300)
committerazv <azv@opencascade.com>
Sun, 15 Sep 2019 11:09:10 +0000 (14:09 +0300)
Refactor MacroEllipse feature to produce several auxiliary features and one ellipse instead of a single feature with a lot of results.

14 files changed:
src/SketchAPI/SketchAPI_Ellipse.cpp
src/SketchPlugin/CMakeLists.txt
src/SketchPlugin/SketchPlugin_ConstraintCoincidenceInternal.cpp [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_ConstraintCoincidenceInternal.h [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_Ellipse.cpp
src/SketchPlugin/SketchPlugin_Ellipse.h
src/SketchPlugin/SketchPlugin_MacroEllipse.cpp
src/SketchPlugin/SketchPlugin_MacroEllipse.h
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_SketchEntity.h
src/SketchPlugin/plugin-Sketch.xml
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.cpp
src/SketchSolver/SketchSolver_Constraint.cpp

index 40c5c4ab31bd1e8e11ef45942d9a9fb873df82f0..b601e6612cce4acd37e35d9d0230a9f383fba282 100644 (file)
@@ -141,10 +141,12 @@ void SketchAPI_Ellipse::setMinorRadius(double theMinorRadius)
 
 ModelHighAPI_Selection SketchAPI_Ellipse::majorAxis() const
 {
+  return ModelHighAPI_Selection();
 }
 
 ModelHighAPI_Selection SketchAPI_Ellipse::minorAxis() const
 {
+  return ModelHighAPI_Selection();
 }
 
 void SketchAPI_Ellipse::dump(ModelHighAPI_Dumper& theDumper) const
index 26cf523f22870505faa102b59b51d12666ab0fd9..b304b4aad7d7ce7f7871156ad17e30c9c19357e7 100644 (file)
@@ -28,6 +28,7 @@ SET(PROJECT_HEADERS
     SketchPlugin_ConstraintAngle.h
     SketchPlugin_ConstraintBase.h
     SketchPlugin_ConstraintCoincidence.h
+    SketchPlugin_ConstraintCoincidenceInternal.h
     SketchPlugin_ConstraintCollinear.h
     SketchPlugin_ConstraintDistance.h
     SketchPlugin_ConstraintDistanceAlongDir.h
@@ -74,6 +75,7 @@ SET(PROJECT_SOURCES
     SketchPlugin_Constraint.cpp
     SketchPlugin_ConstraintAngle.cpp
     SketchPlugin_ConstraintCoincidence.cpp
+    SketchPlugin_ConstraintCoincidenceInternal.cpp
     SketchPlugin_ConstraintCollinear.cpp
     SketchPlugin_ConstraintDistance.cpp
     SketchPlugin_ConstraintDistanceAlongDir.cpp
diff --git a/src/SketchPlugin/SketchPlugin_ConstraintCoincidenceInternal.cpp b/src/SketchPlugin/SketchPlugin_ConstraintCoincidenceInternal.cpp
new file mode 100644 (file)
index 0000000..ccab1cf
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright (C) 2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SketchPlugin_ConstraintCoincidenceInternal.h"
+
+SketchPlugin_ConstraintCoincidenceInternal::SketchPlugin_ConstraintCoincidenceInternal()
+{
+}
+
+void SketchPlugin_ConstraintCoincidenceInternal::initAttributes()
+{
+  SketchPlugin_ConstraintCoincidence::initAttributes();
+}
+
+void SketchPlugin_ConstraintCoincidenceInternal::execute()
+{
+}
+
+AISObjectPtr SketchPlugin_ConstraintCoincidenceInternal::getAISObject(AISObjectPtr thePrevious)
+{
+  return AISObjectPtr();
+}
diff --git a/src/SketchPlugin/SketchPlugin_ConstraintCoincidenceInternal.h b/src/SketchPlugin/SketchPlugin_ConstraintCoincidenceInternal.h
new file mode 100644 (file)
index 0000000..fac0060
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright (C) 2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef SketchPlugin_ConstraintCoincidenceInternal_H_
+#define SketchPlugin_ConstraintCoincidenceInternal_H_
+
+#include "SketchPlugin.h"
+#include "SketchPlugin_ConstraintCoincidence.h"
+
+/** \class SketchPlugin_ConstraintCoincidenceInternal
+ *  \ingroup Plugins
+ *  \brief Internal coincidence constraint not applicable for the end user
+ */
+class SketchPlugin_ConstraintCoincidenceInternal : public SketchPlugin_ConstraintCoincidence
+{
+  public:
+  /// Coincidence constraint kind
+  inline static const std::string& ID()
+  {
+    static const std::string MY_CONSTRAINT_COINCIDENCE_ID("SketchConstraintCoincidenceInternal");
+    return MY_CONSTRAINT_COINCIDENCE_ID;
+  }
+  /// \brief Returns the kind of a feature
+  SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = SketchPlugin_ConstraintCoincidenceInternal::ID();
+    return MY_KIND;
+  }
+
+  /// Returns the AIS preview
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
+
+  /// \brief Creates a new part document if needed
+  SKETCHPLUGIN_EXPORT virtual void execute();
+
+  /// \brief Request for initialization of data model of the feature: adding all attributes
+  SKETCHPLUGIN_EXPORT virtual void initAttributes();
+
+  /// \brief Use plugin manager for features creation
+  SketchPlugin_ConstraintCoincidenceInternal();
+};
+
+#endif
index 6e88c8191102c0c6e4c7fc1b578a6e81dc88a3a7..af4f1bb4a300cc7e8c66e491c4ab7c8f6f3e9425 100644 (file)
@@ -77,29 +77,9 @@ void SketchPlugin_Ellipse::execute()
   // Calculate all characteristics of the ellipse.
   fillCharacteristicPoints();
 
-  // Make visible points related to ellipse characteristics.
+  // Make a visible center of the ellipse.
   int aResultIndex = 0;
   SketchPlugin_Sketch::createPoint2DResult(this, aSketch, CENTER_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createPoint2DResult(this, aSketch, FIRST_FOCUS_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createPoint2DResult(this, aSketch, SECOND_FOCUS_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createPoint2DResult(this, aSketch, MAJOR_AXIS_START_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createPoint2DResult(this, aSketch, MAJOR_AXIS_END_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createPoint2DResult(this, aSketch, MINOR_AXIS_START_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createPoint2DResult(this, aSketch, MINOR_AXIS_END_ID(), aResultIndex++);
-
-  // Make auxiliary axes
-  SketchPlugin_Sketch::createLine2DResult(this, aSketch,
-      MAJOR_AXIS_START_ID(), MAJOR_AXIS_END_ID(), aResultIndex++);
-  SketchPlugin_Sketch::createLine2DResult(this, aSketch,
-      MINOR_AXIS_START_ID(), MINOR_AXIS_END_ID(), aResultIndex++);
-
-  // Mark already created results auxiliary
-  myAuxiliaryResults.clear();
-  const std::list<ResultPtr>& aResults = results();
-  std::list<ResultPtr>::const_iterator anIt = aResults.begin();
-  for (int anIndex = 0; anIt != aResults.end() && anIndex < aResultIndex; ++anIt, ++anIndex)
-    myAuxiliaryResults.insert(*anIt);
-
   // Make a visible ellipse.
   createEllipse(aSketch, aResultIndex);
 }
@@ -108,11 +88,6 @@ bool SketchPlugin_Ellipse::isFixed() {
   return data()->selection(EXTERNAL_ID())->context().get() != NULL;
 }
 
-bool SketchPlugin_Ellipse::isAuxiliary(ResultPtr theResult)
-{
-  return myAuxiliaryResults.find(theResult) != myAuxiliaryResults.end();
-}
-
 void SketchPlugin_Ellipse::attributeChanged(const std::string& theID) {
   // the second condition for unability to move external segments anywhere
   if (theID == EXTERNAL_ID() || isFixed()) {
index bfa0478a7e4f6bdae0148fb288d9439c968bd2f0..35c88d1110432ea6515fea4bfd63e358a0753926 100644 (file)
@@ -116,9 +116,6 @@ class SketchPlugin_Ellipse: public SketchPlugin_SketchEntity
   /// Use plugin manager for features creation
   SketchPlugin_Ellipse();
 
-  /// Returns \c true if the result is marked as auxiliary
-  virtual bool isAuxiliary(ResultPtr theResult);
-
 protected:
   /// \brief Initializes attributes of derived class.
   virtual void initDerivedClassAttributes();
@@ -127,9 +124,6 @@ private:
   bool fillCharacteristicPoints();
 
   void createEllipse(SketchPlugin_Sketch* theSketch, const int theResultIndex);
-
-private:
-  std::set<ResultPtr> myAuxiliaryResults;
 };
 
 #endif
index 0b5ecf95c263b582edce9defe56443857e790a3b..6d5dd57411ce26f5a72f19a17be738269d0602aa 100644 (file)
 
 #include <SketchPlugin_MacroEllipse.h>
 
+#include <SketchPlugin_ConstraintCoincidenceInternal.h>
 #include <SketchPlugin_Ellipse.h>
+#include <SketchPlugin_Line.h>
 #include <SketchPlugin_MacroArcReentrantMessage.h>
+#include <SketchPlugin_Point.h>
 #include <SketchPlugin_Tools.h>
 #include <SketchPlugin_Sketch.h>
 
@@ -284,9 +287,67 @@ FeaturePtr SketchPlugin_MacroEllipse::createEllipseFeature()
       boolean(AUXILIARY_ID())->value());
 
   aEllipseFeature->execute();
+
+  // create auxiliary points
+  createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::FIRST_FOCUS_ID()), "FirstFocus");
+  createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::SECOND_FOCUS_ID()), "SecondFocus");
+  createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID()), "MajorAxisNegative");
+  createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID()), "MajorAxisPositive");
+  createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_START_ID()), "MinorAxisNegative");
+  createAuxiliaryPoint(aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_END_ID()), "MinorAxisPositive");
+  // create auxiliary axes
+  createAuxiliaryAxis(aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID()),
+                      aEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID()));
+  createAuxiliaryAxis(aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_START_ID()),
+                      aEllipseFeature->attribute(SketchPlugin_Ellipse::MINOR_AXIS_END_ID()));
+
   return aEllipseFeature;
 }
 
+void SketchPlugin_MacroEllipse::createAuxiliaryPoint(const AttributePtr& theEllipsePoint,
+                                                     const std::string& theName)
+{
+  FeaturePtr aPointFeature = sketch()->addFeature(SketchPlugin_Point::ID());
+  aPointFeature->data()->setName(theName);
+  aPointFeature->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
+
+  AttributePoint2DPtr anElPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theEllipsePoint);
+
+  AttributePoint2DPtr aCoord = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+      aPointFeature->attribute(SketchPlugin_Point::COORD_ID()));
+  aCoord->setValue(anElPoint->x(), anElPoint->y());
+
+  createInternalConstraint(anElPoint, aCoord);
+}
+
+void SketchPlugin_MacroEllipse::createAuxiliaryAxis(const AttributePtr& theStartPoint,
+                                                    const AttributePtr& theEndPoint)
+{
+  FeaturePtr aLineFeature = sketch()->addFeature(SketchPlugin_Line::ID());
+  aLineFeature->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
+
+  AttributePoint2DPtr aStartPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theStartPoint);
+  AttributePoint2DPtr aEndPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(theEndPoint);
+
+  AttributePoint2DPtr aLineStart = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+      aLineFeature->attribute(SketchPlugin_Line::START_ID()));
+  aLineStart->setValue(aStartPoint->x(), aStartPoint->y());
+
+  AttributePoint2DPtr aLineEnd = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+      aLineFeature->attribute(SketchPlugin_Line::END_ID()));
+  aLineEnd->setValue(aEndPoint->x(), aEndPoint->y());
+
+  createInternalConstraint(aStartPoint, aLineStart);
+  createInternalConstraint(aEndPoint, aLineEnd);
+}
+
+void SketchPlugin_MacroEllipse::createInternalConstraint(const AttributePtr& thePoint1,
+                                                         const AttributePtr& thePoint2)
+{
+  SketchPlugin_Tools::createConstraintAttrAttr(
+      sketch(), SketchPlugin_ConstraintCoincidenceInternal::ID(), thePoint1, thePoint2);
+}
+
 AISObjectPtr SketchPlugin_MacroEllipse::getAISObject(AISObjectPtr thePrevious)
 {
   SketchPlugin_Sketch* aSketch = sketch();
index 5b7d2945a6876518c46578c26e4a2fcb60de8c54..ac087b0551245bb8bea8524cc3b66f9d2effe8ce 100644 (file)
@@ -25,7 +25,6 @@
 #include <SketchPlugin_SketchEntity.h>
 #include <GeomAPI_IPresentable.h>
 
-////class GeomAPI_Circ2d;
 class GeomAPI_Pnt2d;
 
 /**\class SketchPlugin_MacroEllipse
@@ -163,6 +162,12 @@ private:
 
   FeaturePtr createEllipseFeature();
 
+  void createAuxiliaryPoint(const AttributePtr& theEllipsePoint,
+                            const std::string& theName);
+  void createAuxiliaryAxis(const AttributePtr& theStartPoint, const AttributePtr& theEndPoint);
+
+  void createInternalConstraint(const AttributePtr& thePoint1, const AttributePtr& thePoint2);
+
 private:
   std::shared_ptr<GeomAPI_Pnt2d> myCenter;
   std::shared_ptr<GeomAPI_Pnt2d> myFocus;
index 3958b491c49ebd5f546e79f1014d37a5aa9ae0e5..38852d714517ec9a8c50455ba721920789588415 100644 (file)
@@ -27,6 +27,7 @@
 #include <SketchPlugin_Projection.h>
 #include <SketchPlugin_ConstraintAngle.h>
 #include <SketchPlugin_ConstraintCoincidence.h>
+#include <SketchPlugin_ConstraintCoincidenceInternal.h>
 #include <SketchPlugin_ConstraintCollinear.h>
 #include <SketchPlugin_ConstraintDistance.h>
 #include <SketchPlugin_ConstraintDistanceHorizontal.h>
@@ -198,6 +199,8 @@ FeaturePtr SketchPlugin_Plugin::createFeature(std::string theFeatureID)
     return FeaturePtr(new SketchPlugin_Projection);
   } else if (theFeatureID == SketchPlugin_ConstraintCoincidence::ID()) {
     return FeaturePtr(new SketchPlugin_ConstraintCoincidence);
+  } else if (theFeatureID == SketchPlugin_ConstraintCoincidenceInternal::ID()) {
+    return FeaturePtr(new SketchPlugin_ConstraintCoincidenceInternal);
   } else if (theFeatureID == SketchPlugin_ConstraintCollinear::ID()) {
     return FeaturePtr(new SketchPlugin_ConstraintCollinear);
   } else if (theFeatureID == SketchPlugin_ConstraintDistance::ID()) {
@@ -296,6 +299,7 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> SketchPlugin_Plugin
       aMsg->setState(SketchPlugin_Ellipse::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_Projection::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_ConstraintCoincidence::ID(), aHasSketchPlane);
+      aMsg->setState(SketchPlugin_ConstraintCoincidenceInternal::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_ConstraintCollinear::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_ConstraintDistance::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_ConstraintLength::ID(), aHasSketchPlane);
index 1a736ad58ca4dbe422ae319d1f9877c8e43c82da..c207dd72b264b3f279483e3fa17021978e59a006 100644 (file)
@@ -112,10 +112,6 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
   }
 
 // LCOV_EXCL_START
-  /// Returns \c true if the result is marked as auxiliary
-  virtual bool isAuxiliary(ResultPtr theResult)
-  { return false; }
-
   /// Customize presentation of the feature
   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
                                      std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
@@ -146,8 +142,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
     std::vector<int> aColor;
     std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
                                     data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID());
-    bool isConstruction = (anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value())
-                       || isAuxiliary(theResult);
+    bool isConstruction = anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value();
     if (isConstruction) {
       aColor = Config_PropManager::color("Visualization", "sketch_auxiliary_color");
     }
index e26d1dd44fd905ac9059a3dbc2b1f8a0c2d84273..9c930341cb3ea630209f22454d6e8afafea2fde5 100644 (file)
@@ -13,7 +13,7 @@
                 SketchConstraintRigid SketchConstraintHorizontal SketchConstraintVertical
                 SketchConstraintEqual SketchConstraintTangent
                 SketchFillet SketchSplit SketchTrim
-                SketchConstraintCoincidence
+                SketchConstraintCoincidence SketchConstraintCoincidenceInternal
                 SketchConstraintMirror SketchConstraintAngle
                 SketchMultiRotation SketchMultiTranslation
                 SketchConstraintCollinear SketchConstraintMiddle"
         </sketch_shape_selector>
         <validator id="PartSet_CoincidentSelection"/>
       </feature>
+      <!--  SketchConstraintCoincidenceInternal  -->
+      <feature id="SketchConstraintCoincidenceInternal" title="Internal Coincidence" tooltip="Internal coincidence" icon="icons/Sketch/coincedence.png"
+               helpfile="coincedenceFeature.html" internal="1">
+        <sketch_shape_selector id="ConstraintEntityA" label="First object" tooltip="Select a first object" shape_types="vertex">
+          <validator id="PartSet_DifferentObjects"/>
+          <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
+        </sketch_shape_selector>
+        <sketch_shape_selector id="ConstraintEntityB" label="Second object" tooltip="Select a second object" shape_types="vertex">
+          <validator id="PartSet_DifferentObjects"/>
+          <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
+          <validator id="SketchPlugin_CoincidenceAttr" parameters="ConstraintEntityA"/>
+        </sketch_shape_selector>
+        <validator id="PartSet_CoincidentSelection"/>
+      </feature>
 
       <!--  SketchConstraintMiddle  -->
       <feature id="SketchConstraintMiddle" title="Middle point" tooltip="Create constraint for setting middle point on a line"
index 4cb7ef44db67862ada4733482064bbf6213d9dfd..5b3572c0221a8b8c97dbbb200d0d2f7627612eab 100644 (file)
@@ -26,6 +26,7 @@
 #include <SketchSolver_Constraint.h>
 #include <SketchSolver_ConstraintAngle.h>
 #include <SketchSolver_ConstraintCoincidence.h>
+#include <SketchPlugin_ConstraintCoincidenceInternal.h>
 #include <SketchSolver_ConstraintCollinear.h>
 #include <SketchSolver_ConstraintDistance.h>
 #include <SketchSolver_ConstraintEqual.h>
@@ -122,7 +123,8 @@ static GCS::SET_pD ellipseParameters(const EdgeWrapperPtr& theEllipse);
 
 SolverConstraintPtr PlaneGCSSolver_Tools::createConstraint(ConstraintPtr theConstraint)
 {
-  if (theConstraint->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
+  if (theConstraint->getKind() == SketchPlugin_ConstraintCoincidence::ID() ||
+      theConstraint->getKind() == SketchPlugin_ConstraintCoincidenceInternal::ID()) {
     return SolverConstraintPtr(new SketchSolver_ConstraintCoincidence(theConstraint));
   } else if (theConstraint->getKind() == SketchPlugin_ConstraintCollinear::ID()) {
     return SolverConstraintPtr(new SketchSolver_ConstraintCollinear(theConstraint));
index 4ed6b81e992743639bcd0e6c310473ba7e71a9c5..1f0466486c5573e0c5431902e4d74e22bde701b9 100644 (file)
@@ -23,6 +23,7 @@
 #include <SketchSolver_Constraint.h>
 
 #include <SketchPlugin_ConstraintCoincidence.h>
+#include <SketchPlugin_ConstraintCoincidenceInternal.h>
 #include <SketchPlugin_ConstraintCollinear.h>
 #include <SketchPlugin_ConstraintMiddle.h>
 
@@ -48,6 +49,7 @@ void PlaneGCSSolver_UpdateCoincidence::attach(SketchSolver_Constraint* theObserv
 void PlaneGCSSolver_UpdateCoincidence::update(const FeaturePtr& theFeature)
 {
   if (theFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID() ||
+      theFeature->getKind() == SketchPlugin_ConstraintCoincidenceInternal::ID() ||
       theFeature->getKind() == SketchPlugin_ConstraintMiddle::ID() ||
       theFeature->getKind() == SketchPlugin_ConstraintCollinear::ID()) {
     myCoincident.clear();
index 7d047ac8091f1a83ecf5bc37098628918dbcbae1..48c0fa5b80d63454f15ee4b12fa0a563c4b941d7 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <SketchPlugin_ConstraintAngle.h>
 #include <SketchPlugin_ConstraintCoincidence.h>
+#include <SketchPlugin_ConstraintCoincidenceInternal.h>
 #include <SketchPlugin_ConstraintCollinear.h>
 #include <SketchPlugin_ConstraintDistance.h>
 #include <SketchPlugin_ConstraintEqual.h>
@@ -76,7 +77,8 @@ void SketchSolver_Constraint::blockEvents(bool isBlocked)
 SketchSolver_ConstraintType SketchSolver_Constraint::TYPE(ConstraintPtr theConstraint)
 {
   const std::string& aType = theConstraint->getKind();
-  if (aType == SketchPlugin_ConstraintCoincidence::ID())
+  if (aType == SketchPlugin_ConstraintCoincidence::ID() ||
+      aType == SketchPlugin_ConstraintCoincidenceInternal::ID())
     return CONSTRAINT_COINCIDENCE;
   else if (aType == SketchPlugin_ConstraintRigid::ID())
     return CONSTRAINT_FIXED;