VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGlyph3DMapper.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 =========================================================================*/ 00030 #ifndef vtkGlyph3DMapper_h 00031 #define vtkGlyph3DMapper_h 00032 00033 #include "vtkRenderingCoreModule.h" // For export macro 00034 #include "vtkMapper.h" 00035 #include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...). 00036 #include "vtkWeakPointer.h" // needed for vtkWeakPointer. 00037 00038 class VTKRENDERINGCORE_EXPORT vtkGlyph3DMapper : public vtkMapper 00039 { 00040 public: 00041 static vtkGlyph3DMapper* New(); 00042 vtkTypeMacro(vtkGlyph3DMapper, vtkMapper); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 //BTX 00045 enum ArrayIndexes 00046 { 00047 SCALE = 0, 00048 SOURCE_INDEX = 1, 00049 MASK = 2, 00050 ORIENTATION = 3, 00051 SELECTIONID = 4 00052 }; 00053 //ETX 00054 00056 00059 void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput); 00060 void SetSourceConnection(vtkAlgorithmOutput* algOutput) 00061 { this->SetSourceConnection(0, algOutput); } 00063 00067 void SetInputData(vtkDataObject *); 00068 00070 void SetSourceData(int idx, vtkPolyData *pd); 00071 00076 void SetSourceData(vtkPolyData *pd); 00077 00079 vtkPolyData *GetSource(int idx = 0); 00080 00082 00085 vtkSetMacro(Scaling, bool); 00086 vtkBooleanMacro(Scaling, bool); 00087 vtkGetMacro(Scaling, bool); 00089 00091 00095 vtkSetMacro(ScaleMode, int); 00096 vtkGetMacro(ScaleMode, int); 00098 00100 00102 vtkSetMacro(ScaleFactor, double); 00103 vtkGetMacro(ScaleFactor, double); 00105 00106 //BTX 00107 enum ScaleModes 00108 { 00109 NO_DATA_SCALING = 0, 00110 SCALE_BY_MAGNITUDE = 1, 00111 SCALE_BY_COMPONENTS = 2 00112 }; 00113 //ETX 00114 void SetScaleModeToScaleByMagnitude() 00115 { this->SetScaleMode(SCALE_BY_MAGNITUDE); } 00116 void SetScaleModeToScaleByVectorComponents() 00117 { this->SetScaleMode(SCALE_BY_COMPONENTS); } 00118 void SetScaleModeToNoDataScaling() 00119 { this->SetScaleMode(NO_DATA_SCALING); } 00120 const char *GetScaleModeAsString(); 00121 00123 00124 vtkSetVector2Macro(Range, double); 00125 vtkGetVectorMacro(Range, double, 2); 00127 00129 00131 vtkSetMacro(Orient, bool); 00132 vtkGetMacro(Orient, bool); 00133 vtkBooleanMacro(Orient, bool); 00135 00137 00140 vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); 00141 vtkGetMacro(OrientationMode, int); 00142 void SetOrientationModeToDirection() 00143 { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } 00144 void SetOrientationModeToRotation() 00145 { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } 00146 const char* GetOrientationModeAsString(); 00147 //BTX 00148 enum OrientationModes 00149 { 00150 DIRECTION=0, 00151 ROTATION=1 00152 }; 00153 //ETX 00155 00157 00159 vtkSetMacro(Clamping, bool); 00160 vtkGetMacro(Clamping, bool); 00161 vtkBooleanMacro(Clamping, bool); 00163 00165 00170 vtkSetMacro(SourceIndexing, bool); 00171 vtkGetMacro(SourceIndexing, bool); 00172 vtkBooleanMacro(SourceIndexing, bool); 00174 00176 00178 vtkSetMacro(UseSelectionIds, bool); 00179 vtkBooleanMacro(UseSelectionIds, bool); 00180 vtkGetMacro(UseSelectionIds, bool); 00182 00184 virtual double *GetBounds(); 00185 00188 virtual void GetBounds(double bounds[6]); 00189 00191 virtual void Render(vtkRenderer *ren, vtkActor *act); 00192 00194 00199 vtkSetMacro(NestedDisplayLists, bool); 00200 vtkGetMacro(NestedDisplayLists, bool); 00201 vtkBooleanMacro(NestedDisplayLists, bool); 00203 00205 00210 vtkSetMacro(Masking, bool); 00211 vtkGetMacro(Masking, bool); 00212 vtkBooleanMacro(Masking, bool); 00214 00219 void SetMaskArray(const char* maskarrayname); 00220 00229 void SetMaskArray(int fieldAttributeType); 00230 00244 void SetOrientationArray(const char* orientationarrayname); 00245 00262 void SetOrientationArray(int fieldAttributeType); 00263 00267 void SetScaleArray(const char* scalarsarrayname); 00268 00272 void SetScaleArray(int fieldAttributeType); 00273 00278 void SetSourceIndexArray(const char* arrayname); 00279 00284 void SetSourceIndexArray(int fieldAttributeType); 00285 00291 void SetSelectionIdArray(const char* selectionIdArrayName); 00292 00298 void SetSelectionIdArray(int fieldAttributeType); 00299 00301 00304 vtkSetMacro(SelectionColorId, unsigned int); 00305 vtkGetMacro(SelectionColorId, unsigned int); 00307 00309 00310 vtkSetMacro(SelectMode, int); 00312 00314 00318 virtual bool GetSupportsSelection() 00319 { return true; } 00320 //BTX 00321 protected: 00322 vtkGlyph3DMapper(); 00323 ~vtkGlyph3DMapper(); 00325 00326 virtual int RequestUpdateExtent(vtkInformation *request, 00327 vtkInformationVector **inInfo, 00328 vtkInformationVector *outInfo); 00329 00330 virtual int FillInputPortInformation(int port, vtkInformation *info); 00331 00332 vtkPolyData *GetSource(int idx, vtkInformationVector *sourceInfo); 00333 00335 00336 vtkDataArray* GetMaskArray(vtkDataSet* input); 00337 vtkDataArray* GetSourceIndexArray(vtkDataSet* input); 00338 vtkDataArray* GetOrientationArray(vtkDataSet* input); 00339 vtkDataArray* GetScaleArray(vtkDataSet* input); 00340 vtkDataArray* GetSelectionIdArray(vtkDataSet* input); 00341 vtkUnsignedCharArray* GetColors(vtkDataSet* input); 00343 00344 bool Scaling; // Determine whether scaling of geometry is performed 00345 double ScaleFactor; // Scale factor to use to scale geometry 00346 int ScaleMode; // Scale by scalar value or vector magnitude 00347 00348 double Range[2]; // Range to use to perform scalar scaling 00349 bool Orient; // boolean controls whether to "orient" data 00350 bool Clamping; // whether to clamp scale factor 00351 bool SourceIndexing; // Enable/disable indexing into the glyph table 00352 bool UseSelectionIds; // Enable/disable custom pick ids 00353 bool Masking; // Enable/disable masking. 00354 int OrientationMode; 00355 bool NestedDisplayLists; // boolean 00356 00357 unsigned int SelectionColorId; 00358 int SelectMode; 00359 00360 private: 00361 vtkGlyph3DMapper(const vtkGlyph3DMapper&); // Not implemented. 00362 void operator=(const vtkGlyph3DMapper&); // Not implemented. 00363 00365 00366 bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]); 00367 //ETX 00368 }; 00370 00371 #endif