Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPickEditor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
27 #ifndef __TY_PICK_EDITOR__
28 #define __TY_PICK_EDITOR__
29 
30 #include "TYAbstractSceneEditor.h"
32 #include "TYElementPicker.h"
33 #include <QPoint>
34 
40 {
41  Q_OBJECT
42 
43 public:
44  TYPickEditor(TYModelerFrame* pModeler);
45  ~TYPickEditor();
46 
52  {
53  return _pPicker;
54  }
55 
59  void setPickTolerance(float tolerance)
60  {
61  _pickTolerance = tolerance;
62  }
67  {
68  return _pickTolerance;
69  }
70 
74  void setRolloverTolerance(float tolerance)
75  {
76  _rolloverTolerance = tolerance;
77  }
82  {
83  return _rolloverTolerance;
84  }
85 
86 public slots:
87  virtual void slotMousePressed(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state);
88  virtual void slotMouseReleased(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state);
89  virtual void slotMouseMoved(int x, int y, Qt::MouseButtons button, Qt::KeyboardModifiers state);
90  virtual void slotWheeled(int x, int y, int delta, Qt::KeyboardModifiers state);
91  virtual void slotKeyPressed(int key);
92  virtual void slotMouseLeave();
93 
97  void useHighlight(bool state)
98  {
99  _useHighlight = state;
100  }
104  void usePopup(bool state)
105  {
106  _usePopup = state;
107  }
108 
112  void resetPicker()
113  {
114  _pPicker->reset();
115  }
116 
117 protected slots:
118  virtual void showPopupMenu(std::shared_ptr<LPTYElementArray> pElts);
119  void showPositionDialog(TYGeometryNode* pGeoNode, bool activeHeight);
120  void showRotationDialog(TYGeometryNode* pGeoNode);
121  void showDimensionsDialog(TYAcousticVolume* pAccVol);
122  void showPanel(TYElement* pElt);
123  void hidePanel();
124 
125 private:
126  void siteModelerPopupMenu(std::shared_ptr<LPTYElementArray> pElts);
127  void machineModelerPopupMenu(std::shared_ptr<LPTYElementArray> pElts);
128  void batimentModelerPopupMenu(std::shared_ptr<LPTYElementArray> pElts);
129  void manageProperties(TYElement* pElement);
130  void copySite(TYElement* pElement);
131  void remSite(TYElement* pElement);
132  void splitCurve(TYElement* pElement);
133  void copyMaillage(TYElement* pElement);
134  void remMaillage(TYElement* pElement);
135  void copyPtCtrl(TYElement* pElement);
136  void remPtCtrl(TYElement* pElement);
137  void remTopoElmt(TYElement* pElement);
138  void copyTopoElmt(TYElement* pElement);
139  void remInfraElmt(TYElement* pElement);
140  void copyInfraElmt(TYElement* pElement);
141  void setVolumeSize(TYElement* pElement);
142  void removeVolume(TYElement* pElement);
143  void copyVolume(TYElement* pElement);
144  void openFaceModeler(TYElement* pElement);
145  void inverseNormal(TYElement* pElement);
146  void floorHeight(TYElement* pElement);
147  void screenHeight(TYElement* pElement);
148  void screenThick(TYElement* pElement);
149  bool realWorldPosition(OPoint3D& pt);
151 
152 protected:
155 
159 
160  // Dernier element rollover
162 
166  bool _usePopup;
167 
171 };
172 
173 #endif // __TY_PICK_EDITOR__
gestion de l'interaction entre la vue graphique (2D ou 3D) et le clavier et la souris (fichier header...
gestion des elements selectionnes par picking (fichier header)
The 3D point class.
Definition: 3d.h:487
Classe abstraite pour la gestion de l'interaction entre la vue graphique (2D ou 3D) et le clavier et ...
gestion des elements selectionnes par picking
void reset()
Retourne dans son etat initial.
Classe generique pour une fenetre de modeleur.
gestion de l'element actionne par picking
Definition: TYPickEditor.h:40
void remSite(TYElement *pElement)
void copyTopoElmt(TYElement *pElement)
void screenThick(TYElement *pElement)
void openFaceModeler(TYElement *pElement)
void inverseNormal(TYElement *pElement)
void copyMaillage(TYElement *pElement)
void updateCopyPosition(LPTYGeometryNode &pNode)
void copySite(TYElement *pElement)
void screenHeight(TYElement *pElement)
virtual void showPopupMenu(std::shared_ptr< LPTYElementArray > pElts)
void usePopup(bool state)
Definition: TYPickEditor.h:104
void resetPicker()
Definition: TYPickEditor.h:112
void showRotationDialog(TYGeometryNode *pGeoNode)
void manageProperties(TYElement *pElement)
virtual void slotKeyPressed(int key)
bool realWorldPosition(OPoint3D &pt)
float _rolloverTolerance
Definition: TYPickEditor.h:170
TYPickEditor(TYModelerFrame *pModeler)
void setVolumeSize(TYElement *pElement)
void showDimensionsDialog(TYAcousticVolume *pAccVol)
void removeVolume(TYElement *pElement)
void copyVolume(TYElement *pElement)
void batimentModelerPopupMenu(std::shared_ptr< LPTYElementArray > pElts)
void setRolloverTolerance(float tolerance)
Definition: TYPickEditor.h:74
void setPickTolerance(float tolerance)
Definition: TYPickEditor.h:59
virtual void slotMousePressed(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state)
virtual void slotMouseLeave()
virtual void slotMouseReleased(int x, int y, Qt::MouseButton button, Qt::KeyboardModifiers state)
TYElementPicker * getPicker()
Methode qui retourne le picker.
Definition: TYPickEditor.h:51
void floorHeight(TYElement *pElement)
void showPositionDialog(TYGeometryNode *pGeoNode, bool activeHeight)
void remTopoElmt(TYElement *pElement)
void copyInfraElmt(TYElement *pElement)
TYElementPicker * _pPicker
Le picker du modeler.
Definition: TYPickEditor.h:154
void siteModelerPopupMenu(std::shared_ptr< LPTYElementArray > pElts)
TYElement * _pLastRolloverElt
Definition: TYPickEditor.h:161
QPoint _lastPressedCurPos
Derniere position de la souris.
Definition: TYPickEditor.h:157
float getRolloverTolerance()
Definition: TYPickEditor.h:81
float _pickTolerance
Tolerance du picking.
Definition: TYPickEditor.h:169
void remPtCtrl(TYElement *pElement)
void machineModelerPopupMenu(std::shared_ptr< LPTYElementArray > pElts)
void useHighlight(bool state)
Definition: TYPickEditor.h:97
void remInfraElmt(TYElement *pElement)
QPoint _lastMovedCurPos
Definition: TYPickEditor.h:158
void remMaillage(TYElement *pElement)
void splitCurve(TYElement *pElement)
void copyPtCtrl(TYElement *pElement)
float getPickTolerance()
Definition: TYPickEditor.h:66
virtual void slotMouseMoved(int x, int y, Qt::MouseButtons button, Qt::KeyboardModifiers state)
bool _useHighlight
Flag pour l'activation du highlight.
Definition: TYPickEditor.h:164
void showPanel(TYElement *pElt)
bool _usePopup
Flag pour l'activation du popup menu.
Definition: TYPickEditor.h:166
virtual void slotWheeled(int x, int y, int delta, Qt::KeyboardModifiers state)