QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Line2PEx Class Reference

Line from two points or sequence of lines. More...

Inheritance diagram for Line2PEx:
Line Draw EAction RActionAdapter RAction

List of all members.

Public Member Functions

void beginEvent ()
 Called when the user starts this action by clicking a button, choosing a menu, entering a command, etc.
void checkButtonStates ()
void commandEvent (void event)
 Allows commands to be entered in command line Using the 'startsWith' function allows the user to enter only as many characters as needed to distinguish between commands In this case only the first character is needed.
void coordinateEvent (void event)
 If restrict is on then change the co-ordinate to lie on the nearest multiple of the specified angle.
void coordinateEventPreview (void event)
 If restrict is on then change the co-ordinate to lie on the nearest multiple of the specified angle.
void displayAngle (void relativeZero, void pos, void view)
 Display the angle between relativeZero and pos.
void escapeEvent ()
 Called when the user presses Escape or clicks the right mouse button.
void getOperation (void preview)
 Called by updatePreview.
void hideUiOptions (void saveSettings)
 Hides the UI options of this action.
void keyPressEvent (void event)
 Called when the user presses a key.
void keyReleaseEvent (void event)
 Called when the user releases a key.
void Line2PEx (void guiAction)
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 restrictToAngle (void relativeZero, void pos, void snapang, void isDistance)
 restrictToAngle calculates the co-ordinate which lies on the nearest multiple of the specified angle.
void setPrompt ()
 This changes the command line prompt each time the user chooses a point or uses close, undo or redo.
void setState (void state)
 Set the state of this action.
void showUiOptions (void resume)
void slotClose ()
void slotDisplayChanged (void value)
void slotRedo ()
 pops values from redoList until redoList is empty this is different from system redo as redoList is not reset when user enters a co-ordinate
void slotRestrictChanged (void value)
void slotUndo ()
- Public Member Functions inherited from Line
void createLineEntity (void doc, void p1, void p2)
void getTitle ()
void initUiOptions (void resume)
 Overwrite to initialize combo boxes and other UI elements of the options tool bar.
void isRayOrXLine ()
void Line (void guiAction)
void slotTypeRayChanged (void checked)
void slotTypeSegmentChanged (void checked)
void slotTypeXLineChanged (void checked)
void typeChanged ()
- Public Member Functions inherited from Draw
void Draw (void guiAction)
- Public Member Functions inherited from EAction
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 commandEventPreview (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 finishEvent ()
 Called when this action is terminated.
void getAuxPreview ()
 Called by updatePreview.
void getDocumentInterface ()
void getGraphicsView ()
void getGraphicsViews ()
void getHighlightedEntities ()
 Called by updatePreview.
void getScales ()
void initState ()
 Called to initialize a new state of this action.
void mousePressEvent (void event)
 Does nothing.
void mouseReleaseEvent (void event)
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 setCursor (void cursor, void name)
void setLeftMouseTip (void tip)
void setRightMouseTip (void tip)
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 ()
RDocumentgetDocument ()
QList< RGraphicsScene * > getGraphicsScenes ()
virtual RGuiActiongetGuiAction ()
RActiongetOverrideBase ()
RStoragegetStorage ()
QString getUniqueGroup ()
bool hasNoState ()
bool isOverride ()
bool isTerminated ()
 RAction (RGuiAction *guiAction=NULL)
 Copyright (c) 2011-2013 by Andrew Mustun.
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 cmd
int display
int point1
int point2
int pointList
int redoList
int restrict
int rzpos
int undoList
- Public Attributes inherited from Line
int lineType

Detailed Description

Line from two points or sequence of lines.


Constructor & Destructor Documentation

void Line2PEx::Line2PEx ( void  guiAction)
inline

Member Function Documentation

void Line2PEx::beginEvent ( )
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 Line.

void Line2PEx::checkButtonStates ( )
inline
void Line2PEx::commandEvent ( void  event)
inline

Allows commands to be entered in command line Using the 'startsWith' function allows the user to enter only as many characters as needed to distinguish between commands In this case only the first character is needed.

(But entering 'c', 'cl', 'clo', 'clos' or 'close' would all invoke the close command. Similarly with undo and redo)

Reimplemented from EAction.

void Line2PEx::coordinateEvent ( void  event)
inline

If restrict is on then change the co-ordinate to lie on the nearest multiple of the specified angle.

If the user has entered an absolute or relative co-ordinate, then that overrides restrict. Calls pickCoordinate(event, false)

Reimplemented from EAction.

void Line2PEx::coordinateEventPreview ( void  event)
inline

If restrict is on then change the co-ordinate to lie on the nearest multiple of the specified angle.

Calls pickCoordinate(event, true)

Reimplemented from EAction.

void Line2PEx::displayAngle ( void  relativeZero,
void  pos,
void  view 
)
inline

Display the angle between relativeZero and pos.

void Line2PEx::escapeEvent ( void  )
inlinevirtual

Called when the user presses Escape or clicks the right mouse button.

Reimplemented from EAction.

void Line2PEx::getOperation ( void  preview)
inline

Called by updatePreview.

Implementations must return an ROperation subclass object for the operation that should be previewed.

Reimplemented from EAction.

void Line2PEx::hideUiOptions ( void  saveToSettings)
inline

Hides the UI options of this action.

Usually this function does not need to be called directly by implementing actions.

Parameters:
saveToSettingsif true, the state is saved to settings

Reimplemented from Line.

void Line2PEx::keyPressEvent ( void  event)
inline

Called when the user presses a key.

By default, the event is ignored.

Reimplemented from EAction.

void Line2PEx::keyReleaseEvent ( void  event)
inline

Called when the user releases a key.

By default, the event is ignored.

Reimplemented from EAction.

void Line2PEx::pickCoordinate ( void  event,
void  preview 
)
inline

High level event triggered when a coordinate was specified by the user of a coordinate specification should be previewed.

Reimplemented from EAction.

void Line2PEx::restrictToAngle ( void  relativeZero,
void  pos,
void  snapang,
void  isDistance 
)
inline

restrictToAngle calculates the co-ordinate which lies on the nearest multiple of the specified angle.

Params relativeZero pos - the co-ordinate to change snapang - the angle multiplier in degrees isDistance - boolean indicating if user entered a distance if true then use that distance (dist) if false then adjust the distance to the long side of a right- angled triangle between pos, relativeZero and nearest angle (pdist)

void Line2PEx::setPrompt ( )
inline

This changes the command line prompt each time the user chooses a point or uses close, undo or redo.

The prompt indicates which options are available each time.

void Line2PEx::setState ( void  state)
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 from EAction.

void Line2PEx::showUiOptions ( void  resume)
inline
void Line2PEx::slotClose ( )
inline
void Line2PEx::slotDisplayChanged ( void  value)
inline
void Line2PEx::slotRedo ( )
inline

pops values from redoList until redoList is empty this is different from system redo as redoList is not reset when user enters a co-ordinate

void Line2PEx::slotRestrictChanged ( void  value)
inline
void Line2PEx::slotUndo ( )
inline

Member Data Documentation

int Line2PEx::cmd
int Line2PEx::display
int Line2PEx::point1
int Line2PEx::point2
int Line2PEx::pointList
int Line2PEx::redoList
int Line2PEx::restrict
int Line2PEx::rzpos
int Line2PEx::undoList

The documentation for this class was generated from the following file: