Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYCameraEditor.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
21 #include <math.h>
22 #include <qtimer.h>
23 #include <qcursor.h>
24 #include <qvector3d.h>
25 
33 #include "gui/tools/NxVec3.h"
34 #include "TYCameraEditor.h"
35 
36 // using namespace Qt;
37 
39 {
40  _firstCall = true;
41 
47 
53 
59 
65 
66  _mouseEventActive = false;
67  _keyEventActive = 0;
69  setSensitivity(10.0);
70  _wheelStep = 1.0f;
71  if (TYPreferenceManager::exists(TYDIRPREFERENCEMANAGER, "ZoomStep"))
72  {
73  _wheelStep = TYPreferenceManager::getFloat(TYDIRPREFERENCEMANAGER, "ZoomStep");
74  }
75  else
76  {
77  TYPreferenceManager::setFloat(TYDIRPREFERENCEMANAGER, "ZoomStep", _wheelStep);
78  }
79 
80  _bKeyUp = false;
81  _bKeyDown = false;
82  _bKeyLeft = false;
83  _bKeyRight = false;
84  _bKeyPageUp = false;
85  _bKeyPageDown = false;
86  _bKeyShift = false;
87 
88  _pStepTimer = new QTimer(this);
89  Q_CHECK_PTR(_pStepTimer);
90 
92  Q_CHECK_PTR(_pCurrentCamera);
93 
94  _zoomStep = 2.0f;
95  if (TYPreferenceManager::exists(TYDIRPREFERENCEMANAGER, "CameraZoomStep"))
96  {
97  _zoomStep = TYPreferenceManager::getFloat(TYDIRPREFERENCEMANAGER, "CameraZoomStep");
98  }
99  else
100  {
101  TYPreferenceManager::setFloat(TYDIRPREFERENCEMANAGER, "CameraZoomStep", _zoomStep);
102  }
103 
104  _translateStep = 5.0f;
105  if (TYPreferenceManager::exists(TYDIRPREFERENCEMANAGER, "CameraTranslateStep"))
106  {
107  _translateStep = TYPreferenceManager::getFloat(TYDIRPREFERENCEMANAGER, "CameraTranslateStep");
108  }
109  else
110  {
111  TYPreferenceManager::setFloat(TYDIRPREFERENCEMANAGER, "CameraTranslateStep", _translateStep);
112  }
113 
114  _rotateStep = 10.0f;
115  if (TYPreferenceManager::exists(TYDIRPREFERENCEMANAGER, "CameraRotateStep"))
116  {
117  _rotateStep = TYPreferenceManager::getFloat(TYDIRPREFERENCEMANAGER, "CameraRotateStep");
118  }
119  else
120  {
121  TYPreferenceManager::setFloat(TYDIRPREFERENCEMANAGER, "CameraRotateStep", _rotateStep);
122  }
123 
124  // Pour la mise a jour de l'orientation et la position des axes et de la grille
125  QObject::connect(this, &TYCameraEditor::cameraUpdated, pModeler, &TYModelerFrame::updateAxes);
126  QObject::connect(this, &TYCameraEditor::cameraUpdated, pModeler, &TYModelerFrame::updateGrid);
127  // Pour le passage en mode wireframe lors du deplacement de la cam si l'option est active
128  QObject::connect(this, &TYCameraEditor::startMovingCamera, pModeler,
130  QObject::connect(this, &TYCameraEditor::stopMovingCamera, pModeler,
132  // L'echelle est mise a jour a la fin de chaque deplacement de camera
133  QObject::connect(this, &TYCameraEditor::stopMovingCamera, pModeler, &TYModelerFrame::updateScale);
134 
136 }
137 
139 
141 {
142  if (function == NULL)
143  {
145  }
146  else
147  {
148  _leftButtonFunction = function;
149  }
150 }
151 
153 {
154  if (function == NULL)
155  {
157  }
158  else
159  {
160  _middleButtonFunction = function;
161  }
162 }
163 
165 {
166  if (function == NULL)
167  {
169  }
170  else
171  {
172  _rightButtonFunction = function;
173  }
174 }
175 
177 {
178  if (function == NULL)
179  {
181  }
182  else
183  {
184  _shiftLeftButtonFunction = function;
185  }
186 }
187 
189 {
190  if (function == NULL)
191  {
193  }
194  else
195  {
196  _shiftRightButtonFunction = function;
197  }
198 }
199 
201 {
202  if (function == NULL)
203  {
205  }
206  else
207  {
208  _leftButtonFunction2D = function;
209  }
210 }
211 
213 {
214  if (function == NULL)
215  {
217  }
218  else
219  {
220  _middleButtonFunction2D = function;
221  }
222 }
223 
225 {
226  if (function == NULL)
227  {
229  }
230  else
231  {
232  _rightButtonFunction2D = function;
233  }
234 }
235 
237 {
238  if (function == NULL)
239  {
241  }
242  else
243  {
244  _shiftLeftButtonFunction2D = function;
245  }
246 }
247 
249 {
250  if (function == NULL)
251  {
253  }
254  else
255  {
256  _shiftRightButtonFunction2D = function;
257  }
258 }
259 
261 {
262  if (function == NULL)
263  {
265  }
266  else
267  {
268  _leftButtonFunction3D = function;
269  }
270 }
271 
273 {
274  if (function == NULL)
275  {
277  }
278  else
279  {
280  _middleButtonFunction3D = function;
281  }
282 }
283 
285 {
286  if (function == NULL)
287  {
289  }
290  else
291  {
292  _rightButtonFunction3D = function;
293  }
294 }
295 
297 {
298  if (function == NULL)
299  {
301  }
302  else
303  {
304  _shiftLeftButtonFunction3D = function;
305  }
306 }
307 
309 {
310  if (function == NULL)
311  {
313  }
314  else
315  {
316  _shiftRightButtonFunction3D = function;
317  }
318 }
319 
321 {
322  if (function == NULL)
323  {
325  }
326  else
327  {
328  _leftButtonFunctionFree = function;
329  }
330 }
331 
333 {
334  if (function == NULL)
335  {
337  }
338  else
339  {
340  _middleButtonFunctionFree = function;
341  }
342 }
343 
345 {
346  if (function == NULL)
347  {
349  }
350  else
351  {
352  _rightButtonFunctionFree = function;
353  }
354 }
355 
357 {
358  if (function == NULL)
359  {
361  }
362  else
363  {
364  _shiftLeftButtonFunctionFree = function;
365  }
366 }
367 
369 {
370  if (function == NULL)
371  {
373  }
374  else
375  {
377  }
378 }
379 
381 {
382  _mouseEventActive = false;
383  _pStepTimer->stop();
384  QObject::disconnect(_pStepTimer, 0, this, 0);
385 
386  emit stopMovingCamera();
387 }
388 
390 {
392  {
393  // Update la cam courante
395  switch (key)
396  {
397  case Qt::Key_Shift:
398  {
399  _bKeyShift = true;
400  _keyEventActive++;
401  if (_keyEventActive > 1)
402  {
403  return;
404  }
405  else
406  {
407  QObject::connect(_pStepTimer, &QTimer::timeout, this,
409  }
410  }
411  break;
412  case Qt::Key_Up:
413  {
414  _bKeyUp = true;
415  _keyEventActive++;
416  if (_keyEventActive > 1)
417  {
418  return;
419  }
420  else
421  {
422  QObject::connect(_pStepTimer, &QTimer::timeout, this,
424  }
425  }
426  break;
427  case Qt::Key_Down:
428  {
429  _bKeyDown = true;
430  _keyEventActive++;
431  if (_keyEventActive > 1)
432  {
433  return;
434  }
435  else
436  {
437  QObject::connect(_pStepTimer, &QTimer::timeout, this,
439  }
440  }
441  break;
442  case Qt::Key_Left:
443  {
444  _bKeyLeft = true;
445  _keyEventActive++;
446  if (_keyEventActive > 1)
447  {
448  return;
449  }
450  else
451  {
452  QObject::connect(_pStepTimer, &QTimer::timeout, this,
454  }
455  }
456  break;
457  case Qt::Key_Right:
458  {
459  _bKeyRight = true;
460  _keyEventActive++;
461  if (_keyEventActive > 1)
462  {
463  return;
464  }
465  else
466  {
467  QObject::connect(_pStepTimer, &QTimer::timeout, this,
469  }
470  }
471  break;
472  case Qt::Key_PageUp:
473  {
474  _bKeyPageUp = true;
475  _keyEventActive++;
476  if (_keyEventActive > 1)
477  {
478  return;
479  }
480  else
481  {
482  QObject::connect(_pStepTimer, &QTimer::timeout, this,
484  }
485  }
486  break;
487  case Qt::Key_PageDown:
488  {
489  _bKeyPageDown = true;
490  _keyEventActive++;
491  if (_keyEventActive > 1)
492  {
493  return;
494  }
495  else
496  {
497  QObject::connect(_pStepTimer, &QTimer::timeout, this,
499  }
500  }
501  break;
502  }
503 
504  if (_keyEventActive > 0)
505  {
506  _firstCall = true;
508  emit startMovingCamera();
509  }
510  }
511 }
512 
514 {
516  {
517  if (_keyEventActive > 0)
518  {
519  _keyEventActive--;
520  switch (key)
521  {
522  case Qt::Key_Shift:
523  {
524  _bKeyShift = false;
525  }
526  break;
527  case Qt::Key_Up:
528  {
529  _bKeyUp = false;
530  }
531  break;
532  case Qt::Key_Down:
533  {
534  _bKeyDown = false;
535  }
536  break;
537  case Qt::Key_Left:
538  {
539  _bKeyLeft = false;
540  }
541  break;
542  case Qt::Key_Right:
543  {
544  _bKeyRight = false;
545  }
546  break;
547  case Qt::Key_PageUp:
548  {
549  _bKeyPageUp = false;
550  }
551  break;
552  case Qt::Key_PageDown:
553  {
554  _bKeyPageDown = false;
555  }
556  break;
557  }
558 
559  if (_keyEventActive == 0)
560  {
561  if (!_mouseEventActive)
562  {
563  _pStepTimer->stop();
564  QObject::disconnect(_pStepTimer, 0, this, 0);
565 
566  emit stopMovingCamera();
567  }
568  }
569  }
570  }
571 }
572 
573 void TYCameraEditor::slotMousePressed(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state)
574 {
575  if (_mouseEventActive)
576  {
577  return;
578  }
579 
580  // Update la cam courante
582 
584  {
586  }
587  else
588  {
589  _pCurrentCamera->setDistanceStep(30, 70, 30);
590  }
591 
592  if (button & Qt::LeftButton)
593  {
594  // Left mouse button
595  _mouseEventActive = true;
596 
597  if (state & Qt::ShiftModifier)
598  {
599  // With Shift button
600  QObject::connect(_pStepTimer, &QTimer::timeout, this, _shiftLeftButtonFunction);
601  }
602  else
603  {
604  // Without shift button
605  QObject::connect(_pStepTimer, &QTimer::timeout, this, _leftButtonFunction);
606  }
607  }
608  else if (button & Qt::MiddleButton)
609  {
610  // Middle mouse button
611  _mouseEventActive = true;
612  QObject::connect(_pStepTimer, &QTimer::timeout, this, _middleButtonFunction);
613  }
614  else if (button & Qt::RightButton)
615  {
616  // Right mouse button
617  _mouseEventActive = true;
618 
619  if (state & Qt::ShiftModifier)
620  {
621  // With Shift button
622  QObject::connect(_pStepTimer, &QTimer::timeout, this, _shiftRightButtonFunction);
623  }
624  else
625  {
626  // Without Shift button
627  QObject::connect(_pStepTimer, &QTimer::timeout, this, _rightButtonFunction);
628  }
629  }
630 
631  if (_mouseEventActive)
632  {
633  _currentMousePos[0] = x;
634  _currentMousePos[1] = y;
635  _lastMousePos[0] = x;
636  _lastMousePos[1] = y;
637  _firstCall = true;
639 
640  emit startMovingCamera();
641  }
642 }
643 
644 void TYCameraEditor::slotMouseReleased(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state)
645 {
646  if (_mouseEventActive)
647  {
648  _mouseEventActive = false;
649  if (_keyEventActive == 0)
650  {
651  _pStepTimer->stop();
652  QObject::disconnect(_pStepTimer, 0, this, 0);
653 
654  emit stopMovingCamera();
655  }
656  }
657 }
658 
659 void TYCameraEditor::slotMouseMoved(int x, int y, Qt::MouseButtons button, Qt::KeyboardModifiers state)
660 {
661  _currentMousePos[0] = x;
662  _currentMousePos[1] = y;
663 }
664 
665 void TYCameraEditor::slotWheeled(int x, int y, int delta, Qt::KeyboardModifiers state)
666 {
668  {
669  // Update la cam courante
671  _pCurrentCamera->setDistanceStep(30, 70, 30);
672 
673  _currentMousePos[0] = x;
674  _currentMousePos[1] = y;
675 
676  _lastMousePos[0] = _currentMousePos[0] + int(delta * _wheelStep);
677  _lastMousePos[1] = _currentMousePos[1] + int(delta * _wheelStep);
678 
679  // Update la cam courante
681 
682  cameraZoom();
683 
684  emit stopMovingCamera();
685  }
686 }
687 
689 {
691  _pModeler->setFocus();
692 }
693 
695 {
696  if (view == TYModelerFrame::PerspView)
697  {
699  }
700  else if (view == TYModelerFrame::FreeView)
701  {
703  }
704  else
705  {
707  }
708 }
709 
711 {
717 }
718 
720 {
726 }
727 
729 {
735 }
736 
738 {
739  float xf = NAN;
740  float yf = NAN;
741 
742  // do nothing if mouse is still on the same pos
743  if ((_currentMousePos[0] == _lastMousePos[0]) && (_currentMousePos[1] == _lastMousePos[1]))
744  {
745  return;
746  }
747 
748  // first time we do some preprocessing
749  if (_firstCall)
750  {
751  QRect viewport = _pInteractor->getViewport();
752  if (_pCurrentCamera)
753  {
754  _deltaAzimuth = -20.0 / (viewport.width() * viewport.width());
755  _deltaElevation = -20.0 / (viewport.height() * viewport.height());
756  }
757  }
758 
759  if (_pCurrentCamera)
760  {
763 
766  }
767 
768  if (!_firstCall)
769  {
770  }
771  else
772  {
773  _firstCall = false;
774  }
775 
776  emit cameraUpdated();
777 
778  // update
780 
781  // save mouse pos
784 }
785 
787 {
788  QVector3D motionVector{};
789 
790  // do nothing if mouse is still on the same pos
791  if ((_currentMousePos[0] == _lastMousePos[0]) && (_currentMousePos[1] == _lastMousePos[1]))
792  {
793  return;
794  }
795 
796  if (_pCurrentCamera)
797  {
799  {
800  if ((_currentMousePos[0] - _lastMousePos[0]) > 0)
801  {
803  }
804  if ((_currentMousePos[0] - _lastMousePos[0]) < 0)
805  {
807  }
808  if ((_currentMousePos[1] - _lastMousePos[1]) > 0)
809  {
811  }
812  if ((_currentMousePos[1] - _lastMousePos[1]) < 0)
813  {
815  }
816  }
817  else
818  {
819  QRect viewport = _pInteractor->getViewport();
821  double focalDepth = ret.z();
822  QVector3D retNew = _pInteractor->getViewport().displayToWorld(QVector3D(
823  float(viewport.width() / 2.0 + (_currentMousePos[0] - _lastMousePos[0])),
824  float(viewport.height() / 2.0 - (_currentMousePos[1] - _lastMousePos[1])), focalDepth));
825 
826  motionVector = (_pCurrentCamera->to() - retNew) * _trackballFactor / 10;
827  _pCurrentCamera->move(motionVector);
828  }
829  }
830 
831  emit cameraUpdated();
832 
833  // update
835 
836  // save mouse pos
839 }
840 
842 {
843  if (_pCurrentCamera)
844  {
845  if (_bKeyShift)
846  {
848  }
849  else
850  {
852  }
853 
855  if (_bKeyUp)
856  {
858  }
859  if (_bKeyDown)
860  {
862  }
863  if (_bKeyLeft)
864  {
866  }
867  if (_bKeyRight)
868  {
870  }
871  if (_bKeyPageUp)
872  {
874  }
875  if (_bKeyPageDown)
876  {
878  }
879  }
880 
881  emit cameraUpdated();
882 
883  // update
885 }
886 
888 {
889  float yf = NAN;
890 
891  // do nothing if mouse is still on the same y position
892  if (_currentMousePos[1] == _lastMousePos[1])
893  {
894  return;
895  }
896 
897  yf = float(_currentMousePos[1] - _lastMousePos[1]) / float(_pInteractor->getViewport().height()) *
899  // if yf < 0, we need to be between 0..1
900  yf = pow(1.1f, yf);
901 
902  if (_pCurrentCamera)
903  {
904  _pCurrentCamera->zoom(yf);
905  }
906 
907  emit cameraUpdated();
908 
909  // update
910  _pModeler->updateView(false); //, _pModeler->getShowGrid());
911 
912  // save mouse pos
915 }
916 
918 {
919  float angle = NAN;
920 
921  // do nothing if mouse is still on the same pos
922  if ((_currentMousePos[0] == _lastMousePos[0]) && (_currentMousePos[1] == _lastMousePos[1]))
923  {
924  return;
925  }
926 
927  if (_pCurrentCamera)
928  {
929  // first time we do some preprocessing
930  if (_firstCall)
931  {
932  QPoint viewportCenter = _pInteractor->getViewport().center();
933  _renCenter[0] = viewportCenter.x();
934  _renCenter[1] = viewportCenter.y();
935  _firstCall = false;
936  }
937 
938  // calculate the angle in radians and roll the camera
939  int diffX1 = _currentMousePos[0] - int(_renCenter[0]);
940  int diffY1 = _currentMousePos[1] - int(_renCenter[1]);
941  int diffX2 = _lastMousePos[0] - int(_renCenter[0]);
942  int diffY2 = _lastMousePos[1] - int(_renCenter[1]);
943 
944  double a1 = atan2(double(diffY1), double(diffX1));
945  double a2 = atan2(double(diffY2), double(diffX2));
946  angle = (a1 - a2) / (2.0 * 3.1415926535) * 360.0;
947 
948  _pCurrentCamera->roll(angle);
949 
950  emit cameraUpdated();
951  }
952 
953  // update
955 
956  // save mouse pos
959 }
960 
962 
963 void TYCameraEditor::cameraZoneZoom(const QVector3D& focalPoint2D, double factor)
964 {
965 
966  if (_pCurrentCamera)
967  {
969  double focalDepth = ret.z();
970  QVector3D targetTo = _pInteractor->getViewport().displayToWorld(
971  QVector3D(focalPoint2D[0], focalPoint2D[1], focalDepth));
972 
973  QVector3D translation = targetTo - _pCurrentCamera->to();
974  _pCurrentCamera->move(translation);
975 
976  _pCurrentCamera->zoom(1 / factor);
977  }
978 
979  emit cameraUpdated();
980 
981  // update
982  _pModeler->updateView(false);
983 }
984 
986 {
987  if (_pCurrentCamera)
988  {
990  }
991 
992  emit cameraUpdated();
993 
994  // update
996 }
998 {
999  if (_pCurrentCamera)
1000  {
1002  }
1003 
1004  emit cameraUpdated();
1005 
1006  // update
1007  _pModeler->updateView();
1008 }
1010 {
1011  if (_pCurrentCamera)
1012  {
1014  }
1015 
1016  emit cameraUpdated();
1017 
1018  // update
1019  _pModeler->updateView();
1020 }
1022 {
1024 
1025  emit cameraUpdated();
1026 
1027  // update
1028  _pModeler->updateView();
1029 }
1031 {
1032 
1033  if (_pCurrentCamera)
1034  {
1035  QVector3D motionVector(0, 1, 0);
1036  motionVector *= _translateStep;
1037  _pCurrentCamera->move(motionVector);
1038  }
1039 
1040  emit cameraUpdated();
1041 
1042  // update
1043  _pModeler->updateView();
1044 }
1045 
1047 {
1048 
1049  if (_pCurrentCamera)
1050  {
1051  QVector3D motionVector(0, 1, 0);
1052  motionVector *= _translateStep;
1053  _pCurrentCamera->move(-motionVector);
1054  }
1055 
1056  emit cameraUpdated();
1057 
1058  // update
1059  _pModeler->updateView();
1060 }
1062 {
1063 
1064  if (_pCurrentCamera)
1065  {
1066  QVector3D direction = _pCurrentCamera->from() - _pCurrentCamera->to();
1067  QVector3D motionVector = QVector3D::crossProduct(direction, QVector3D(0, 1, 0));
1068  motionVector.normalize();
1069 
1070  motionVector *= _translateStep;
1071 
1072  _pCurrentCamera->move(motionVector);
1073  }
1074 
1075  emit cameraUpdated();
1076 
1077  // update
1078  _pModeler->updateView();
1079 }
1081 {
1082  NxVec3 motionVector;
1083 
1084  if (_pCurrentCamera)
1085  {
1086  QVector3D direction = _pCurrentCamera->from() - _pCurrentCamera->to();
1087  QVector3D motionVector = QVector3D::crossProduct(direction, QVector3D(0, 1, 0));
1088  motionVector.normalize();
1089 
1090  motionVector *= _translateStep;
1091  _pCurrentCamera->move(-motionVector);
1092  }
1093 
1094  emit cameraUpdated();
1095 
1096  // update
1097  _pModeler->updateView();
1098 }
1100 {
1101  if (_pCurrentCamera)
1102  {
1104  }
1105 
1106  emit cameraUpdated();
1107 
1108  // update
1109  _pModeler->updateView();
1110 }
1112 {
1113  if (_pCurrentCamera)
1114  {
1116  }
1117 
1118  emit cameraUpdated();
1119 
1120  // update
1121  _pModeler->updateView();
1122 }
All base classes related to 3D manipulation.
@ PERSPECTIVE
Definition: OGLCamera.h:42
gestion de l'edition de la camera (fichier header)
#define TYDIRPREFERENCEMANAGER
Definition: TYElement.h:51
Classe generique pour une fenetre de modeleur (fichier header)
Le role de cette classe est limite a emettre des signaux pouvant etre utilise pour interagir sur le r...
Definition: NxVec3.h:23
void moveDown()
Definition: OGLCamera.cpp:150
void move(const QVector3D &_direction)
Definition: OGLCamera.cpp:97
void elevation(NxReal _angle)
Definition: OGLCamera.cpp:403
void azimuth(NxReal _angle)
Definition: OGLCamera.cpp:396
void roll(NxReal _angle)
Definition: OGLCamera.cpp:410
void zoom(double zoomFactor)
Definition: OGLCamera.cpp:373
void moveRight()
Definition: OGLCamera.cpp:180
void calculateStepVectors()
Definition: OGLCamera.cpp:341
void moveLeft()
Definition: OGLCamera.cpp:165
const QVector3D & from() const
Definition: OGLCamera.cpp:263
CameraType cameraType() const
Definition: OGLCamera.cpp:92
void setDistanceStep(NxReal _magnitudeStepUp, NxReal _magnitudeStepFront, NxReal _magnitudeStepLeft)
Definition: OGLCamera.cpp:237
const QVector3D & to() const
Definition: OGLCamera.cpp:276
void moveBack()
Definition: OGLCamera.cpp:120
void moveFront()
Definition: OGLCamera.cpp:105
void moveUp()
Definition: OGLCamera.cpp:135
Classe abstraite pour la gestion de l'interaction entre la vue graphique (2D ou 3D) et le clavier et ...
TYModelerFrame * _pModeler
Le modeler associe a cet editor.
TYRenderWindowInteractor * _pInteractor
La vue graphique associee a cet editor.
Gestion de l'edition en mode camera.
QTimer * _pStepTimer
void setMiddleButtonFunction(void(TYCameraEditor::*function)())
void setRightButtonFunctionFree(void(TYCameraEditor::*function)())
void(TYCameraEditor::* _shiftLeftButtonFunctionFree)()
void(TYCameraEditor::* _shiftRightButtonFunction)()
void setRightButtonFunction(void(TYCameraEditor::*function)())
void stopMovingCamera()
Indique la fin du deplacement de la camera.
void(TYCameraEditor::* _shiftRightButtonFunction3D)()
void setMiddleButtonFunction3D(void(TYCameraEditor::*function)())
void startMovingCamera()
Indique le debut du deplacement de la camera.
void(TYCameraEditor::* _middleButtonFunction2D)()
virtual void slotMouseReleased(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state)
void setToNavigationFree()
void setRightButtonFunction3D(void(TYCameraEditor::*function)())
OGLCamera * _pCurrentCamera
void setShiftRightButtonFunction3D(void(TYCameraEditor::*function)())
void(TYCameraEditor::* _middleButtonFunction)()
virtual void slotMouseMoved(int x, int y, Qt::MouseButtons button, Qt::KeyboardModifiers state)
virtual void slotKeyPressed(int key)
void setLeftButtonFunctionFree(void(TYCameraEditor::*function)())
void setLeftButtonFunction2D(void(TYCameraEditor::*function)())
void cameraUpdated()
Indique que la position ou l'orientation de la camera a ete modifiee.
void setNavigationOnViewType(int view)
Switch auto entre navi 2D ou 3D.
void(TYCameraEditor::* _shiftRightButtonFunction2D)()
void cameraStepTranslateUp()
void setShiftRightButtonFunctionFree(void(TYCameraEditor::*function)())
void(TYCameraEditor::* _shiftLeftButtonFunction2D)()
void(TYCameraEditor::* _leftButtonFunction2D)()
void setMiddleButtonFunction2D(void(TYCameraEditor::*function)())
void cameraStepRotateRight()
void(TYCameraEditor::* _rightButtonFunction2D)()
void(TYCameraEditor::* _shiftLeftButtonFunction3D)()
void setInteractionTime(int time)
void setRightButtonFunction2D(void(TYCameraEditor::*function)())
void(TYCameraEditor::* _rightButtonFunction3D)()
void(TYCameraEditor::* _leftButtonFunction3D)()
void setShiftLeftButtonFunctionFree(void(TYCameraEditor::*function)())
void setShiftRightButtonFunction2D(void(TYCameraEditor::*function)())
void cameraStepTranslateRight()
void cameraStepRotateDown()
virtual void slotWheeled(int x, int y, int delta, Qt::KeyboardModifiers state)
void(TYCameraEditor::* _leftButtonFunctionFree)()
float _renCenter[2]
virtual void slotKeyReleased(int key)
void(TYCameraEditor::* _leftButtonFunction)()
void setLeftButtonFunction3D(void(TYCameraEditor::*function)())
void setShiftLeftButtonFunction2D(void(TYCameraEditor::*function)())
void stopCameraZoom()
Force l'arrêt du mode zoom de la caméra.
void(TYCameraEditor::* _shiftLeftButtonFunction)()
TYCameraEditor(TYModelerFrame *pModeler)
void cameraStepTranslateDown()
void setMiddleButtonFunctionFree(void(TYCameraEditor::*function)())
void(TYCameraEditor::* _rightButtonFunction)()
void setShiftLeftButtonFunction3D(void(TYCameraEditor::*function)())
int _currentMousePos[2]
void(TYCameraEditor::* _rightButtonFunctionFree)()
void setSensitivity(float t)
void setShiftRightButtonFunction(void(TYCameraEditor::*function)())
void cameraStepTranslateLeft()
void setShiftLeftButtonFunction(void(TYCameraEditor::*function)())
void(TYCameraEditor::* _middleButtonFunction3D)()
void cameraZoneZoom(const QVector3D &focalPoint2D, double factor)
virtual void slotMousePressed(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state)
void(TYCameraEditor::* _middleButtonFunctionFree)()
void setLeftButtonFunction(void(TYCameraEditor::*function)())
virtual void slotViewTypeChanged(int view)
void(TYCameraEditor::* _shiftRightButtonFunctionFree)()
Generic class for a modeler window.
void startMovingRenderMode()
virtual void updateView(bool clipping=true, bool axesAndGrid=true)
QVector3D worldToDisplay(const QVector3D &world) const
QVector3D displayToWorld(const QVector3D &display) const
const TYRenderViewport & getViewport() const
OGLCamera * getActiveCamera()