========================= Context (hwx.inspire.gui) ========================= A context is a GUI action that supports user interaction. For example it can be used to create the workflow the lets a user create a fastener by selecting two parts. The context is connected to the GUI by specifying the context class on the parameter of SpriteAction. When the SpriteAction is toggled on, the Context is created (if needed) and activated. Activate/Deactivate: - onFirstActivate - onActivate - onDeactivate - onExitAccept - getActiveContext - isactive Picking: get objects/features to create new objects - setPickable - onObjectsPicked - onObjectPicked - onPickListChanged - getPickedObjects - addPick - removePick - clearPickList - onPicking - isolatePicked Selecting: select objects for editing, popup editor, context menu, ... - setSelectable - selectObjects - deselectObjects - clearSelectList - getSelectedObjects - onSelecting - onObjectsSelected - onSelectionChanged Pick/Select processing: - showPickedHovered Guide the user - showObjectToolTip - showHelpMessage - showHelpTopic - showStatusMessage - popupObjectEditor Object utilities: - noteState - persistedAttributes Cursors: set cursor tell the user the 'state' of the context - setMainCursor - setCursor - registerCursor - waitCursor Messaging: show text message to tell the user the 'state' of the context - setHelpTopic - showHelpMessage - clearHelpMessage - showStatusMessage - clearStatusMessage Usage Tracking: send the usage message to the license server - reportUsage - reportContextUsage Manipulators: 3D graphical object editors - showManipulators - hideManipulators ModelListener methods - activateModelListener - deactivateModelListener - onObjectCreated - onObjectDeleted - onObjectModified - onNewProject Lower level draw utilities to change how objects are rendered - drawHovered - drawHighlighted - drawUnhighlighted - isHighlighed - setObjectColor - makeModelTransparent - setObjectTransparency - setVisualizationStyle Graphics view methods - redrawGraphics - getViewMatrix - fitView Optimization methods - disableColorPicking Lower level methods to respond to mouse/key signals - onKeyPress - onKeyRelease - onMousePress - onMouseRelease - onMouseMove - onMouseWheel KeyModifiers - ctrlDown - altDown - shiftDown ---------- Properties ---------- +----------------------+----------------------+----------------------+ | altDown_ | ctrlDown_ | isactive_ | +----------------------+----------------------+----------------------+ | metaDown_ | modelIsTransparent_ | persistedAttributes_ | +----------------------+----------------------+----------------------+ | shiftDown_ | usageMessage_ | | +----------------------+----------------------+----------------------+ -------------- Public Methods -------------- +---------------------------------------------------------------------------------------------------------------------------------------------+ | classmethod getActiveContext_ (cls) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | classmethod popActive_ (cls) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | classmethod popAll_ (cls) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | classmethod push_ (cls, name=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | classmethod reportContextUsage_ (cls, message, contextName='') | +---------------------------------------------------------------------------------------------------------------------------------------------+ | Destroy_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | addEventTool_ (self, tool, before=False) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | addManipulator_ (self, manip) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | addPick_ (self, obj, makePickable=True) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | canIsolate_ (self, objsToIsolate=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | clearAllLists_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | clearHelpMessage_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | clearPickList_ (self, makeUnpickable=False) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | clearSelectList_ (self, objects=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | clearStatusMessage_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | deselectObjects_ (self, objects=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | disableColorPicking_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | drawHighlighted_ (self, obj=None, highlight=True) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | drawHovered_ (self, obj=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | drawUnhighlighted_ (self, obj=None, highlight=False) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | filterSelection_ (self, objects) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | fitView_ (self, obj=None, padded=True) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | getIsolatedPick_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | getObjectsForIsolate_ (self, objsToIsolate=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | getPickedObjects_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | getSelectedObjects_ (self, beforeChange=False, active=True, **kwds) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | getViewMatrix_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | hideManipulators_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | initializeCounter_ (self, counterActionName) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | isAllowedToExit_ (self, exitControl) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | isHighlighted_ (self, obj, highlighted=True) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | isPickable_ (self, obj, filter=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | isolatePicked_ (self, forward=True, pickList=None, padded=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | makeModelTransparent_ (self, transparent=True, filter=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onAboutToExit_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onAboutToSave_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onActivate_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onDeactivate_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onExitAccept_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onFirstActivate_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onKeyPress_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onKeyRelease_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onMouseDoubleClick_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onMouseMove_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onMousePress_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onMouseRelease_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onMouseWheel_ (self, event) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onNewProject_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectCreated_ (self, obj) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectDeleted_ (self, obj) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectModified_ (self, obj, attr) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectPicked_ (self, obj, why) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectSelected_ (self, obj) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectsPicked_ (self, objects, why) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onObjectsSelected_ (self, objects) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onPickListChanged_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onPicking_ (self, objects) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onSelecting_ (self, objects) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | onSelectionChanged_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | pop_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | popupObjectEditor_ (self, obj) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | processPickListEvent_ (self, objects) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | redrawGraphics_ (self, now=False) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | registerCursor_ (self, name, icon, mask='', x=1, y=1) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | removePick_ (self, obj, makeUnpickable=False) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | reportUsage_ (self, message) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | selectObjects_ (self, objects=None, clear=True) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setCursor_ (self, name, ignored=True) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setHelpTopic_ (self, helpTopic) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setMainCursor_ (self, icon=None, mask=None, x=1, y=1) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setObjectColor_ (self, obj, color) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setObjectTransparency_ (self, obj=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setPickable_ (self, pickable=None, ifvisible=False, style=None, **kwds) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setSelectable_ (self, selectable=None, ifvisible=True, style=None, **kwds) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | setVisualizationStyle_ (self, style) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | showHelpMessage_ (self, message, details=None, helpTopic=None, movie=None, movieTitle='', buttons=(), keys=(), width=None, relativeTo=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | showManipulators_ (self, obj) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | showObjectToolTip_ (self, obj=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | showPickedHovered_ (self, pickedList, cursor=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | showStatusMessage_ (self, msg, ms=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | unsetCursor_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | updateCounter_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------------+ | waitCursor_ (self, message=None) | +---------------------------------------------------------------------------------------------------------------------------------------------+ ---------------- Property Details ---------------- .. _altDown: .. method:: altDown Returns True if Alt key is pressed, False otherwise. .. _ctrlDown: .. method:: ctrlDown Returns True if Control key is pressed, False otherwise. .. _isactive: .. method:: isactive Returns True if this is the current active context, False otherwise. .. _metaDown: .. method:: metaDown Returns True if Meta key is pressed, False otherwise. .. _modelIsTransparent: .. method:: modelIsTransparent Returns True if the model is transparent, False otherwise. .. _persistedAttributes: .. method:: persistedAttributes Return values from the popup editor which are used to create objects When a user creates an object, it is selected, the popup editor is displayed. We want to use the values he changed in editor when the next object is created. .. _shiftDown: .. method:: shiftDown Returns True if Shift key is pressed, False otherwise. .. _usageMessage: .. method:: usageMessage Returns and ses the usage message to be reported when the context gets activated. -------------- Method Details -------------- .. _getActiveContext: .. classmethod:: getActiveContext(cls) Returns the current active context. .. _popActive: .. classmethod:: popActive(cls) Removes active context. .. _popAll: .. classmethod:: popAll(cls) Pops all contexts to the idle context. .. _push: .. classmethod:: push(cls, name=None) Pushs context onto context stack, activates the context. :param name: The name of context to push. Defaults to calling context. :type name: str :returns: The active context. :rtype: Context .. _reportContextUsage: .. classmethod:: reportContextUsage(cls, message, contextName='') Reports the usage message to the context. :param message: The message to be reported. :type message: str :param contextName: The context to send the message to. :type contextName: str .. _Destroy: .. method:: Destroy(self) Destroys this context. .. _addEventTool: .. method:: addEventTool(self, tool, before=False) Add event tool to the context. :param tool: The tool to be added to context. :type tool: EventTool :param before: Determines whether to add the tool in the beginning of events list. :type before: bool .. _addManipulator: .. method:: addManipulator(self, manip) Add Manipulator to this context. :param manip: Manipulator to be added. :type manip: Manipulator .. _addPick: .. method:: addPick(self, obj, makePickable=True) Add the specified object to the PickedList. :param obj: The object to be added to the PickedList. :type obj: Union[Named, Feature, Hole] :param makePickable: Determines whether the object is pickable. :type makePickable: bool .. _canIsolate: .. method:: canIsolate(self, objsToIsolate=None) Determines if the objects can be isolated. :param objsToIsolate: Valid choices are - "selectable" - "picked" - "pickable" :type objsToIsolate: str, optional :returns: True if the objects can be isolated, False otherwise. :rtype: bool .. _clearAllLists: .. method:: clearAllLists(self) Clears the PickedList and select list. .. _clearHelpMessage: .. method:: clearHelpMessage(self) Undisplays the help message. .. _clearPickList: .. method:: clearPickList(self, makeUnpickable=False) Removes all picked objects from the PickedList. :param makeUnPickable: Determines whether the object is unpickable. :type makeUnPickable: bool .. _clearSelectList: .. method:: clearSelectList(self, objects=None) Deselects all the selected objects. :param objects: List of objects to be deselected. :type objects: list[Union[Named, Feature, Hole]] .. _clearStatusMessage: .. method:: clearStatusMessage(self) Removes the message from the status bar if any. .. _deselectObjects: .. method:: deselectObjects(self, objects=None) Deselects the specified objects from the selectList. :param objects: List of objects to be deselected. :type objects: list[Union[Named, Feature, Hole]] .. _disableColorPicking: .. method:: disableColorPicking(self) Disables color based picking while in this context. Color based picking is the default for picking objects in the graphics view. It is faster than non-color picking, but it can slow down redrawing of the graphics. You might want to disable it for contexts that require rapid redraws, like animation. .. _drawHighlighted: .. method:: drawHighlighted(self, obj=None, highlight=True) Renders objects highlighted to show the user objects of interest. :param obj: The objects to be highlighted. :type obj: list[Union[Named, Feature, Hole]] :param highlight: Determines whether to highlight the objects. :type highlight: bool .. _drawHovered: .. method:: drawHovered(self, obj=None) Draws the object in hover (prehighlight) mode. It 'unhovers' the previous 'hovered' from this call. :param obj: The object to be hovered. Defaults to None, and unhovers all objects. :type obj: Union[Named, Feature, Hole] .. _drawUnhighlighted: .. method:: drawUnhighlighted(self, obj=None, highlight=False) Render objects highlighted to show the user objects of interest. :param obj: The objects to be highlighted. :type obj: list[Union[Named, Feature, Hole]] :param highlight: Determines whether to highlight the objects. :type highlight: bool .. _filterSelection: .. method:: filterSelection(self, objects) Overload this method to filter selectable objects when selecting from the browser or tables. :param objects: The list of objects to process events. :type objects: PickedList :returns: False to allow other listeners to process the event. True to block. :rtype: bool .. _fitView: .. method:: fitView(self, obj=None, padded=True) Fits view to the specified objects. :param obj: Object(s) to fit the view to. :type obj: list[Union[Named, Feature, Hole]] :param padded: The spacing around objects. True means 4.0 for Features and 1.5 for Objects. False means 1. :type padded: bool, float .. _getIsolatedPick: .. method:: getIsolatedPick(self) Returns the isolated object(s). .. _getObjectsForIsolate: .. method:: getObjectsForIsolate(self, objsToIsolate=None) Returns a list of objects that can be isolated. :param objsToIsolate: Valid choices are - "selectable" - "picked" - "pickable" :type objsToIsolate: str, optional :returns: The objects that can be isolated. :rtype: PickList .. _getPickedObjects: .. method:: getPickedObjects(self) Returns an ObjectList with the picked objects. .. _getSelectedObjects: .. method:: getSelectedObjects(self, beforeChange=False, active=True, **kwds) Returns an ObjectList with the selected objects. :param beforeChange: Determines whether to just return the current selected objects. :type beforeChange: bool, optional :param active: Determines whether to include only active objects. :type active: bool, optional :param \*\*kwds: Keyword arguments for filtering with isa. .. _getViewMatrix: .. method:: getViewMatrix(self) Returns a Matrix44 to convert from world to view coordinates. .. _hideManipulators: .. method:: hideManipulators(self) Deactivates all manipulators in this context. .. _initializeCounter: .. method:: initializeCounter(self, counterActionName) Gets the SpriteCounterAction by this name and automatically manages it. :param counterActionName: The name of the SpriteCounterAction. :type counterActionName: str .. _isAllowedToExit: .. method:: isAllowedToExit(self, exitControl) Called when the user RightMouse clicks or presses escape. :param exitControl: Valid choices are: - self.RMB_RELEASE - self.ESC_KEY - self.F1_KEY :type exitControl: int :returns: [description] :rtype: [type] .. _isHighlighted: .. method:: isHighlighted(self, obj, highlighted=True) Checks if the specified object is drawn highlighted. :param obj: The objects to be checked. :type obj: list[Union[Named, Feature, Hole]] :param highlighted: if True returns True if all object are highlighted. If False return Trues if any of the objects is highlighted. :type highlighted: bool :returns: True if one or all object are highlighted, False otherwise. :rtype: bool .. _isPickable: .. method:: isPickable(self, obj, filter=None) Checks if an object is pickable via the PickList or SelectList. :param obj: The object to be checked. :type obj: Union[Named, Feature, Hole] :param filter: The funtion used to filter objects. :type filter: function :returns: True if the object is pickable, False otherwise. :rtype: bool .. _isolatePicked: .. method:: isolatePicked(self, forward=True, pickList=None, padded=None) Isolate the next/prev object from the pickList. Tours the pickList - or the selectable objects, if something is selected. And zooms in on each of the items in the pickList, making that item the only one the user can pick. :param forward: Determines whether to turn off isolation. None turns off isolation. :type forward: bool, optional :param pickList: A PickedList that contains the single or box picked objects. :type pickList: PickedList, optional :param padded: The spacing around objects. True means 4.0 for Features, 1.5 for Objects. False means 1. :type padded: Union[bool, float], optional .. _makeModelTransparent: .. method:: makeModelTransparent(self, transparent=True, filter=None) Makes pickable/selectable objects stand out by making the rest of the objects transparent. :param transparent: Determines whether to make other objects transparent. :type transparent: bool :param filter: The function used to filter objects. :type filter: function .. _onAboutToExit: .. method:: onAboutToExit(self) Overload if you need to stop processing something when the user tries to exit the application during a long loop, like doing an analysis. .. _onAboutToSave: .. method:: onAboutToSave(self) Overload to do something right before Inspire saves an stmod. If you have a GeneralObject sitting around storing things you don't want saved in to the stmod, for example. .. _onActivate: .. method:: onActivate(self) Overload to initialize your context each time it is activated. .. _onDeactivate: .. method:: onDeactivate(self) Overload to cleanup your context when it is being deactivated. .. _onExitAccept: .. method:: onExitAccept(self) Overload to execute code on right mouse button exit. Return True to prevent the context from being deactivated. .. _onFirstActivate: .. method:: onFirstActivate(self) Overload to initialize your context the first time it is activated. .. _onKeyPress: .. method:: onKeyPress(self, event) Overload this method to define behaviour when a key is pressed. :param event: The event being processed. :type event: Event .. _onKeyRelease: .. method:: onKeyRelease(self, event) Overload this method to define behaviour when a key is released. :param event: The event being processed. :type event: Event .. _onMouseDoubleClick: .. method:: onMouseDoubleClick(self, event) Overload this method to define behaviour on mouse double click. :param event: The event being processed. :type event: Event .. _onMouseMove: .. method:: onMouseMove(self, event) Overload this method to define behaviour when mouse moves. :param event: The event being processed. :type event: Event .. _onMousePress: .. method:: onMousePress(self, event) Overload this method to define behaviour when mouse is pressed. :param event: The event being processed. :type event: Event .. _onMouseRelease: .. method:: onMouseRelease(self, event) Overload this method to define behaviour when mouse is released. :param event: The event being processed. :type event: Event .. _onMouseWheel: .. method:: onMouseWheel(self, event) Overload this method to define behaviour when mouse wheel is active. :param event: The event being processed. :type event: Event .. _onNewProject: .. method:: onNewProject(self) Overload if you need to clean up when a new model is loaded. .. _onObjectCreated: .. method:: onObjectCreated(self, obj) Overload if interested when an object is created after ListenForModelChanges is called. :param obj: The event being processed. :type obj: Event .. _onObjectDeleted: .. method:: onObjectDeleted(self, obj) Overload if interested when an object is deleted after ListenForModelChanges is called. :param obj: The event being processed. :type obj: Event .. _onObjectModified: .. method:: onObjectModified(self, obj, attr) Overload if interested when an object is modified after ListenForModelChanges is called. :param obj: The event being processed. :type obj: Event :param attr: Name of the attribute that was modified. :type attr: str .. _onObjectPicked: .. method:: onObjectPicked(self, obj, why) Called when a pickable object is picked. This is passed so connector contexts can either: - pick 2 features to create the connector: len (self.pickList) == 2 - pick the same feature twice to connect to ground: why="inlist" :param objects: A PickedList that contains the single or box picked objects. :type objects: PickedList :param why: Valid choices are: - "add" - "remove" - "inlist" :type why: str .. _onObjectSelected: .. method:: onObjectSelected(self, obj) Called when an object is selected from any view. Overload this method to process the selectList when object is selected. :param obj: The selected object. :type obj: Union[Named, Feature, Hole] .. _onObjectsPicked: .. method:: onObjectsPicked(self, objects, why) Called when one or more pickable object are picked. Utility method that calls onObjectPicked for each object in objects. Unless you specify windowing in setPickable it may be easier to overload onObjectPicked instead of this method. :param objects: A PickedList that contains the single or box picked objects. :type objects: PickedList :param why: Valid choices are: - "add" - "remove" - "inlist" :type why: str .. _onObjectsSelected: .. method:: onObjectsSelected(self, objects) Called when objects are selected from any view. :param objects: The list of selected objects. :type objects: PickedList .. _onPickListChanged: .. method:: onPickListChanged(self) Called when an object is added to/removed from the pickList. .. _onPicking: .. method:: onPicking(self, objects) Overloaded in derived context to process a pick event. Called on any mouse move/press/release if any pickable objects are under the mouse or inside the pick window. :param objects: A PickedList that contains the single or box picked objects. :type objects: PickedList .. _onSelecting: .. method:: onSelecting(self, objects) Overload this method to process any/all selectList events. :param objects: The list of selected objects. :type objects: SelectList :returns: False to allow other listeners process the event. True to block. :rtype: bool .. _onSelectionChanged: .. method:: onSelectionChanged(self) Overload this method to process the selectList when it changes. .. _pop: .. method:: pop(self) Pops context off context stack, deactivating the context. .. _popupObjectEditor: .. method:: popupObjectEditor(self, obj) Overload this to popup an editor when an object of interest is selected. Return the editor so it can be hidden. :param obj: the selected object. :type obj: Union[Named, Feature, Hole] .. _processPickListEvent: .. method:: processPickListEvent(self, objects) Called on any mouse move/press/release from the PickList. :param objects: A PickedList that contains the single or box picked objects. :type objects: PickedList .. _redrawGraphics: .. method:: redrawGraphics(self, now=False) Force a redraw of the graphics. :param now: Determines whether to redraw immediately or on idle. :type now: bool .. _registerCursor: .. method:: registerCursor(self, name, icon, mask='', x=1, y=1) Cache cursor for lazy create in setCursor. :param icon: The path to icon file. :type icon: str, optional :param mask: The cursor mask. :type mask: str, optional :param x: The x location where to place the cursor. :type x: int, optional :param y: The y location where to place the cursor. :type y: int, optional .. _removePick: .. method:: removePick(self, obj, makeUnpickable=False) Removes the specified object from the PickedList. :param obj: The object to be removed from the PickedList. :type obj: Union[Named, Feature, Hole] :param makeUnPickable: Determines whether the object is unpickable. :type makeUnPickable: bool .. _reportUsage: .. method:: reportUsage(self, message) Report the usage message within this context. :param message: message to be reported. :type message: str .. _selectObjects: .. method:: selectObjects(self, objects=None, clear=True) Selects the specified objects, if they are instances of the types specified in setSelectable. :param objects: List of objects to be selected. :type objects: list[Union[Named, Feature, Hole]] :param clear: Determines whether to add the objects to selectList. :type clear: bool .. _setCursor: .. method:: setCursor(self, name, ignored=True) Set the named cursor if it is not the current one. :param name: The name of the cursor. Valid choices are: - "" : The default cursor (arrow) - "MAIN" : show the user what context he is in - '+' : show an object that can be added to the PickedList - '-' : show an object that can be removed from the PickedList - '+- : show an object that can be toggled (windowMode) - 'x' : show an object that is in the PickedList - .png : The name of an icon file - other : The name of a registered cursor :type name: str :param ignored: For backwards compatibility. :type ignored: bool, optional .. _setHelpTopic: .. method:: setHelpTopic(self, helpTopic) Sets the help topic to display when F1 is pressed. :param helpTopic: The help topic to display. :type helpTopic: str .. _setMainCursor: .. method:: setMainCursor(self, icon=None, mask=None, x=1, y=1) Sets the cursor to show what context the user is in. :param icon: The path to icon file. :type icon: str, optional :param mask: The cursor mask. :type mask: str, optional :param x: The x location where to place the cursor. :type x: int, optional :param y: The y location where to place the cursor. :type y: int, optional .. _setObjectColor: .. method:: setObjectColor(self, obj, color) Draw the unhighlighted object(s) in the specified color. :param obj: Object(s) to apply the color to :type obj: Named :param color: The color to be applied. :type color: str, list[float] .. _setObjectTransparency: .. method:: setObjectTransparency(self, obj=None) Ensure the transparency of the specfied object is correct or all objects if no object is specified. :param obj: The object to checked for transparency. If it is None, apply to all objects. :type obj: Union[Named, Feature, Hole] .. _setPickable: .. method:: setPickable(self, pickable=None, ifvisible=False, style=None, **kwds) Specifies the object(s)/types(s) that are pickable. Picked objects are generally used to specify what is passed to the creation of an object. For example, when creating a motor the user picks two features or a fastener. When objects are picked the onObjectsPicked method is called. :param pickable: The types/objects that are pickable. :type pickable: set :param ifvisible: Determines whether to pick only visible objects. :type ifvisible: bool :param style: The picking style. :type style: str :param \*\*kwds: TogglePickingStyle kwds, i.e., - windowing = True, # override default - filter = None, # standard setPickable filter - attribute = None, # the object attribute to toggle .. _setSelectable: .. method:: setSelectable(self, selectable=None, ifvisible=True, style=None, **kwds) Determines what objects/types can be selected by the user. Selected objects are generally the objects being created by the context and when the object is created it is selected. By default the selected objects popup an editor and/or manipulators to modify its values. Objects can be selected from the browser, tables or the graphics view. :param selectable: The types and/or objects that can be selected. :type selectable: list, optional :param ifvisible: Determines whether to be invisible, when selecting from the graphics view. :type ifvisible: bool, optional :param style: The select style. :type style: str, optional :param \*\*kwds: Keyword arguments for SelectList.setSelectable. .. _setVisualizationStyle: .. method:: setVisualizationStyle(self, style) Internal method to enable context specific rendering. Supported modes are: - RigidGroupContext :param style: Name of style (rigidgroup). :type style: str .. _showHelpMessage: .. method:: showHelpMessage(self, message, details=None, helpTopic=None, movie=None, movieTitle='', buttons=(), keys=(), width=None, relativeTo=None) Puts a text message under the guide bar to inform the user. :param message: The message to be printed. :type message: str :param details: The longer message that gets displayed when user clicks on message. :type details: str, optional :param helpTopic str, optional): The help topic to display when F1 is pressed. :param movie: The path to an animated gif file. :type movie: str, optional :param movieTitle: The movie title. :type movieTitle: str, optional :param buttons: A list of pairs (button, text) where button is a string, which contains a combination of LeftButton, MidButton, RightButton, ShiftButton, ControlButton or AltButton. :type buttons: list, optional :param keys: A list of (key, text) where key is the string name. :type keys: list, optional :param width: The width of message in pixels. :type width: int, optional :param relativeTo: The place where to locate the message. :type relativeTo: bool, optional .. _showManipulators: .. method:: showManipulators(self, obj) For all manipulators in this context, set manipulator's object. :param obj: The object for the manipulators. :type obj: Union[Named, Feature, Hole] .. _showObjectToolTip: .. method:: showObjectToolTip(self, obj=None) Set tool tip in the graphics window when hovering over an object to let the user know what the object is. :param obj: The object being hovered. :type obj: Union[Named, Feature, Hole] .. _showPickedHovered: .. method:: showPickedHovered(self, pickedList, cursor=None) Draws the objects hovered and sets the cursor, if there are any objects in the pickedList and hovering. :param pickedList: The list of picked objects. :type pickedList: PickedList :param cursor: The cursor type. :type cursor: str, optional :returns: False if pickedList is empty or hovering, True otherwise. :rtype: bool .. _showStatusMessage: .. method:: showStatusMessage(self, msg, ms=None) Shows a message in the status bar. :param msg: The message to be shown. :type msg: str :param ms: Indicates the miliseconds that the message will stay for. :type ms: int, optional .. _unsetCursor: .. method:: unsetCursor(self) Reset the cursor to the default cursor. .. _updateCounter: .. method:: updateCounter(self) Updates the value that the CounterAction shows. .. _waitCursor: .. method:: waitCursor(self, message=None) Python context for displaying a wait cursor. :param message: The message to be displayed in the status bar. :type message: str