-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef PartSet_WidgetPoint2D_H
#include <ModelAPI_CompositeFeature.h>
#include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_ViewerPrs.h>
#include <QObject>
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
std::shared_ptr<ModelAPI_Object>& theObject,
std::shared_ptr<GeomAPI_Shape>& 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();
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
/// \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
const FeaturePtr& theSkipFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
+private:
/// Returns attribute reference if the key is defined in XML definition of this control
/// \return found attribute or null
std::shared_ptr<ModelAPI_AttributeRefAttr> attributeRefAttr() const;