Salome HOME
22806: EDF SMESH: Regression: Prism_3D error
[modules/smesh.git] / src / OBJECT / SMESH_SVTKActor.h
1 // Copyright (C) 2007-2014  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, or (at your option) any later version.
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
23 //  SMESH OBJECT : interactive object for SMESH visualization
24 //  File   : SMESH_SVTKActor.h
25 //  Author : Roman NIKOLAEV
26 //  Module : SMESH
27 //
28 #ifndef SMESH_SVTKACTOR_H
29 #define SMESH_SVTKACTOR_H
30
31 #include "SMESH_Object.h"
32 #include <SVTK_Actor.h>
33
34
35 class SVTK_Actor;
36 class vtkUnstructureGrid;
37 class vtkDataSetMapper;
38
39 class SMESHOBJECT_EXPORT SMESH_SVTKActor : public SVTK_Actor {
40
41 public:
42   static SMESH_SVTKActor* New();
43
44   vtkTypeMacro(SMESH_SVTKActor, SVTK_Actor);
45
46   void SetBallSize(float theSize);
47   void Set0DSize(float theSize);
48
49   //! To publish the actor an all its internal devices
50   virtual
51   void
52   AddToRender(vtkRenderer* theRendere); 
53
54   virtual void SetVisibility( int theVisibility );
55
56   //! Initialiaze the instance completely
57   virtual void
58   Initialize();
59
60   //! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
61   virtual void
62   MapCells(SALOME_Actor* theMapActor,
63            const TColStd_IndexedMapOfInteger& theMapIndex);
64
65
66   //! To remove the actor an all its internal devices
67   virtual
68   void
69   RemoveFromRender(vtkRenderer* theRendere);
70
71   void SetVisualObject(TVisualObjPtr theVisualObj);
72
73  protected:
74   SVTK_DeviceActor* my0DActor;
75   SVTK_DeviceActor* myBallActor;
76
77   vtkUnstructuredGrid* my0DGrid;
78   vtkUnstructuredGrid* myBallGrid;
79   TVisualObjPtr myVisualObj;
80   
81   SMESH_SVTKActor();
82   virtual ~SMESH_SVTKActor();
83 };
84
85 #endif