OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkPieceScalars.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkPieceScalars.h,v $
5   Language:  C++
6   Date:      $Date: 2002/09/30 20:35:49 $
7   Version:   $Revision: 1.11 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkPieceScalars - Sets all cell scalars from the update piece.
19 // .SECTION Description
20 // vtkPieceScalars is meant to display which piece is being requested
21 // as scalar values.  It is usefull for visualizing the partioning for
22 // streaming or distributed pipelines.
23 // .SECTION See Also
24 // vtkPolyDataStreamer
25
26 #ifndef __vtkPieceScalars_h
27 #define __vtkPieceScalars_h
28
29 #include "vtkDataSetToDataSetFilter.h"
30
31 class vtkFloatArray;
32 class vtkIntArray;
33
34 class VTK_PARALLEL_EXPORT vtkPieceScalars : public vtkDataSetToDataSetFilter
35 {
36 public:
37   static vtkPieceScalars *New();
38
39   vtkTypeRevisionMacro(vtkPieceScalars,vtkDataSetToDataSetFilter);
40   void PrintSelf(ostream& os, vtkIndent indent);
41
42   // Description:
43   // Option to centerate cell scalars of poi9nts scalars.  Default is point scalars.
44   void SetScalarModeToCellData() {this->SetCellScalarsFlag(1);}
45   void SetScalarModeToPointData() {this->SetCellScalarsFlag(0);}
46   int GetScalarMode() {return this->CellScalarsFlag;}
47   
48   // Dscription:
49   // This option uses a random mapping between pieces and scalar values.
50   // The scalar values are choosen between 0 and 1.  By default, random mode is off.
51   vtkSetMacro(RandomMode, int);
52   vtkGetMacro(RandomMode, int);
53   vtkBooleanMacro(RandomMode, int);
54   
55 protected:
56   vtkPieceScalars();
57   ~vtkPieceScalars();
58   
59   // Append the pieces.
60   void Execute();
61   
62   vtkIntArray *MakePieceScalars(int piece, vtkIdType numScalars);
63   vtkFloatArray *MakeRandomScalars(int piece, vtkIdType numScalars);
64   
65   vtkSetMacro(CellScalarsFlag,int);
66   int CellScalarsFlag;
67   int RandomMode;
68 private:
69   vtkPieceScalars(const vtkPieceScalars&);  // Not implemented.
70   void operator=(const vtkPieceScalars&);  // Not implemented.
71 };
72
73 #endif