SHAPER  9.13.0
PartSet_WidgetPoint2DFlyout Class Reference

Implementation of usual point 2d widget with a condition that it can not accept the focus when the AIS presentation is not visualized in the viewer. More...

Inheritance diagram for PartSet_WidgetPoint2DFlyout:
Inheritance graph

Public Types

enum  ValueState { Stored , ModifiedInPP , ModifiedInViewer , Reset }
 State of the widget. More...
 
enum  EnableState { On , Off , DefinedInPreferences }
 the value is reset More...
 

Signals

void vertexSelected ()
 Signal about selection of an existing vertex from an object. More...
 
void beforeValuesChanged ()
 The signal about widget values are to be changed. More...
 
void valuesChanged ()
 The signal about widget values changed. More...
 
void valuesModified ()
 The signal about widget values modified. More...
 
void afterValuesChanged ()
 The signal about widget values are to be changed. More...
 
void beforeValuesRestored ()
 The signal about widget values are to be restored. More...
 
void afterValuesRestored ()
 The signal about widget values are to be restored. More...
 
void keyReleased (QObject *theObject, QKeyEvent *theEvent)
 The signal about key release on the control, that corresponds to the attribute. More...
 
void enterClicked (QObject *theObject)
 The signal is emitted if the enter is clicked in the control of the widget. More...
 
void focusInWidget (ModuleBase_ModelWidget *theWidget)
 The signal about the widget is get focus. More...
 
void focusOutWidget (ModuleBase_ModelWidget *theWidget)
 The signal about the widget is lost focus. More...
 
void valueStateChanged (int theState)
 The signal about value state modification. More...
 
void objectUpdated ()
 The signal is emitted after flush of updates singal for the widget. More...
 

Public Member Functions

 PartSet_WidgetPoint2DFlyout (QWidget *theParent, ModuleBase_IWorkshop *theWorkshop, const Config_WidgetAPI *theData)
 Constructor. More...
 
virtual ~PartSet_WidgetPoint2DFlyout ()
 Destructor. More...
 
virtual bool setSelection (QList< std::shared_ptr< ModuleBase_ViewerPrs >> &theValues, const bool theToValidate)
 Set the given wrapped value to the current widget This value should be processed in the widget according to the needs. More...
 
virtual bool isValidSelectionCustom (const std::shared_ptr< ModuleBase_ViewerPrs > &theValue)
 Checks if the selection presentation is valid in widget. More...
 
virtual bool focusTo ()
 Activates the editor control only in case if the mouse over the OCC window, otherwise set focus to the usual double value control. More...
 
virtual bool useSelectedShapes () const
 Returns true if the attribute can be changed using the selected shapes in the viewer and creating a coincidence constraint to them. More...
 
virtual void selectionModes (int &theModuleSelectionModes, QIntList &theModes)
 Fills given container with selection modes if the widget has it. More...
 
bool isValidSelectionForAttribute_ (const std::shared_ptr< ModuleBase_ViewerPrs > &theValue, const std::shared_ptr< ModelAPI_Attribute > &theAttribute)
 Checks all attribute validators returns valid. More...
 
bool setSelectionCustom (const std::shared_ptr< ModuleBase_ViewerPrs > &theValue)
 Fills the attribute with the value of the selected owner. More...
 
virtual QList< QWidget * > getControls () const
 Select the internal content if it can be selected. It is empty in the default realization. More...
 
virtual void deactivate ()
 The methiod called when widget is deactivated. More...
 
CompositeFeaturePtr sketch () const
 
void setSketch (CompositeFeaturePtr theSketch)
 Set sketch instance. More...
 
bool setPoint (double theX, double theY)
 Fill the widget values by given point. More...
 
double x () const
 Returns coordinate X currently defined in the control. More...
 
double y () const
 Returns coordinate Y currently defined in the control. More...
 
virtual bool processEnter ()
 Returns true if the event is processed. More...
 
