RAction vs. ROperation

Discussion forum for contributors and developers who are using the QCAD version 3 ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

RAction vs. ROperation

Postby andrew » Mon Nov 18, 2013 10:41 am

From a QCAD user:

In browsing the QCAD source, I've come across a little bit of confusion: I see RAction and ROperation, but I'm a little bit confused at the difference between them, and how they're related. Could you clarify?
User avatar
andrew
Site Admin
 
Posts: 2756
Joined: Fri Mar 30, 2007 6:07 am

Re: RAction vs. ROperation

Postby andrew » Mon Nov 18, 2013 10:47 am

RAction classes handle user interaction with a document. An action reacts to mouse clicks, coordinates that are being entered, etc.

Example for RAction implementations: File - Open, Zoom in, Draw line from two points and any other QCAD tool.
Actions are the 'glue' between the user inputs and the QCAD application.


ROperation classes encapsulate a modification that can be applied to a document.

Such an operation might add objects (entities, layers, blocks, ...), delete objects or modify objects.
Operations are a low level concept and would also exist in an application without user interface.
User avatar
andrew
Site Admin
 
Posts: 2756
Joined: Fri Mar 30, 2007 6:07 am

Re: RAction vs. ROperation

Postby galed » Mon Nov 25, 2013 7:07 pm

What about RGuiActions? They seem kind of redundant with RActions

How are ROperations rolled into the undo framework provided by the transaction stack?
galed
Registered Member
 
Posts: 1
Joined: Sun Nov 24, 2013 11:59 pm

Re: RAction vs. ROperation

Postby andrew » Tue Nov 26, 2013 10:27 am

galed wrote:What about RGuiActions? They seem kind of redundant with RActions


A GUI action (RGuiAction) represents an action in the user interface. A GUI action is typically visualized by a menu and optionally a tool button. RGuiActions can also be triggered through command input. RGuiAction is derived from QAction and serves the same purpose.

How are ROperations rolled into the undo framework provided by the transaction stack?


ROperations typically trigger transactions (RTransaction) on a lower level. Transactions are undoable.
User avatar
andrew
Site Admin
 
Posts: 2756
Joined: Fri Mar 30, 2007 6:07 am


Return to QCAD 3 Developers and Contributors

Who is online

Users browsing this forum: No registered users and 4 guests