VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPieceScalars.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 __vtkPieceScalars_h 00031 #define __vtkPieceScalars_h 00032 00033 #include "vtkFiltersParallelModule.h" // For export macro 00034 #include "vtkDataSetAlgorithm.h" 00035 00036 class vtkFloatArray; 00037 class vtkIntArray; 00038 00039 class VTKFILTERSPARALLEL_EXPORT vtkPieceScalars : public vtkDataSetAlgorithm 00040 { 00041 public: 00042 static vtkPieceScalars *New(); 00043 00044 vtkTypeMacro(vtkPieceScalars,vtkDataSetAlgorithm); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 00048 00050 void SetScalarModeToCellData() {this->SetCellScalarsFlag(1);} 00051 void SetScalarModeToPointData() {this->SetCellScalarsFlag(0);} 00052 int GetScalarMode() {return this->CellScalarsFlag;} 00054 00055 // Dscription: 00056 // This option uses a random mapping between pieces and scalar values. 00057 // The scalar values are chosen between 0 and 1. By default, random mode is off. 00058 vtkSetMacro(RandomMode, int); 00059 vtkGetMacro(RandomMode, int); 00060 vtkBooleanMacro(RandomMode, int); 00061 00062 protected: 00063 vtkPieceScalars(); 00064 ~vtkPieceScalars(); 00065 00066 // Append the pieces. 00067 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00068 00069 vtkIntArray *MakePieceScalars(int piece, vtkIdType numScalars); 00070 vtkFloatArray *MakeRandomScalars(int piece, vtkIdType numScalars); 00071 00072 vtkSetMacro(CellScalarsFlag,int); 00073 int CellScalarsFlag; 00074 int RandomMode; 00075 private: 00076 vtkPieceScalars(const vtkPieceScalars&); // Not implemented. 00077 void operator=(const vtkPieceScalars&); // Not implemented. 00078 }; 00079 00080 #endif