105 class DocumentManager* documentManager() const; |
105 class DocumentManager* documentManager() const; |
106 IndexGenerator indices() const; |
106 IndexGenerator indices() const; |
107 LDObject* lookup(const QModelIndex& index) const; |
107 LDObject* lookup(const QModelIndex& index) const; |
108 QColor pickingColorForObject(const QModelIndex& objectIndex) const; |
108 QColor pickingColorForObject(const QModelIndex& objectIndex) const; |
109 QModelIndex objectByPickingColor(const QColor& color) const; |
109 QModelIndex objectByPickingColor(const QColor& color) const; |
|
110 Winding winding() const; |
|
111 void setWinding(Winding winding); |
110 |
112 |
111 bool moveRows( |
113 bool moveRows( |
112 const QModelIndex& sourceParent, |
114 const QModelIndex& sourceParent, |
113 int sourceRow, |
115 int sourceRow, |
114 int count, |
116 int count, |
121 |
123 |
122 signals: |
124 signals: |
123 void objectAdded(const QModelIndex& object); |
125 void objectAdded(const QModelIndex& object); |
124 void aboutToRemoveObject(const QModelIndex& index); |
126 void aboutToRemoveObject(const QModelIndex& index); |
125 void objectModified(LDObject* object); |
127 void objectModified(LDObject* object); |
|
128 void windingChanged(Winding newWinding); |
126 |
129 |
127 protected: |
130 protected: |
128 template<typename T, typename... Args> T* constructObject(Args&& ...args); |
131 template<typename T, typename... Args> T* constructObject(Args&& ...args); |
129 |
132 |
130 QVector<LDObject*> _objects; |
133 QVector<LDObject*> _objects; |
131 QMap<LDObject*, QRgb> pickingColors; |
134 QMap<LDObject*, QRgb> pickingColors; |
132 QRgb pickingColorCursor = 0x000001; |
135 QRgb pickingColorCursor = 0x000001; |
133 class DocumentManager* _manager; |
136 class DocumentManager* _manager; |
134 mutable int _triangleCount = 0; |
137 mutable int _triangleCount = 0; |
135 mutable bool _needsTriangleRecount; |
138 mutable bool _needsTriangleRecount; |
|
139 Winding _winding = NoWinding; |
136 |
140 |
137 private: |
141 private: |
138 void installObject(int row, LDObject* object); |
142 void installObject(int row, LDObject* object); |
139 }; |
143 }; |
140 |
144 |