]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Intersection point feature implementation
authorazv <azv@opencascade.com>
Fri, 12 Feb 2016 11:19:31 +0000 (14:19 +0300)
committerazv <azv@opencascade.com>
Fri, 12 Feb 2016 11:20:02 +0000 (14:20 +0300)
14 files changed:
src/GeomAPI/GeomAPI_Pln.cpp
src/GeomAPI/GeomAPI_Pln.h
src/SketchPlugin/CMakeLists.txt
src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_IntersectionPoint.h [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Validators.cpp
src/SketchPlugin/SketchPlugin_Validators.h
src/SketchPlugin/plugin-Sketch.xml
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.cpp
src/SketchSolver/SketchSolver_ConstraintMulti.cpp
src/SketchSolver/SketchSolver_Storage.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp

index dfb7e9bd773534d588c2a355cf7188eaf134c743..4ba71589844abbf5e043c48076f5124325f121e5 100644 (file)
@@ -4,12 +4,14 @@
 // Created:     23 Apr 2014
 // Author:      Mikhail PONIKAROV
 
-#include<GeomAPI_Pln.h>
+#include <GeomAPI_Pln.h>
 #include <GeomAPI_Ax3.h>
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Dir.h>
+#include <GeomAPI_Lin.h>
+#include <GeomAPI_XYZ.h>
 
-#include<gp_Pln.hxx>
+#include <gp_Pln.hxx>
 
 using namespace std;
 
@@ -29,13 +31,13 @@ GeomAPI_Pln::GeomAPI_Pln(const double theA, const double theB, const double theC
 {
 }
 
-std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::location()
+std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::location() const
 {
   gp_Pnt aLoc = impl<gp_Pln>().Location();
   return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
 }
 
-std::shared_ptr<GeomAPI_Dir> GeomAPI_Pln::direction()
+std::shared_ptr<GeomAPI_Dir> GeomAPI_Pln::direction() const
 {
   const gp_Dir& aDir = impl<gp_Pln>().Axis().Direction();
   return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));
@@ -56,3 +58,19 @@ bool GeomAPI_Pln::isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, cons
   const gp_Pln& anOtherPln = thePlane->impl<gp_Pln>();
   return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance));
 }
+
+std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const
+{
+  std::shared_ptr<GeomAPI_XYZ> aLineDir = theLine->direction()->xyz();
+  std::shared_ptr<GeomAPI_XYZ> aLineLoc = theLine->location()->xyz();
+
+  std::shared_ptr<GeomAPI_XYZ> aNormal = direction()->xyz();
+  std::shared_ptr<GeomAPI_XYZ> aLocation = location()->xyz();
+
+  double aDot = aNormal->dot(aLineDir);
+  if (Abs(aDot) < Precision::SquareConfusion())
+    return std::shared_ptr<GeomAPI_Pnt>();
+
+  double aParam = aNormal->dot(aLocation->decreased(aLineLoc)) / aDot;
+  return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLineLoc->added(aLineDir->multiplied(aParam))));
+}
index e0564557e531a2fbf45d7c4c7599325b54f676b0..81bc519a0900c49affc2f3a93ec3b4ee23c6ccd6 100644 (file)
@@ -13,6 +13,7 @@
 class GeomAPI_Ax3;
 class GeomAPI_Pnt;
 class GeomAPI_Dir;
