]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Exclude links to SketchPlugin
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 2 Apr 2015 10:31:07 +0000 (13:31 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 2 Apr 2015 10:31:07 +0000 (13:31 +0300)
24 files changed:
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 60c2e451a1df0b7da64d621f447c292ec4c9bef0..f98c29f7f3a083e7e2c8fece29ef786266e5377c 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>
@@ -30,7 +28,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 9b9c4cd8acc347825b1e22fef1aebac86e6b6a7f..10d0c72c1553b47bba1b0acf80d241bf23953428 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;
 };
 
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 4edc69f69575362b81c650603cab6d78ebbfb34e..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,19 +126,19 @@ 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(
-//          aData, SketchPlugin_Constraint::ENTITY_A());
-//      if (aLine) {
-//        aPnt_B = aPoint_B->pnt();
-//        aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
-//      }
+      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(
-//          aData, SketchPlugin_Constraint::ENTITY_B());
-//      if (aLine) {
-//        aPnt_A = aPoint_A->pnt();
-//        aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
-//      }
+      FeaturePtr 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;
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 e154f8000f89d366cfbafc8528fbd5caba6290bd..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,38 +100,37 @@ std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
 }
 
 //*************************************************************************************
-//std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
-//                                                  const std::string& theAttribute)
-//{
-//  std::shared_ptr<SketchPlugin_Line> aLine;
-//  if (!theData)
-//    return aLine;
-//
-//  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 aLine;
-//}
+FeaturePtr getFeatureLine(DataPtr theData,
+                          const std::string& theAttribute)
+{
+  FeaturePtr aLine;
+  if (!theData)
+    return aLine;
+
+  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()) {
+      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<ModelAPI_Data> 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>(
-//      aData->attribute(SketchPlugin_Line::END_ID()));
-//
-//  GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());
-//  return aLin2d.project(thePoint);
-//}
+std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(const FeaturePtr theLine,
+                                                  const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+  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>(
+      aData->attribute(SketchPlugin_Line::END_ID()));
+
+  GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());
+  return aLin2d.project(thePoint);
+}
 
 
 static double MyArrowSize = 30.;
index cd74bdae679806e474b87a576dc0938f9ec74757..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 std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
+  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
+                        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,