QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RClipboardOperation.h
Go to the documentation of this file.
1 
20 #ifndef RCLIPBOARDOPERATION_H
21 #define RCLIPBOARDOPERATION_H
22 
23 #include "operations_global.h"
24 
25 #include <QMap>
26 
27 #include "RDocument.h"
28 #include "REntity.h"
29 #include "RExporter.h"
30 #include "ROperation.h"
31 #include "RVector.h"
32 
33 typedef QMap<QString, QString> RQMapQStringQString;
34 
35 #define RDEFAULT_QMAP_QSTRING_QSTRING RQMapQStringQString()
36 
45 public:
47  virtual ~RClipboardOperation() {}
48 
49 protected:
50  void copy(RDocument& src, RDocument& dest,
51  const RVector& offset,
52  double scale,
53  double rotation,
54  bool flipHorizontal,
55  bool flipVertical,
56  bool toCurrentLayer,
57  bool toCurrentBlock,
58  bool overwriteLayers,
59  bool overwriteBlocks,
60  const QString& blockName,
61  const QString& layerName,
62  RTransaction& transaction,
63  bool selectionOnly, bool clear,
64  bool toModelSpaceBlock,
65  bool preview,
67  ) const;
68 
69  void copyEntity(
70  REntity& entity,
71  RDocument& src, RDocument& dest,
72  const RVector& offset,
73  double scale,
74  double unitScale,
75  double rotation,
76  bool flipHorizontal,
77  bool flipVertical,
78  bool toCurrentLayer,
79  bool toCurrentBlock,
80  bool overwriteLayers,
81  bool overwriteBlocks,
82  const QString& blockName,
83  RTransaction& transaction,
84  bool toModelSpaceBlock
85  ) const;
86 
87  QSharedPointer<RLayer> copyEntityLayer(
88  REntity& entity,
89  RDocument& src,
90  RDocument& dest,
91  bool overwriteLayers,
92  RTransaction& transaction
93  ) const;
94 
95  QSharedPointer<RLayer> copyLayer(
96  RLayer::Id layerId,
97  RDocument& src, RDocument& dest,
98  bool overwriteLayers,
99  RTransaction& transaction
100  ) const;
101 
102  QSharedPointer<RLinetype> copyEntityLinetype(
103  REntity& entity,
104  RDocument& src,
105  RDocument& dest,
106  bool overwriteLinetypes,
107  RTransaction& transaction
108  ) const;
109 
110  QSharedPointer<RLinetype> copyLinetype(
111  RLinetype::Id linetypeId,
112  RDocument& src, RDocument& dest,
113  bool overwriteLinetypes,
114  RTransaction& transaction
115  ) const;
116 
117 private:
118  mutable QMap<QString, QSharedPointer<RLayer> > copiedLayers;
119  mutable QMap<QString, QSharedPointer<RLinetype> > copiedLinetypes;
120  mutable QMap<QString, QSharedPointer<RBlock> > copiedBlocks;
121  mutable QSet<RBlock::Id> copiedBlockContents;
122 };
123 
125 
126 #endif