+class GeomAPI_Lin;
 
 /**\class GeomAPI_Pln
  * \ingroup DataModel
@@ -37,11 +38,11 @@ class GeomAPI_Pln : public GeomAPI_Interface
 
   /// Returns a point of this plane
   GEOMAPI_EXPORT 
-  std::shared_ptr<GeomAPI_Pnt> location();
+  std::shared_ptr<GeomAPI_Pnt> location() const;
 
   /// Returns a plane normal
   GEOMAPI_EXPORT 
-  std::shared_ptr<GeomAPI_Dir> direction();
+  std::shared_ptr<GeomAPI_Dir> direction() const;
 
   /// Returns the plane coefficients (Ax+By+Cz+D=0)
   GEOMAPI_EXPORT 
@@ -50,6 +51,10 @@ class GeomAPI_Pln : public GeomAPI_Interface
   /// Returns true if planes are coincident.
   GEOMAPI_EXPORT
   bool isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, const double theTolerance = 1.e-7);
+
+  /// Returns intersection point or empty if no intersections
+  GEOMAPI_EXPORT
+    std::shared_ptr<GeomAPI_Pnt> intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const;
 };
 
 #endif
index d92bfba14cea94711e03aa16272bc78223bbba4a..ecb1cb269e38b43beae1887d5c754f85ee2211da 100644 (file)
@@ -11,6 +11,7 @@ SET(PROJECT_HEADERS
     SketchPlugin_SketchEntity.h
     SketchPlugin_Line.h
     SketchPlugin_Point.h
+    SketchPlugin_IntersectionPoint.h
     SketchPlugin_Circle.h
     SketchPlugin_Arc.h
     SketchPlugin_Constraint.h
@@ -45,6 +46,7 @@ SET(PROJECT_SOURCES
     SketchPlugin_SketchEntity.cpp
     SketchPlugin_Line.cpp
     SketchPlugin_Point.cpp
+    SketchPlugin_IntersectionPoint.cpp
     SketchPlugin_Circle.cpp
     SketchPlugin_Arc.cpp
     SketchPlugin_Constraint.cpp
diff --git a/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp b/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp
new file mode 100644 (file)
index 0000000..5c41142
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:    SketchPlugin_IntersectionPoint.cpp
+// Created: 07 May 2014
+// Author:  Artem ZHIDKOV
+
+#include "SketchPlugin_IntersectionPoint.h"
+
+#include <ModelAPI_AttributeRefAttr.h>
+
+#include <GeomAPI_Edge.h>
+#include <GeomAPI_Lin.h>
+#include <GeomDataAPI_Point2D.h>
+
+SketchPlugin_IntersectionPoint::SketchPlugin_IntersectionPoint()
+    : SketchPlugin_Point()
+{
+}
+
+void SketchPlugin_IntersectionPoint::initDerivedClassAttributes()
+{
+  data()->addAttribute(EXTERNAL_LINE_ID(), ModelAPI_AttributeRefAttr::typeId());
+
+  SketchPlugin_Point::initDerivedClassAttributes();
+}
+
+void SketchPlugin_IntersectionPoint::execute()
+{
+  SketchPlugin_Sketch* aSketch = sketch();
+  if (aSketch) {
+    computePoint();
+    SketchPlugin_Point::execute();
+
+    // set this feature as external
+    data()->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape());
+  }
+}
+
+void SketchPlugin_IntersectionPoint::move(double theDeltaX, double theDeltaY)
+{
+}
+
+void SketchPlugin_IntersectionPoint::attributeChanged(const std::string& theID)
+{
+  if (theID == EXTERNAL_LINE_ID()) {
+    // compute intersection between line and sketch plane
+    computePoint();
+  }
+}
+
+void SketchPlugin_IntersectionPoint::computePoint()
+{
+  AttributeRefAttrPtr aLineRefAttr =
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(attribute(EXTERNAL_LINE_ID()));
+  ResultPtr aLineResult = std::dynamic_pointer_cast<ModelAPI_Result>(aLineRefAttr->object());
+  if (!aLineResult)
+    return;
+
+  std::shared_ptr<GeomAPI_Edge> aLinearEdge =
+      std::dynamic_pointer_cast<GeomAPI_Edge>(aLineResult->shape());
+  std::shared_ptr<GeomAPI_Lin> aLine = aLinearEdge->line();
+  std::shared_ptr<GeomAPI_Pln> aSketchPlane = sketch()->plane();
+
+  std::shared_ptr<GeomAPI_Pnt> anIntersection = aSketchPlane->intersect(aLine);
+  if (!anIntersection)
+    return;
+
+  std::shared_ptr<GeomDataAPI_Point2D> aCoordAttr = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(COORD_ID()));
+  aCoordAttr->setValue(sketch()->to2D(anIntersection));
+}
diff --git a/src/SketchPlugin/SketchPlugin_IntersectionPoint.h b/src/SketchPlugin/SketchPlugin_IntersectionPoint.h
new file mode 100644 (file)
index 0000000..c088bc6
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:    SketchPlugin_IntersectionPoint.h
+// Created: 07 May 2014
+// Author:  Artem ZHIDKOV
+
+#ifndef SketchPlugin_IntersectionPoint_H_
+#define SketchPlugin_IntersectionPoint_H_
+
+#include "SketchPlugin_Point.h"
+
+/**\class SketchPlugin_IntersectionPoint
+ * \ingroup Plugins
+ * \brief Feature for creation of external point as an intersection
+ *        between external edge and a plane of the sketch.
+ */
+class SketchPlugin_IntersectionPoint : public SketchPlugin_Point
+{
+public:
+  /// Point feature kind
+  inline static const std::string& ID()
+  {
+    static const std::string MY_POINT_ID("SketchIntersectionPoint");
+    return MY_POINT_ID;
+  }
+  /// Returns the kind of a feature
+  virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = SketchPlugin_IntersectionPoint::ID();
+    return MY_KIND;
+  }
+
+  static const std::string& EXTERNAL_LINE_ID()
+  {
+    static std::string MY_LINE_ID("ExternalLine");
+    return MY_LINE_ID;
+  }
+
+  /// Returns true because intersection point is always external
+  virtual bool isFixed()
+  { return true; }
+
+  /// Creates a new part document if needed
+  SKETCHPLUGIN_EXPORT virtual void execute();
+
+  /// Moves the feature
+  /// \param theDeltaX the delta for X coordinate is moved
+  /// \param theDeltaY the delta for Y coordinate is moved
+  SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
+
+  /// Called on change of any argument-attribute of this object: for external point
+  SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
+
+  /// Use plugin manager for features creation
+  SketchPlugin_IntersectionPoint();
+
+protected:
+  /// \brief Initializes attributes of derived class.
+  virtual void initDerivedClassAttributes();
+
+private:
+  /// \brief Find intersection between a line and a sketch plane
+  void computePoint();
+};
+
+#endif
index 0d3c66fd57f4b0823b226e1d964a0d81f107eabc..b0f84cc79008fbce693501597d0945640def36fb 100644 (file)
@@ -4,6 +4,7 @@
 #include <SketchPlugin_Sketch.h>
 #include <SketchPlugin_Line.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Arc.h>
 #include <SketchPlugin_ConstraintAngle.h>
