1 // Copyright (C) 2009-2015 CEA/DEN, EDF R&D
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
22 #ifndef _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_
23 #define _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_
25 #include "HEXABLOCKGUI_Export.hxx"
27 #include <OCCViewer_ViewWindow.h>
28 #include "HEXABLOCKGUI_SalomeTools.hxx"
30 #include <AIS_Shape.hxx>
31 #include <SelectMgr_IndexedMapOfOwner.hxx>
34 #include <QModelIndex>
35 #include <QModelIndexList>
43 /********************************************************************************
45 ********************************************************************************/
47 class HEXABLOCK_EXPORT OccGraphicView
51 OccGraphicView(OCCViewer_ViewWindow* view, QWidget* parent=NULL);
52 virtual ~OccGraphicView(){};
54 void highlight( const QModelIndex & index, bool only=true );
55 void highlight( const QModelIndexList & indexList, bool only=true );
57 // * 'only' parameter precise if we want to clear the current highlighted shapes/subshapes first
58 void highlightSubShapes(const Handle(AIS_Shape)& anObj,
59 const TColStd_IndexedMapOfInteger& aIndexMap, bool only=true);
60 void highlight( const QMultiMap<QString, int>& entrySubIDs, bool only=true );
62 void setViewWindow(OCCViewer_ViewWindow* view) { viewWindow = view; }
63 OCCViewer_ViewWindow* getViewWindow() const { return viewWindow; }
65 void setSelectionMode(TopAbs_ShapeEnum mode);
66 void setSelectionMode(const QModelIndex& eltIndex);
67 TopAbs_ShapeEnum getSelectionMode() const { return selectionMode; }
68 void getSelected(SALOME_ListIO& selectedObjects);
69 void clearSelection();
70 void localSelection(const int theMode);
71 void globalSelection(const bool update = false );
73 void addShape(QString& entry, const Handle(AIS_Shape)& ais_shape);
74 Handle(AIS_Shape) getShape(const QString& entry);
75 Handle(AIS_InteractiveContext) getContext();
76 SOCC_Prs* getPrs() const { return prs; }
77 void setPrs(SOCC_Prs* occPrs) { prs = occPrs; }
78 void addVertexToCloud(TopoDS_Vertex& vertex);
79 void displayPreview(TopoDS_Shape& shape);
80 Handle(AIS_Shape) getPreviewShape();
84 OCCViewer_ViewWindow* viewWindow;
86 Handle(AIS_Shape) previewShape;
87 TopAbs_ShapeEnum selectionMode;
88 QMap<QString, Handle(AIS_Shape)> shapes;