QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ROperation.h
Go to the documentation of this file.
1 
20 #ifndef ROPERATION_H
21 #define ROPERATION_H
22 
23 #include "core_global.h"
24 
25 #include "RNonCopyable.h"
26 #include "RRequireHeap.h"
27 #include "RS.h"
28 #include "RTransaction.h"
29 
30 class RDocument;
31 class RExporter;
32 
33 
34 
45 public:
47  bool undoable=true,
48  RS::EntityType entityTypeFilter = RS::EntityAll
49  ) : undoable(undoable),
50  recordAffectedObjects(true),
51  spatialIndexDisabled(false),
52  entityTypeFilter(entityTypeFilter) {}
53  virtual ~ROperation() {
54  }
55 
63  virtual RTransaction apply(RDocument& document, bool preview = false) const = 0;
64 
66  return entityTypeFilter;
67  }
68 
69  void setRecordAffectedObjects(bool on) {
70  recordAffectedObjects = on;
71  }
72 
73  void setSpatialIndexDisabled(bool on) {
74  spatialIndexDisabled = on;
75  }
76 
77 protected:
78  bool undoable;
82 };
83 
85 
86 #endif