@@ -78,6 +79,8 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
                               new SketchPlugin_MiddlePointAttrValidator);
   aFactory->registerValidator("SketchPlugin_ArcTangentPoint",
                               new SketchPlugin_ArcTangentPointValidator);
+  aFactory->registerValidator("SketchPlugin_IntersectionValidator",
+                              new SketchPlugin_IntersectionValidator);
 
   // register this plugin
   ModelAPI_Session::get()->registerPlugin(this);
@@ -115,6 +118,8 @@ FeaturePtr SketchPlugin_Plugin::createFeature(string theFeatureID)
     return FeaturePtr(new SketchPlugin_Sketch);
   } else if (theFeatureID == SketchPlugin_Point::ID()) {
     return FeaturePtr(new SketchPlugin_Point);
+  } else if (theFeatureID == SketchPlugin_IntersectionPoint::ID()) {
+    return FeaturePtr(new SketchPlugin_IntersectionPoint);
   } else if (theFeatureID == SketchPlugin_Line::ID()) {
     return FeaturePtr(new SketchPlugin_Line);
   } else if (theFeatureID == SketchPlugin_Circle::ID()) {
@@ -194,6 +199,7 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> SketchPlugin_Plugin
                         !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0);
 
       aMsg->setState(SketchPlugin_Point::ID(), aHasSketchPlane);
+      aMsg->setState(SketchPlugin_IntersectionPoint::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_Line::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_Circle::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_Arc::ID(), aHasSketchPlane);
index 26c965dec1bf824a380a9b1fb222c997f131ca89..13d7138e1af1a97f1cd33ceb757e0601af5da4e6 100755 (executable)
 #include <ModelAPI_Session.h>
 #include <ModelAPI_ResultConstruction.h>
 
+#include <GeomAPI_Lin.h>
+#include <GeomAPI_Edge.h>
 #include <GeomAPI_Vertex.h>
 #include <GeomDataAPI_Point2D.h>
 
+#include <cmath>
+
 const double tolerance = 1.e-7;
 
 bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribute, 
@@ -683,3 +687,48 @@ bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttri
 
   return true;
 }
+
+bool SketchPlugin_IntersectionValidator::isValid(const AttributePtr& theAttribute,
+                                                 const std::list<std::string>& theArguments,
+                                                 std::string& theError) const
+{
+  if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
+    theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+    return false;
+  }
+  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+  ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aRefAttr->object());
+  if (!aResult) {
+    theError = "The attribute " + theAttribute->id() + " should be an object";
+    return false;
+  }
+
+  std::shared_ptr<GeomAPI_Edge> anEdge = std::dynamic_pointer_cast<GeomAPI_Edge>(aResult->shape());
+  if (!anEdge || !anEdge->isLine()) {
+    theError = "The attribute " + theAttribute->id() + " should be a line";
+    return false;
+  }
+
+  std::shared_ptr<GeomAPI_Dir> aLineDir = anEdge->line()->direction();
+
+  // find a sketch
+  std::shared_ptr<SketchPlugin_Sketch> aSketch;
+  std::set<AttributePtr> aRefs = aRefAttr->owner()->data()->refsToMe();
+  std::set<AttributePtr>::const_iterator anIt = aRefs.begin();
+  for (; anIt != aRefs.end(); ++anIt) {
+    CompositeFeaturePtr aComp =
+        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>((*anIt)->owner());
+    if (aComp && aComp->getKind() == SketchPlugin_Sketch::ID()) {
+      aSketch = std::dynamic_pointer_cast<SketchPlugin_Sketch>(aComp);
+      break;
+    }
+  }
+  if (!aSketch) {
+    theError = "There is no sketch referring to the current feature";
+    return false;
+  }
+
+  std::shared_ptr<GeomAPI_Pln> aPlane = aSketch->plane();
+  std::shared_ptr<GeomAPI_Dir> aNormal = aPlane->direction();
+  return fabs(aNormal->dot(aLineDir)) > tolerance * tolerance;
+}
index ef5e77aba44997a768d4d1b979f1243e5445ac2d..49854af5e11f9d1ce32f11219c310a2283227ad8 100644 (file)
@@ -218,4 +218,20 @@ class SketchPlugin_ArcTangentPointValidator : public ModelAPI_AttributeValidator
                        std::string& theError) const;
 };
 
