20 #ifndef PartSet_WidgetPoint2D_H
21 #define PartSet_WidgetPoint2D_H
24 #include "PartSet_MouseProcessor.h"
26 #include <ModelAPI_CompositeFeature.h>
27 #include <ModuleBase_ModelWidget.h>
28 #include <ModuleBase_ViewerPrs.h>
32 #include <TopoDS_Shape.hxx>
33 #include <V3d_View.hxx>
74 virtual void selectionModes(
int& theModuleSelectionModes, QIntList& theModes);
87 bool isValidSelectionForAttribute_(
const std::shared_ptr<ModuleBase_ViewerPrs>& theValue,
88 const std::shared_ptr<ModelAPI_Attribute>& theAttribute);
92 bool setSelectionCustom(
const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
98 virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
99 const bool theToValidate);
114 CompositeFeaturePtr
sketch()
const {
return mySketch; }
117 void setSketch(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
123 bool setPoint(
double theX,
double theY);
132 virtual bool processEnter();
136 virtual bool useSelectedShapes()
const;
150 virtual void setPreSelection(
const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected,
152 QMouseEvent* theEvent);
158 void getGeomSelection_(
const std::shared_ptr<ModuleBase_ViewerPrs>& theValue,
159 std::shared_ptr<ModelAPI_Object>& theObject,
160 std::shared_ptr<GeomAPI_Shape>& theShape);
179 void storeCurentValue();
183 bool restoreCurentValue();
201 bool isFeatureContainsPoint(
const FeaturePtr& theFeature,
double theX,
double theY);
218 bool setConstraintToPoint(
double theClickedX,
double theClickedY,
219 const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
224 bool setConstraintToObject(
const ObjectPtr& theObject);
230 void processSelection(
const ModuleBase_ViewerPrsPtr& theValue,
double theX,
double theY);
243 static bool isOrphanPoint(
const FeaturePtr& theFeature,
const CompositeFeaturePtr& theSketch,
244 double theX,
double theY);
250 static bool shapeExploreHasVertex(
const std::shared_ptr<GeomAPI_Shape>& theShape,
251 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint,
252 const CompositeFeaturePtr& theSketch);
258 static std::shared_ptr<GeomDataAPI_Point2D> findFirstEqualPointInArgumentFeatures(
259 const FeaturePtr& theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
265 static std::shared_ptr<GeomDataAPI_Point2D> findFirstEqualPoint(
const FeaturePtr& theFeature,
266 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
273 static std::shared_ptr<GeomDataAPI_Point2D> findFirstEqualPointInSketch(
274 const CompositeFeaturePtr& theSketch,
275 const FeaturePtr& theSkipFeature,
276 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
281 std::shared_ptr<ModelAPI_AttributeRefAttr> attributeRefAttr()
const;
286 void fillRefAttribute(
const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
287 void fillRefAttribute(
double theClickedX,
double theClickedY,
288 const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
289 void fillRefAttribute(
const ObjectPtr& theObject);
291 ObjectPtr getGeomSelection(
const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
305 std::shared_ptr<ModuleBase_ViewerPrs> myPreSelected;
308 CompositeFeaturePtr mySketch;
310 std::string myRefAttribute;
311 bool myValueIsCashed;
312 bool myIsFeatureVisibleInCash;
313 double myXValueInCash;
314 double myYValueInCash;
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Attribute that contains reference to an attribute of a feature or reference to a feature (switchable)
Definition: ModelAPI_AttributeRefAttr.h:33
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39
Interface to ViewWindow object which contains 3d scene.
Definition: ModuleBase_IViewWindow.h:34
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
Implementation of model widget for a label control.
Definition: ModuleBase_LabelValue.h:34
An extension of a double spin box which let to use parameters and expressions for value definition.
Definition: ModuleBase_ParamSpinBox.h:37
Customosation of ModuleBase_WidgetShapeSelector in order to provide working with sketch specific obje...
Definition: PartSet_ExternalObjectsMgr.h:43
This is an interface to allow processing of mouse events.
Definition: PartSet_MouseProcessor.h:40
virtual void mouseMoved(ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
Processing the mouse move event in the viewer.
Definition: PartSet_MouseProcessor.h:45
virtual void setPreSelection(const std::shared_ptr< ModuleBase_ViewerPrs > &thePreSelected, ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
Fill preselection used in mouseReleased.
Definition: PartSet_MouseProcessor.h:64
virtual void mouseReleased(ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
Processing the mouse release event in the viewer.
Definition: PartSet_MouseProcessor.h:55