Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSiteFrame.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 
25 #ifndef __TY_SITE_FRAME__
26 #define __TY_SITE_FRAME__
27 
28 #include <qwidget.h>
29 #include <qtreewidget.h>
30 
31 #include "TYAppDefines.h"
34 
35 class QMenuBar;
36 class QListView;
37 
42 class TYSiteFrame : public QWidget
43 {
44  Q_OBJECT
45 
46 public:
50  TYSiteFrame(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags f = QFlag(0));
54  virtual ~TYSiteFrame();
55 
60  {
61  return _pSiteNodeRoot;
62  }
63 
67  void clear()
68  {
69  _pListView->clear();
70  }
71 
75  void exportEXCEL(TYElement* pElement);
76 
80  void changePos(TYElement* pElement);
81 
85  void changeRotation(TYElement* pElement);
86 
90  void localise(TYElement* pElement, TYElementGraphic* pGraphicObject);
91 
95  bool supprime(TYElementListItem* eltItem);
96 
100  void importFromLib(const unsigned int& filter, TYElement* pElement);
101 
105  void addEltXML(const char* className, TYElement* pElement);
106 
110  void newElt(const char* className, TYElement* pElement);
111 
115  void addElt(TYElement* pElement, TYElement* pElt);
116 
120  void selectOrUnselectAll(TYElementListItem* item, const bool& bSelect);
121 
126  void setDMaxDefault(TYElementListItem* item);
127 
128 public slots:
132  void setSiteNodeRoot(LPTYSiteNode pSiteNode);
133 
137  void updateList();
138 
143  {
144  _pCurrentCalcul = pCalcul;
145  updateList();
146  }
147 
152  TYElementListItem* addToList(LPTYSiteNode pElement, TYElementListItem* parent = NULL);
168 
173  TYElementListItem* addToList(LPTYSpectre pElement, TYElementListItem* parent = NULL);
183  TYElementListItem* addToList(LPTYMachine pElement, TYElementListItem* parent = NULL);
188  TYElementListItem* addToList(LPTYBatiment pElement, TYElementListItem* parent = NULL);
189 
193  bool remInInfra(LPTYSiteNode _siteNode, TYElementListItem* item, const char* className);
194 
198  bool remInTopo(LPTYSiteNode _siteNode, TYElementListItem* item, const char* className);
199 
203  virtual void contextMenuEvent(QContextMenuEvent* e);
204 
211  bool remFromList(TYElementListItem* item);
212 
219  void apply(QTreeWidgetItem* item, int col);
220 
227  void openModeler(QTreeWidgetItem* item, int column);
228 
229 private:
234  bool remFromSite(TYElement* pElement);
235 
236 protected:
242  const bool& chekable = false);
243 
244 protected:
245  QMenuBar* _pMenuBar;
246  QTreeWidget* _pListView;
247 
250 
253 };
254 
255 #endif //__TY_SITE_FRAME__
const char * name
classe graphique pour un element de base
Frame pour les messages de retour.
Frame pour la gestion de site.
Definition: TYSiteFrame.h:43
void clear()
Definition: TYSiteFrame.h:67
void newElt(const char *className, TYElement *pElement)
void openModeler(QTreeWidgetItem *item, int column)
void changeRotation(TYElement *pElement)
virtual ~TYSiteFrame()
Definition: TYSiteFrame.cpp:84
bool remFromList(TYElementListItem *item)
void updateList()
TYSiteFrame(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=QFlag(0))
Definition: TYSiteFrame.cpp:58
void selectOrUnselectAll(TYElementListItem *item, const bool &bSelect)
void addEltXML(const char *className, TYElement *pElement)
LPTYCalcul _pCurrentCalcul
L'Id du calcul courant.
Definition: TYSiteFrame.h:252
TYSiteNode * getSiteNodeRoot()
Definition: TYSiteFrame.h:59
void setDMaxDefault(TYElementListItem *item)
void changePos(TYElement *pElement)
LPTYSiteNode _pSiteNodeRoot
Le site node root.
Definition: TYSiteFrame.h:249
QMenuBar * _pMenuBar
Definition: TYSiteFrame.h:245
void localise(TYElement *pElement, TYElementGraphic *pGraphicObject)
void addElt(TYElement *pElement, TYElement *pElt)
bool supprime(TYElementListItem *eltItem)
void setSiteNodeRoot(LPTYSiteNode pSiteNode)
Definition: TYSiteFrame.cpp:89
bool remFromSite(TYElement *pElement)
TYElementListItem * addToList(LPTYSiteNode pElement, TYElementListItem *parent=NULL)
void exportEXCEL(TYElement *pElement)
TYElementListItem * addEltToList(LPTYElement pElement, TYElementListItem *parent=NULL, const bool &chekable=false)
void importFromLib(const unsigned int &filter, TYElement *pElement)
virtual void contextMenuEvent(QContextMenuEvent *e)
QTreeWidget * _pListView
Definition: TYSiteFrame.h:246
bool remInTopo(LPTYSiteNode _siteNode, TYElementListItem *item, const char *className)
void setCurrentCalcul(LPTYCalcul pCalcul)
Definition: TYSiteFrame.h:142
bool remInInfra(LPTYSiteNode _siteNode, TYElementListItem *item, const char *className)
void apply(QTreeWidgetItem *item, int col)