From: vsv Date: Thu, 2 Apr 2015 10:31:07 +0000 (+0300) Subject: Exclude links to SketchPlugin X-Git-Tag: V_1.1.0~57^2~25^2~3^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e9d4bd92e29ba18fc93a074b3bd3fd0972ec8992;p=modules%2Fshaper.git Exclude links to SketchPlugin --- diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index 60c2e451a..f98c29f7f 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -16,8 +16,6 @@ #include #include -#include -#include #include #include @@ -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& thePlane) : AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Coincident.h b/src/SketcherPrs/SketcherPrs_Coincident.h index 9b9c4cd8a..10d0c72c1 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.h +++ b/src/SketcherPrs/SketcherPrs_Coincident.h @@ -8,12 +8,11 @@ #define SketcherPrs_Coincident_H #include +#include #include #include -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& 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 myPlane; }; diff --git a/src/SketcherPrs/SketcherPrs_Equal.cpp b/src/SketcherPrs/SketcherPrs_Equal.cpp index 7ba9a3f65..f26682c3c 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.cpp +++ b/src/SketcherPrs/SketcherPrs_Equal.cpp @@ -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& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Equal.h b/src/SketcherPrs/SketcherPrs_Equal.h index 4bd1a86ab..d958d4124 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.h +++ b/src/SketcherPrs/SketcherPrs_Equal.h @@ -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& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Equal) protected: diff --git a/src/SketcherPrs/SketcherPrs_Factory.cpp b/src/SketcherPrs/SketcherPrs_Factory.cpp index 04f9bf3b7..7ef236862 100644 --- a/src/SketcherPrs/SketcherPrs_Factory.cpp +++ b/src/SketcherPrs/SketcherPrs_Factory.cpp @@ -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& thePlane) \ { \ std::shared_ptr 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& thePlane) { std::shared_ptr 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& thePlane) { std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); diff --git a/src/SketcherPrs/SketcherPrs_Factory.h b/src/SketcherPrs/SketcherPrs_Factory.h index d416644f9..c43fb948f 100644 --- a/src/SketcherPrs/SketcherPrs_Factory.h +++ b/src/SketcherPrs/SketcherPrs_Factory.h @@ -9,13 +9,13 @@ #include "SketcherPrs.h" +#include + #include #include -class SketchPlugin_Constraint; - #define GET_CONSTRAINT_PRS(NAME) \ - static AISObjectPtr NAME(SketchPlugin_Constraint* theConstraint, \ + static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \ const std::shared_ptr& thePlane); diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.cpp b/src/SketcherPrs/SketcherPrs_HVDirection.cpp index 5992db2fd..b1459205e 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.cpp +++ b/src/SketcherPrs/SketcherPrs_HVDirection.cpp @@ -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& thePlane, bool isHorisontal) : SketcherPrs_SymbolPrs(theConstraint, thePlane), myIsHorisontal(isHorisontal) diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.h b/src/SketcherPrs/SketcherPrs_HVDirection.h index 96432d230..079991dd2 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.h +++ b/src/SketcherPrs/SketcherPrs_HVDirection.h @@ -8,9 +8,7 @@ #define SketcherPrs_HVDirection_H #include "SketcherPrs_SymbolPrs.h" - -class SketchPlugin_Constraint; -class SketchPlugin_Sketch; +#include 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& thePlane, bool isHorisontal); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index 4edc69f69..a1564129b 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -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& 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 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 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; diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.h b/src/SketcherPrs/SketcherPrs_LengthDimension.h index 94bd89c46..ea4832e7e 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.h +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.h @@ -9,12 +9,11 @@ #define SketcherPrs_LinearDimension_H #include +#include #include #include -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& 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 myPlane; diff --git a/src/SketcherPrs/SketcherPrs_Parallel.cpp b/src/SketcherPrs/SketcherPrs_Parallel.cpp index 71f97ceda..e80fb8f78 100644 --- a/src/SketcherPrs/SketcherPrs_Parallel.cpp +++ b/src/SketcherPrs/SketcherPrs_Parallel.cpp @@ -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& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Parallel.h b/src/SketcherPrs/SketcherPrs_Parallel.h index d0126d30b..3194a63cc 100644 --- a/src/SketcherPrs/SketcherPrs_Parallel.h +++ b/src/SketcherPrs/SketcherPrs_Parallel.h @@ -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& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Parallel) protected: diff --git a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp index e00b23d7d..ecfd72d11 100644 --- a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp +++ b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp @@ -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& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Perpendicular.h b/src/SketcherPrs/SketcherPrs_Perpendicular.h index c77a09203..6cabbf03a 100644 --- a/src/SketcherPrs/SketcherPrs_Perpendicular.h +++ b/src/SketcherPrs/SketcherPrs_Perpendicular.h @@ -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& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Perpendicular) diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 5e30f527f..cd6e32f39 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -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& thePlane) : AIS_RadiusDimension(MyDefCirc), myConstraint(theConstraint), myPlane(thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Radius.h b/src/SketcherPrs/SketcherPrs_Radius.h index 0b32639b7..7b75569da 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.h +++ b/src/SketcherPrs/SketcherPrs_Radius.h @@ -9,12 +9,11 @@ #define SketcherPrs_Radius_H #include +#include #include #include -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& 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 myPlane; diff --git a/src/SketcherPrs/SketcherPrs_Rigid.cpp b/src/SketcherPrs/SketcherPrs_Rigid.cpp index 84a36d3c0..2a7245e1d 100644 --- a/src/SketcherPrs/SketcherPrs_Rigid.cpp +++ b/src/SketcherPrs/SketcherPrs_Rigid.cpp @@ -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& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Rigid.h b/src/SketcherPrs/SketcherPrs_Rigid.h index 532821077..cabccbf07 100644 --- a/src/SketcherPrs/SketcherPrs_Rigid.h +++ b/src/SketcherPrs/SketcherPrs_Rigid.h @@ -9,9 +9,7 @@ #include "SketcherPrs_SymbolPrs.h" #include - -class SketchPlugin_Constraint; -class SketchPlugin_Sketch; +#include 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& thePlane); diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index a74dfc82a..f73556bac 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -219,7 +219,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SymbolPrs, AIS_InteractiveObject); std::map SketcherPrs_SymbolPrs::myIconsMap; -SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(SketchPlugin_Constraint* theConstraint, +SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) : AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.h b/src/SketcherPrs/SketcherPrs_SymbolPrs.h index 9145705f5..446cedabc 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.h +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.h @@ -8,6 +8,7 @@ #define SketcherPrs_SymbolPrs_H #include "SketcherPrs_SensitivePoint.h" +#include #include #include @@ -22,7 +23,6 @@ #include -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& thePlane); virtual ~SketcherPrs_SymbolPrs(); @@ -59,7 +59,7 @@ public: Standard_EXPORT std::shared_ptr 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 myPlane; diff --git a/src/SketcherPrs/SketcherPrs_Tangent.cpp b/src/SketcherPrs/SketcherPrs_Tangent.cpp index bbee898f9..45f320494 100644 --- a/src/SketcherPrs/SketcherPrs_Tangent.cpp +++ b/src/SketcherPrs/SketcherPrs_Tangent.cpp @@ -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& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { diff --git a/src/SketcherPrs/SketcherPrs_Tangent.h b/src/SketcherPrs/SketcherPrs_Tangent.h index 335006da5..78aaff550 100644 --- a/src/SketcherPrs/SketcherPrs_Tangent.h +++ b/src/SketcherPrs/SketcherPrs_Tangent.h @@ -8,9 +8,7 @@ #define SketcherPrs_Tangent_H #include "SketcherPrs_SymbolPrs.h" - -class SketchPlugin_Constraint; -class SketchPlugin_Sketch; +#include 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& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Tangent) diff --git a/src/SketcherPrs/SketcherPrs_Tools.cpp b/src/SketcherPrs/SketcherPrs_Tools.cpp index e154f8000..47468899e 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.cpp +++ b/src/SketcherPrs/SketcherPrs_Tools.cpp @@ -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 aData = theFeature->data(); std::shared_ptr anAttr = @@ -40,8 +40,8 @@ std::shared_ptr getShape(ObjectPtr theObject) } -std::shared_ptr getPoint(SketchPlugin_Constraint* theFeature, - const std::string& theAttribute) +std::shared_ptr getPoint(ModelAPI_Feature* theFeature, + const std::string& theAttribute) { std::shared_ptr aPointAttr; @@ -100,38 +100,37 @@ std::shared_ptr getFeaturePoint(DataPtr theData, } //************************************************************************************* -//std::shared_ptr getFeatureLine(DataPtr theData, -// const std::string& theAttribute) -//{ -// std::shared_ptr aLine; -// if (!theData) -// return aLine; -// -// std::shared_ptr 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(aFeature); -// } -// } -// return aLine; -//} +FeaturePtr getFeatureLine(DataPtr theData, + const std::string& theAttribute) +{ + FeaturePtr aLine; + if (!theData) + return aLine; + + std::shared_ptr anAttr = + std::dynamic_pointer_cast(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 getProjectionPoint( -// const std::shared_ptr& theLine, -// const std::shared_ptr& thePoint) -//{ -// std::shared_ptr aData = theLine->data(); -// std::shared_ptr aPoint1 = std::dynamic_pointer_cast( -// aData->attribute(SketchPlugin_Line::START_ID())); -// std::shared_ptr aPoint2 = std::dynamic_pointer_cast( -// aData->attribute(SketchPlugin_Line::END_ID())); -// -// GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y()); -// return aLin2d.project(thePoint); -//} +std::shared_ptr getProjectionPoint(const FeaturePtr theLine, + const std::shared_ptr& thePoint) +{ + DataPtr aData = theLine->data(); + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( + aData->attribute(SketchPlugin_Line::START_ID())); + std::shared_ptr aPoint2 = std::dynamic_pointer_cast( + 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.; diff --git a/src/SketcherPrs/SketcherPrs_Tools.h b/src/SketcherPrs/SketcherPrs_Tools.h index cd74bdae6..c040fff59 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.h +++ b/src/SketcherPrs/SketcherPrs_Tools.h @@ -11,30 +11,29 @@ #include #include #include +#include #include -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 getShape(ObjectPtr theObject); - SKETCHERPRS_EXPORT std::shared_ptr getPoint(SketchPlugin_Constraint* theFeature, + SKETCHERPRS_EXPORT std::shared_ptr getPoint(ModelAPI_Feature* theFeature, const std::string& theAttrName); -// SKETCHERPRS_EXPORT std::shared_ptr getProjectionPoint( -// const std::shared_ptr& theLine, -// const std::shared_ptr& thePoint); + SKETCHERPRS_EXPORT std::shared_ptr getProjectionPoint( + const FeaturePtr theLine, + const std::shared_ptr& thePoint); -// SKETCHERPRS_EXPORT std::shared_ptr 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 getFeaturePoint(DataPtr theData,