QCAD
Open Source 2D CAD
ROperation Class Referenceabstract

This abstract class is an interface for all operation implementations. More...

#include <ROperation.h>

Inheritance diagram for ROperation:
RRequireHeap RNonCopyable RAddObjectsOperation RChangePropertyOperation RClickReferencePointOperation RClipboardOperation RDeleteAllEntitiesOperation RDeleteObjectsOperation RMixedOperation RMoveReferencePointOperation RMoveSelectionOperation RScaleSelectionOperation

Public Member Functions

virtual RTransaction apply (RDocument &document, bool preview=false)=0
 Applies this operation to selection in the given document. More...
 
RS::EntityType getEntityTypeFilter () const
 
QString getText () const
 
int getTransactionGroup () const
 
bool getTransactionType (RTransaction::Type t) const
 
RTransaction::Types getTransactionTypes () const
 
 ROperation (bool undoable=true, RS::EntityType entityTypeFilter=RS::EntityAll)
 
void setAllowAll (bool on)
 
void setAllowInvisible (bool on)
 
void setKeepChildren (bool on)
 Keep child entities (e.g. More...
 
void setRecordAffectedObjects (bool on)
 
void setSpatialIndexDisabled (bool on)
 
void setText (const QString &t)
 
void setTransactionGroup (int g)
 
void setTransactionType (RTransaction::Type t, bool on=true)
 
virtual ~ROperation ()
 
- Public Member Functions inherited from RRequireHeap
void doDelete ()
 

Protected Attributes

bool allowAll
 
bool allowInvisible
 
RS::EntityType entityTypeFilter
 
bool keepChildren
 
bool recordAffectedObjects
 
bool spatialIndexDisabled
 
QString text
 
int transactionGroup
 
RTransaction::Types transactionTypes
 
bool undoable
 

Additional Inherited Members

- Protected Member Functions inherited from RRequireHeap
virtual ~RRequireHeap ()
 
- Private Member Functions inherited from RNonCopyable
 RNonCopyable ()
 
 ~RNonCopyable ()
 

Detailed Description

This abstract class is an interface for all operation implementations.

An operation encapsulates a modification that can be applied to a document. An implementing class might for example implement a move operation that moves all selected entities by a given vector.

Scriptable:\nThis class is available in script environments.\n

Constructor & Destructor Documentation

◆ ROperation()

ROperation::ROperation ( bool  undoable = true,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)
inline

◆ ~ROperation()

virtual ROperation::~ROperation ( )
inlinevirtual

Member Function Documentation

◆ apply()

virtual RTransaction ROperation::apply ( RDocument document,
bool  preview = false 
)
pure virtual

Applies this operation to selection in the given document.

This is used for both previews and the actual apply. In case of a preview, the given document is a temporary document with a storage that is linked to the real document for realistic condiditions for the preview.

Implemented in RPasteOperation, RAddObjectsOperation, RMixedOperation, RChangePropertyOperation, RClipboardOperation, RDeleteObjectsOperation, RDeleteAllEntitiesOperation, RMoveReferencePointOperation, RMoveSelectionOperation, RScaleSelectionOperation, RCopyOperation, RDeleteSelectionOperation, and RClickReferencePointOperation.

◆ getEntityTypeFilter()

RS::EntityType ROperation::getEntityTypeFilter ( ) const
inline

◆ getText()

QString ROperation::getText ( ) const
inline

◆ getTransactionGroup()

int ROperation::getTransactionGroup ( ) const
inline

◆ getTransactionType()

bool ROperation::getTransactionType ( RTransaction::Type  t) const
inline

◆ getTransactionTypes()

RTransaction::Types ROperation::getTransactionTypes ( ) const
inline

◆ setAllowAll()

void ROperation::setAllowAll ( bool  on)
inline

◆ setAllowInvisible()

void ROperation::setAllowInvisible ( bool  on)
inline

◆ setKeepChildren()

void ROperation::setKeepChildren ( bool  on)
inline

Keep child entities (e.g.

keep block attributes when deleting block references)

◆ setRecordAffectedObjects()

void ROperation::setRecordAffectedObjects ( bool  on)
inline

◆ setSpatialIndexDisabled()

void ROperation::setSpatialIndexDisabled ( bool  on)
inline

◆ setText()

void ROperation::setText ( const QString &  t)
inline

◆ setTransactionGroup()

void ROperation::setTransactionGroup ( int  g)
inline

◆ setTransactionType()

void ROperation::setTransactionType ( RTransaction::Type  t,
bool  on = true 
)
inline

Member Data Documentation

◆ allowAll

bool ROperation::allowAll
protected

◆ allowInvisible

bool ROperation::allowInvisible
protected

◆ entityTypeFilter

RS::EntityType ROperation::entityTypeFilter
protected

◆ keepChildren

bool ROperation::keepChildren
protected

◆ recordAffectedObjects

bool ROperation::recordAffectedObjects
protected

◆ spatialIndexDisabled

bool ROperation::spatialIndexDisabled
protected

◆ text

QString ROperation::text
protected

◆ transactionGroup

int ROperation::transactionGroup
protected

◆ transactionTypes

RTransaction::Types ROperation::transactionTypes
protected

◆ undoable

bool ROperation::undoable
protected

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