X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_LengthDimension.h;h=b737488fa566497d95df49b744fd62d7f9278c3c;hb=2ab502106663ac32f9a5d87e4fdc950f5ac6f6b7;hp=dc83f8d1d0143f740db72b94b4950760e70bc66d;hpb=87b6a30a3afb8fb32e7e43ade8d9c947d9eb1684;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.h b/src/SketcherPrs/SketcherPrs_LengthDimension.h index dc83f8d1d..b737488fa 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.h +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SketcherPrs_LinearDimension_H @@ -25,12 +24,13 @@ #include #include #include +#include #include #include #include -#include +#include DEFINE_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension) @@ -46,7 +46,7 @@ public: /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch Standard_EXPORT SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane); + SketchPlugin_Sketch* theSketcher); /// Destructor Standard_EXPORT ~SketcherPrs_LengthDimension(); @@ -60,6 +60,13 @@ public: /// \return boolean result value static bool IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); + + /// Returns sketcher plane + Standard_EXPORT std::shared_ptr plane() const + { + return mySketcher->coordinatePlane(); + } + protected: /// Redefinition of virtual function Standard_EXPORT virtual void Compute( @@ -76,16 +83,20 @@ private: const std::shared_ptr& thePlane, gp_Pnt& thePnt1, gp_Pnt& thePnt2); + /// Set the direction for horizontal/vertical constraint + void setDirection(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane); + /// Constraint feature ModelAPI_Feature* myConstraint; - /// Plane of the current sketcher - std::shared_ptr mySketcherPlane; + /// A current sketcher + SketchPlugin_Sketch* mySketcher; //Handle(Prs3d_DimensionAspect) myAspect; /// Listener to update dimension visualization style - SketcherPrs_DimensionStyleListener* myStyleListener; + SketcherPrs_DimensionStyle* myStyleListener; /// container of values obtained from the constraint, which are necessary /// to fill the presentation @@ -95,7 +106,7 @@ private: double myDistance; ///< the flyout distance /// the structure filled by constraint - SketcherPrs_DimensionStyleListener::DimensionValue myValue; + SketcherPrs_DimensionStyle::DimensionValue myValue; }; #endif \ No newline at end of file