]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'BR_DEBIAN_RUNTIME' of newgeom:newgeom.git into Dev_1.1.0
authorsbh <sergey.belash@opencascade.com>
Thu, 2 Apr 2015 11:01:28 +0000 (14:01 +0300)
committersbh <sergey.belash@opencascade.com>
Thu, 2 Apr 2015 11:01:28 +0000 (14:01 +0300)
28 files changed:
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_Coincident.h
src/SketcherPrs/SketcherPrs_Equal.cpp
src/SketcherPrs/SketcherPrs_Equal.h
src/SketcherPrs/SketcherPrs_Factory.cpp
src/SketcherPrs/SketcherPrs_Factory.h
src/SketcherPrs/SketcherPrs_HVDirection.cpp
src/SketcherPrs/SketcherPrs_HVDirection.h
src/SketcherPrs/SketcherPrs_LengthDimension.cpp
src/SketcherPrs/SketcherPrs_LengthDimension.h
src/SketcherPrs/SketcherPrs_Parallel.cpp
src/SketcherPrs/SketcherPrs_Parallel.h
src/SketcherPrs/SketcherPrs_Perpendicular.cpp
src/SketcherPrs/SketcherPrs_Perpendicular.h
src/SketcherPrs/SketcherPrs_Radius.cpp
src/SketcherPrs/SketcherPrs_Radius.h
src/SketcherPrs/SketcherPrs_Rigid.cpp
src/SketcherPrs/SketcherPrs_Rigid.h
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.h
src/SketcherPrs/SketcherPrs_Tangent.cpp
src/SketcherPrs/SketcherPrs_Tangent.h
src/SketcherPrs/SketcherPrs_Tools.cpp
src/SketcherPrs/SketcherPrs_Tools.h

index 59ca35b02cc6fcebf2681d99929a8219f415238f..b7f708a9c59578efdec9e6d06e6b9690e1c46058 100644 (file)
@@ -82,19 +82,19 @@ bool SketchPlugin_ConstraintDistance::compute(const std::string& theAttributeId)
     aPnt_A = aPoint_A->pnt();
     aPnt_B = aPoint_B->pnt();
   } else if (!aPoint_A && aPoint_B) {
-    std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
-        aData, SketchPlugin_Constraint::ENTITY_A());
-    if (aLine) {
-      aPnt_B = aPoint_B->pnt();
-      aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
-    }
+    //std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+    //    aData, SketchPlugin_Constraint::ENTITY_A());
+    //if (aLine) {
+    //  aPnt_B = aPoint_B->pnt();
+    //  aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
+    //}
   } else if (aPoint_A && !aPoint_B) {
-    std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
-        aData, SketchPlugin_Constraint::ENTITY_B());
-    if (aLine) {
-      aPnt_A = aPoint_A->pnt();
-      aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
-    }
+    //std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+    //    aData, SketchPlugin_Constraint::ENTITY_B());
+    //if (aLine) {
+    //  aPnt_A = aPoint_A->pnt();
+    //  aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
+    //}
   }
   if (!aPnt_A || !aPnt_B)
     return false;
@@ -159,19 +159,19 @@ double SketchPlugin_ConstraintDistance::calculateCurrentDistance() const
   if (aPointA && aPointB) {  // both points
     aDistance = aPointA->pnt()->distance(aPointB->pnt());
   } else {
-    if (!aPointA && aPointB) {  //Line and point
-      std::shared_ptr<SketchPlugin_Line> aLine =
-          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
-      if (aLine) {
-        aDistance = aLine->distanceToPoint(aPointB->pnt());
-      }
-    } else if (aPointA && !aPointB) {  // Point and line
-      std::shared_ptr<SketchPlugin_Line> aLine =
-          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
-      if (aLine) {
-        aDistance = aLine->distanceToPoint(aPointA->pnt());
-      }
-    }
+//    if (!aPointA && aPointB) {  //Line and point
+//      std::shared_ptr<SketchPlugin_Line> aLine =
+//          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
+//      if (aLine) {
+//        aDistance = aLine->distanceToPoint(aPointB->pnt());
+//      }
+//    } else if (aPointA && !aPointB) {  // Point and line
+//      std::shared_ptr<SketchPlugin_Line> aLine =
+//          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
+//      if (aLine) {
+//        aDistance = aLine->distanceToPoint(aPointA->pnt());
+//      }
+//    }
   }
   return aDistance;
 }
