X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetPoint2d.h;h=f992f8bb3c37ae7e0964e8f6b9d84fdd59a74177;hb=3b02241a66e6be241eebbe70df42349293c5f4ab;hp=4c7659deb88888dac7ab06cd339ac94baeb8037a;hpb=62390c63cfcaf79e7ee1182aac74a015080db7bc;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetPoint2d.h b/src/PartSet/PartSet_WidgetPoint2d.h old mode 100755 new mode 100644 index 4c7659deb..f992f8bb3 --- a/src/PartSet/PartSet_WidgetPoint2d.h +++ b/src/PartSet/PartSet_WidgetPoint2d.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_WidgetPoint2d.h -// Created: 25 Apr 2014 -// Author: Natalia ERMOLAEVA +// Copyright (C) 2014-2022 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef PartSet_WidgetPoint2D_H #define PartSet_WidgetPoint2D_H @@ -12,6 +25,7 @@ #include #include +#include #include @@ -54,6 +68,11 @@ Q_OBJECT /// Destructor virtual ~PartSet_WidgetPoint2D(); + /// Fills given container with selection modes if the widget has it + /// \param [out] theModuleSelectionModes module additional modes, -1 means all default modes + /// \param theModes [out] a container of modes + virtual void selectionModes(int& theModuleSelectionModes, QIntList& theModes); + /// Checks if the selection presentation is valid in widget /// \param theValue a selected presentation in the view /// \return a boolean value @@ -80,7 +99,7 @@ Q_OBJECT const bool theToValidate); /// Select the internal content if it can be selected. It is empty in the default realization - virtual void selectContent(); + //virtual void selectContent(); /// Returns list of widget controls /// \return a control list @@ -140,6 +159,10 @@ Q_OBJECT std::shared_ptr& theObject, std::shared_ptr& theShape); + /// Return reference to external objects manager + /// \return manager instance + PartSet_ExternalObjectsMgr* getExternalObjectMgr() const { return myExternalObjectMgr; } + signals: /// Signal about selection of an existing vertex from an object void vertexSelected(); @@ -189,14 +212,6 @@ protected: virtual void initializeValueByActivate(); private: - /// Returns point 2d from selected vertex - /// \param theView a view window - /// \param theShape a vertex shape - /// \param theX an output value of X coordinate - /// \param theY an output value of Y coordinate - bool getPoint2d(const Handle(V3d_View)& theView, const TopoDS_Shape& theShape, - double& theX, double& theY) const; - /// Creates constrains of the clicked point /// \param theClickedX the horizontal coordnate of the point /// \param theClickedY the vertical coordnate of the point @@ -208,6 +223,14 @@ protected: /// \return true if succed bool setConstraintToObject(const ObjectPtr& theObject); + /// Process selected value + /// \param theValue the selected object + /// \param theX X coordinate of clicked point + /// \param theY Y coordinate of clicked point + void processSelection(const ModuleBase_ViewerPrsPtr& theValue, double theX, double theY); + + +public: /// Returns if the feature is an orphan point, circle or an arc. Returns true if it /// has no a coincident to other lines. It processes point, circle and arc features /// In circle an arc features, only centers are processed, for other points, it returns @@ -252,6 +275,7 @@ protected: const FeaturePtr& theSkipFeature, const std::shared_ptr& thePoint); +private: /// Returns attribute reference if the key is defined in XML definition of this control /// \return found attribute or null std::shared_ptr attributeRefAttr() const;