1 // Copyright (C) 2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library 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. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef GEOMGUI_TEXTTREEWDG_H
21 #define GEOMGUI_TEXTTREEWDG_H
23 #include "GEOM_GEOMGUI.hxx"
24 #include "GEOM_Displayer.h"
26 #include <QTreeWidget>
29 #include <SALOMEDSClient.hxx>
34 class QTreeWidgetItem;
35 class SalomeApp_Application;
36 class SalomeApp_Study;
39 * \brief Tree view contains Dimension and Annotation text items:
40 * - text visibility in OCC viewer
43 class GEOMGUI_EXPORT GEOMGUI_TextTreeWdg : public QTreeWidget
48 GEOMGUI_TextTreeWdg( SalomeApp_Application* app );
49 ~GEOMGUI_TextTreeWdg();
51 int getWinID() { return myWindowID; }
53 void removeBranch( const QString& theEntry,
55 int idFromItem( QTreeWidgetItem* theItem );
56 QString entryFromItem( QTreeWidgetItem* theShapeItem );
57 QTreeWidgetItem* itemFromEntry( QString theEntry );
58 void setShapeDimensionsVisibility( QString theEntry, bool theVisibility );
59 void setDimensionVisibility( QString theEntry, QTreeWidgetItem* theDimItem, bool theVisibility );
63 void redisplay( QString theEntry );
67 void updateBranch( const QString& theEntry );
70 void onItemClicked(QTreeWidgetItem*, int );
71 void updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
72 void setVisibility( bool visibility );
73 void showContextMenu( const QPoint& pos );
80 QIcon myInvisibleIcon;
81 QHash<QString, QTreeWidgetItem*> myObjects;
82 SalomeApp_Study* myStudy;
83 QTreeWidgetItem* myDimensionsItem;
84 GEOM_Displayer myDisplayer;
86 QMap<int, QAction*> myActions; //!< menu actions list