Salome HOME
correct previous integration (Porting to Python 2.6)
[modules/smesh.git] / src / OBJECT / SMESH_PreviewActorsCollection.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH OBJECT : interactive object for SMESH visualization
23 //  File   : SMESH_PreviewActorsCollection.h
24 //  Author : OCN
25 //  Module : SMESH
26 //  $Header: /home/server/cvs/SMESH/SMESH_SRC/src/OBJECT/SMESH_PreviewActorsCollection.h,v 1
27 //
28 #ifndef SMESH_PREVIEW_ACTOR_COLLECTION_H
29 #define SMESH_PREVIEW_ACTOR_COLLECTION_H
30
31 #include "SMESH_Actor.h"
32 #include <GEOM_Actor.h>
33 #include "SMESH_Object.h"
34 #include <TopoDS_Shape.hxx>
35 #include <SMDS_SetIterator.hxx>
36 #include <TopAbs_ShapeEnum.hxx>
37 #include <TopTools_IndexedMapOfShape.hxx>
38 #include <QString>
39 #include <QMap>
40
41 class vtkRenderer;
42 class GEOM_Actor;
43
44 class SMESHOBJECT_EXPORT SMESH_PreviewActorsCollection
45 {
46  public:
47   SMESH_PreviewActorsCollection();
48   ~SMESH_PreviewActorsCollection();
49
50   virtual void    AddToRender(vtkRenderer* theRenderer);
51   virtual void    RemoveFromRender(vtkRenderer* theRenderer);
52
53   bool            Init( const TopoDS_Shape& theShape, TopAbs_ShapeEnum subShapeType = TopAbs_EDGE, const QString& = QString("") );
54
55   void            SetSelector( SVTK_Selector* );
56
57   void            HighlightAll( bool );
58   void            HighlightID( int );
59
60   GEOM_Actor*     GetActorByIndex( int );
61
62   int             GetIndexByShape( const TopoDS_Shape& );
63
64   void            SetShown( bool );
65
66  protected:
67    GEOM_Actor*    createActor( const TopoDS_Shape& );
68
69  protected:
70   TopoDS_Shape                 myMainShape;
71   SVTK_Selector*               mySelector;
72   vtkRenderer*                 myRenderer;
73   TopTools_IndexedMapOfShape   myMapOfShapes;
74   QMap<int, GEOM_Actor*>       myMapOfActors;
75 };
76
77
78 #endif //SMESH_DEVICE_ACTOR_COLLECTION_H