MovePlugin.hh 20.7 KB
Newer Older
1
/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
2
3
*                                                                            *
*                              OpenFlipper                                   *
Jan Möbius's avatar
Jan Möbius committed
4
*      Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen       *
Jan Möbius's avatar
Jan Möbius committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
*                           www.openflipper.org                              *
*                                                                            *
*--------------------------------------------------------------------------- *
*  This file is part of OpenFlipper.                                         *
*                                                                            *
*  OpenFlipper is free software: you can redistribute it and/or modify       *
*  it under the terms of the GNU Lesser General Public License as            *
*  published by the Free Software Foundation, either version 3 of            *
*  the License, or (at your option) any later version with the               *
*  following exceptions:                                                     *
*                                                                            *
*  If other files instantiate templates or use macros                        *
*  or inline functions from this file, or you compile this file and          *
*  link it with other files to produce an executable, this file does         *
*  not by itself cause the resulting executable to be covered by the         *
*  GNU Lesser General Public License. This exception does not however        *
*  invalidate any other reasons why the executable file might be             *
*  covered by the GNU Lesser General Public License.                         *
*                                                                            *
*  OpenFlipper is distributed in the hope that it will be useful,            *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
*  GNU Lesser General Public License for more details.                       *
*                                                                            *
*  You should have received a copy of the GNU LesserGeneral Public           *
*  License along with OpenFlipper. If not,                                   *
*  see <http://www.gnu.org/licenses/>.                                       *
*                                                                            *
33
34
35
\*===========================================================================*/

/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
36
37
38
39
40
*                                                                            *
*   $Revision$                                                       *
*   $LastChangedBy$                                                *
*   $Date$                     *
*                                                                            *
41
\*===========================================================================*/
Jan Möbius's avatar
Jan Möbius committed
42

Jan Möbius's avatar
 
Jan Möbius committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef MOVEPLUGIN_HH
#define MOVEPLUGIN_HH

#include <QObject>
#include <QMenuBar>

#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/MouseInterface.hh>
#include <OpenFlipper/BasePlugin/KeyInterface.hh>
#include <OpenFlipper/BasePlugin/PickingInterface.hh>
#include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
#include <OpenFlipper/BasePlugin/BackupInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/BasePlugin/ScriptInterface.hh>
#include <OpenFlipper/BasePlugin/ToolbarInterface.hh>
58
#include <OpenFlipper/BasePlugin/ContextMenuInterface.hh>
59
#include <OpenFlipper/BasePlugin/LoadSaveInterface.hh>
60
#include <OpenFlipper/BasePlugin/RPCInterface.hh>
Jan Möbius's avatar
 
Jan Möbius committed
61
62
#include <OpenFlipper/common/Types.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
Dirk Wilden's avatar
Dirk Wilden committed
63
#include <ObjectTypes/Plane/Plane.hh>
Jan Möbius's avatar
 
Jan Möbius committed
64
65
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>

Dirk Wilden's avatar
Dirk Wilden committed
66
67
68
69
#ifdef ENABLE_SKELETON_SUPPORT
  #include <ObjectTypes/Skeleton/Skeleton.hh>
#endif

70
71
72
73
#ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
#include <OpenVolumeMesh/Attribs/NormalAttrib.hh>
#endif

Jan Möbius's avatar
 
Jan Möbius committed
74
#include "MoveToolbar.hh"
75
#include "MoveProps.hh"
76
#include "MoveObjectMarker.hh"
Jan Möbius's avatar
 
Jan Möbius committed
77
78
79

/** Plugin for moving objects and selections
*/
80
class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface, PickingInterface, ToolboxInterface, BackupInterface, LoggingInterface, ScriptInterface,ToolbarInterface, ContextMenuInterface, LoadSaveInterface, RPCInterface
Jan Möbius's avatar
 
