]> SALOME platform Git repositories - modules/geom.git/blob - src/OBJECT/GEOM_OCCReader.h
Salome HOME
NRI : First integration.
[modules/geom.git] / src / OBJECT / GEOM_OCCReader.h
1 //  File      : GEOM_OCCReader.h
2 //  Created   : Wed Feb 20 17:24:59 2002
3 //  Author    : Christophe ATTANASIO
4 //  Project   : SALOME
5 //  Module    : GEOM
6 //  Copyright : Open CASCADE 2002
7 //  $Header$
8
9 /*!
10   \class GEOM_OCCReader GEOM_OCCReader.h
11   \brief This class allow to display a OpenCASCADE CAD model in a VTK viewer.
12 */
13
14 #ifndef GEOM_OCCREADER_H
15 #define GEOM_OCCREADER_H
16
17 // VTK
18 #include <vtkPolyDataSource.h>
19 #include <vtkPoints.h>
20 #include <vtkCellArray.h>
21
22 // OpenCASCADE
23 #include <TopoDS_Shape.hxx>
24 #include <TopoDS.hxx>
25 #include <Poly_Polygon3D.hxx>
26 #include <Poly_PolygonOnTriangulation.hxx>
27 #include <GeomAbs_IsoType.hxx>
28 #include <BRepAdaptor_Surface.hxx>
29
30 #ifdef _WIN_32
31 #define VTKOCC_EXPORT __declspec (dllexport)
32 #else
33 #define VTKOCC_EXPORT
34 #endif
35 class VTKOCC_EXPORT GEOM_OCCReader : public vtkPolyDataSource {
36
37   // methods    
38
39  public:        
40
41   static GEOM_OCCReader* New();
42
43   const TopoDS_Shape& getTopo();
44
45   void setTopo(const TopoDS_Shape& ashape);
46
47   int  getDisplayMode();
48   void setDisplayMode(int);
49
50   void setForceUpdate(Standard_Boolean bol);
51
52  protected:
53
54   GEOM_OCCReader();
55   ~GEOM_OCCReader();
56   void Execute();       
57
58   void ComputeShading(vtkPoints* Pts,vtkCellArray* Cells);
59   void ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells);
60
61   void TransferFaceSData(const TopoDS_Face& aFace,
62                          vtkPoints* Pts,
63                          vtkCellArray* Cells);
64
65   void TransferFaceWData(const TopoDS_Face& aFace,
66                          vtkPoints* Pts,
67                          vtkCellArray* Cells);
68
69   void TransferEdgeSData(const TopoDS_Edge& aEdge,
70                          vtkPoints* Pts,
71                          vtkCellArray* Cells);
72
73   void TransferEdgeWData(const TopoDS_Edge& aEdge,
74                          vtkPoints* Pts,
75                          vtkCellArray* Cells);
76
77   void TransferVertexWData(const TopoDS_Vertex& aVertex,
78                            vtkPoints* Pts,
79                            vtkCellArray* Cells);
80
81   void createISO(const TopoDS_Face &, 
82                  double, int,
83                  vtkPoints* Pts,
84                  vtkCellArray* Cells);
85   
86   void DrawIso(GeomAbs_IsoType aType,
87                Standard_Real PParm,
88                Standard_Real p1,
89                Standard_Real p2,
90                vtkPoints* Pts,
91                vtkCellArray* Cells,
92                Standard_Integer& startidx);
93   
94   void MoveTo(gp_Pnt P,
95               vtkPoints* Pts);
96
97   void DrawTo(gp_Pnt P,
98               vtkPoints* Pts,
99               vtkCellArray* Cells);
100
101   void PlotIso(BRepAdaptor_Surface& S, 
102                GeomAbs_IsoType T,
103                Standard_Real& U, 
104                Standard_Real& V, 
105                Standard_Real Step, 
106                Standard_Boolean& halt,
107                vtkPoints* Pts,
108                vtkCellArray* Cells);
109
110   // fields
111
112  private:
113
114   Standard_Boolean       forced;
115   int                    discretiso;
116   int                    amode;
117   int                    nbisos;
118   TopoDS_Shape           myShape;
119
120 };
121
122 #endif //GEOM_OCCREADER_H