VTK
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 "vtkDataSetAlgorithm.h"
34 
35 class vtkFloatArray;
36 class vtkIntArray;
37 
39 {
40 public:
41  static vtkPieceScalars *New();
42 
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
49  void SetScalarModeToCellData() {this->SetCellScalarsFlag(1);}
50  void SetScalarModeToPointData() {this->SetCellScalarsFlag(0);}
51  int GetScalarMode() {return this->CellScalarsFlag;}
53 
54  // Dscription:
55  // This option uses a random mapping between pieces and scalar values.
56  // The scalar values are choosen between 0 and 1. By default, random mode is off.
57  vtkSetMacro(RandomMode, int);
58  vtkGetMacro(RandomMode, int);
59  vtkBooleanMacro(RandomMode, int);
60 
61 protected:
63  ~vtkPieceScalars();
64 
65  // Append the pieces.
67 
68  vtkIntArray *MakePieceScalars(int piece, vtkIdType numScalars);
69  vtkFloatArray *MakeRandomScalars(int piece, vtkIdType numScalars);
70 
71  vtkSetMacro(CellScalarsFlag,int);
72  int CellScalarsFlag;
74 private:
75  vtkPieceScalars(const vtkPieceScalars&); // Not implemented.
76  void operator=(const vtkPieceScalars&); // Not implemented.
77 };
78 
79 #endif