VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkParametricFunctionSource.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00049 #ifndef __vtkParametricFunctionSource_h 00050 #define __vtkParametricFunctionSource_h 00051 00052 #include "vtkPolyDataAlgorithm.h" 00053 00054 class vtkCellArray; 00055 class vtkParametricFunction; 00056 00057 class VTK_GRAPHICS_EXPORT vtkParametricFunctionSource : public vtkPolyDataAlgorithm 00058 { 00059 public: 00060 vtkTypeMacro(vtkParametricFunctionSource,vtkPolyDataAlgorithm); 00061 void PrintSelf(ostream& os, vtkIndent indent); 00062 00065 static vtkParametricFunctionSource *New(); 00066 00068 00069 virtual void SetParametricFunction(vtkParametricFunction*); 00070 vtkGetObjectMacro(ParametricFunction,vtkParametricFunction); 00072 00074 00077 vtkSetMacro(UResolution,int); 00078 vtkGetMacro(UResolution,int); 00080 00082 00085 vtkSetMacro(VResolution,int); 00086 vtkGetMacro(VResolution,int); 00088 00090 00093 vtkSetMacro(WResolution,int); 00094 vtkGetMacro(WResolution,int); 00096 00098 00102 vtkBooleanMacro(GenerateTextureCoordinates,int); 00103 vtkSetMacro(GenerateTextureCoordinates,int); 00104 vtkGetMacro(GenerateTextureCoordinates,int); 00106 00107 //BTX 00109 00126 enum SCALAR_MODE { SCALAR_NONE = 0, 00127 SCALAR_U, SCALAR_V, 00128 SCALAR_U0, SCALAR_V0, SCALAR_U0V0, 00129 SCALAR_MODULUS, SCALAR_PHASE, SCALAR_QUADRANT, 00130 SCALAR_X, SCALAR_Y, SCALAR_Z, SCALAR_DISTANCE, 00131 SCALAR_FUNCTION_DEFINED }; 00132 //ETX 00134 00136 00153 vtkSetClampMacro(ScalarMode, int, SCALAR_NONE, SCALAR_FUNCTION_DEFINED); 00154 vtkGetMacro(ScalarMode, int); 00155 void SetScalarModeToNone( void ) {this->SetScalarMode(SCALAR_NONE);} 00156 void SetScalarModeToU( void ) {this->SetScalarMode(SCALAR_U);} 00157 void SetScalarModeToV( void ) {this->SetScalarMode(SCALAR_V);} 00158 void SetScalarModeToU0( void ) {this->SetScalarMode(SCALAR_U0);} 00159 void SetScalarModeToV0( void ) {this->SetScalarMode(SCALAR_V0);} 00160 void SetScalarModeToU0V0( void ) {this->SetScalarMode(SCALAR_U0V0);} 00161 void SetScalarModeToModulus( void ) {this->SetScalarMode(SCALAR_MODULUS);} 00162 void SetScalarModeToPhase( void ) {this->SetScalarMode(SCALAR_PHASE);} 00163 void SetScalarModeToQuadrant( void ) {this->SetScalarMode(SCALAR_QUADRANT);} 00164 void SetScalarModeToX( void ) {this->SetScalarMode(SCALAR_X);} 00165 void SetScalarModeToY( void ) {this->SetScalarMode(SCALAR_Y);} 00166 void SetScalarModeToZ( void ) {this->SetScalarMode(SCALAR_Z);} 00167 void SetScalarModeToDistance( void ) {this->SetScalarMode(SCALAR_DISTANCE);} 00168 void SetScalarModeToFunctionDefined( void ) {this->SetScalarMode(SCALAR_FUNCTION_DEFINED);} 00170 00172 unsigned long GetMTime(); 00173 00174 protected: 00175 vtkParametricFunctionSource(); 00176 virtual ~vtkParametricFunctionSource(); 00177 00178 // Usual data generation method 00179 int RequestData(vtkInformation *info, vtkInformationVector **input, 00180 vtkInformationVector *output); 00181 00182 // Variables 00183 vtkParametricFunction *ParametricFunction; 00184 00185 int UResolution; 00186 int VResolution; 00187 int WResolution; 00188 int GenerateTextureCoordinates; 00189 int ScalarMode; 00190 00191 private: 00192 // Create output depending on function dimension 00193 void Produce1DOutput(vtkInformationVector *output); 00194 void Produce2DOutput(vtkInformationVector *output); 00195 00203 void MakeTriangleStrips ( vtkCellArray * strips, int PtsU, int PtsV ); 00204 00205 vtkParametricFunctionSource(const vtkParametricFunctionSource&); // Not implemented. 00206 void operator=(const vtkParametricFunctionSource&); // Not implemented. 00207 00208 }; 00209 00210 #endif