index ed07e4079bd6bd7eba234a943289ec1d97b6539e..555b8ae7f4e18e85e3d490e5537bd7a6fd2c899e 100644 (file)
@@ -100,6 +100,12 @@ double SketchPlugin_Line::distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>&
   return aDelta;
 }
 
+const std::string& SketchPlugin_Line::getKind()
+{
+  static std::string MY_KIND = SketchPlugin_Line::ID();
+  return MY_KIND;
+}
+
 bool SketchPlugin_Line::isFixed() {
   return data()->selection(EXTERNAL_ID())->context().get() != NULL;
 }
index 05d94cc65e59bd582bd6290920a1d7820d995e4a..f6d895974b981354c6eda92f0ba9c2f95f4a2dd8 100644 (file)
@@ -39,11 +39,7 @@ class SketchPlugin_Line : public SketchPlugin_SketchEntity
   }
 
   /// Returns the kind of a feature
-  SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
-  {
-    static std::string MY_KIND = SketchPlugin_Line::ID();
-    return MY_KIND;
-  }
+  SKETCHPLUGIN_EXPORT virtual const std::string& getKind();
 
   /// Returns true is sketch element is under the rigid constraint
   SKETCHPLUGIN_EXPORT virtual bool isFixed();
index 6462775d46f17a05ea0c0154febb262994f98cf8..fcdcf3617d8416f6ed3fbd4dead2fe5e96a8710e 100644 (file)
@@ -507,9 +507,7 @@ bool SketchSolver_ConstraintGroup::changeRigidConstraint(
         std::dynamic_pointer_cast<GeomDataAPI_Point>(aConstrAttr->attr());
     std::shared_ptr<GeomDataAPI_Point2D> aPoint2D =
         std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aConstrAttr->attr());
-    std::shared_ptr<SketchPlugin_Point> aSketchPoint = 
-        std::dynamic_pointer_cast<SketchPlugin_Point>(aFeature);
-    if (aPoint || aPoint2D || aSketchPoint) {
+    if (aPoint || aPoint2D || aFeature->getKind() == SketchPlugin_Point::ID()) {
       // Create SolveSpace constraint structure
       Slvs_Constraint aConstraint = Slvs_MakeConstraint(
           ++myConstrMaxID, myID, aConstrType, myWorkplane.h, 0.0,
index 86f1a1f3e53fee0ca76d99dfa9c9b1ab4ed8b056..f7b61d9600c0fd5e2e53cc6b905efad7438b5bae 100644 (file)
@@ -16,8 +16,6 @@
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_Pnt2d.h>
 
-#include <SketchPlugin_Point.h>
-#include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Constraint.h>
 
 #include <AIS_Drawer.hxx>
@@ -33,7 +31,7 @@
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Coincident, AIS_InteractiveObject);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject);
 
-SketcherPrs_Coincident::SketcherPrs_Coincident(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, 
                                                const std::shared_ptr<GeomAPI_Ax3>& thePlane) 
  : AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane)
 {
index 72c7ec5d01a9494ab707016fc3bc8fae66e0b9d0..5aaf5d63589530db34843fe57517504a01cd1020 100644 (file)
@@ -8,12 +8,11 @@
 #define SketcherPrs_Coincident_H
 
 #include <GeomAPI_Ax3.h>
+#include <ModelAPI_Feature.h>
 
 #include <AIS_InteractiveObject.hxx>
 #include <Standard_DefineHandle.hxx>
 
-class SketchPlugin_Constraint;
-
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_Coincident, AIS_InteractiveObject)
 
