Salome HOME
Bug IPAL21615 Problem in VTK viewer when number of isos = 0
[modules/geom.git] / src / OBJECT / GEOM_FaceSource.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 #ifndef GEOM_FACESOURCE_H 
23 #define GEOM_FACESOURCE_H 
24  
25 #include "GEOM_DeviceActor.h" 
26  
27 #include <gp_Pnt.hxx>
28 #include <TopoDS_Face.hxx> 
29 #include <NCollection_Set.hxx> 
30  
31 typedef NCollection_Set<TopoDS_Face> TFaceSet; 
32  
33 #include <vtkPolyDataSource.h> 
34  
35 class GEOM_FaceSource; 
36 typedef GEOM_SmartPtr<GEOM_FaceSource> PFaceSource; 
37  
38  
39 class VTK_EXPORT GEOM_FaceSource: public vtkPolyDataSource 
40
41 public: 
42   vtkTypeMacro(GEOM_FaceSource,vtkPolyDataSource); 
43  
44   void AddFace(const TopoDS_Face& theFace); 
45   void Clear(){ myFaceSet.Clear();} 
46   bool IsEmpty(){return myFaceSet.IsEmpty();}
47  
48 protected: 
49   TFaceSet myFaceSet; 
50  
51   static 
52   void MoveTo(gp_Pnt thePnt, 
53               vtkPoints* thePts);
54   static 
55   void DrawTo(gp_Pnt thePnt,
56               vtkPolyData* thePolyData,
57               vtkPoints* thePts); 
58  
59   GEOM_FaceSource(); 
60   ~GEOM_FaceSource(); 
61  
62 private: 
63   // Not implememnted 
64   GEOM_FaceSource(const GEOM_FaceSource&); 
65   void operator=(const GEOM_FaceSource&); 
66 }; 
67  
68  
69 #endif //GEOM_FACESOURCE_H