Jan Möbius committed
81
82
83
84
{
  Q_OBJECT
  Q_INTERFACES(BaseInterface)
  Q_INTERFACES(MouseInterface)
Jan Möbius's avatar
Dennis:    
Jan Möbius committed
85
  Q_INTERFACES(KeyInterface)
Jan Möbius's avatar
 
Jan Möbius committed
86
87
88
89
  Q_INTERFACES(PickingInterface)
  Q_INTERFACES(ToolboxInterface)
  Q_INTERFACES(BackupInterface)
  Q_INTERFACES(LoggingInterface)
90
  Q_INTERFACES(ContextMenuInterface)
Jan Möbius's avatar
 
Jan Möbius committed
91
92
  Q_INTERFACES(ScriptInterface)
  Q_INTERFACES(ToolbarInterface)
93
  Q_INTERFACES(LoadSaveInterface)
94
  Q_INTERFACES(RPCInterface)
Jan Möbius's avatar
 
Jan Möbius committed
95

Matthias Möller's avatar
Matthias Möller committed
96
97
98
99
#if QT_VERSION >= 0x050000
  Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-Move")
#endif

100
public:
101
102
103
104
  typedef unsigned int SelectionType;
  static const SelectionType VERTEX = 1;
  static const SelectionType EDGE   = 2;
  static const SelectionType FACE   = 4;
105
  static const SelectionType CELL   = 8;
106

Jan Möbius's avatar
 
Jan Möbius committed
107
108
109
  signals:
    // BaseInterface
    void updateView();
Jan Möbius's avatar
Jan Möbius committed
110
    void updatedObject(int, const UpdateType& _type);
111
    void nodeVisibilityChanged(int);
Jan Möbius's avatar
 
Jan Möbius committed
112
113

    // PickingInterface
114
115
116
117
    void addPickMode( const std::string& _mode );
    void addHiddenPickMode( const std::string& _mode );
    void setPickModeMouseTracking (const std::string& _mode, bool _mouseTracking);
    void setPickModeToolbar (const std::string& _mode, QToolBar * _toolbar);
Jan Möbius's avatar
 
Jan Möbius committed
118

119
120
    // ContextMenuInterface
    void addContextMenuItem(QAction* _action , ContextMenuType _type);
121

Jan Möbius's avatar
 
Jan Möbius committed
122
    // BackupInterface
Dirk Wilden's avatar
Dirk Wilden committed
123
    void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
Jan Möbius's avatar
 
Jan Möbius committed
124
125
126
127
128
129
130
131
132
133
134
135
136

    // LoggingInterface
    void log(Logtype _type, QString _message);
    void log(QString _message);

    // ScriptInterface
    void scriptInfo( QString _functionName  );
    void setSlotDescription(QString     _slotName,   QString     _slotDescription,
                            QStringList _parameters, QStringList _descriptions);

    // ToolbarInterface
    void addToolbar(QToolBar* _toolbar);
    void getToolBar( QString _name, QToolBar*& _toolbar);
Jan Möbius's avatar
Dennis:    
Jan Möbius committed
137

Jan Möbius's avatar
Dennis:    
Jan Möbius committed
138
139
    // KeyInterface
    void registerKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse = false);
Jan Möbius's avatar
Jan Möbius committed
140
141
    
    // ToolboxInterface
Dirk Wilden's avatar
Dirk Wilden committed
142
    void addToolbox( QString _name  , QWidget* _widget, QIcon* _icon );
143
144
145
146
    
    // RPCInterface
    void pluginExists(QString _pluginName, bool &_exists);
    void functionExists(QString _pluginName, QString _functionName, bool &_exists);
Jan Möbius's avatar
Dennis:    
Jan Möbius committed
147

Jan Möbius's avatar
 
Jan Möbius committed
148
149
150
  private slots :

    // BaseInterface
Jan Möbius's avatar
Jan Möbius committed
151
    void initializePlugin();
Jan Möbius's avatar
 
Jan Möbius committed
152
    void pluginsInitialized();
153
154
155
156
157
    
    void slotAllCleared();
    
    // LoadSaveInterface
    void objectDeleted( int _id );
Jan Möbius's avatar
 
Jan Möbius committed
158
159
160
161
162

    // MouseInterface
    void slotMouseWheelEvent(QWheelEvent * _event, const std::string & _mode);
    void slotMouseEvent( QMouseEvent* _event );

Jan Möbius's avatar
Dennis:    
Jan Möbius committed
163
164
165
166
    // KeyInterface
    void slotKeyEvent (QKeyEvent* _event);
    void slotKeyReleaseEvent (QKeyEvent* _event);

