VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkPieceScalars.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPieceScalars.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef __vtkPieceScalars_h
31 #define __vtkPieceScalars_h
32 
33 #include "vtkFiltersParallelModule.h" // For export macro
34 #include "vtkDataSetAlgorithm.h"
35 
36 class vtkFloatArray;
37 class vtkIntArray;
38 
39 class VTKFILTERSPARALLEL_EXPORT vtkPieceScalars : public vtkDataSetAlgorithm
40 {
41 public:
42  static vtkPieceScalars *New();
43 
44  vtkTypeMacro(vtkPieceScalars,vtkDataSetAlgorithm);
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48 
50  void SetScalarModeToCellData() {this->SetCellScalarsFlag(1);}
51  void SetScalarModeToPointData() {this->SetCellScalarsFlag(0);}
52  int GetScalarMode() {return this->CellScalarsFlag;}
54 
55  // Dscription:
56  // This option uses a random mapping between pieces and scalar values.
57  // The scalar values are chosen between 0 and 1. By default, random mode is off.
58  vtkSetMacro(RandomMode, int);
59  vtkGetMacro(RandomMode, int);
60  vtkBooleanMacro(RandomMode, int);
61 
62 protected:
64  ~vtkPieceScalars();
65 
66  // Append the pieces.
67  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
68 
69  vtkIntArray *MakePieceScalars(int piece, vtkIdType numScalars);
70  vtkFloatArray *MakeRandomScalars(int piece, vtkIdType numScalars);
71 
72  vtkSetMacro(CellScalarsFlag,int);
73  int CellScalarsFlag;
75 private:
76  vtkPieceScalars(const vtkPieceScalars&); // Not implemented.
77  void operator=(const vtkPieceScalars&); // Not implemented.
78 };
79 
80 #endif
void SetScalarModeToCellData()
Sets all cell scalars from the update piece.
void SetScalarModeToPointData()