+/**\class SketchPlugin_IntersectionValidator
+ * \ingroup Validators
+ * \brief Validator for the attribute to be intersected with the sketch plane.
+ */
+class SketchPlugin_IntersectionValidator : public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  //! \param theError error message
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments,
+                       std::string& theError) const;
+};
+
 #endif
index 6b3ba5c8b37d80e8b9ea051b0355a4ff3d678770..cdcef01559b3adfaf01d2030463e33ae5e674b9f 100644 (file)
@@ -5,7 +5,7 @@
     <group id="Basic">
       <feature
         id="Sketch"
-        nested="SketchPoint SketchLine SketchCircle SketchArc SketchRectangle SketchConstraintLength SketchConstraintRadius SketchConstraintDistance SketchConstraintParallel SketchConstraintPerpendicular SketchConstraintRigid SketchConstraintHorizontal SketchConstraintVertical SketchConstraintEqual SketchConstraintTangent SketchConstraintFillet SketchConstraintCoincidence SketchConstraintMirror SketchConstraintAngle SketchMultiRotation SketchMultiTranslation SketchConstraintCollinear SketchConstraintMiddle"
+        nested="SketchPoint SketchIntersectionPoint SketchLine SketchCircle SketchArc SketchRectangle SketchConstraintLength SketchConstraintRadius SketchConstraintDistance SketchConstraintParallel SketchConstraintPerpendicular SketchConstraintRigid SketchConstraintHorizontal SketchConstraintVertical SketchConstraintEqual SketchConstraintTangent SketchConstraintFillet SketchConstraintCoincidence SketchConstraintMirror SketchConstraintAngle SketchMultiRotation SketchMultiTranslation SketchConstraintCollinear SketchConstraintMiddle"
         when_nested="accept abort"
         title="Sketch"
         tooltip="Create sketch"
         <validator id="SketchPlugin_SolverErrorValidator"/>
       <!--icon=":pictures/x_point.png"-->
       </feature>
+
+      <!-- SketchPoint -->
       <feature id="SketchPoint" title="Point" tooltip="Create point" icon=":icons/point.png">
         <sketch-2dpoint_selector id="PointCoordindates" accept_expressions="0" title="Point" tooltip="Point coordinates"/>
         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
       </feature>
+      
+      <!-- Intersection Point -->
+      <feature
+        id="SketchIntersectionPoint"
+        title="Intersection Point"
+        tooltip="Create intersection point"
+        icon=":icons/point.png">
+        <sketch_shape_selector
+              id="ExternalLine"
+              label="Edge"
+              tooltip="Select external line."
+              shape_types="edge">
+          <validator id="GeomValidators_ShapeType" parameters="line"/>
+          <validator id="SketchPlugin_IntersectionValidator"/>
+        </sketch_shape_selector>
+      </feature>
+      
+      <!-- SketchLine -->
       <feature id="SketchLine" title="Line" tooltip="Create line" icon=":icons/line.png">
         <sketch-2dpoint_selector id="StartPoint" accept_expressions="0" title="Start point" tooltip="Start point coordinates" previous_feature_param="EndPoint"/>
         <sketch-2dpoint_selector id="EndPoint" accept_expressions="0" title="End point" tooltip="End point coordinates"/>
index e5002f1306e8f5070ddd5489c270575a5978bd16..583c6540139405fabee0a7431ea91338e5b85410 100644 (file)
@@ -29,6 +29,7 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Line.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 #include <SketchPlugin_ConstraintAngle.h>
 
 #include <math.h>