@@ -27,7 +26,7 @@ class SketcherPrs_Coincident: public AIS_InteractiveObject
 public:
   /// Constructor
   /// \param theResult a result object
-  Standard_EXPORT SketcherPrs_Coincident(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, 
                                          const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
   Standard_EXPORT virtual void SetColor(const Quantity_Color& aColor);
@@ -45,7 +44,7 @@ protected:
     const Standard_Integer aMode) ;
 
 private:
-  SketchPlugin_Constraint* myConstraint;
+  ModelAPI_Feature* myConstraint;
   std::shared_ptr<GeomAPI_Ax3> myPlane;
   gp_Pnt myPoint;
 };
index 7ba9a3f65ab9dddab53078881a589da978d0923a..f26682c3cae4603bccf4c216fc3f7c54691fc9a7 100644 (file)
@@ -19,7 +19,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs);
 
 static Handle(Image_AlienPixMap) MyPixMap;
 
-SketcherPrs_Equal::SketcherPrs_Equal(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Equal::SketcherPrs_Equal(ModelAPI_Feature* theConstraint, 
                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane) 
  : SketcherPrs_SymbolPrs(theConstraint, thePlane)
 {
index 4bd1a86ab53a3ec4937a923d145a7383056dd4a3..d958d412488c0c90cbe021e2e81eed08bcd5a35f 100644 (file)
@@ -9,9 +9,6 @@
 
 #include "SketcherPrs_SymbolPrs.h"
 
-class SketchPlugin_Constraint;
-class SketchPlugin_Sketch;
-
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_Equal, SketcherPrs_SymbolPrs)
 
@@ -26,7 +23,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_Equal(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Equal(ModelAPI_Feature* theConstraint, 
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
   DEFINE_STANDARD_RTTI(SketcherPrs_Equal)
 protected:
index 04f9bf3b7fb3e91245bf03097d39f8f6f8ff10bb..7ef2368621dbf5a651055fc64e24a71af6b2fb83 100644 (file)
@@ -17,7 +17,7 @@
 #include "SketcherPrs_LengthDimension.h"
 
 #define CONSTRAINT_PRS_IMPL(NAME, CLASS) \
-AISObjectPtr SketcherPrs_Factory::NAME(SketchPlugin_Constraint* theConstraint, \
+AISObjectPtr SketcherPrs_Factory::NAME(ModelAPI_Feature* theConstraint, \
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane) \
 { \
   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject()); \
@@ -36,7 +36,7 @@ CONSTRAINT_PRS_IMPL(radiusConstraint, SketcherPrs_Radius);
 CONSTRAINT_PRS_IMPL(lengthDimensionConstraint, SketcherPrs_LengthDimension);
 
 
-AISObjectPtr SketcherPrs_Factory::horisontalConstraint(SketchPlugin_Constraint* theConstraint,
+AISObjectPtr SketcherPrs_Factory::horisontalConstraint(ModelAPI_Feature* theConstraint,
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane)
 { 
   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject()); 
@@ -45,7 +45,7 @@ AISObjectPtr SketcherPrs_Factory::horisontalConstraint(SketchPlugin_Constraint*
   return aAISObj; 
 }
 
-AISObjectPtr SketcherPrs_Factory::verticalConstraint(SketchPlugin_Constraint* theConstraint,
+AISObjectPtr SketcherPrs_Factory::verticalConstraint(ModelAPI_Feature* theConstraint,
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane)
 { 
   std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject()); 
index d416644f9cb315c56555cb9a04aa91bcb70b6d52..c43fb948fed15389e49ed56601f858331dbdb61b 100644 (file)
@@ -9,13 +9,13 @@
 
 #include "SketcherPrs.h"
 
+#include <ModelAPI_Feature.h>
+
 #include <GeomAPI_Ax3.h>
 #include <GeomAPI_AISObject.h>
 
-class SketchPlugin_Constraint;
-
 #define GET_CONSTRAINT_PRS(NAME) \
-  static AISObjectPtr NAME(SketchPlugin_Constraint* theConstraint, \
+  static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
                            const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
 
index 5992db2fd4ed128240514a711feb824ea15ec785..b1459205ea1e311efa11dfb672cd284e4a41125c 100644 (file)
@@ -20,7 +20,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
 
 static Handle(Image_AlienPixMap) MyPixMap;
 
-SketcherPrs_HVDirection::SketcherPrs_HVDirection(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, 
                                            const std::shared_ptr<GeomAPI_Ax3>& thePlane,
                                            bool isHorisontal) 
  : SketcherPrs_SymbolPrs(theConstraint, thePlane), myIsHorisontal(isHorisontal)
index 96432d23071a59be989deb477bde3205a5333bed..079991dd285d3b39b9a083aa0cc5c40f518fe954 100644 (file)
@@ -8,9 +8,7 @@
 #define SketcherPrs_HVDirection_H
 
 #include "SketcherPrs_SymbolPrs.h"
-
-class SketchPlugin_Constraint;
-class SketchPlugin_Sketch;
+#include <ModelAPI_Feature.h>
 
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs)
@@ -26,7 +24,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_HVDirection(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, 
                                          const std::shared_ptr<GeomAPI_Ax3>& thePlane,
                                          bool isHorisontal);
 
index 65b067782dcf50b1a9e48efc7241a5c66b3b5ea8..a1564129b502605fd0456b6c8bee5b6da81f1fc1 100644 (file)
@@ -30,7 +30,7 @@ static const gp_Pln MyDefPln(gp_Pnt(0,0,0), gp_Dir(0,0,1));
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_LengthDimension, AIS_LengthDimension);
 
-SketcherPrs_LengthDimension::SketcherPrs_LengthDimension(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_LengthDimension::SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint, 
                         const std::shared_ptr<GeomAPI_Ax3>& thePlane)
 : AIS_LengthDimension(MyDefStart, MyDefEnd, MyDefPln), 
 myConstraint(theConstraint), myPlane(thePlane)
@@ -126,14 +126,14 @@ bool SketcherPrs_LengthDimension::getPoints(gp_Pnt& thePnt1, gp_Pnt& thePnt2) co
       aPnt_A = aPoint_A->pnt();
       aPnt_B = aPoint_B->pnt();
     } else if (!aPoint_A && aPoint_B) {
-      std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+      FeaturePtr aLine = SketcherPrs_Tools::getFeatureLine(
           aData, SketchPlugin_Constraint::ENTITY_A());
       if (aLine) {
         aPnt_B = aPoint_B->pnt();
         aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
       }
     } else if (aPoint_A && !aPoint_B) {
-      std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+      FeaturePtr aLine = SketcherPrs_Tools::getFeatureLine(
           aData, SketchPlugin_Constraint::ENTITY_B());
       if (aLine) {
         aPnt_A = aPoint_A->pnt();
index 94bd89c467c05be720ab8ed4fe64acbae6140afd..ea4832e7ea1f1cfcddfa5317bcf7ab62a31d4de5 100644 (file)
@@ -9,12 +9,11 @@
 #define SketcherPrs_LinearDimension_H
 
 #include <GeomAPI_Ax3.h>
+#include <ModelAPI_Feature.h>
 #include <AIS_LengthDimension.hxx>
 #include <Standard_DefineHandle.hxx>
 
 
-class SketchPlugin_Constraint;
-
 DEFINE_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension)
 
 /**
@@ -28,7 +27,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_LengthDimension(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint, 
                         const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
   std::string constraintType() const;
@@ -43,7 +42,7 @@ private:
   bool getPoints(gp_Pnt& thePnt1, gp_Pnt& thePnt2) const;
 
   /// Constraint feature
-  SketchPlugin_Constraint* myConstraint;
+  ModelAPI_Feature* myConstraint;
 
   /// Plane of the current sketcher
   std::shared_ptr<GeomAPI_Ax3> myPlane;
index 71f97ceda2329387a90395a3e714b81038f2c1e4..e80fb8f784c387190422a6b109c45866e13302b5 100644 (file)
@@ -20,7 +20,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs);
 
 static Handle(Image_AlienPixMap) MyPixMap;
 
-SketcherPrs_Parallel::SketcherPrs_Parallel(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Parallel::SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, 
                                            const std::shared_ptr<GeomAPI_Ax3>& thePlane) 
  : SketcherPrs_SymbolPrs(theConstraint, thePlane)
 {
index d0126d30b0e0e8197cff4c5f669c04ad76901493..3194a63cce7c2bc376d37dd38a87944582c8d912 100644 (file)
@@ -9,9 +9,6 @@
 
 #include "SketcherPrs_SymbolPrs.h"
 
-class SketchPlugin_Constraint;
-class SketchPlugin_Sketch;
-
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_Parallel, SketcherPrs_SymbolPrs)
 
@@ -26,7 +23,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_Parallel(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, 
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
   DEFINE_STANDARD_RTTI(SketcherPrs_Parallel)
 protected:
index e00b23d7df1b38283f920035608c9b48ed0c8d54..ecfd72d1181c21d3da822e6086c97f0c46b9497e 100644 (file)
@@ -20,7 +20,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs);
 
 static Handle(Image_AlienPixMap) MyPixMap;
 
-SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint, 
                                                      const std::shared_ptr<GeomAPI_Ax3>& thePlane) 
  : SketcherPrs_SymbolPrs(theConstraint, thePlane)
 {
index c77a09203bcdb3f0a80ab550f3227845cc301ec4..6cabbf03a4807a5ed0100904bdb30d0c424f8bb6 100644 (file)
@@ -25,7 +25,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_Perpendicular(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint, 
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
   DEFINE_STANDARD_RTTI(SketcherPrs_Perpendicular)
index 5e30f527fa95dd82ef66758e8b5b27c2e3aedfe6..cd6e32f39719bce6d7735a2eda93fc31246eaed1 100644 (file)
@@ -23,7 +23,7 @@ static const gp_Circ MyDefCirc(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), 1);
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Radius, AIS_RadiusDimension);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Radius, AIS_RadiusDimension);
 
-SketcherPrs_Radius::SketcherPrs_Radius(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Radius::SketcherPrs_Radius(ModelAPI_Feature* theConstraint, 
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane)
 : AIS_RadiusDimension(MyDefCirc), myConstraint(theConstraint), myPlane(thePlane)
 {
index 0b32639b761dd209c4b7761ee917b0fe3036fa1d..7b75569da8ff69c31c96995391ddda09d2699717 100644 (file)
@@ -9,12 +9,11 @@
 #define SketcherPrs_Radius_H
 
 #include <GeomAPI_Ax3.h>
+#include <ModelAPI_Feature.h>
 
 #include <AIS_RadiusDimension.hxx>
 #include <Standard_DefineHandle.hxx>
 
-class SketchPlugin_Constraint;
-
 DEFINE_STANDARD_HANDLE(SketcherPrs_Radius, AIS_RadiusDimension)
 
 /**
@@ -27,7 +26,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_Radius(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Radius(ModelAPI_Feature* theConstraint, 
                         const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
   DEFINE_STANDARD_RTTI(SketcherPrs_Radius)
@@ -38,7 +37,7 @@ protected:
 
 private:
   /// Constraint feature
-  SketchPlugin_Constraint* myConstraint;
+  ModelAPI_Feature* myConstraint;
 
   /// Plane of the current sketcher
   std::shared_ptr<GeomAPI_Ax3> myPlane;
index 84a36d3c017943d0afa10f58739fc211261ecc17..2a7245e1dfc809d1f91407c2a691f97d4153d632 100644 (file)
@@ -36,7 +36,7 @@ static Handle(Image_AlienPixMap) MyPixMap;
 
 
 
-SketcherPrs_Rigid::SketcherPrs_Rigid(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Rigid::SketcherPrs_Rigid(ModelAPI_Feature* theConstraint, 
                                            const std::shared_ptr<GeomAPI_Ax3>& thePlane) 
  : SketcherPrs_SymbolPrs(theConstraint, thePlane)
 {
index 5328210773228b7eb49ae2d97703f7bc83f675fb..cabccbf07e2928bae5292a74036ddb4d750409b2 100644 (file)
@@ -9,9 +9,7 @@
 
 #include "SketcherPrs_SymbolPrs.h"
 #include <ModelAPI_Object.h>
-
-class SketchPlugin_Constraint;
-class SketchPlugin_Sketch;
+#include <ModelAPI_Feature.h>
 
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_Rigid, SketcherPrs_SymbolPrs)
@@ -27,7 +25,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_Rigid(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Rigid(ModelAPI_Feature* theConstraint, 
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
 
index a74dfc82a763c68c10bebd190dc6902159b3c09d..f73556bacb13623e4b3dab8ae7f508c47f42dc48 100644 (file)
@@ -219,7 +219,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SymbolPrs, AIS_InteractiveObject);
 std::map<const char*, Handle(Image_AlienPixMap)> SketcherPrs_SymbolPrs::myIconsMap;
 
 
-SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, 
                                              const std::shared_ptr<GeomAPI_Ax3>& thePlane)
  : AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane)
 {
index 9145705f520bb787310682d5e9a940d17ac6ebee..446cedabcd6fb9ad28a0d6c11bf2dadae315579b 100644 (file)
@@ -8,6 +8,7 @@
 #define SketcherPrs_SymbolPrs_H
 
 #include "SketcherPrs_SensitivePoint.h"
+#include <ModelAPI_Feature.h>
 
 #include <AIS_InteractiveObject.hxx>
 #include <GeomAPI_Ax3.h>
@@ -22,7 +23,6 @@
 
 #include <OpenGl_Workspace.hxx>
 
-class SketchPlugin_Constraint;
 class OpenGl_Context;
 
 
@@ -38,7 +38,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_SymbolPrs(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, 
                         const std::shared_ptr<GeomAPI_Ax3>& thePlane);
   
   virtual ~SketcherPrs_SymbolPrs();
@@ -59,7 +59,7 @@ public:
 
   Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return myPlane; }
 
-  Standard_EXPORT SketchPlugin_Constraint* feature() const { return myConstraint; }
+  Standard_EXPORT ModelAPI_Feature* feature() const { return myConstraint; }
 
 
   Handle(Graphic3d_ArrayOfPoints) pointsArray() const { return myPntArray; }
@@ -105,7 +105,7 @@ protected:
 
 protected:
   /// Constraint feature
-  SketchPlugin_Constraint* myConstraint;
+  ModelAPI_Feature* myConstraint;
 
   /// Plane of the current sketcher
   std::shared_ptr<GeomAPI_Ax3> myPlane;
index bbee898f92e735037e25243449d0f4a4991b4497..45f32049425091c54120cc4d9426ca5457d3d15e 100644 (file)
@@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs);
 
 static Handle(Image_AlienPixMap) MyPixMap;
 
-SketcherPrs_Tangent::SketcherPrs_Tangent(SketchPlugin_Constraint* theConstraint, 
+SketcherPrs_Tangent::SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, 
                                            const std::shared_ptr<GeomAPI_Ax3>& thePlane) 
  : SketcherPrs_SymbolPrs(theConstraint, thePlane)
 {
index 335006da59e1cf682ef42b1167390826a387d561..78aaff550be0a6b1aba32a65701e76325c86ade5 100644 (file)
@@ -8,9 +8,7 @@
 #define SketcherPrs_Tangent_H
 
 #include "SketcherPrs_SymbolPrs.h"
-
-class SketchPlugin_Constraint;
-class SketchPlugin_Sketch;
+#include <ModelAPI_Feature.h>
 
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_Tangent, SketcherPrs_SymbolPrs)
@@ -26,7 +24,7 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
-  Standard_EXPORT SketcherPrs_Tangent(SketchPlugin_Constraint* theConstraint, 
+  Standard_EXPORT SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, 
                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
 
   DEFINE_STANDARD_RTTI(SketcherPrs_Tangent)
index c94864db66134292b2ffa075a1329431bdd3ba04..47468899ec7d2d7685b561f1277707b93d5c7bd8 100644 (file)
@@ -20,7 +20,7 @@
 
 namespace SketcherPrs_Tools {
 
-ObjectPtr getResult(SketchPlugin_Constraint* theFeature, const std::string& theAttrName)
+ObjectPtr getResult(ModelAPI_Feature* theFeature, const std::string& theAttrName)
 {
   std::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
@@ -40,8 +40,8 @@ std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject)
 }
 
 
-std::shared_ptr<GeomAPI_Pnt2d> getPoint(SketchPlugin_Constraint* theFeature,
-                                               const std::string& theAttribute)
+std::shared_ptr<GeomAPI_Pnt2d> getPoint(ModelAPI_Feature* theFeature,
+                                        const std::string& theAttribute)
 {
   std::shared_ptr<GeomDataAPI_Point2D> aPointAttr;
 
@@ -100,30 +100,29 @@ std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
 }
 
 //*************************************************************************************
-std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
-                                                  const std::string& theAttribute)
+FeaturePtr getFeatureLine(DataPtr theData,
+                          const std::string& theAttribute)
 {
-  std::shared_ptr<SketchPlugin_Line> aLine;
+  FeaturePtr aLine;
   if (!theData)
     return aLine;
 
-  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
-      ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
+  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
   if (anAttr) {
     FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object());
     if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) {
-      aLine = std::dynamic_pointer_cast<SketchPlugin_Line>(aFeature);
+      return aFeature;
     }
   }
   return aLine;
 }
 
 //*************************************************************************************
-std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
-    const std::shared_ptr<SketchPlugin_Line>& theLine,
-    const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(const FeaturePtr theLine,
+                                                  const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
 {
-  std::shared_ptr<ModelAPI_Data> aData = theLine->data();
+  DataPtr aData = theLine->data();
   std::shared_ptr<GeomDataAPI_Point2D> aPoint1 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
       aData->attribute(SketchPlugin_Line::START_ID()));
   std::shared_ptr<GeomDataAPI_Point2D> aPoint2 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
@@ -145,4 +144,4 @@ void setArrowSize(double theSize)
   MyArrowSize = theSize;
 }
 
-};
\ No newline at end of file
+};
index 29446596382d3ccdc54e012871588ec0523fa292..c040fff59fc2e346477f491279f094fa41a0e9f7 100644 (file)
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Pnt2d.h>
 #include <ModelAPI_Object.h>
+#include <ModelAPI_Feature.h>
 #include <string>
 
-class SketchPlugin_Constraint;
-class SketchPlugin_Line;
 class GeomDataAPI_Point2D;
 
 #define MyTextHeight 20
 
 namespace SketcherPrs_Tools {
 
-  SKETCHERPRS_EXPORT ObjectPtr getResult(SketchPlugin_Constraint* theFeature,
+  SKETCHERPRS_EXPORT ObjectPtr getResult(ModelAPI_Feature* theFeature,
                       const std::string& theAttrName);
 
   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject);
 
-  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getPoint(SketchPlugin_Constraint* theFeature,
+  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getPoint(ModelAPI_Feature* theFeature,
                                           const std::string& theAttrName);
 
   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
-                        const std::shared_ptr<SketchPlugin_Line>& theLine,
+                        const FeaturePtr theLine,
                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
 
-  SKETCHERPRS_EXPORT std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
-                                                    const std::string& theAttribute);
+  SKETCHERPRS_EXPORT FeaturePtr getFeatureLine(DataPtr theData,
+                                               const std::string& theAttribute);
 
   /// Obtain the point object from specified constraint parameter
   SKETCHERPRS_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
@@ -45,4 +44,4 @@ namespace SketcherPrs_Tools {
   SKETCHERPRS_EXPORT void setArrowSize(double theSize);
 };
 
-#endif
\ No newline at end of file
+#endif