|
QCAD Application Framework
CAD Application Development and Automation.
|
Base class for all ECMAScript based actions. More...
Public Member Functions | |
| void | applyCommand (void event, void preview) |
| High level event triggered when a command line command should be applied or previewed. | |
| void | applyOperation () |
| Applies the operation returned by this.getOperation(). | |
| void | beginEvent () |
| Called when the user starts this action by clicking a button, choosing a menu, entering a command, etc. | |
| void | commandEvent (void event) |
| Default implementation. | |
| void | commandEventPreview (void event) |
| Default implementation. | |
| void | coordinateEvent (void event) |
| Default implementation. | |
| void | coordinateEventPreview (void event) |
| Default implementation. | |
| void | createDialog (void uiFile, void parent) |
| Creates a new dialog based on the given UI file with the given parent. | |
| void | createWidget (void uiFile, void parent) |
| Creates a new widget based on the given UI file with the given parent. | |
| void | EAction (void guiAction) |
| void | entityPickEvent (void event) |
| Default implementation. | |
| void | entityPickEventPreview (void event) |
| Default implementation. | |
| void | escapeEvent () |
| Called when the user presses Escape or clicks the right mouse button. | |
| void | finishEvent () |
| Called when this action is terminated. | |
| void | getAuxPreview () |
| Called by updatePreview. | |
| void | getDocumentInterface () |
| void | getHighlightedEntities () |
| Called by updatePreview. | |
| void | getOperation (void preview) |
| Called by updatePreview. | |
| void | getScales () |
| void | hideUiOptions (void saveToSettings) |
| Hides the UI options of this action. | |
| void | initState () |
| Called to initialize a new state of this action. | |
| void | initUiOptions (void resume) |
| Overwrite to initialize combo boxes and other UI elements of the options tool bar. | |
| void | keyPressEvent (void event) |
| Called when the user presses a key. | |
| void | keyReleaseEvent (void event) |
| Called when the user releases a key. | |
| void | mousePressEvent (void event) |
| Does nothing. | |
| void | mouseReleaseEvent (void event) |
| void | pickCoordinate (void event, void preview) |
| High level event triggered when a coordinate was specified by the user of a coordinate specification should be previewed. | |
| void | pickEntity (void event, void preview) |
| High level event triggered when an entity was picked by the user or to preview picking an entity. | |
| void | propertyChangeEvent (void event) |
| Allows all actions to handle property change events. | |
| void | resumeEvent () |
| Called whenver the action resumes its operation, for example after it was temporary suspended for another action. | |
| void | setArrowCursor () |
| Sets the current cursor of the current document interface (all views attached to it) to the normal arrow cursor. | |
| void | setCommandPrompt (void prompt) |
| void | setCrosshairCursor () |
| Sets the current cursor of the current document interface (all views attached to it) to crosshair cursor. | |
| void | setLeftMouseTip (void tip) |
| void | setRightMouseTip (void tip) |
| void | setState (void state) |
| Set the state of this action. | |
| void | setUiOptions (void uiFile, void split) |
| Sets the UI options toolbar content for this tool. | |
| void | showUiOptions (void resume, void restoreFromSettings) |
| Shows the UI options of this action if this.uiFile is set. | |
| void | simulateMouseMoveEvent () |
| void | slotReset () |
| Called if the user clicks the reset button of an action. | |
| void | suspendEvent () |
| Called whenver the action is suspended, for example if another action is started while this action is active. | |
| void | updatePreview (void clear) |
| Updates the preview based on the operation returned by getOperation and the auxiliary construction returned be getAuxPreview. | |
Public Member Functions inherited from RActionAdapter | |
| virtual void | commandEvent (RCommandEvent &) |
| Called when a command is entered in the command line. | |
| virtual void | commandEventPreview (RCommandEvent &) |
| Called when a command is being edited in the command line. | |
| virtual void | coordinateEvent (RCoordinateEvent &) |
| Called for every coordinate event. | |
| virtual void | coordinateEventPreview (RCoordinateEvent &) |
Called if the action is in PickCoordinate mode and the mouse is moved around. | |
| virtual void | entityPickEvent (REntityPickEvent &) |
| | |
| virtual void | entityPickEventPreview (REntityPickEvent &) |
| | |
| virtual void | keyPressEvent (QKeyEvent &) |
| virtual void | keyReleaseEvent (QKeyEvent &) |
| virtual void | mouseDoubleClickEvent (RMouseEvent &) |
| Called on mouse double click events. | |
| virtual void | mouseMoveEvent (RMouseEvent &) |
| Called on mouse move events. | |
| virtual void | mousePressEvent (RMouseEvent &) |
| Called on mouse press events. | |
| virtual void | mouseReleaseEvent (RMouseEvent &) |
| Called on mouse release events. | |
| virtual void | panGestureEvent (QPanGesture &) |
| Called on pan gesture events. | |
| virtual void | pinchGestureEvent (QPinchGesture &) |
| Called on pinch gesture events. | |
| virtual void | propertyChangeEvent (RPropertyEvent &) |
| Called when the value of a property is modified while this action is active. | |
| RActionAdapter (RGuiAction *guiAction=NULL) | |
| virtual void | setGraphicsView (RGraphicsView *) |
| Called if this action is set as a navigation action of a graphics view. | |
| virtual void | swipeGestureEvent (QSwipeGesture &) |
| Called on swipe gesture events. | |
| virtual void | tabletEvent (RTabletEvent &) |
| Called on tablet events. | |
| virtual void | wheelEvent (RWheelEvent &) |
| Called on mouse wheel events. | |
Public Member Functions inherited from RAction | |
| RAction::ClickMode | getClickMode () |
| RDocument * | getDocument () |
| QList< RGraphicsScene * > | getGraphicsScenes () |
| virtual RGuiAction * | getGuiAction () |
| RAction * | getOverrideBase () |
| RStorage * | getStorage () |
| QString | getUniqueGroup () |
| bool | hasNoState () |
| bool | isOverride () |
| bool | isTerminated () |
| RAction (RGuiAction *guiAction=NULL) | |
| void | setClickMode (RAction::ClickMode m) |
| Sets the current click mode. | |
| void | setDocumentInterface (RDocumentInterface *di) |
| void | setGuiAction (RGuiAction *guiAction) |
| void | setNoState () |
| void | setOverride () |
| void | setOverrideBase (RAction *base) |
| void | setUniqueGroup (const QString &ug) |
| RVector | snap (RMouseEvent &event) |
| Uses the currently active snap function to snap to the closest object or grid point. | |
| void | terminate () |
| Terminates the action. | |
| virtual | ~RAction () |
Public Attributes | |
| int | additionalOptionsToolBars |
| int | guiAction |
| int | includeBasePath |
| int | optionsToolBarEnabled |
| int | settingsGroup |
| int | splitUiOptions |
| int | state |
| int | uiFile |
Base class for all ECMAScript based actions.
|
inline |
|
inline |
High level event triggered when a command line command should be applied or previewed.
Reimplemented in CircleCR, ArcCPA, CircleCP, EllipseArcCPPA, DimDiametric, and DimRadial.
|
inline |
Applies the operation returned by this.getOperation().
Reimplemented in ClipboardOperation, Delete, and Reverse.
|
inlinevirtual |
Called when the user starts this action by clicking a button, choosing a menu, entering a command, etc.
Shows the GUI elements that refer to this action as checked. Displays GUI options if this.uiFile is set to a valid UI file. Displays tool help in Help Viewer if available.
Reimplemented from RActionAdapter.
Reimplemented in PropertyEditor, PrintPreview, Print, Select, Information, CamSimulation, AbstractPreferences, DrawPolyline, Rotate2, Scale, ClipboardOperation, Rotate, Leader, Mirror, Modify, SnapCoordinatePolar, SnapDistance, Dimension, Text, LibraryBrowser, PolylineInsertNode, Hatch, LineRectangleSize, PolylineTrim, Image, Polyline, PolylineDeleteNodesBetween, PolylineEquidistant, EditText, Arc2PR, Paste, DefaultAction, Arc, Arc2PA, Circle, DimAngular, Ellipse, Line, Point, Spline, InsertBlockItem, Align, Stretch, Translate, ArcTangential, Circle2PR, Line2P, LineAngle, LineParallel, LineRelativeAngle, LineTangent2, SplineControlPoints, ModifyCorner, Trim, BlockList, PolylineDeleteNode, PolylineFromSegments, SplineFitPoints, Divide, Lengthen, SelectPolygon, InsertBlock, LineParallelThrough, LineTangent1, PointMN, PolylineAppendNode, ExImportPoints, NewFile, EditFromInsert, LineBisector, LineFreehand, AdvancedSelection, SelectRectangle, CircleCR, ExAddBlock, ExMathSpiral, ExDirListing, SnapIntersectionManual, ToggleGrid, WindowZoom, ArcCPA, Circle3P, EllipseArcCPPA, LinePolygonCP, LinePolygonPP, PointNP, InsertScriptItem, SearchReplace, ExDrawBoundingBox, ExDrawColors, ExChangeFontToArial, InfoAngle, Duplicates, Circle2P, CircleCP, Delete, Save, Reverse, SplitIntoEqualParts, TrimBoth, LayerList, ViewList, AddBlock, Arc3P, DimAligned, DimOrdinate, DimRegen, DimRotated, LineHorizontal, LineRectangle, LineVertical, Point1P, Redo, Undo, OpenFile, InfoArea, ZeroLengthDetection, SelectContour, SelectIntersectedEntities, SetRelativeZero, SnapCoordinate, DimDiametric, DimRadial, CloseFile, InfoTotalLength, AddLayer, HideAllLayers, ShowAllLayers, BreakOut, Reset, ClipboardDisplay, CommandLine, RenameBlock, ExLayerWhiteToBlack, PdfExport, SaveAs, InfoDistanceEP, EditLayer, RemoveLayer, IsoProject, SelectLayer, CamExport, BitmapExport, Compare, SvgExport, Bevel, PanZoom, NewFromTemplate, About, InfoDistancePP, DeselectAll, InvertSelection, SelectAll, LockRelativeZero, Snap, SnapMiddleManual, DraftMode, ToggleStatusBar, FullScreen, CreateBlock, CreateLibraryItem, EditBlock, EditMainDrawing, HideAllBlocks, RemoveBlock, ShowAllBlocks, ToggleBlockVisibility, DrawingPreferences, Esc, ExThreePoints, MenusAndToolBars, MyAction, PersistentWidgets, RecentFiles, SvgExportAs, SvgImport, CheckForUpdates, FAQ, Forum, HelpContents, Purchase, ReportBug, ReportTranslationError, ShowReadme, Website, ShowActiveLayer, ToggleLayerVisibility, Explode, ExplodeText, ToBack, ToFront, RestrictHorizontal, RestrictOff, RestrictOrthogonal, RestrictVertical, SnapAuto, SnapCenter, SnapEnd, SnapFree, SnapGrid, SnapIntersection, SnapMiddle, SnapOnEntity, SnapPerpendicular, SnapReference, AddView, AutoZoom, CommandLineFocus, EditView, OptionsToolBarFocus, PickView, PreviousView, RemoveView, ZoomIn, ZoomOut, ZoomToSelection, CascadeWindows, CloseAll, NextWindow, PreviousWindow, and TileWindows.
|
inline |
Default implementation.
Calls applyCommand(event, false)
|
inline |
Default implementation.
Calls applyCommand(event, true)
|
inline |
Default implementation.
Calls pickCoordinate(event, false)
Reimplemented in ClipboardOperation, DefaultAction, LineRectangle, LineRectangleSize, LineAngle, Point1P, SelectPolygon, SetRelativeZero, SelectRectangle, SnapMiddleManual, SelectIntersectedEntities, CreateBlock, CreateLibraryItem, and ExThreePoints.
|
inline |
Default implementation.
Calls pickCoordinate(event, true)
Reimplemented in DefaultAction, LineRectangle, LineRectangleSize, LineAngle, SelectPolygon, SelectRectangle, SnapMiddleManual, and SelectIntersectedEntities.
|
inline |
Creates a new dialog based on the given UI file with the given parent.
This is a helper function for WidgetFactory.createDialog.
|
inline |
Creates a new widget based on the given UI file with the given parent.
This is a helper function for WidgetFactory.createWidget.
|
inline |
Default implementation.
Calls pickEntity(event, false)
Reimplemented in LineBisector, SelectLayer, SelectContour, and SnapIntersectionManual.
|
inline |
Default implementation.
Calls pickEntity(event, true)
Reimplemented in LineBisector, SnapIntersectionManual, SelectContour, and SelectLayer.
|
inlinevirtual |
Called when the user presses Escape or clicks the right mouse button.
Reimplemented from RActionAdapter.
Reimplemented in DrawPolyline, Align, Scale, Rotate2, IsoProject, Rotate, Leader, Mirror, PolylineEquidistant, PolylineInsertNode, PolylineTrim, Arc2PA, Arc2PR, LineBisector, LineRelativeAngle, DimAngular, Stretch, ArcTangential, Circle2PR, LineParallel, PolylineDeleteNodesBetween, Divide, Translate, Trim, LineTangent1, LineTangent2, SplineControlPoints, Lengthen, DefaultAction, Line2P, PointMN, PolylineDeleteNode, SplineFitPoints, ModifyCorner, DimRotated, EllipseArcCPPA, LineParallelThrough, PolylineFromSegments, SelectPolygon, ArcCPA, LineFreehand, PolylineAppendNode, CircleCR, LinePolygonCP, LinePolygonPP, LineRectangle, SelectRectangle, EditFromInsert, Circle2P, Circle3P, DimDiametric, DimRadial, Arc3P, CircleCP, DimAligned, DimOrdinate, PointNP, BreakOut, InfoArea, SelectIntersectedEntities, and InfoDistancePP.
|
inlinevirtual |
Called when this action is terminated.
Shows the GUI elements that refer to this action as un-checked. Hides GUI options if this.uiFile is set to a valid UI file. Clears up mouse tips, etc.
Reimplemented from RActionAdapter.
Reimplemented in PropertyEditor, PrintPreview, CamSimulation, LibraryBrowser, InsertBlockItem, ToggleGrid, BlockList, LineBisector, InsertScriptItem, Align, SnapIntersectionManual, WindowZoom, LayerList, ViewList, PanZoom, LockRelativeZero, Snap, DraftMode, ToggleStatusBar, ClipboardDisplay, CommandLine, and FullScreen.
|
inline |
Called by updatePreview.
Implementations must return an array of RShape objects that should be displayed as auxiliary construction.
Reimplemented in DrawPolyline, Scale, Rotate, Mirror, Hatch, Arc2PR, Paste, Arc2PA, Align, Stretch, ArcTangential, Circle2PR, LineTangent2, SplineControlPoints, SplineFitPoints, Divide, LineTangent1, ArcCPA, EllipseArcCPPA, Round, BreakOut, and SplitIntoEqualParts.
|
inline |
Reimplemented from RAction.
|
inline |
Called by updatePreview.
Implementations must return an array of enitity IDs which should be highlighted.
Reimplemented in PolylineTrim, PolylineDeleteNodesBetween, PolylineInsertNode, PolylineEquidistant, EditText, DimAngular, LineParallel, LineRelativeAngle, ModifyCorner, Trim, ArcTangential, LineTangent2, PolylineFromSegments, Lengthen, PolylineDeleteNode, Divide, LineTangent1, PolylineAppendNode, EditFromInsert, DimDiametric, DimRadial, and BreakOut.
|
inline |
Called by updatePreview.
Implementations must return an ROperation subclass object for the operation that should be previewed.
Reimplemented in DrawPolyline, Scale, ClipboardOperation, Rotate, Leader, PolylineInsertNode, LineRectangleSize, PolylineEquidistant, PolylineTrim, Arc2PR, Paste, Arc2PA, Circle2PR, DimAngular, LineParallel, Align, Stretch, ArcTangential, Line2P, LineAngle, LineRelativeAngle, LineTangent2, SplineControlPoints, Trim, InsertBlock, LineTangent1, SplineFitPoints, Divide, Lengthen, DimRotated, LineBisector, PointMN, PolylineAppendNode, EllipseArcCPPA, LineFreehand, ArcCPA, CircleCR, SplitIntoEqualParts, Circle3P, LinePolygonCP, LinePolygonPP, PointNP, Round, Circle2P, CircleCP, LineRectangle, Arc3P, DimAligned, DimOrdinate, BreakOut, DimDiametric, DimRadial, IsoProject, and Bevel.
|
inline |
|
inline |
Hides the UI options of this action.
Usually this function does not need to be called directly by implementing actions.
| saveToSettings | if true, the state is saved to settings |
Reimplemented in PrintPreview.
|
inline |
Called to initialize a new state of this action.
Overwrite to set mouse tips, show desired toolbars, etc.
Reimplemented in DrawPolyline, Align, PolylineDeleteNodesBetween, PolylineInsertNode, LineParallel, LineParallelThrough, PolylineDeleteNode, PolylineAppendNode, and Translate.
|
inline |
Overwrite to initialize combo boxes and other UI elements of the options tool bar.
Reimplemented in PrintPreview, Dimension, and LineRectangleSize.
|
inline |
Called when the user presses a key.
By default, the event is ignored.
|
inline |
Called when the user releases a key.
By default, the event is ignored.
|
inline |
Does nothing.
Needs to be implemented here to avoid recursion when child classes call the base class implementation.
Reimplemented in PrintPreview, DefaultAction, Align, LineFreehand, WindowZoom, and PanZoom.
|
inline |
Reimplemented in PrintPreview, DefaultAction, LineFreehand, PanZoom, and WindowZoom.
|
inline |
High level event triggered when a coordinate was specified by the user of a coordinate specification should be previewed.
Reimplemented in DrawPolyline, Rotate2, Rotate, Scale, Leader, Mirror, Text, PolylineInsertNode, Stretch, Circle2PR, PolylineDeleteNodesBetween, Paste, Arc2PA, Arc2PR, LineRelativeAngle, LineTangent1, SplineControlPoints, InsertBlockItem, DimAngular, Image, Line2P, SplineFitPoints, Divide, Translate, ArcTangential, InsertBlock, EllipseArcCPPA, PointMN, PolylineDeleteNode, ArcCPA, DimRotated, CircleCR, LineParallelThrough, LinePolygonCP, LinePolygonPP, PointNP, Circle2P, Circle3P, InfoArea, Arc3P, CircleCP, DimAligned, DimDiametric, DimOrdinate, DimRadial, IsoProject, InfoDistanceEP, and InfoDistancePP.
|
inline |
High level event triggered when an entity was picked by the user or to preview picking an entity.
Reimplemented in Align, EditText, PolylineTrim, PolylineDeleteNode, PolylineEquidistant, PolylineInsertNode, PolylineAppendNode, PolylineDeleteNodesBetween, EditFromInsert, DimAngular, ModifyCorner, Trim, LineParallel, LineTangent2, Lengthen, ArcTangential, LineParallelThrough, LineRelativeAngle, LineTangent1, PolylineFromSegments, Divide, InfoTotalLength, InfoAngle, InfoDistanceEP, BreakOut, DimDiametric, and DimRadial.
|
inline |
Allows all actions to handle property change events.
This is neccessary to ensure that properties can be changed even if a tool is active (e.g. while drawing lines).
|
inlinevirtual |
Called whenver the action resumes its operation, for example after it was temporary suspended for another action.
Reimplemented from RActionAdapter.
Reimplemented in Information, DefaultAction, and CloseFile.
|
inline |
Sets the current cursor of the current document interface (all views attached to it) to the normal arrow cursor.
|
inline |
|
inline |
Sets the current cursor of the current document interface (all views attached to it) to crosshair cursor.
|
inline |
|
inline |
|
inline |
Set the state of this action.
Action implementations overwrite this function to initialize this action for the given state. This includes setting the appropriate click mode, displaying the appropriate CAD toolbar, setting mouse tips, mouse cursor, etc.
Reimplemented in PrintPreview, InsertBlockItem, Paste, IsoProject, Scale, Rotate2, Rotate, Leader, Mirror, LineRectangleSize, PolylineEquidistant, PolylineTrim, Text, Arc2PA, Arc2PR, LineBisector, LineRelativeAngle, LineTangent2, Divide, DimAngular, Image, ModifyCorner, Stretch, DefaultAction, ArcTangential, Circle2PR, EditText, Trim, DimRotated, LineAngle, LineTangent1, SplineControlPoints, Lengthen, Line2P, SplineFitPoints, PointMN, EllipseArcCPPA, LineRectangle, PolylineFromSegments, SelectPolygon, EditFromInsert, ArcCPA, Circle2P, Circle3P, LineFreehand, PointNP, Arc3P, CircleCP, CircleCR, DimAligned, DimOrdinate, LinePolygonCP, LinePolygonPP, InfoAngle, SelectRectangle, DimDiametric, DimRadial, WindowZoom, InfoArea, BreakOut, Point1P, SetRelativeZero, InfoTotalLength, SelectContour, SelectIntersectedEntities, InfoDistanceEP, InfoDistancePP, SelectLayer, CreateBlock, CreateLibraryItem, and ExThreePoints.
|
inline |
Sets the UI options toolbar content for this tool.
By default, a tool shows the options toolbar defined in "DefaultOptions.ui".
| uiFile | A path to a single UI file or an array of UI file paths. |
| split | If true, the options are split up into multiple toolbars. |
|
inline |
Shows the UI options of this action if this.uiFile is set.
UI options are typically shown in a horizontal toolbar at the top of the drawing area.
Usually this function does not need to be called directly by implementing actions.
| resume | Action was resumed from suspension. |
| restoreFromSettings | Restore settings from document / config file (default). |
|
inline |
|
inline |
Called if the user clicks the reset button of an action.
A reset button may be displayed as part of the UI options of this action and must have the object name "Reset".
|
inlinevirtual |
Called whenver the action is suspended, for example if another action is started while this action is active.
Reimplemented from RActionAdapter.
Reimplemented in PrintPreview, and DefaultAction.
|
inline |
Updates the preview based on the operation returned by getOperation and the auxiliary construction returned be getAuxPreview.
| clear | True to clear the preview first. This is necessary if the preview is updated not as a result of a mouse move event, e.g. when changing action parameters in the options toolbar. |
Reimplemented in InfoAngle, InfoArea, and InfoTotalLength.
| int EAction::additionalOptionsToolBars |
| int EAction::guiAction |
Reimplemented from RAction.
| int EAction::includeBasePath |
| int EAction::optionsToolBarEnabled |
| int EAction::settingsGroup |
| int EAction::splitUiOptions |
| int EAction::state |
Reimplemented in SnapIntersectionManual, and SnapMiddleManual.
| int EAction::uiFile |