fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / VTK / OSGVTKPolyDataMapper.h
blob3ce844c891260dc4a29f3de1def1e1d15fef40a5
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGVTKPOLYDATAMAPPER_H_
40 #define _OSGVTKPOLYDATAMAPPER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGVTKPolyDataMapperBase.h"
47 #include "OSGChunkMaterial.h"
48 #include "OSGMaterialChunk.h"
49 #include "OSGGeometry.h"
51 #ifdef OSG_WITH_VTK
52 #include <vtkTimeStamp.h>
54 class vtkActor;
55 class vtkCellArray;
56 #endif
58 #ifdef OSG_HAVE_ACTION //CHECK
59 #include "OSGActorBase.h"
60 #endif
62 OSG_BEGIN_NAMESPACE
64 class OSG_CONTRIBVTK_DLLMAPPING VTKPolyDataMapper : public VTKPolyDataMapperBase
66 /*========================== PUBLIC =================================*/
68 public:
70 /*---------------------------------------------------------------------*/
71 /*! \name Sync */
72 /*! \{ */
74 virtual void changed(ConstFieldMaskArg whichField,
75 UInt32 origin,
76 BitVector detail);
78 /*! \} */
79 /*---------------------------------------------------------------------*/
80 /*! \name Helper */
81 /*! \{ */
83 void execute(void);
85 #ifdef OSG_WITH_VTK
86 void setActor(vtkActor *pActor);
87 #endif
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Helper */
92 /*! \{ */
94 void adjustVolume(Volume &volume);
96 /*! \} */
97 /*---------------------------------------------------------------------*/
98 /*! \name Dump */
99 /*! \{ */
101 virtual void dump( UInt32 uiIndent = 0,
102 const BitVector bvFlags = 0) const;
104 /*! \} */
105 /*========================= PROTECTED ===============================*/
107 protected:
109 typedef VTKPolyDataMapperBase Inherited;
111 #ifdef OSG_WITH_VTK
112 vtkActor *_pActor;
113 vtkTimeStamp _executeTime;
114 vtkTimeStamp _modifiedTime;
115 #endif
117 /*---------------------------------------------------------------------*/
118 /*! \name Constructors */
119 /*! \{ */
121 VTKPolyDataMapper(void);
122 VTKPolyDataMapper(const VTKPolyDataMapper &source);
124 /*! \} */
125 /*---------------------------------------------------------------------*/
126 /*! \name Destructors */
127 /*! \{ */
129 virtual ~VTKPolyDataMapper(void);
131 virtual void resolveLinks(void);
133 /*! \} */
134 /*---------------------------------------------------------------------*/
135 /*! \name Init */
136 /*! \{ */
138 void initGeometries(void);
140 #ifdef OSG_WITH_VTK
141 bool processPrimitive(OSG::GeoPnt3fProperty *pPoints,
142 OSG::GeoColor4fProperty *pColors,
143 OSG::GeoVec3fProperty *pNormals,
144 OSG::GeoUInt32Property *pLengths,
145 OSG::GeoUInt8Property *pTypes,
147 vtkActor *actor,
148 vtkCellArray *primArray,
149 int primType,
150 int verbose );
151 #endif
153 /*! \} */
154 /*---------------------------------------------------------------------*/
155 /*! \name Init */
156 /*! \{ */
158 static void initMethod(InitPhase ePhase);
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Intersect & Render */
163 /*! \{ */
165 Action::ResultE intersectEnter(Action *action);
166 Action::ResultE intersectLeave(Action *action);
168 Action::ResultE renderEnter (Action *action);
169 Action::ResultE renderLeave (Action *action);
171 /*! \} */
172 /*========================== PRIVATE ================================*/
174 private:
176 friend class FieldContainer;
177 friend class VTKPolyDataMapperBase;
179 /*---------------------------------------------------------------------*/
181 /*!\brief prohibit default function (move to 'public' if needed) */
182 void operator =(const VTKPolyDataMapper &source);
185 typedef VTKPolyDataMapper *VTKPolyDataMapperP;
187 OSG_END_NAMESPACE
189 #include "OSGVTKPolyDataMapperBase.inl"
190 #include "OSGVTKPolyDataMapper.inl"
192 #endif /* _OSGVTKPOLYDATAMAPPER_H_ */