@@ -499,7 +500,8 @@ EntityWrapperPtr PlaneGCSSolver_Builder::createFeature(
   else if (aFeatureKind == SketchPlugin_Arc::ID())
     return createArc(theFeature, theAttributes, theGroupID);
   // Point (it has low probability to be an attribute of constraint, so it is checked at the end)
-  else if (aFeatureKind == SketchPlugin_Point::ID()) {
+  else if (aFeatureKind == SketchPlugin_Point::ID() ||
+           aFeatureKind == SketchPlugin_IntersectionPoint::ID()) {
     EntityWrapperPtr aSub;
     if (theAttributes.size() == 1)
       aSub = theAttributes.front();
index 45bee0ed50c3c2ca4ebdcfafade742b90f3a596b..e1dbad9be4327832cf53dfdd7b060e54268f8241 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <PlaneGCSSolver_EntityWrapper.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 #include <SketchPlugin_Sketch.h>
 
 PlaneGCSSolver_EntityWrapper::PlaneGCSSolver_EntityWrapper(
@@ -27,7 +28,8 @@ PlaneGCSSolver_EntityWrapper::PlaneGCSSolver_EntityWrapper(
   }
 
   // empty entity, probably this is a SketchPlugin_Point or SketchPlugin_Sketch
-  if (theFeature->getKind() == SketchPlugin_Point::ID())
+  if (theFeature->getKind() == SketchPlugin_Point::ID() ||
+      theFeature->getKind() == SketchPlugin_IntersectionPoint::ID())
     myType = ENTITY_POINT;
   else if (theFeature->getKind() == SketchPlugin_Sketch::ID())
     myType = ENTITY_SKETCH;
index 404c5df7fb455fc6d0707e592d7ae33f00bc5450..d9e246cc97424df86aa4cf5dd650385743d82197 100644 (file)
@@ -10,6 +10,7 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Line.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 
 void SketchSolver_ConstraintMulti::getEntities(std::list<EntityWrapperPtr>& theEntities)
 {
@@ -159,7 +160,8 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
         aPoints.push_back(aFeature->attribute(SketchPlugin_Line::END_ID()));
       } else if (aFeature->getKind() == SketchPlugin_Circle::ID())
         aPoints.push_back(aFeature->attribute(SketchPlugin_Circle::CENTER_ID()));
-      else if (aFeature->getKind() == SketchPlugin_Point::ID())
+      else if (aFeature->getKind() == SketchPlugin_Point::ID() ||
+               aFeature->getKind() == SketchPlugin_IntersectionPoint::ID())
         aPoints.push_back(aFeature->attribute(SketchPlugin_Point::COORD_ID()));
 
       std::list<AttributePtr>::iterator aPtIt = aPoints.begin();
index 809bef132cf4fa9e5c9591990dbfe151b55c4cd1..c63d28e437a662c61818cf2c85b400e6f0f3516d 100644 (file)
@@ -14,6 +14,7 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Line.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 #include <SketchPlugin_ConstraintRigid.h>
 
 
@@ -96,7 +97,8 @@ static std::list<AttributePtr> pointAttributes(FeaturePtr theFeature)
     aPoints.push_back(theFeature->attribute(SketchPlugin_Line::START_ID()));
     aPoints.push_back(theFeature->attribute(SketchPlugin_Line::END_ID()));
   }
-  else if (theFeature->getKind() == SketchPlugin_Point::ID())
+  else if (theFeature->getKind() == SketchPlugin_Point::ID() ||
+           theFeature->getKind() == SketchPlugin_IntersectionPoint::ID())
     aPoints.push_back(theFeature->attribute(SketchPlugin_Point::COORD_ID()));
   return aPoints;
 }
index 01b747804e4d089b0c46caa59125cbe5bc6f8607..f080a9fcab404f1ef1ff8f30bde2c9917f360357 100644 (file)
@@ -27,6 +27,7 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Line.h>
 #include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
 
 #include <math.h>
 
@@ -331,7 +332,8 @@ EntityWrapperPtr SolveSpaceSolver_Builder::createFeature(
   else if (aFeatureKind == SketchPlugin_Arc::ID())
     return createArc(theFeature, theAttributes, theGroupID, theSketchID);
   // Point (it has low probability to be an attribute of constraint, so it is checked at the end)
-  else if (aFeatureKind == SketchPlugin_Point::ID()) {
+  else if (aFeatureKind == SketchPlugin_Point::ID() || 
+           aFeatureKind == SketchPlugin_IntersectionPoint::ID()) {
     AttributePtr aPoint = theFeature->attribute(SketchPlugin_Point::COORD_ID());
     if (!aPoint->isInitialized())
       return aDummy;