Jan Möbius's avatar
 
Jan Möbius committed
167
168
169
170
171
172
173
174
175
176
177
178
179
    // PickingInterface
    void slotPickModeChanged( const std::string& _mode);

    // BackupInterface
    void slotBackupRequested( int /*_id*/ , QString /*_name*/ , int /*_backup_id*/){};
    void slotRestoreRequested( int /*_id*/ , QString /*_name*/ , int /*_backup_id*/){};

  public :

    /// Default Constructor
    MovePlugin();

    /// Destructor
180
    ~MovePlugin();
Jan Möbius's avatar
 
Jan Möbius committed
181
182
183
184
185

    /// Name of the Plugin
    QString name(){ return (QString("Move")); };

    /// Description of the Plugin
Jan Möbius's avatar
Jan Möbius committed
186
    QString description() { return (QString(tr("Moves Meshes with Manipulators"))); };
Jan Möbius's avatar
 
Jan Möbius committed
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

//===========================================================================
/** @name ToolBox
  * @{ */
//===========================================================================

  private:
    /// stores the current axes in the tool
    int axisA_;
    int axisB_;

  private slots:

    /// Position of manipulator in tab changed
    void slotSetPosition();

    /// Toggle the first axis for changing direction in tab
    void slotToggleAxisA();

    /// Toggle the second axis for changing direction in tab
    void slotToggleAxisB();

    /// Set Direction of manipulator in tab changed
    void slotSetDirection();

    /// perform a translation for Manipulator in tab
    void slotTranslation();

    /// Project the current manipulator onto the tangent plane of the object
    void slotProjectToTangentPlane();

    /// Move the current manipulator to the cog of the object
    void slotMoveManipToCOG();

    /// Rotate Manipulator (with values from Tab)
    void slotRotate();

    /// Scale (with values from Tab)
    void slotScale();

227
    /// Move target Meshes cog to the origin
Jan Möbius's avatar
 
Jan Möbius committed
228
229
230
231
    void slotMoveToOrigin();

    /// Scale Boundingbox Diagonal to unit size
    void slotUnifyBoundingBoxDiagonal();
232
233
234
235

    void slotEnableSelectionMode();

    void slotEnableObjectMode();
Jan Möbius's avatar
 
Jan Möbius committed
236
237
238
239
240
241

  private:

    /// Update the Dialog with the last clicked manipulator
    void updateManipulatorDialog();

242
243
244
245
246
247
248
249
250
251
252
253
    /// Get closest vertex to hitpoint
    template <typename MeshType>
    OpenMesh::Vec3d getNearestVertex(MeshType* _mesh, uint _fh, OpenMesh::Vec3d& _hitPoint);

    /// Get closest edge to hitpoint
    template <typename MeshType>
    OpenMesh::Vec3d getNearestEdge(MeshType* _mesh, uint _fh, OpenMesh::Vec3d& _hitPoint);

    /// Get closest face to hitpoint
    template <typename MeshType>
    OpenMesh::Vec3d getNearestFace(MeshType* _mesh, uint _fh, OpenMesh::Vec3d& _hitPoint);

Jan Möbius's avatar
 
Jan Möbius committed
254
255
256
257
258
    /// True if the toolbox widget is active
    bool toolboxActive_;

    /// Widget for Toolbox
    moveToolbarWidget* tool_;
Dirk Wilden's avatar
Dirk Wilden committed
259
260
    
    QIcon* toolIcon_;
Jan Möbius's avatar
 
Jan Möbius committed
261
262
263
264
265
266
267
268
269
270
271

/** @} */

//===========================================================================
/** @name ToolBar
  * @{ */
//===========================================================================

  private :
    QAction* moveAction_;
    QAction* moveSelectionAction_;
272
    
Jan Möbius's avatar
 
Jan Möbius committed
273
    QActionGroup* toolBarActions_;
Jan Möbius's avatar
Jan Möbius committed
274
275
    
    QToolBar* toolbar_;
Jan Möbius's avatar
 
Jan Möbius committed
276
277
278
279
280
281
282
283

  private slots:

    /// Called by Toolbar to enable move mode
    void slotSetMoveMode(QAction* _action);

