44
43
CSVWidget::SceneToolRun *mRun;
45
44
CSMDoc::Document& mDocument;
46
45
unsigned int mInteractionMask;
47
std::map<std::pair<Qt::MouseButton, bool>, std::string> mButtonMapping;
48
46
CSVWidget::SceneToolMode *mEditMode;
50
48
std::string mDragMode;
100
98
void selectDefaultNavigationMode();
100
void centerOrbitCameraOnSelection();
102
102
static DropType getDropType(const std::vector<CSMWorld::UniversalId>& data);
104
104
virtual dropRequirments getDropRequirements(DropType type) const;
127
127
/// \param elementMask Elements to be affected by the clear operation
128
128
virtual void clearSelection (int elementMask) = 0;
130
/// \param elementMask Elements to be affected by the select operation
131
virtual void selectAll (int elementMask) = 0;
133
// Select everything that references the same ID as at least one of the elements
136
/// \param elementMask Elements to be affected by the select operation
137
virtual void selectAllWithSameParentId (int elementMask) = 0;
139
/// Return the next intersection point with scene elements matched by
140
/// \a interactionMask based on \a localPos and the camera vector.
141
/// If there is no such point, instead a point "in front" of \a localPos will be
144
/// \param ignoreHidden ignore elements specified in interactionMask that are
145
/// flagged as not visible.
146
osg::Vec3f getIntersectionPoint (const QPoint& localPos,
147
unsigned int interactionMask = Mask_Reference | Mask_Terrain,
148
bool ignoreHidden = false) const;
150
virtual std::string getCellId (const osg::Vec3f& point) const = 0;
152
virtual std::vector<osg::ref_ptr<TagBase> > getSelection (unsigned int elementMask)
155
virtual std::vector<osg::ref_ptr<TagBase> > getEdited (unsigned int elementMask)
158
virtual void setSubMode (int subMode, unsigned int elementMask) = 0;
160
/// Erase all overrides and restore the visual representation to its true state.
161
virtual void reset (unsigned int elementMask) = 0;
163
/// \note Drags will be automatically aborted when the aborting is triggered
164
/// (either explicitly or implicitly) from within this class. This function only
165
/// needs to be called, when the drag abort is triggered externally (e.g. from
171
/// Visual elements in a scene
172
/// @note do not change the enumeration values, they are used in pre-existing button file names!
175
Button_Reference = 0x1,
176
Button_Pathgrid = 0x2,
179
Button_Terrain = 0x10
132
182
virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool);
134
184
virtual void addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool);
138
188
virtual void mouseMoveEvent (QMouseEvent *event);
139
189
virtual void mousePressEvent (QMouseEvent *event);
140
190
virtual void mouseReleaseEvent (QMouseEvent *event);
141
virtual void mouseDoubleClickEvent (QMouseEvent *event);
142
191
virtual void wheelEvent (QWheelEvent *event);
143
192
virtual void keyPressEvent (QKeyEvent *event);
145
194
virtual void handleMouseClick (osg::ref_ptr<TagBase> tag, const std::string& button,
197
/// \return Is \a key a button mapping setting? (ignored otherwise)
198
virtual bool storeMappingSetting (const CSMPrefs::Setting *setting);
200
virtual void settingChanged (const CSMPrefs::Setting *setting);
202
EditMode *getEditMode();
150
206
void dragEnterEvent(QDragEnterEvent *event);
154
210
void dragMoveEvent(QDragMoveEvent *event);
156
/// \return Is \a key a button mapping setting? (ignored otherwise)
157
bool storeMappingSetting (const CSMPrefs::Setting *setting);
159
212
osg::ref_ptr<TagBase> mousePick (const QPoint& localPos);
161
std::string mapButton (QMouseEvent *event);
163
214
virtual std::string getStartupInstruction() = 0;
167
void settingChanged (const CSMPrefs::Setting *setting);
169
void selectNavigationMode (const std::string& mode);
171
218
virtual void referenceableDataChanged (const QModelIndex& topLeft,
172
219
const QModelIndex& bottomRight) = 0;