virtual void mouseMoved (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse move event in the viewer. More...
 
virtual void mouseReleased (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse release event in the viewer. More...
 
virtual void setPreSelection (const std::shared_ptr< ModuleBase_ViewerPrs > &thePreSelected, ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
 Fill preselection used in mouseReleased. More...
 
void getGeomSelection_ (const std::shared_ptr< ModuleBase_ViewerPrs > &theValue, std::shared_ptr< ModelAPI_Object > &theObject, std::shared_ptr< GeomAPI_Shape > &theShape)
 Return an object and geom shape by the viewer presentation. More...
 
PartSet_ExternalObjectsMgrgetExternalObjectMgr () const
 Return reference to external objects manager. More...
 
bool reset ()
 Fills the widget with default values. More...
 
bool isInitialized (ObjectPtr theObject) const
 Returns the state whether the attribute of the feature is initialized. More...
 
virtual void selectionFilters (QIntList &theModuleSelectionFilters, SelectMgr_ListOfFilter &theSelectionFilters)
 Appends into container of workshop selection filters. More...
 
bool isComputedDefault () const
 Returns true, if default value of the widget should be computed on operation's execute, like radius for circle's constraint (can not be zero) More...
 
std::string getDefaultValue () const
 Returns true, if default value of the widget is defined in the XML and it is not the computed value. More...
 
bool isInternal () const
 Returns true, if widget is internal. More...
 
bool isObligatory () const
 Returns true, if the obligatory value of the widget is not defined in the XML or has true value. More...
 
virtual bool isValueEnabled () const
 Returns true, if the widget value is enabled and might be modified manualy. More...
 
bool isUseReset () const
 Returns this parameter value in the xml file. More...
 
std::string isModifiedInEdit () const
 Returns this parameter value in the xml file. More...
 
ValueState getValueState () const
 Returns this widget value state. More...
 
void processValueState ()
 Stores the widget value if it is modified. More...
 
Events_InfoMessage getValueStateError () const
 Returns an attribute error according to the value state It exists in all cases excepring the "Store" case. More...
 
virtual bool isViewerSelector ()
 Defines if it is supposed that the widget should interact with the viewer. More...
 
virtual bool canAcceptFocus () const
 Defines if it is supported to set the value in this widget By default it returns true. More...
 
virtual QString getError (const bool theValueStateChecked=true) const
 Returns the widget error, get it from the attribute validator and state of the widget If the feature is correct, it returns an empty value. More...
 
virtual void getHighlighted (QList< std::shared_ptr< ModuleBase_ViewerPrs >> &theValues)
 Returns values which should be highlighted when the whidget is active. More...
 
ModuleBase_WidgetValidatorwidgetValidator ()
 Returns widget validator, by default it is NULL. To be created in a child if necessary. More...
 
bool restoreValue ()
 Restore value from attribute data to the widget's control. More...
 
bool storeValue ()
 Saves the internal parameters to the given feature. More...
 
virtual void selectContent ()
 Select the internal content if it can be selected. It is empty in the default realization. More...
 
void activate ()
 The method called when widget is activated. More...
 
virtual void updateAfterDeactivation ()
 Opportunity to do something after the active widget of the property panel changed. More...
 
virtual void updateAfterActivation ()
 Opportunity to do something after the active widget of the property panel changed. More...
 
virtual bool needToBeActivated ()
 The method called if widget should be activated always. More...
 
QWidgetgetControlAcceptingFocus (const bool isFirst)
 Returns the first or the last control that can accept the focus. More...
 
virtual bool eventFilter (QObject *theObject, QEvent *theEvent)
 FocusIn events processing. More...
 
virtual void enableFocusProcessing ()
 Enables processing of focus event on all controls by the widget if this widget is not obligatory and set no-focus policy otherwise. More...
 
std::string attributeID () const
 Returns the attribute name. More...
 
FeaturePtr feature () const
 
virtual std::string context () const
 
virtual void setFeature (const FeaturePtr &theFeature, const bool theToStoreValue=false, const bool isUpdateFlushed=true)
 Set feature which is processing by active operation. More...
 
virtual void setEditingMode (bool isEditing)
 Editing mode depends on mode of current operation. This value is defined by it. More...
 
bool isEditingMode () const
 
virtual bool canProcessAction (ModuleBase_ActionType theActionType, bool &isActionEnabled)
 Returns true if the action can be processed. More...
 
virtual bool processAction (ModuleBase_ActionType theActionType, const ActionParamPtr &theParam=ActionParamPtr())
 Returns true if the event is processed. The default implementation is empty, returns false. More...
 
virtual QList< ActionInfoactionsList (ModuleBase_ActionType theActionType) const
 Returns list of accessible actions for Undo/Redo commands. More...
 
void updateObject (ObjectPtr theObj)
 Sends Update and Redisplay for the given object. More...
 
virtual QString translate (const std::string &theStr) const
 Translate passed string with widget context() More...
 
void emitFocusInWidget ()
 Emit focus in widget to set this control as active in propety panel. More...
 
virtual bool usesAttribute () const
 Returns True if the widget uses feature attribute. More...
 
virtual void onFeatureAccepted ()
 It is called when user press Ok or OkPlus buttons in the parent property panel By default this slot does nothing. More...
 
virtual bool isInformative () const
 Returns True in case if the widget contains useful information for inspection tool. More...
 
virtual void showInformativePage ()
 If widgets has several panels then this method has to show a page which contains information for current feature. More...
 
virtual bool isModified () const
 Returns True if data of its attribute was modified. More...
 
virtual void setReadOnly (bool isReadOnly)
 
virtual bool isReadOnly () const
 
bool canUseExternalParts () const
 Returns true if the widget should have access to external parts. More...
 
virtual void mousePressed (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse press event in the viewer. More...
 
virtual void mouseDoubleClick (ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent)
 Processing the mouse double click event in the viewer. More...
 

Static Public Member Functions

static bool isOrphanPoint (const FeaturePtr &theFeature, const CompositeFeaturePtr &theSketch, double theX, double theY)
 Returns if the feature is an orphan point, circle or an arc. More...
 
static bool shapeExploreHasVertex (const std::shared_ptr< GeomAPI_Shape > &theShape, const std::shared_ptr< GeomAPI_Pnt2d > &thePoint, const CompositeFeaturePtr &theSketch)
 Explode the given shape by vertices and found closed to the point vertes. More...
 
static std::shared_ptr< GeomDataAPI_Point2DfindFirstEqualPointInArgumentFeatures (const FeaturePtr &theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
 Finds in the feature's sub-features first Point2D attribute with the given point coordinates. More...
 
static std::shared_ptr< GeomDataAPI_Point2DfindFirstEqualPoint (const FeaturePtr &theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
 Finds in the feature first Point2D attribute with the given point coordinates. More...
 
static std::shared_ptr< GeomDataAPI_Point2DfindFirstEqualPointInSketch (const CompositeFeaturePtr &theSketch, const FeaturePtr &theSkipFeature, const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
 Finds in the sketch attribute point of any feature that is nearest to the given point. More...
 
static ModuleBase_ModelWidgetfindModelWidget (ModuleBase_IPropertyPanel *theProp, QWidget *theWidget)
 Finds model widget parent of the given sub widget. More...
 

Protected Slots

void onWidgetValuesChanged ()
 Processing of values changed in model widget by store the current value to the feature. More...
 
void onWidgetValuesModified ()
 Changes widget state. More...
 

Protected Member Functions

virtual bool storeValueCustom ()
 Saves the internal parameters to the given feature. More...
 
virtual bool restoreValueCustom ()
 Restore value from attribute data to the widget's control. More...
 
void storeCurentValue ()
 Store current value in cashed value. More...
 
bool restoreCurentValue ()
 Restore cashed value in the model attribute. More...
 
virtual bool resetCustom ()
 Fills the widget with default values. More...
 
virtual void activateCustom ()
 The methiod called when widget is activated. More...
 
virtual void setHighlighted (bool isHighlighted)
 Switch On/Off highlighting of the widget. More...
 
bool isFeatureContainsPoint (const FeaturePtr &theFeature, double theX, double theY)
 Returns true if the feature contains Point2D attribute with the same coordinates The attribute of the widget is not processed. More...
 
virtual void initializeValueByActivate ()
 Process value changed event. More...
 
virtual bool processSelection ()
 Returns true if envent is processed. It applyes workshop selection for the widget attribute. More...
 
void setDefaultValue (const std::string &theValue)
 Sets default value of widget. More...
 
void setAttributeID (const std::string &theAttribute)
 Set the attribute name. More...
 
ValueState setValueState (const ValueState &theState)
 Sets the current value state. More...
 
bool blockValueState (const bool theBlocked)
 Blocks the value state change. More...
 
virtual bool processEscape ()
 
virtual bool processDelete ()
 

Protected Attributes

ModuleBase_IWorkshopmyWorkshop
 workshop More...
 
ModuleBase_WidgetValidatormyWidgetValidator
 own validator, by default it is zero More...
 
std::string myAttributeID
 The attribute name of the model feature. More...
 
FeaturePtr myFeature
 A feature which is processing by active operation. More...
 
std::string myFeatureId
 A feature ID. More...
 
bool myIsObligatory
 Flag which shows whether current widget is obligatory The non-obligatory widgets should not accept the focus in the property panel. More...
 
EnableState myIsValueEnabled
 Flag about value of the control is enabled (can be modified) More...
 
ValueState myState
 The widget value state. More...
 

Detailed Description

Implementation of usual point 2d widget with a condition that it can not accept the focus when the AIS presentation is not visualized in the viewer.

Member Enumeration Documentation

◆ ValueState

State of the widget.

Enumerator
ModifiedInPP 

modification is finished and applyed to the model

ModifiedInViewer 

modification has not been finished and set to the model yet

Reset 

modification performed by viewer events

◆ EnableState

the value is reset

Enumerator
Off 

the widget value is always enabled

DefinedInPreferences 

the widget value is always disabled

the widget value enable state is defined in preferences

Constructor & Destructor Documentation

◆ PartSet_WidgetPoint2DFlyout()

PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout ( QWidget theParent,
ModuleBase_IWorkshop theWorkshop,
const Config_WidgetAPI theData 
)

Constructor.

Parameters
theParentthe parent object
theWorkshopa current workshop
theDatathe widget configuation. The attribute of the model widget is obtained from

◆ ~PartSet_WidgetPoint2DFlyout()

virtual PartSet_WidgetPoint2DFlyout::~PartSet_WidgetPoint2DFlyout ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ setSelection()

bool PartSet_WidgetPoint2DFlyout::setSelection ( QList< std::shared_ptr< ModuleBase_ViewerPrs >> &  theValues,
const bool  theToValidate 
)
virtual

Set the given wrapped value to the current widget This value should be processed in the widget according to the needs.

Parameters
theValuesthe wrapped widget values
theToValidatea validation flag

Reimplemented from PartSet_WidgetPoint2D.

◆ isValidSelectionCustom()

bool PartSet_WidgetPoint2DFlyout::isValidSelectionCustom ( const std::shared_ptr< ModuleBase_ViewerPrs > &  theValue)
virtual

Checks if the selection presentation is valid in widget.

Parameters
theValuea selected presentation in the view
Returns
a boolean value

Reimplemented from PartSet_WidgetPoint2D.

◆ focusTo()

bool PartSet_WidgetPoint2DFlyout::focusTo ( )
virtual

Activates the editor control only in case if the mouse over the OCC window, otherwise set focus to the usual double value control.

Returns
the state whether the widget can accept the focus

Reimplemented from ModuleBase_ModelWidget.

◆ useSelectedShapes()

bool PartSet_WidgetPoint2DFlyout::useSelectedShapes ( ) const
virtual

Returns true if the attribute can be changed using the selected shapes in the viewer and creating a coincidence constraint to them.

This control does not use them.

Reimplemented from PartSet_WidgetPoint2D.

◆ selectionModes()

void PartSet_WidgetPoint2D::selectionModes ( int &  theModuleSelectionModes,
QIntList &  theModes 
)
virtualinherited

Fills given container with selection modes if the widget has it.

Parameters
[out]theModuleSelectionModesmodule additional modes, -1 means all default modes
theModes[out] a container of modes

Reimplemented from ModuleBase_ModelWidget.

◆ isValidSelectionForAttribute_()

bool PartSet_WidgetPoint2D::isValidSelectionForAttribute_ ( const std::shared_ptr< ModuleBase_ViewerPrs > &  theValue,
const std::shared_ptr< ModelAPI_Attribute > &  theAttribute 
)
inherited

Checks all attribute validators returns valid.

It tries on the given selection to current attribute by setting the value inside and calling validators. After this, the previous attribute value is restored.The valid/invalid value is cashed.

Parameters
theValuea selected presentation in the view
theAttributethe attribute
Returns
a boolean value

◆ setSelectionCustom()

bool PartSet_WidgetPoint2D::setSelectionCustom ( const std::shared_ptr< ModuleBase_ViewerPrs > &  theValue)
inherited

Fills the attribute with the value of the selected owner.

Parameters
thePrsa selected owner

◆ getControls()

QList< QWidget * > PartSet_WidgetPoint2D::getControls ( ) const
virtualinherited

Select the internal content if it can be selected. It is empty in the default realization.

Returns list of widget controls

Returns
a control list

Implements ModuleBase_ModelWidget.

◆ deactivate()

void PartSet_WidgetPoint2D::deactivate ( )
virtualinherited

The methiod called when widget is deactivated.

Reimplemented from ModuleBase_ModelWidget.

◆ sketch()

CompositeFeaturePtr PartSet_WidgetPoint2D::sketch ( ) const
inlineinherited
Returns
the sketch instance

◆ setSketch()

void PartSet_WidgetPoint2D::setSketch ( CompositeFeaturePtr  theSketch)
inlineinherited

Set sketch instance.

◆ setPoint()

bool PartSet_WidgetPoint2D::setPoint ( double  theX,
double  theY 
)
inherited

Fill the widget values by given point.

Parameters
theXthe X coordinate
theYthe Y coordinate
Returns
True in case of success

◆ x()

double PartSet_WidgetPoint2D::x ( ) const
inherited

Returns coordinate X currently defined in the control.

◆ y()

double PartSet_WidgetPoint2D::y ( ) const
inherited

Returns coordinate Y currently defined in the control.

◆ processEnter()

bool PartSet_WidgetPoint2D::processEnter ( )
virtualinherited

Returns true if the event is processed.

Reimplemented from ModuleBase_ModelWidget.

◆ mouseMoved()

void PartSet_WidgetPoint2D::mouseMoved ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
virtualinherited

Processing the mouse move event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

Reimplemented from PartSet_MouseProcessor.

◆ mouseReleased()

void PartSet_WidgetPoint2D::mouseReleased ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
virtualinherited

Processing the mouse release event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

Reimplemented from PartSet_MouseProcessor.

◆ setPreSelection()

void PartSet_WidgetPoint2D::setPreSelection ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePreSelected,
ModuleBase_IViewWindow theWnd,
QMouseEvent *  theEvent 
)
virtualinherited

Fill preselection used in mouseReleased.

Reimplemented from PartSet_MouseProcessor.

◆ getGeomSelection_()

void PartSet_WidgetPoint2D::getGeomSelection_ ( const std::shared_ptr< ModuleBase_ViewerPrs > &  theValue,
std::shared_ptr< ModelAPI_Object > &  theObject,
std::shared_ptr< GeomAPI_Shape > &  theShape 
)
inherited

Return an object and geom shape by the viewer presentation.

Parameters
thePrsa selection
theObjectan output object
theShapea shape of the selection

◆ getExternalObjectMgr()

PartSet_ExternalObjectsMgr* PartSet_WidgetPoint2D::getExternalObjectMgr ( ) const
inlineinherited

Return reference to external objects manager.

Returns
manager instance

◆ vertexSelected

void PartSet_WidgetPoint2D::vertexSelected ( )
signalinherited

Signal about selection of an existing vertex from an object.

◆ storeValueCustom()

bool PartSet_WidgetPoint2D::storeValueCustom ( )
protectedvirtualinherited

Saves the internal parameters to the given feature.

Returns
True in success

Implements ModuleBase_ModelWidget.

◆ restoreValueCustom()

bool PartSet_WidgetPoint2D::restoreValueCustom ( )
protectedvirtualinherited

Restore value from attribute data to the widget's control.

Implements ModuleBase_ModelWidget.

◆ storeCurentValue()

void PartSet_WidgetPoint2D::storeCurentValue ( )
protectedinherited

Store current value in cashed value.

◆ restoreCurentValue()

bool PartSet_WidgetPoint2D::restoreCurentValue ( )
protectedinherited

Restore cashed value in the model attribute.

Returns
boolean state if the restored feature shoud be hidden

◆ resetCustom()

bool PartSet_WidgetPoint2D::resetCustom ( )
protectedvirtualinherited

Fills the widget with default values.

Returns
true if the widget current value is reset

Reimplemented from ModuleBase_ModelWidget.

◆ activateCustom()

void PartSet_WidgetPoint2D::activateCustom ( )
protectedvirtualinherited

The methiod called when widget is activated.

Reimplemented from ModuleBase_ModelWidget.

◆ setHighlighted()

void PartSet_WidgetPoint2D::setHighlighted ( bool  isHighlighted)
protectedvirtualinherited

Switch On/Off highlighting of the widget.

Reimplemented from ModuleBase_ModelWidget.

◆ isFeatureContainsPoint()

bool PartSet_WidgetPoint2D::isFeatureContainsPoint ( const FeaturePtr &  theFeature,
double  theX,
double  theY 
)
protectedinherited

Returns true if the feature contains Point2D attribute with the same coordinates The attribute of the widget is not processed.

Parameters
theFeaturea feature
theXthe X coordinate
theYthe Y coordinate
Returns
boolean result

◆ initializeValueByActivate()

void PartSet_WidgetPoint2D::initializeValueByActivate ( )
protectedvirtualinherited

Process value changed event.

Compute the feature default value and fill the controls with it or store the control value to the feature The widget is not initialize the attribute value in order to avoid the incorrect visualization in Sketch. E.g. by a line creation, the line should not be visualized immediatelly when the end point widget is activated.

Reimplemented from ModuleBase_ModelWidget.

◆ processSelection()

bool ModuleBase_ModelWidget::processSelection ( )
protectedvirtualinherited

Returns true if envent is processed. It applyes workshop selection for the widget attribute.

Reimplemented in PartSet_WidgetSketchLabel, PartSet_WidgetSketchCreator, ModuleBase_WidgetSelector, ModuleBase_WidgetMultiSelector, and ModuleBase_WidgetFeatureSelector.

◆ isOrphanPoint()

bool PartSet_WidgetPoint2D::isOrphanPoint ( const FeaturePtr &  theFeature,
const CompositeFeaturePtr &  theSketch,
double  theX,
double  theY 
)
staticinherited

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 that the point is not an orphan.

Parameters
theFeaturea checked feature
theSketcha sketch
theXan X coordinate of the point
theYan Y coordinate of the point
Returns
boolean result

check that the geometry point with the given coordinates is the checked point e.g. in arc the (x,y) point can not coicide to the center point and it automatically means that this point is not an orphant one.

◆ shapeExploreHasVertex()

bool PartSet_WidgetPoint2D::shapeExploreHasVertex ( const std::shared_ptr< GeomAPI_Shape > &  theShape,
const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint,
const CompositeFeaturePtr &  theSketch 
)
staticinherited

Explode the given shape by vertices and found closed to the point vertes.

Parameters
theShapea shape to be exploded
thePointa point
Returns
boolean value

◆ findFirstEqualPointInArgumentFeatures()

std::shared_ptr< GeomDataAPI_Point2D > PartSet_WidgetPoint2D::findFirstEqualPointInArgumentFeatures ( const FeaturePtr &  theFeature,
const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint 
)
staticinherited

Finds in the feature's sub-features first Point2D attribute with the given point coordinates.

Parameters
theFeaturea feature with sub-feature attributes
thePointa point to provided searched coordinates
Returns
found point or null

◆ findFirstEqualPoint()

std::shared_ptr< GeomDataAPI_Point2D > PartSet_WidgetPoint2D::findFirstEqualPoint ( const FeaturePtr &  theFeature,
const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint 
)
staticinherited

Finds in the feature first Point2D attribute with the given point coordinates.

Parameters
theFeaturea feature with point attributes
thePointa point to provided searched coordinates
Returns
found point or null

◆ findFirstEqualPointInSketch()

std::shared_ptr< GeomDataAPI_Point2D > PartSet_WidgetPoint2D::findFirstEqualPointInSketch ( const CompositeFeaturePtr &  theSketch,
const FeaturePtr &  theSkipFeature,
const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint 
)
staticinherited

Finds in the sketch attribute point of any feature that is nearest to the given point.

Parameters
theSketcha sketch, that is a container of features
theSkipFeaturea feature that do not participate in the search
thePointa point to provided searched coordinates
Returns
found point or null

◆ reset()

bool ModuleBase_ModelWidget::reset ( )
inherited

Fills the widget with default values.

It calls the resetCustom method and change the widget state to Reset if the reset is performed.

Returns
true if the widget current value is reset

◆ isInitialized()

bool ModuleBase_ModelWidget::isInitialized ( ObjectPtr  theObject) const
inherited

Returns the state whether the attribute of the feature is initialized.

Parameters
theObjecta model feature to be checked
Returns
the boolean result

◆ selectionFilters()

void ModuleBase_ModelWidget::selectionFilters ( QIntList &  theModuleSelectionFilters,
SelectMgr_ListOfFilter &  theSelectionFilters 
)
virtualinherited

Appends into container of workshop selection filters.

Parameters
[out]theModuleSelectionFiltersmodule additional modes, -1 means all default modes
[out]theSelectionFiltersselection filters

Reimplemented in PartSet_WidgetSketchLabel, PartSet_WidgetShapeSelector, and ModuleBase_WidgetValidated.

◆ isComputedDefault()

bool ModuleBase_ModelWidget::isComputedDefault ( ) const
inlineinherited

Returns true, if default value of the widget should be computed on operation's execute, like radius for circle's constraint (can not be zero)

◆ getDefaultValue()

std::string ModuleBase_ModelWidget::getDefaultValue ( ) const
inlineinherited

Returns true, if default value of the widget is defined in the XML and it is not the computed value.

Returns
the boolean result

◆ isInternal()

bool ModuleBase_ModelWidget::isInternal ( ) const
inlineinherited

Returns true, if widget is internal.

Returns
the boolean result

◆ isObligatory()

bool ModuleBase_ModelWidget::isObligatory ( ) const
inlineinherited

Returns true, if the obligatory value of the widget is not defined in the XML or has true value.

Returns
the boolean result

◆ isValueEnabled()

bool ModuleBase_ModelWidget::isValueEnabled ( ) const
virtualinherited

Returns true, if the widget value is enabled and might be modified manualy.

It returns false if the application preferences allow having disabled value and the internal state tells to disable

Returns
the boolean result

◆ isUseReset()

bool ModuleBase_ModelWidget::isUseReset ( ) const
inlineinherited

Returns this parameter value in the xml file.

Returns
the boolean result

◆ isModifiedInEdit()

std::string ModuleBase_ModelWidget::isModifiedInEdit ( ) const
inlineinherited

Returns this parameter value in the xml file.

Returns
the boolean result

◆ getValueState()

ValueState ModuleBase_ModelWidget::getValueState ( ) const
inlineinherited

Returns this widget value state.

Returns
the enumeration result

◆ processValueState()

void ModuleBase_ModelWidget::processValueState ( )
inherited

Stores the widget value if it is modified.

◆ getValueStateError()

Events_InfoMessage ModuleBase_ModelWidget::getValueStateError ( ) const
inherited

Returns an attribute error according to the value state It exists in all cases excepring the "Store" case.

◆ isViewerSelector()

virtual bool ModuleBase_ModelWidget::isViewerSelector ( )
inlinevirtualinherited

Defines if it is supposed that the widget should interact with the viewer.

Reimplemented in PartSet_WidgetMultiSelector, ModuleBase_WidgetSelector, and ModuleBase_WidgetPointInput.

◆ canAcceptFocus()

virtual bool ModuleBase_ModelWidget::canAcceptFocus ( ) const
inlinevirtualinherited

Defines if it is supported to set the value in this widget By default it returns true.

Reimplemented in ModuleBase_WidgetToolbox, ModuleBase_WidgetSwitch, ModuleBase_WidgetOptionalBox, ModuleBase_WidgetLabel, ModuleBase_WidgetConcealedObjects, ModuleBase_WidgetChoice, and ModuleBase_WidgetBoolValue.

◆ getError()

QString ModuleBase_ModelWidget::getError ( const bool  theValueStateChecked = true) const
virtualinherited

Returns the widget error, get it from the attribute validator and state of the widget If the feature is correct, it returns an empty value.

Parameters
theValueStateCheckedthe boolean flag if the state of the widget should be checked
Returns
string value

Reimplemented in ModuleBase_WidgetSelectionFilter.

◆ getHighlighted()

virtual void ModuleBase_ModelWidget::getHighlighted ( QList< std::shared_ptr< ModuleBase_ViewerPrs >> &  theValues)
inlinevirtualinherited

Returns values which should be highlighted when the whidget is active.

Parameters
theValuesa list of presentations

Reimplemented in ModuleBase_WidgetMultiSelector.

◆ widgetValidator()

ModuleBase_WidgetValidator* ModuleBase_ModelWidget::widgetValidator ( )
inlineinherited

Returns widget validator, by default it is NULL. To be created in a child if necessary.

◆ restoreValue()

bool ModuleBase_ModelWidget::restoreValue ( )
inherited

Restore value from attribute data to the widget's control.

Emits signals before and after store

Returns
True in success

◆ storeValue()

bool ModuleBase_ModelWidget::storeValue ( )
inherited

Saves the internal parameters to the given feature.

Emits signals before and after store

Returns
True in success

store value in an alternative attribute if possible(attribute has the same type)

◆ selectContent()

virtual void ModuleBase_ModelWidget::selectContent ( )
inlinevirtualinherited

Select the internal content if it can be selected. It is empty in the default realization.

Reimplemented in ModuleBase_WidgetIntValue, and ModuleBase_WidgetDoubleValue.

◆ activate()

void ModuleBase_ModelWidget::activate ( )
inherited

The method called when widget is activated.

◆ updateAfterDeactivation()

virtual void ModuleBase_ModelWidget::updateAfterDeactivation ( )
inlinevirtualinherited

Opportunity to do something after the active widget of the property panel changed.

Reimplemented in ModuleBase_WidgetMultiSelector.

◆ updateAfterActivation()

virtual void ModuleBase_ModelWidget::updateAfterActivation ( )
inlinevirtualinherited

Opportunity to do something after the active widget of the property panel changed.

Reimplemented in ModuleBase_WidgetMultiSelector.

◆ needToBeActivated()

virtual bool ModuleBase_ModelWidget::needToBeActivated ( )
inlinevirtualinherited

The method called if widget should be activated always.

Reimplemented in PartSet_WidgetSketchLabel.

◆ getControlAcceptingFocus()

QWidget * ModuleBase_ModelWidget::getControlAcceptingFocus ( const bool  isFirst)
inherited

Returns the first or the last control that can accept the focus.

Parameters
isFirstif true, the first controls is returned or the last one
Returns
a control from a list of controls

◆ eventFilter()

bool ModuleBase_ModelWidget::eventFilter ( QObject theObject,
QEvent theEvent 
)
virtualinherited

FocusIn events processing.

Reimplemented in CollectionPlugin_WidgetField, and PartSet_WidgetSketchLabel.

◆ enableFocusProcessing()

void ModuleBase_ModelWidget::enableFocusProcessing ( )
virtualinherited

Enables processing of focus event on all controls by the widget if this widget is not obligatory and set no-focus policy otherwise.

Reimplemented in PartSet_WidgetSketchLabel, and ModuleBase_PagedContainer.

◆ attributeID()

std::string ModuleBase_ModelWidget::attributeID ( ) const
inlineinherited

Returns the attribute name.

Returns
the string value

◆ feature()

FeaturePtr ModuleBase_ModelWidget::feature ( ) const
inlineinherited
Returns
Current feature

◆ context()

virtual std::string ModuleBase_ModelWidget::context ( ) const
inlinevirtualinherited
Returns
Context for translation

Reimplemented in ModuleBase_WidgetAction.

◆ setFeature()

void ModuleBase_ModelWidget::setFeature ( const FeaturePtr &  theFeature,
const bool  theToStoreValue = false,
const bool  isUpdateFlushed = true 
)
virtualinherited

Set feature which is processing by active operation.

Parameters
theFeaturea feature object
theToStoreValuea value about necessity to store the widget value to the feature
isUpdateFlusheda flag if update should be flushed on store value

it is possible to give this flag as parameter in storeValue/storeCustomValue after debug, it may be corrected

it is possible that the attribute is filled before the operation is started, e.g. by reentrant operation case some attributes are filled by values of feature of previous operation, we should not lost them here

Reimplemented in PartSet_BSplineWidget.

◆ setEditingMode()

virtual void ModuleBase_ModelWidget::setEditingMode ( bool  isEditing)
inlinevirtualinherited

Editing mode depends on mode of current operation. This value is defined by it.

Reimplemented in PartSet_WidgetSketchCreator.

◆ isEditingMode()

bool ModuleBase_ModelWidget::isEditingMode ( ) const
inlineinherited
Returns
Current Editing mode

◆ canProcessAction()

bool ModuleBase_ModelWidget::canProcessAction ( ModuleBase_ActionType  theActionType,
bool &  isActionEnabled 
)
virtualinherited

Returns true if the action can be processed.

By default it is empty and returns false.

Parameters
theActionTypean action type
isActionEnabledif true, the enable state of the action

Reimplemented in ModuleBase_WidgetMultiSelector.

◆ processAction()

bool ModuleBase_ModelWidget::processAction ( ModuleBase_ActionType  theActionType,
const ActionParamPtr &  theParam = ActionParamPtr() 
)
virtualinherited

Returns true if the event is processed. The default implementation is empty, returns false.

Reimplemented in ModuleBase_WidgetMultiSelector.

◆ actionsList()

virtual QList<ActionInfo> ModuleBase_ModelWidget::actionsList ( ModuleBase_ActionType  theActionType) const
inlinevirtualinherited

Returns list of accessible actions for Undo/Redo commands.

By default it returns empty list.

Parameters
theActionTypetype of action. It can be ActionUndo or ActionRedo.

Reimplemented in ModuleBase_WidgetMultiSelector.

◆ updateObject()

void ModuleBase_ModelWidget::updateObject ( ObjectPtr  theObj)
inherited

Sends Update and Redisplay for the given object.

Parameters
theObjis updating object

◆ translate()

QString ModuleBase_ModelWidget::translate ( const std::string &  theStr) const
virtualinherited

Translate passed string with widget context()

◆ emitFocusInWidget()

void ModuleBase_ModelWidget::emitFocusInWidget ( )
inlineinherited

Emit focus in widget to set this control as active in propety panel.

◆ findModelWidget()

ModuleBase_ModelWidget * ModuleBase_ModelWidget::findModelWidget ( ModuleBase_IPropertyPanel theProp,
QWidget theWidget 
)
staticinherited

Finds model widget parent of the given sub widget.

Parameters
theWidgeta candidate to be a child of the model widget
thePropa property panel instance
Returns
a model widget or NULL

◆ usesAttribute()

virtual bool ModuleBase_ModelWidget::usesAttribute ( ) const
inlinevirtualinherited

Returns True if the widget uses feature attribute.

If not then it means that the widget do not need attribute at all.

Reimplemented in ModuleBase_WidgetNameEdit.

◆ onFeatureAccepted()

virtual void ModuleBase_ModelWidget::onFeatureAccepted ( )
inlinevirtualinherited

It is called when user press Ok or OkPlus buttons in the parent property panel By default this slot does nothing.

Reimplemented in ModuleBase_WidgetSelectionFilter, ModuleBase_WidgetMultiSelector, ModuleBase_WidgetChoice, and ModuleBase_PagedContainer.

◆ isInformative()

virtual bool ModuleBase_ModelWidget::isInformative ( ) const
inlinevirtualinherited

Returns True in case if the widget contains useful information for inspection tool.

Reimplemented in PartSet_WidgetSketchCreator.

◆ showInformativePage()

virtual void ModuleBase_ModelWidget::showInformativePage ( )
inlinevirtualinherited

If widgets has several panels then this method has to show a page which contains information for current feature.

By default does nothing

Reimplemented in PartSet_WidgetSketchLabel.

◆ isModified()

virtual bool ModuleBase_ModelWidget::isModified ( ) const
inlinevirtualinherited

◆ canUseExternalParts()

bool ModuleBase_ModelWidget::canUseExternalParts ( ) const
inlineinherited

Returns true if the widget should have access to external parts.

◆ beforeValuesChanged

void ModuleBase_ModelWidget::beforeValuesChanged ( )
signalinherited

The signal about widget values are to be changed.

◆ valuesChanged

void ModuleBase_ModelWidget::valuesChanged ( )
signalinherited

The signal about widget values changed.

◆ valuesModified

void ModuleBase_ModelWidget::valuesModified ( )
signalinherited

The signal about widget values modified.

◆ afterValuesChanged

void ModuleBase_ModelWidget::afterValuesChanged ( )
signalinherited

The signal about widget values are to be changed.

◆ beforeValuesRestored

void ModuleBase_ModelWidget::beforeValuesRestored ( )
signalinherited

The signal about widget values are to be restored.

◆ afterValuesRestored

void ModuleBase_ModelWidget::afterValuesRestored ( )
signalinherited

The signal about widget values are to be restored.

◆ keyReleased

void ModuleBase_ModelWidget::keyReleased ( QObject theObject,
QKeyEvent *  theEvent 
)
signalinherited

The signal about key release on the control, that corresponds to the attribute.

Parameters
theObjecta sender of the event
theEventkey release event

◆ enterClicked

void ModuleBase_ModelWidget::enterClicked ( QObject theObject)
signalinherited

The signal is emitted if the enter is clicked in the control of the widget.

Parameters
theObjecta sender of the event

◆ focusInWidget

void ModuleBase_ModelWidget::focusInWidget ( ModuleBase_ModelWidget theWidget)
signalinherited

The signal about the widget is get focus.

Parameters
theWidgetthe model base widget

◆ focusOutWidget

void ModuleBase_ModelWidget::focusOutWidget ( ModuleBase_ModelWidget theWidget)
signalinherited

The signal about the widget is lost focus.

Parameters
theWidgetthe model base widget

◆ valueStateChanged

void ModuleBase_ModelWidget::valueStateChanged ( int  theState)
signalinherited

The signal about value state modification.

◆ objectUpdated

void ModuleBase_ModelWidget::objectUpdated ( )
signalinherited

The signal is emitted after flush of updates singal for the widget.

◆ setDefaultValue()

void ModuleBase_ModelWidget::setDefaultValue ( const std::string &  theValue)
protectedinherited

Sets default value of widget.

Normally, widget should fetch this value from the xml. However, some widgets derived widgets could define it

◆ setAttributeID()

void ModuleBase_ModelWidget::setAttributeID ( const std::string &  theAttribute)
inlineprotectedinherited

Set the attribute name.

Parameters
theAttributethe string value with attribute name

◆ setValueState()

ModuleBase_ModelWidget::ValueState ModuleBase_ModelWidget::setValueState ( const ValueState theState)
protectedinherited

Sets the current value state.

If the value is changed, the signal is emitted If the current value state is Blocked, this method do nothing

Parameters
theStatea new state
Returns
the previous value state

◆ blockValueState()

bool ModuleBase_ModelWidget::blockValueState ( const bool  theBlocked)
protectedinherited

Blocks the value state change.

Parameters
theBlockeda block state
Returns
the previous value

◆ onWidgetValuesChanged

void ModuleBase_ModelWidget::onWidgetValuesChanged ( )
protectedslotinherited

Processing of values changed in model widget by store the current value to the feature.

◆ onWidgetValuesModified

void ModuleBase_ModelWidget::onWidgetValuesModified ( )
protectedslotinherited

Changes widget state.

◆ mousePressed()

virtual void PartSet_MouseProcessor::mousePressed ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
inlinevirtualinherited

Processing the mouse press event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

◆ mouseDoubleClick()

virtual void PartSet_MouseProcessor::mouseDoubleClick ( ModuleBase_IViewWindow theWindow,
QMouseEvent *  theEvent 
)
inlinevirtualinherited

Processing the mouse double click event in the viewer.

Parameters
theWindowa view window
theEventa mouse event

Field Documentation

◆ myWorkshop

ModuleBase_IWorkshop* PartSet_WidgetPoint2D::myWorkshop
protectedinherited

workshop

◆ myWidgetValidator

ModuleBase_WidgetValidator* ModuleBase_ModelWidget::myWidgetValidator
protectedinherited

own validator, by default it is zero

◆ myAttributeID

std::string ModuleBase_ModelWidget::myAttributeID
protectedinherited

The attribute name of the model feature.

◆ myFeature

FeaturePtr ModuleBase_ModelWidget::myFeature
protectedinherited

A feature which is processing by active operation.

◆ myFeatureId

std::string ModuleBase_ModelWidget::myFeatureId
protectedinherited

A feature ID.

◆ myIsObligatory

bool ModuleBase_ModelWidget::myIsObligatory
protectedinherited

Flag which shows whether current widget is obligatory The non-obligatory widgets should not accept the focus in the property panel.

◆ myIsValueEnabled

EnableState ModuleBase_ModelWidget::myIsValueEnabled
protectedinherited

Flag about value of the control is enabled (can be modified)

◆ myState

ValueState ModuleBase_ModelWidget::myState
protectedinherited

The widget value state.