/** @} */

284
285
286
287
288
289
//===========================================================================
/** @name PickToolBar
  * @{ */
//===========================================================================

  private :
290
    QToolBar* pickToolbar_;
291
292

    QAction* placeAction_;
293
294
    QAction* rotateTranslateAction_;
    QAction* rotateManipAction_;
295
296
297
298
299
    QAction* resizeAction_;

    QAction* biggerManipAction_;
    QAction* smallerManipAction_;

300
    QAction* fixChildManipAction_;
301
302
    QAction* transformRefPoseManipAction_;
    QAction* currentPoseManipAction_;
303
    
304
305
    QAction* placeAndSnapAction_;

306
307
308
309
310
311
312
313
314
    QActionGroup* pickToolBarActions_;

  private slots:

    /// Called by pick Toolbar
    void slotPickToolbarAction(QAction* _action);

/** @} */

Jan Möbius's avatar
 
Jan Möbius committed
315
316
317
318
319
//===========================================================================
/** @name Manipulator Handling
  * @{ */
//===========================================================================

320
321
322
323
  private:
    //object ids of all objects with active Manipulator
    std::vector< int > activeManipulators_;

Jan Möbius's avatar
 
Jan Möbius committed
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
  private slots:

    /// move the object when its manipulator moves
    void manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseEvent* _event);

    /// update object when its manipulator changes position
    void ManipulatorPositionChanged(QtTranslationManipulatorNode* _node );

  private:

    ///Transform a mesh with the given transformation matrix
    template< typename MeshT >
    void transformMesh(ACG::Matrix4x4d _mat , MeshT& _mesh );

    #ifdef ENABLE_POLYLINE_SUPPORT
    ///Transform a polyline with the given transformation matrix
    template< class PolyLineT >
341
342
    void transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine );
    #endif
Jan Möbius's avatar
 
Jan Möbius committed
343

Dirk Wilden's avatar
Dirk Wilden committed
344
345
346
347
348
    #ifdef ENABLE_SKELETON_SUPPORT
    ///Transform a skeleton with the given transformation matrix
    void transformSkeleton( ACG::Matrix4x4d _mat , Skeleton& _skeleton );
    #endif

349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
    #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
    /// Transform a volume mesh with the given transformation matrix
    template< typename VolumeMeshT >
    void transformVolumeMesh(ACG::Matrix4x4d _mat , VolumeMeshT& _mesh , OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib );

    /// Calculate center of gravity of a volume mesh
    template< typename VolumeMeshT >
    ACG::Vec3d cogVolumeMesh( VolumeMeshT& _mesh );

    /// get bounding box diagonal of a volume mesh
    template< typename VolumeMeshT >
    void getBBVolumeMesh( VolumeMeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max  );

    /// scale volume mesh to have a boundingboxdiagonal of one
    template< typename VolumeMeshT >
    void unifyBBDiagVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib);

    /// Scales volume mesh such that bounding box diagonal has unit length
    template< typename VolumeMeshT >
    void unifyBBDiagVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max  );
    #endif

Jan Möbius's avatar
 
Jan Möbius committed
371
372
373
374
375
376
377
378
379
380
381
    /** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator )
      *
      * @param _reset reset the transformation matrix of the manipulator to identity)
      * @return current transformation matrix of the manipulator
      */
    ACG::Matrix4x4d getLastManipulatorMatrix(bool _reset = true);

    /// Checks if the manipulators should be visible or not
    void showManipulators( );

    /// Place and show the Manipulator
382
    void placeManip(QMouseEvent * _event, bool _snap = false);
Jan Möbius's avatar
 
Jan Möbius committed
383
384
385
386

    /// scale mesh to have a boundingboxdiagonal of one
    template< typename MeshT >
    void unifyBBDiag(MeshT& _mesh );
387

388
389
390
    /// get bounding box diagonal of a mesh
    template< typename MeshT >
    void getBB( MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max  );
391

392
393
394
    /// Scales object such that bounding box diagonal has unit length
    template< typename MeshT >
    void unifyBBDiag( MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max  );
Jan Möbius's avatar
 
