00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
#ifndef VTK_REGULAR_POLYTOPE_SOURCE_H_
00017
# define VTK_REGULAR_POLYTOPE_SOURCE_H_
00018
# include "vtkExtensionsGraphicsConfigure.h"
00019
00020
# include "vtkPolyDataSource.h"
00021
00022 # define VTK_MAX_POLYTOPE_SUBDIVISIONS 15
00023
00024 # define VTK_TETRAHEDRON_SOURCE 0
00025 # define VTK_HEXAHEDRON_SOURCE 1
00026 # define VTK_OCTAHEDRON_SOURCE 2
00027 # define VTK_ICOSAHEDRON_SOURCE 3
00028 # define VTK_DODECAHEDRON_SOURCE 4
00029
00030
class vtkPoints;
00031
class vtkCellArray;
00032
class vtkFloatArray;
00033
00034
VTK_EXTENSIONS_GRAPHICS_NAMESPACE_BEGIN
00035
00046 class VTK_EXTENSIONS_GRAPHICS_EXPORT vtkRegularPolytopeSource
00047 :
public vtkPolyDataSource
00048 {
00049
public:
00050
static vtkRegularPolytopeSource*
New (
void);
00051 vtkTypeRevisionMacro (vtkRegularPolytopeSource,
vtkPolyDataSource);
00052
void PrintSelf (ostream&,
vtkIndent);
00053
00056 vtkSetClampMacro ( Polytope,
int,
00057
VTK_TETRAHEDRON_SOURCE,
00058
VTK_DODECAHEDRON_SOURCE );
00059 vtkGetMacro (Polytope,
int);
00060 void SetPolytopeToTetrahedron (
void)
00061 { this->Polytope =
VTK_TETRAHEDRON_SOURCE; }
00062 void SetPolytopeToHexahedron (
void)
00063 { this->Polytope =
VTK_HEXAHEDRON_SOURCE; }
00064 void SetPolytopeToCube (
void)
00065 { this->Polytope =
VTK_HEXAHEDRON_SOURCE; }
00066 void SetPolytopeToOctahedron (
void)
00067 { this->Polytope =
VTK_OCTAHEDRON_SOURCE; }
00068 void SetPolytopeToIcosahedron (
void)
00069 { this->Polytope =
VTK_ICOSAHEDRON_SOURCE; }
00070 void SetPolytopeToDodecahedron (
void)
00071 { this->Polytope =
VTK_DODECAHEDRON_SOURCE; }
00072
const char* GetPolytopeAsString (
void);
00077 vtkSetClampMacro (CircumscribedRadius,
double, 0.0, VTK_LARGE_FLOAT);
00078 vtkGetMacro (CircumscribedRadius,
double);
00083 vtkSetVector3Macro (Center,
double);
00084 vtkGetVectorMacro (Center,
double, 3);
00089 vtkSetClampMacro (NumberOfSubdivisions,
int, 0, VTK_MAX_POLYTOPE_SUBDIVISIONS);
00090 vtkGetMacro (NumberOfSubdivisions,
int);
00095 vtkSetMacro (Triangulate,
int);
00096 vtkGetMacro (Triangulate,
int);
00097 vtkBooleanMacro (Triangulate,
int);
00102 vtkSetMacro (GenerateNormals,
int);
00103 vtkGetMacro (GenerateNormals,
int);
00104 vtkBooleanMacro (GenerateNormals,
int);
00109 vtkSetMacro (GenerateTCoords,
int);
00110 vtkGetMacro (GenerateTCoords,
int);
00111 vtkBooleanMacro (GenerateTCoords,
int);
00120 vtkSetMacro (PreventSeam,
int);
00121 vtkGetMacro (PreventSeam,
int);
00122 vtkBooleanMacro (PreventSeam,
int);
00125
protected:
00126 vtkRegularPolytopeSource (
void);
00127 ~vtkRegularPolytopeSource() {}
00128
00130
void ExecuteData (
vtkDataObject*);
00131
00133
void PointToTCoord (
const double point[3],
double tcoord[2]);
00134
00135
00136
void SubdivideTriangleBy4 (
vtkPoints* points,
00137
vtkCellArray* polys,
00138
vtkFloatArray* normals,
00139
vtkFloatArray* tcoords,
00140
vtkIdType const& id0,
00141
vtkIdType const& id1,
00142
vtkIdType const& id2,
00143
vtkIdType const& depth,
00144
vtkIdType & nextId);
00145
00146
void SubdivideTriangleBy4 (
vtkPoints* points,
00147
vtkCellArray* polys,
00148
vtkFloatArray* normals,
00149
vtkFloatArray* tcoords,
00150
const vtkIdType cell[3],
00151
vtkIdType const& depth,
00152
vtkIdType & nextId);
00153
00154
void SubdivideTriangleBy3 (
vtkPoints* points,
00155
vtkCellArray* polys,
00156
vtkFloatArray* normals,
00157
vtkFloatArray* tcoords,
00158
vtkIdType const& id0,
00159
vtkIdType const& id1,
00160
vtkIdType const& id2,
00161
vtkIdType const& depth,
00162
vtkIdType & nextId);
00163
00164
void SubdivideTriangleBy3 (
vtkPoints* points,
00165
vtkCellArray* polys,
00166
vtkFloatArray* normals,
00167
vtkFloatArray* tcoords,
00168
const vtkIdType cell[3],
00169
vtkIdType const& depth,
00170
vtkIdType & nextId);
00171
00172
void SubdivideQuadBy4 (
vtkPoints* points,
00173
vtkCellArray* polys,
00174
vtkFloatArray* normals,
00175
vtkFloatArray* tCoords,
00176
vtkIdType const& id0,
00177
vtkIdType const& id1,
00178
vtkIdType const& id2,
00179
vtkIdType const& id3,
00180
vtkIdType const& depth,
00181
vtkIdType & nextId);
00182
00183
void SubdivideQuadBy4 (
vtkPoints* points,
00184
vtkCellArray* polys,
00185
vtkFloatArray* normals,
00186
vtkFloatArray* tCoords,
00187
const vtkIdType cell[4],
00188
vtkIdType const& depth,
00189
vtkIdType & nextId);
00190
00191
void SubdivideQuadBy2 (
vtkPoints* points,
00192
vtkCellArray* polys,
00193
vtkFloatArray* normals,
00194
vtkFloatArray* tCoords,
00195
vtkIdType const& id0,
00196
vtkIdType const& id1,
00197
vtkIdType const& id2,
00198
vtkIdType const& id3,
00199
vtkIdType const& depth,
00200
vtkIdType & nextId);
00201
00202
void SubdivideQuadBy2 (
vtkPoints* points,
00203
vtkCellArray* polys,
00204
vtkFloatArray* normals,
00205
vtkFloatArray* tCoords,
00206
const vtkIdType cell[4],
00207
vtkIdType const& depth,
00208
vtkIdType & nextId);
00209
00210
void SubdividePentagonBy5 (
vtkPoints* points,
00211
vtkCellArray* polys,
00212
vtkFloatArray* normals,
00213
vtkFloatArray* tCoords,
00214
vtkIdType const& id0,
00215
vtkIdType const& id1,
00216
vtkIdType const& id2,
00217
vtkIdType const& id3,
00218
vtkIdType const& id4,
00219
vtkIdType const& depth,
00220
vtkIdType & nextId);
00221
00222
void SubdividePentagonBy5 (
vtkPoints* points,
00223
vtkCellArray* polys,
00224
vtkFloatArray* normals,
00225
vtkFloatArray* tCoords,
00226
const vtkIdType cell[5],
00227
vtkIdType const& depth,
00228
vtkIdType & nextId);
00229
00230
00231 int Polytope;
00232 double CircumscribedRadius;
00233 double Center[3];
00234 int NumberOfSubdivisions;
00235 int Triangulate;
00236 int GenerateNormals;
00237 int GenerateTCoords;
00238 int PreventSeam;
00239
00240
private:
00241 vtkRegularPolytopeSource (
const vtkRegularPolytopeSource&);
00242
void operator= (
const vtkRegularPolytopeSource&);
00243 };
00244
00245
00246
inline void
00247 vtkRegularPolytopeSource::SubdivideTriangleBy4 (
vtkPoints* aPoints,
00248
vtkCellArray* aPolys,
00249
vtkFloatArray* aNormals,
00250
vtkFloatArray* aTCoords,
00251
const vtkIdType aCell[3],
00252
vtkIdType const& aDepth,
00253
vtkIdType & aNextId)
00254 {
00255 this->
SubdivideTriangleBy4( aPoints, aPolys, aNormals, aTCoords,
00256 aCell[0], aCell[1], aCell[2], aDepth, aNextId );
00257 }
00258
00259
00260
inline void
00261 vtkRegularPolytopeSource::SubdivideTriangleBy3 (
vtkPoints* aPoints,
00262
vtkCellArray* aPolys,
00263
vtkFloatArray* aNormals,
00264
vtkFloatArray* aTCoords,
00265
const vtkIdType aCell[3],
00266
vtkIdType const& aDepth,
00267
vtkIdType & aNextId)
00268 {
00269 this->
SubdivideTriangleBy3( aPoints, aPolys, aNormals, aTCoords,
00270 aCell[0], aCell[1], aCell[2], aDepth, aNextId );
00271 }
00272
00273
00274
inline void
00275 vtkRegularPolytopeSource::SubdivideQuadBy4 (
vtkPoints* aPoints,
00276
vtkCellArray* aPolys,
00277
vtkFloatArray* aNormals,
00278
vtkFloatArray* aTCoords,
00279
const vtkIdType aCell[4],
00280
vtkIdType const& aDepth,
00281
vtkIdType & aNextId)
00282 {
00283 this->
SubdivideQuadBy4( aPoints, aPolys, aNormals, aTCoords,
00284 aCell[0], aCell[1], aCell[2], aCell[3],
00285 aDepth, aNextId );
00286 }
00287
00288
00289
inline void
00290 vtkRegularPolytopeSource::SubdivideQuadBy2 (
vtkPoints* aPoints,
00291
vtkCellArray* aPolys,
00292
vtkFloatArray* aNormals,
00293
vtkFloatArray* aTCoords,
00294
const vtkIdType aCell[4],
00295
vtkIdType const& aDepth,
00296
vtkIdType & aNextId)
00297 {
00298 this->
SubdivideQuadBy2( aPoints, aPolys, aNormals, aTCoords,
00299 aCell[0], aCell[1], aCell[2], aCell[3],
00300 aDepth, aNextId );
00301 }
00302
00303
00304
inline void
00305 vtkRegularPolytopeSource::SubdividePentagonBy5 (
vtkPoints* aPoints,
00306
vtkCellArray* aPolys,
00307
vtkFloatArray* aNormals,
00308
vtkFloatArray* aTCoords,
00309
const vtkIdType aCell[5],
00310
vtkIdType const& aDepth,
00311
vtkIdType & aNextId)
00312 {
00313 this->
SubdividePentagonBy5( aPoints, aPolys, aNormals, aTCoords,
00314 aCell[0], aCell[1], aCell[2], aCell[3], aCell[4],
00315 aDepth, aNextId );
00316 }
00317
00318
VTK_EXTENSIONS_GRAPHICS_NAMESPACE_END
00319
00320
#endif
00321
00322
00323
00324