VTK  9.3.0
vtkPolyDataMapper.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
28 #ifndef vtkPolyDataMapper_h
29 #define vtkPolyDataMapper_h
30 
31 #include "vtkMapper.h"
32 #include "vtkRenderingCoreModule.h" // For export macro
33 
34 #include <cstdint> // For uintptr_t
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkPolyData;
38 class vtkRenderer;
39 class vtkRenderWindow;
40 
41 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper : public vtkMapper
42 {
43 public:
45  vtkTypeMacro(vtkPolyDataMapper, vtkMapper);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  virtual void RenderPiece(vtkRenderer*, vtkActor*){};
52 
56  void Render(vtkRenderer* ren, vtkActor* act) override;
57 
58  using MapperHashType = std::uintptr_t;
67  virtual MapperHashType GenerateHash(vtkPolyData*) { return 0; };
68 
70 
76 
78 
81  void Update(int port) override;
82  void Update() override;
83  vtkTypeBool Update(int port, vtkInformationVector* requests) override;
84  vtkTypeBool Update(vtkInformation* requests) override;
86 
88 
91  vtkSetMacro(Piece, int);
92  vtkGetMacro(Piece, int);
93  vtkSetMacro(NumberOfPieces, int);
94  vtkGetMacro(NumberOfPieces, int);
95  vtkSetMacro(NumberOfSubPieces, int);
96  vtkGetMacro(NumberOfSubPieces, int);
98 
100 
103  vtkSetMacro(GhostLevel, int);
104  vtkGetMacro(GhostLevel, int);
106 
108 
116  vtkSetMacro(SeamlessU, bool);
117  vtkGetMacro(SeamlessU, bool);
118  vtkBooleanMacro(SeamlessU, bool);
119  vtkSetMacro(SeamlessV, bool);
120  vtkGetMacro(SeamlessV, bool);
121  vtkBooleanMacro(SeamlessV, bool);
123 
128  double* GetBounds() VTK_SIZEHINT(6) override;
129  void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); }
130 
134  void ShallowCopy(vtkAbstractMapper* m) override;
135 
148  virtual void MapDataArrayToVertexAttribute(const char* vertexAttributeName,
149  const char* dataArrayName, int fieldAssociation, int componentno = -1);
150 
151  // Specify a data array to use as the texture coordinate
152  // for a named texture. See vtkProperty.h for how to
153  // name textures.
155  const char* textureName, const char* dataArrayName, int fieldAssociation, int componentno = -1);
156 
160  virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
161 
166 
172 
194  {
201  FOCAL_POINT_SHIFT_SCALE
202  };
203 
207  virtual void SetVBOShiftScaleMethod(int) {}
208  virtual int GetVBOShiftScaleMethod() { return this->ShiftScaleMethod; }
209 
224  virtual void SetPauseShiftScale(bool pauseShiftScale) { this->PauseShiftScale = pauseShiftScale; }
225  vtkGetMacro(PauseShiftScale, bool);
226  vtkBooleanMacro(PauseShiftScale, bool);
227 
228 protected:
230  ~vtkPolyDataMapper() override = default;
231 
237  virtual void ComputeBounds();
238 
239  int Piece;
243  bool SeamlessU, SeamlessV;
244  int ShiftScaleMethod; // for points
246 
248 
249 private:
250  vtkPolyDataMapper(const vtkPolyDataMapper&) = delete;
251  void operator=(const vtkPolyDataMapper&) = delete;
252 };
253 
254 VTK_ABI_NAMESPACE_END
255 #endif
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
abstract class specifies interface to map data
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:86
map vtkPolyData to graphics primitives
virtual void MapDataArrayToVertexAttribute(const char *vertexAttributeName, const char *dataArrayName, int fieldAssociation, int componentno=-1)
Select a data array from the point/cell data and map it to a generic vertex attribute.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyData * GetInput()
Specify the input data to map.
virtual void RemoveAllVertexAttributeMappings()
Remove all vertex attributes.
void ShallowCopy(vtkAbstractMapper *m) override
Make a shallow copy of this mapper.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
void Update(int port) override
Bring this algorithm's outputs up-to-date.
virtual void MapDataArrayToMultiTextureAttribute(const char *textureName, const char *dataArrayName, int fieldAssociation, int componentno=-1)
virtual void SetVBOShiftScaleMethod(int)
A convenience method for enabling/disabling the VBO's shift+scale transform.
ShiftScaleMethodType
Methods for VBO coordinate shift+scale-computation.
@ NEAR_PLANE_SHIFT_SCALE
Shift scale based on camera settings.
@ DISABLE_SHIFT_SCALE
Do not shift/scale point coordinates. Ever!
@ AUTO_SHIFT_SCALE
The default, automatic computation.
@ ALWAYS_AUTO_SHIFT_SCALE
Always shift scale using auto computed values.
@ MANUAL_SHIFT_SCALE
Manual shift/scale (for use with AppendVBO)
@ AUTO_SHIFT
Only Apply the shift.
virtual void RemoveVertexAttributeMapping(const char *vertexAttributeName)
Remove a vertex attribute mapping.
virtual MapperHashType GenerateHash(vtkPolyData *)
This hash integer is computed by concrete graphics implementation of this class.
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
void Render(vtkRenderer *ren, vtkActor *act) override
This calls RenderPiece (in a for loop if streaming is necessary).
std::uintptr_t MapperHashType
vtkTypeBool Update(vtkInformation *requests) override
Bring this algorithm's outputs up-to-date.
vtkTypeBool Update(int port, vtkInformationVector *requests) override
Bring this algorithm's outputs up-to-date.
~vtkPolyDataMapper() override=default
void Update() override
Bring this algorithm's outputs up-to-date.
virtual void RenderPiece(vtkRenderer *, vtkActor *)
Implemented by sub classes.
void SetInputData(vtkPolyData *in)
Specify the input data to map.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
static vtkPolyDataMapper * New()
virtual int GetVBOShiftScaleMethod()
virtual void SetPauseShiftScale(bool pauseShiftScale)
Pause per-render updates to VBO shift+scale parameters.
virtual void ComputeBounds()
Called in GetBounds().
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:71
void GetBounds(T a, double bds[6])
@ port
Definition: vtkX3D.h:447
std::map< DataSetType, DataSet > Piece
Definition: VTXTypes.h:43
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)