Jan Möbius committed
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411

    /// Size for the manipulators
    double manip_size_;

    /// Modifier for the Size (changed by Mousewheel Events)
    double manip_size_modifier_;

    /// Stores the last manipulator which has been clicked ( used for the toolbox dialog)
    int lastActiveManipulator_;

    /// Set Descriptions for scriptable functions
    void setDescriptions();

    /// Move an object with given id
    void moveObject(ACG::Matrix4x4d mat, int _id);

    /// Move selection on an object with given id
Dirk Wilden's avatar
Dirk Wilden committed
412
    void moveSelection(ACG::Matrix4x4d mat, int _id, QEvent::Type _type);
Jan Möbius's avatar
 
Jan Möbius committed
413

414
415
416
    /// Object marker to dimm Objects during manipulator transformation
    MoveObjectMarker objectMarker_;

Jan Möbius's avatar
Dennis:    
Jan Möbius committed
417
418
419
420
421
  private:

    /// Holds the current manipulator mode
    QtTranslationManipulatorNode::ManipulatorMode manMode_;

422
423
    void setManipMode (QtTranslationManipulatorNode::ManipulatorMode _mode);

Jan Möbius's avatar
 
Jan Möbius committed
424
425
426
427
428
429
430
431
432
433
/** @} */

//===========================================================================
/** @name Selection Plugin Communication
  * @{ */
//===========================================================================

    /// Current SelectionType of SelectionPlugin
    SelectionType selectionType_;

434
435
    /// Get current primitive selection
    void updateSelectionType();
Jan Möbius's avatar
 
Jan Möbius committed
436
437
438

  private slots:

439
    /// Sets whether all targets should be affected or not
440
    void setAllTargets(bool _state);
441

Jan Möbius's avatar
 
Jan Möbius committed
442
/** @} */
443

444
445
446
447
  //===========================================================================
  /** @name Context Menu
   * @{ */
  //===========================================================================
Jan Möbius's avatar
 
Jan Möbius committed
448

449
450
    private slots:

451
    /// Show properties of move manipulator in a dialog ( Called via context for picking. Get the picked id from the Qvariant attached to the connected action)
452
    void showProps( );
453
454
455
    
    /// Hide the manipulator( Called via context for picking. Get the picked id from the Qvariant attached to the connected action)
    void hideManipulator();
456

Mike Kremer's avatar
Mike Kremer committed
457
    /// Get properties dialog widget that is attached to BaseDataObject obj
458
    movePropsWidget* getDialogWidget(BaseObjectData* _obj);
459

Mike Kremer's avatar
Mike Kremer committed
460
    /// Get parent properties dialog widget of QPushButton but
461
    movePropsWidget* getDialogFromButton(QPushButton* _but);
462

Mike Kremer's avatar
Mike Kremer committed
463
464
    /** Override ContextMenuInterface slot in order to avoid appearance of
     * context menu entry when clicking on other nodes (other than manpipulator nodes)
465
     */
466
    void slotUpdateContextMenuNode( int _nodeId );
467

468
    private:
469
470
471

    void setPickModeProps(movePropsWidget* _pW, const std::string &_pickmode);

Mike Kremer's avatar
Mike Kremer committed
472
    /// List of properties dialogs (each corresponding to one manipulator)
473
    QList<movePropsWidget*> propsWindows_;
474

475
    /// Context menu entry for showing per manipulator settings
476
    QAction* contextAction_;
477
478
479
    
    /// Context menu entry to hide a manipulator
    QAction* contextActionHide_;
480

481
482
483
    /// Checked if transformation should be applied to all target objs
    QAction* toAllTargets_;

484
/** @} */
485

Jan Möbius's avatar
 
Jan Möbius committed
486
487
488
489
490
491
492
493
494
495
496
//===========================================================================
/** @name Scriptable Functions
  * @{ */
//===========================================================================

public slots :

  /// translate an Object by a given vector
  void translate( int _objectId , Vector _vector );

  /// translate given vertices by a vector
Jan Möbius's avatar
Jan Möbius committed
497
  void translate( int _objectId , IdList _vHandles, Vector _vector );
Jan Möbius's avatar
 
Jan Möbius committed
498

