21 #ifndef MOUSEMOVESELECTION_H
22 #define MOUSEMOVESELECTION_H
25 #include <tulip/GlCircle.h>
26 #include <tulip/GlRect.h>
27 #include <tulip/GlComposite.h>
28 #include <tulip/Observable.h>
29 #include <tulip/GLInteractor.h>
30 #include <tulip/GlComplexPolygon.h>
31 #include <tulip/LayoutProperty.h>
32 #include <tulip/DoubleProperty.h>
33 #include <tulip/SizeProperty.h>
38 class TLP_QT_SCOPE MouseSelectionEditor:
public GLInteractorComponent {
42 MouseSelectionEditor();
43 ~MouseSelectionEditor();
45 bool compute(GlMainWidget *glMainWidget);
46 bool draw(GlMainWidget *);
47 bool eventFilter(QObject *, QEvent *);
48 InteractorComponent *clone() {
49 return new MouseSelectionEditor();
53 enum EditOperation { NONE=0, ROTATE_Z, ROTATE_XY, STRETCH_X, STRETCH_Y, STRETCH_XY, TRANSLATE, ALIGN_TOP, ALIGN_BOTTOM, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_VERTICALLY, ALIGN_HORIZONTALLY};
54 enum OperationTarget { COORD = 0, SIZE, COORD_AND_SIZE};
57 GlMainWidget *glMainWidget;
58 LayoutProperty *_layout;
59 BooleanProperty *_selection;
60 DoubleProperty *_rotation;
62 LayoutProperty *_copyLayout;
63 SizeProperty *_copySizes;
64 DoubleProperty *_copyRotation;
66 void initProxies(GlMainWidget *glMainWidget);
71 EditOperation operation;
76 Coord editLayoutCenter;
83 GlComposite *composite;
84 GlCircle _controls[8];
85 GlComplexPolygon _advControls[6];
90 bool computeFFD(GlMainWidget*);
91 void getOperation(GlEntity *select);
92 void mMouseTranslate(
double,
double, GlMainWidget*);
93 void mMouseRotate(
double,
double, GlMainWidget*);
94 void mMouseStretchAxis(
double,
double, GlMainWidget*);
95 void mAlign(EditOperation operation,GlMainWidget*);