VTK  9.7.1
vtkCellGridMapper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
25 #ifndef vtkCellGridMapper_h
26 #define vtkCellGridMapper_h
27 
28 #include "vtkMapper.h"
29 #include "vtkRenderingCoreModule.h" // For export macro.
30 #include "vtkUnsignedCharArray.h" // For API.
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkCellGrid;
34 class vtkCellAttribute;
35 class vtkDataObject;
36 class vtkRenderer;
37 
38 class VTKRENDERINGCORE_EXPORT vtkCellGridMapper : public vtkMapper
39 {
40 public:
41  static vtkCellGridMapper* New();
42  vtkTypeMacro(vtkCellGridMapper, vtkMapper);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  vtkSetMacro(VisualizePCoords, int);
46  vtkGetMacro(VisualizePCoords, int);
47 
48  vtkSetMacro(VisualizeBasisFunction, int);
49  vtkGetMacro(VisualizeBasisFunction, int);
50 
54  void Render(vtkRenderer*, vtkActor*) override {}
55 
57 
60  void SetInputData(vtkCellGrid* in);
63 
65 
68  bool Update(int port) override;
69  bool Update() override;
70  vtkTypeBool Update(int port, vtkInformationVector* requests) override;
71  vtkTypeBool Update(vtkInformation* requests) override;
73 
81  void PrepareColormap(vtkScalarsToColors* cmap = nullptr);
82 
87  double* GetBounds() VTK_SIZEHINT(6) override;
88  void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); }
89 
90  bool HasTranslucentPolygonalGeometry() override;
91 
92 protected:
94  ~vtkCellGridMapper() override = default;
95 
96  void ComputeBounds();
97  int FillInputPortInformation(int, vtkInformation*) override;
98 
100  void CreateColormapTexture();
101 
103  virtual vtkCellAttribute* GetColorAttribute(vtkCellGrid* input) const;
104 
105  int VisualizePCoords = -1;
106  int VisualizeBasisFunction = -1;
107 
108 private:
109  vtkCellGridMapper(const vtkCellGridMapper&) = delete;
110  void operator=(const vtkCellGridMapper&) = delete;
111 };
112 
113 VTK_ABI_NAMESPACE_END
114 #endif // vtkCellGridMapper_h
void GetBounds(T a, double bds[6])
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
Store vtkAlgorithm input/output information.
virtual bool HasTranslucentPolygonalGeometry()
Some introspection on the type of data the mapper will render used by props to determine if they shou...
abstract specification for renderers
Definition: vtkRenderer.h:63
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for mapping scalar values to colors.
Visualization data composed of cells of arbitrary type.
Definition: vtkCellGrid.h:48
a simple class to control print indentation
Definition: vtkIndent.h:28
void Render(vtkRenderer *, vtkActor *) override
Implemented by sub classes.
A function defined over the physical domain of a vtkCellGrid.
map a vtkCellGrid to graphics primitives.
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_SIZEHINT(...)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:77
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
virtual bool Update()
Bring this algorithm's outputs up-to-date.
vtkDataSet * GetInput()
Get the input as a vtkDataSet.
general representation of visualization data
Definition: vtkDataObject.h:55