499
500
501
502
503
504
505
506
  /// translate current vertex selection of an Object by a given vector
  void translateVertexSelection( int _objectId , Vector _vector );

  /// translate current face selection of an Object by a given vector
  void translateFaceSelection( int _objectId , Vector _vector );

  /// translate current edge selection of an Object by a given vector
  void translateEdgeSelection( int _objectId , Vector _vector );
Jan Möbius's avatar
 
Jan Möbius committed
507
508
509
510
511

  /// transform an Object by a given matrix
  void transform( int _objectId , Matrix4x4 _matrix );

  /// transform given vertices by a matrix
Jan Möbius's avatar
Jan Möbius committed
512
  void transform( int _objectId , IdList _vHandles, Matrix4x4 _matrix );
Jan Möbius's avatar
 
Jan Möbius committed
513
514

  /// transform current selection of an Object by a given matrix
515
  bool transformVertexSelection( int _objectId , Matrix4x4 _matrix );
Jan Möbius's avatar
 
Jan Möbius committed
516
517

  /// transform current selection of an Object by a given matrix
518
  bool transformFaceSelection( int _objectId , Matrix4x4 _matrix );
Jan Möbius's avatar
 
Jan Möbius committed
519
520

  /// transform current selection of an Object by a given matrix
521
  bool transformEdgeSelection( int _objectId , Matrix4x4 _matrix );
Jan Möbius's avatar
 
Jan Möbius committed
522

523
524
525
  /// transform current selection of an Object by a given matrix
  bool transformCellSelection( int _objectId , Matrix4x4 _matrix );

526
527
528
  /// Transform handle region using the given transformation matrix
  void transformHandleRegion(int _objectId, Matrix4x4 _matrix);

Jan Möbius's avatar
 
Jan Möbius committed
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
  /// Set the position of the manipulator
  void setManipulatorPosition( int _objectId , Vector _position );

  /// Get the position of the manipulator
  Vector manipulatorPosition( int _objectId );

  /// Set the direction of the manipulator
  void setManipulatorDirection( int _objectId , Vector _directionX, Vector _directionY );

  /// Get the x-direction of the manipulator
  Vector manipulatorDirectionX( int _objectId );

  /// Get the y-direction of the manipulator
  Vector manipulatorDirectionY( int _objectId );

  /// Get the z-direction of the manipulator
  Vector manipulatorDirectionZ( int _objectId );
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582

  /** \brief Sets the Object Matrix in the scenegraph to identity
   */
  void objectRenderingMatrixIdentity(int _objectId);

  /** \brief Adds a scaling factor to the Object rendering Matrix in the scenegraph
   *
   *  @param _objectId Id of the object to modify
   *  @param _s        Scaling factor
   */
  void objectRenderingMatrixScale(int _objectId, double _s);

  /** \brief Adds a scaling factor to the Object rendering Matrix in the scenegraph
   *
   *  @param _objectId    Id of the object to modify
   *  @param _translation Translation vector
   */
  void objectRenderingMatrixTranslate(int _objectId, Vector _translation);

  /** \brief Adds a scaling factor to the Object rendering Matrix in the scenegraph
     *
     *  @param _objectId Id of the object to modify
     *  @param _axis     Rotation axis
     *  @param _angle    Rotation angle
     */
  void objectRenderingMatrixRotate(int _objectId, Vector _axis, double _angle);

  /** \brief Gets the Object Matrix in the scenegraph
   *
   *  The object itself is not modified b< this matrix. Only the transformation matrix applied to the object
   *  coordinates before rendering gets modified.
   *
   *  @param _objectId Id of the object to modify
   *  @return Current Matrix of the object
   */
  Matrix4x4 getObjectRenderingMatrix(int _objectId);

Jan Möbius's avatar
 
Jan Möbius committed
583
584
585
/** @} */

  public slots:
586
    QString version() { return QString("1.2"); };
Jan Möbius's avatar
 
Jan Möbius committed
587
588

  private:
589
    bool hide_;
Jan Möbius's avatar
 
Jan Möbius committed
590

591
592
    bool allTargets_;

593
    bool placeMode_;
594
595
596

    /// stores if any selected elements where transformed
    bool transformedSelected_;
Jan Möbius's avatar
 
Jan Möbius committed
597
598
599
};

#endif //MOVEPLUGIN_HH