|
SHAPER
9.15.0
|
A class for management of sketch operations At the time of the sketcher operation active, only the sketch sub-feature results are displayed in the viewer. More...

Data Structures | |
| struct | SelectionInfo |
| Struct to define selection model information to store/restore selection. More... | |
Public Types | |
| enum | SelectionType { ST_HighlightType , ST_SelectType , ST_SelectAndHighlightType } |
| Enumeration for selection mode used. More... | |
| typedef QMap< FeaturePtr, SelectionInfo > | FeatureToSelectionMap |
Public Slots | |
| void | onPlaneSelected (const std::shared_ptr< GeomAPI_Pln > &thePln) |
| Process sketch plane selected event. More... | |
| void | onShowPoints (bool toShow) |
| The slot is called when user checks "Show free points" button. More... | |
| void | onEditValues () |
| void | onUpdateConstraintsList () |
| void | onDeactivate (bool isNeedDeactivate, std::vector< FeaturePtr > theFeatures) |
Public Member Functions | |
| PartSet_SketcherMgr (PartSet_Module *theModule) | |
| Constructor. More... | |
| bool | isNestedSketchOperation (ModuleBase_Operation *theOperation) const |
| Returns true if the operation feature belongs to list of granted features of Sketch operation. More... | |
| bool | isNestedSketchFeature (const QString &theFeatureKind) const |
| Returns true if the feature kind belongs to list of granted features of Sketch operation. More... | |
| bool | isNestedCreateOperation (ModuleBase_Operation *theOperation, const CompositeFeaturePtr &) const |
| Returns true if the operation is a create and nested sketch operationn. More... | |
| bool | isNestedEditOperation (ModuleBase_Operation *theOperation, const CompositeFeaturePtr &) const |
| Returns true if the operation is an edit nested feature one. More... | |
| bool | isMouseOverWindow () |
| Returns true if a mouse cursor is over viewer window. More... | |
| CompositeFeaturePtr | activeSketch () const |
| Returns current Sketch feature/ Returns NULL if there is no launched sketch operation. More... | |
| PartSet_PreviewSketchPlane * | previewSketchPlane () const |
| Returns help class to visualize sketcher plane. More... | |
| void | startSketch (ModuleBase_Operation *) |
| Starts sketch operation. More... | |
| void | stopSketch (ModuleBase_Operation *) |
| Stops sketch operation. More... | |
| void | startNestedSketch (ModuleBase_Operation *theOperation) |
| Starts sketch operation, connects to the operation property panel. More... | |
| void | stopNestedSketch (ModuleBase_Operation *theOperation) |
| Stop sketch operation, disconnects from the operation property panel. More... | |
| void | commitNestedSketch (ModuleBase_Operation *theOperation) |
| Visualizes the operation feature if it is a creation nested feature operation. More... | |
| bool | sketchSelectionFilter (const ModuleBase_SelectionFilterType theFilterType) |
| Returns true if the filter is created by the sketch manager. More... | |
| void | registerSelectionFilter (const ModuleBase_SelectionFilterType theFilterType, const Handle &&theFilter) |
| Append selection filter into the module and type of the filter in internal container. More... | |
| bool | operationActivatedByPreselection () |
| Commit the operation if it is possible. More... | |
| bool | canUndo () const |
| Returns True if there are available Undos and the sketch manager allows undo. More... | |
| bool | canRedo () const |
| Returns True if there are available Redos and the sketch manager allows redo. More... | |
| bool | canEraseObject (const ObjectPtr &theObject) const |
| Returns False only if the sketch creating feature can not be visualized. More... | |
| bool | canDisplayObject (const ObjectPtr &theObject) const |
| Returns whether the object can be displayed at the bounds of the active operation. More... | |
| bool | canDisplayConstraint (const FeaturePtr &theObject, const PartSet_Tools::ConstraintVisibleState &theState, bool &isProcessed) const |
| Returns whether the constraint object can be displayed. More... | |
| bool | canDisplayCurrentCreatedFeature () const |
| Check the given objects either there are some results of the current sketch. More... | |
| bool | canChangeCursor (ModuleBase_Operation *theOperation) const |
| Returns true if the current operation is nested creation or internal reentrant edit. More... | |
| const QMap< PartSet_Tools::ConstraintVisibleState, bool > & | showConstraintStates () |
| Returns state of constraints showing flag. More... | |
| bool | isObjectOfSketch (const ObjectPtr &theObject) const |
| Returns true if the object is a current sketch sub feature of a result of the feature. More... | |
| void | storeSelection (const SelectionType theType, FeatureToSelectionMap &theCurrentSelection) |
| Saves the current selection in the viewer into an internal container It obtains the selected attributes. More... | |
| void | restoreSelection (FeatureToSelectionMap &theCurrentSelection) |
| Restores previously saved selection state. More... | |
| bool | sketchSolverError () |
| Return error state of the sketch feature, true if the error has happened. More... | |
| QString | getFeatureError (const FeaturePtr &theFeature) |
| Returns the feature error if the current state of the feature in the sketch is not correct If the feature is correct, it returns an empty value Incorrect states: the feature is sketch, the solver error value The feature value is reset, this is the flag of sketch mgr. More... | |
| void | clearClickedFlags () |
| It nullify internal flags concerned to clicked mouse event. More... | |
| HandleccreatePresentation (const ObjectPtr &theResult) | |
| Create specific for the module presentation. More... | |
| void | connectToPropertyPanel (ModuleBase_ModelWidget *theWidget, const bool isToConnect) |
| Connects or disconnects to the value changed signal of the property panel widgets. More... | |
| void | widgetStateChanged (int thePreviousState) |
| Visualize the operation feature if the previous state is modified value in property panel. More... | |
| void | customizeSketchPresentation (const ObjectPtr &theObject, const AISObjectPtr &thePrs) const |
| If the current operation is a dimension one, the style of dimension visualization is send for the current object. More... | |
| void | updateBySketchParameters (const PartSet_Tools::ConstraintVisibleState &theType, bool theState) |
| Update sketch presentations according to the the state. More... | |
| bool | isShowFreePointsShown () const |
| PartSet_Module * | module () const |
| virtual void | processEvent (const std::shared_ptr< Events_Message > &theMessage) |
| Implementation of Event Listener method. More... | |
| bool | isDragModeCreation () const |
| Returns true if current mode of objects creation is by drag mouse. More... | |
| XGUI_SketchConstraintsBrowser * | constraintsBrowser () |
| virtual EVENTS_EXPORT bool | groupMessages () |
| Listener that needs mostly grouped messages received returns true in this method. More... | |
Static Public Member Functions | |
| static bool | isSketchOperation (ModuleBase_Operation *theOperation) |
| Returns true if the operation is the sketch. More... | |
| static bool | isEntity (const std::string &theId) |
| Returns whether the current operation is a sketch entity - line, point, arc or circle. More... | |
| static bool | isExternalFeature (const FeaturePtr &theFeature) |
| Returns whether the feature has external attribute filled with 'true' value. More... | |
| static bool | isDistanceOperation (ModuleBase_Operation *theOperation) |
| Returns whether the current operation is a sketch distance - length, distance or radius. More... | |
| static bool | isDistanceKind (std::string &theKind) |
| Returns whether the feature kind is a sketch distance - length, distance or radius. More... | |
| static const QStringList & | replicationsIdList () |
| Returns list of strings which contains id's of sketch replication operations. More... | |
| static const QStringList & | constraintsIdList () |
| Returns list of strings which contains id's of constraints operations. More... | |
| static void | sketchSelectionModes (const CompositeFeaturePtr &theSketch, QIntList &theModes) |
| Returns a list of modes, where the AIS objects should be activated. More... | |
Protected Member Functions | |
| void | groupWhileFlush (const std::shared_ptr< Events_Message > &theMessage) |
| Allows to group messages while they are flushed (for flush for groupMessages=true listeners) More... | |
| EVENTS_EXPORT void | flushGrouped (const Events_ID &theID) |
| Sends myGroups on flush finish. More... | |
Friends | |
| class | PartSet_PreviewSketchPlane |
A class for management of sketch operations At the time of the sketcher operation active, only the sketch sub-feature results are displayed in the viewer.
After the sketch create/edit operation is finished, the sub-feature are hidden, the sketch feature result is displayed
| PartSet_SketcherMgr::PartSet_SketcherMgr | ( | PartSet_Module * | theModule | ) |
Constructor.
| theModule | a pointer to PartSet module |
|
static |
Returns true if the operation is the sketch.
| theOperation | an operation |
| bool PartSet_SketcherMgr::isNestedSketchOperation | ( | ModuleBase_Operation * | theOperation | ) | const |
Returns true if the operation feature belongs to list of granted features of Sketch operation.
An operation of a sketch should be started before.
| theOperation | an operation |
| bool PartSet_SketcherMgr::isNestedSketchFeature | ( | const QString & | theFeatureKind | ) | const |
Returns true if the feature kind belongs to list of granted features of Sketch operation.
An operation of a sketch should be started before.
| theOperation | an operation |
| bool PartSet_SketcherMgr::isNestedCreateOperation | ( | ModuleBase_Operation * | theOperation, |
| const CompositeFeaturePtr & | theSketch | ||
| ) | const |
Returns true if the operation is a create and nested sketch operationn.
| theOperation | a checked operation |
| theSketch | a sketch feature |
| bool PartSet_SketcherMgr::isNestedEditOperation | ( | ModuleBase_Operation * | theOperation, |
| const CompositeFeaturePtr & | theSketch | ||
| ) | const |
Returns true if the operation is an edit nested feature one.
| theOperation | a checked operation |
|
static |
Returns whether the current operation is a sketch entity - line, point, arc or circle.
| theId | is an id of object |
|
static |
Returns whether the feature has external attribute filled with 'true' value.
| theFeature | a feature object |
|
static |
Returns whether the current operation is a sketch distance - length, distance or radius.
| theOperation | the operation |
|
static |
Returns whether the feature kind is a sketch distance - length, distance or radius.
| theKind | the feature kind |
|
inline |
Returns true if a mouse cursor is over viewer window.
|
inline |
Returns current Sketch feature/ Returns NULL if there is no launched sketch operation.
|
inline |
Returns help class to visualize sketcher plane.
| void PartSet_SketcherMgr::startSketch | ( | ModuleBase_Operation * | theOperation | ) |
Starts sketch operation.
| void PartSet_SketcherMgr::stopSketch | ( | ModuleBase_Operation * | theOperation | ) |
Stops sketch operation.
| void PartSet_SketcherMgr::startNestedSketch | ( | ModuleBase_Operation * | theOperation | ) |
Starts sketch operation, connects to the operation property panel.
| theOperation | a committed operation |
| void PartSet_SketcherMgr::stopNestedSketch | ( | ModuleBase_Operation * | theOperation | ) |
Stop sketch operation, disconnects from the operation property panel.
| theOperation | a stopped operation |
improvement to deselect automatically all eventual selected objects, when
| void PartSet_SketcherMgr::commitNestedSketch | ( | ModuleBase_Operation * | theOperation | ) |
Visualizes the operation feature if it is a creation nested feature operation.
| theOperation | a committed operation |
| bool PartSet_SketcherMgr::sketchSelectionFilter | ( | const ModuleBase_SelectionFilterType | theFilterType | ) |
Returns true if the filter is created by the sketch manager.
| theFilterType | a checked type |
| void PartSet_SketcherMgr::registerSelectionFilter | ( | const ModuleBase_SelectionFilterType | theFilterType, |
| const Handle && | theFilter | ||
| ) |
Append selection filter into the module and type of the filter in internal container.
| theFilterType | selection filter type |
| theFilter | added filter |
| bool PartSet_SketcherMgr::operationActivatedByPreselection | ( | ) |
Commit the operation if it is possible.
If the operation is dimension constraint, it gives widget editor to input dimension value
Commit sketcher operations automatically distance operation are able to show popup editor to modify the distance value after entering the value, the operation should be committed/aborted(by Esc key)
| bool PartSet_SketcherMgr::canUndo | ( | ) | const |
Returns True if there are available Undos and the sketch manager allows undo.
| bool PartSet_SketcherMgr::canRedo | ( | ) | const |
Returns True if there are available Redos and the sketch manager allows redo.
| bool PartSet_SketcherMgr::canEraseObject | ( | const ObjectPtr & | theObject | ) | const |
Returns False only if the sketch creating feature can not be visualized.
| theObject | a model object |
| bool PartSet_SketcherMgr::canDisplayObject | ( | const ObjectPtr & | theObject | ) | const |
Returns whether the object can be displayed at the bounds of the active operation.
Display only current operation results for usual operation and ask the sketcher manager if it is a sketch operation
| theObject | a model object |
some sketch entities should be never shown, e.g. projection feature
| bool PartSet_SketcherMgr::canDisplayConstraint | ( | const FeaturePtr & | theObject, |
| const PartSet_Tools::ConstraintVisibleState & | theState, | ||
| bool & | isProcessed | ||
| ) | const |
Returns whether the constraint object can be displayed.
It depends on the sketch check box states
| theObject | a model object |
| theState | the constraint visible state state to be checked |
| isProcessed | an output parameter if it is processed |
| bool PartSet_SketcherMgr::canDisplayCurrentCreatedFeature | ( | ) | const |
Check the given objects either there are some results of the current sketch.
If so, it suggests to delete them as there are no functionality to show back hidden sketch objects
| theObjects | a list of hidden objects Returns true if the mouse is over viewer or property panel value is changed |
| bool PartSet_SketcherMgr::canChangeCursor | ( | ModuleBase_Operation * | theOperation | ) | const |
Returns true if the current operation is nested creation or internal reentrant edit.
| theOperation | an operation |
| const QMap< PartSet_Tools::ConstraintVisibleState, bool > & PartSet_SketcherMgr::showConstraintStates | ( | ) |
Returns state of constraints showing flag.
| bool PartSet_SketcherMgr::isObjectOfSketch | ( | const ObjectPtr & | theObject | ) | const |
Returns true if the object is a current sketch sub feature of a result of the feature.
| theObject | an object |
| void PartSet_SketcherMgr::storeSelection | ( | const SelectionType | theType, |
| PartSet_SketcherMgr::FeatureToSelectionMap & | theCurrentSelection | ||
| ) |
Saves the current selection in the viewer into an internal container It obtains the selected attributes.
The highlighted objects can be processes as the selected ones
| theHighlightedOnly | a boolean flag |
| theCurrentSelection | a container filled by the current selection |
| void PartSet_SketcherMgr::restoreSelection | ( | PartSet_SketcherMgr::FeatureToSelectionMap & | theCurrentSelection | ) |
Restores previously saved selection state.
| theCurrentSelection | a container filled by the current selection |
| bool PartSet_SketcherMgr::sketchSolverError | ( | ) |
Return error state of the sketch feature, true if the error has happened.
| QString PartSet_SketcherMgr::getFeatureError | ( | const FeaturePtr & | theFeature | ) |
Returns the feature error if the current state of the feature in the sketch is not correct If the feature is correct, it returns an empty value Incorrect states: the feature is sketch, the solver error value The feature value is reset, this is the flag of sketch mgr.
| void PartSet_SketcherMgr::clearClickedFlags | ( | ) |
It nullify internal flags concerned to clicked mouse event.
|
static |
Returns list of strings which contains id's of sketch replication operations.
|
static |
Returns list of strings which contains id's of constraints operations.
|
static |
Returns a list of modes, where the AIS objects should be activated.
| theSketch | a sketch object, modes are empty if sketch plane is not defined yet |
| theModes | a list of modes |
| PartSet_SketcherMgr::HandleccreatePresentation | ( | const ObjectPtr & | theResult | ) |
Create specific for the module presentation.
| theResult | an object for presentation |
| void PartSet_SketcherMgr::connectToPropertyPanel | ( | ModuleBase_ModelWidget * | theWidget, |
| const bool | isToConnect | ||
| ) |
Connects or disconnects to the value changed signal of the property panel widgets.
| theWidget | a property control widget |
| isToConnect | a boolean value whether connect or disconnect |
| void PartSet_SketcherMgr::widgetStateChanged | ( | int | thePreviousState | ) |
Visualize the operation feature if the previous state is modified value in property panel.
| thePreviousState | the previous widget value state |
| void PartSet_SketcherMgr::customizeSketchPresentation | ( | const ObjectPtr & | theObject, |
| const AISObjectPtr & | thePrs | ||
| ) | const |
If the current operation is a dimension one, the style of dimension visualization is send for the current object.
| theObject | an object to be customized |
| void PartSet_SketcherMgr::updateBySketchParameters | ( | const PartSet_Tools::ConstraintVisibleState & | theType, |
| bool | theState | ||
| ) |
Update sketch presentations according to the the state.
| theType | a type of sketch visualization style |
| theState | a boolean state |
call all sketch features redisplay, the expression state will be corrected in customize of distance presentation
|
virtual |
Implementation of Event Listener method.
| [in] | theMessage | the data of the event |
Implements Events_Listener.
| bool PartSet_SketcherMgr::isDragModeCreation | ( | ) | const |
Returns true if current mode of objects creation is by drag mouse.
|
slot |
Process sketch plane selected event.
|
slot |
The slot is called when user checks "Show free points" button.
| toShow | a state of the check box |
|
inlinevirtualinherited |
Listener that needs mostly grouped messages received returns true in this method.
In this case during the message is flushed, all the new messages are grouped, not sended immideately and then sent in the end of flush.
Reimplemented in SketchSolver_Manager, and SketchPlugin_OverConstraintsResolver.
|
protectedinherited |
Allows to group messages while they are flushed (for flush for groupMessages=true listeners)
|
protectedinherited |
Sends myGroups on flush finish.