VTK  9.3.1
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
19 #ifndef vtkPolyDataMapper_h
20 #define vtkPolyDataMapper_h
21 
22 #include "vtkMapper.h"
23 #include "vtkRenderingCoreModule.h" // For export macro
24 
25 #include <cstdint> // For uintptr_t
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkPolyData;
29 class vtkRenderer;
30 class vtkRenderWindow;
31 
32 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper : public vtkMapper
33 {
34 public:
35  static vtkPolyDataMapper* New();
36  vtkTypeMacro(vtkPolyDataMapper, vtkMapper);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  virtual void RenderPiece(vtkRenderer*, vtkActor*){};
43 
47  void Render(vtkRenderer* ren, vtkActor* act) override;
48 
49  using MapperHashType = std::uintptr_t;
58  virtual MapperHashType GenerateHash(vtkPolyData*) { return 0; };
59 
61 
64  void SetInputData(vtkPolyData* in);
67 
69 
72  void Update(int port) override;
73  void Update() override;
74  vtkTypeBool Update(int port, vtkInformationVector* requests) override;
75  vtkTypeBool Update(vtkInformation* requests) override;
77 
79 
82  vtkSetMacro(Piece, int);
83  vtkGetMacro(Piece, int);
84  vtkSetMacro(NumberOfPieces, int);
85  vtkGetMacro(NumberOfPieces, int);
86  vtkSetMacro(NumberOfSubPieces, int);
87  vtkGetMacro(NumberOfSubPieces, int);
89 
91 
94  vtkSetMacro(GhostLevel, int);
95  vtkGetMacro(GhostLevel, int);
97 
99 
107  vtkSetMacro(SeamlessU, bool);
108  vtkGetMacro(SeamlessU, bool);
109  vtkBooleanMacro(SeamlessU, bool);
110  vtkSetMacro(SeamlessV, bool);
111  vtkGetMacro(SeamlessV, bool);
112  vtkBooleanMacro(SeamlessV, bool);
114 
119  double* GetBounds() VTK_SIZEHINT(6) override;
120  void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); }
121 
125  void ShallowCopy(vtkAbstractMapper* m) override;
126 
139  virtual void MapDataArrayToVertexAttribute(const char* vertexAttributeName,
140  const char* dataArrayName, int fieldAssociation, int componentno = -1);
141 
142  // Specify a data array to use as the texture coordinate
143  // for a named texture. See vtkProperty.h for how to
144  // name textures.
145  virtual void MapDataArrayToMultiTextureAttribute(
146  const char* textureName, const char* dataArrayName, int fieldAssociation, int componentno = -1);
147 
151  virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
152 
156  virtual void RemoveAllVertexAttributeMappings();
157 
163 
185  {
192  FOCAL_POINT_SHIFT_SCALE
193  };
194 
198  virtual void SetVBOShiftScaleMethod(int) {}
199  virtual int GetVBOShiftScaleMethod() { return this->ShiftScaleMethod; }
200 
215  virtual void SetPauseShiftScale(bool pauseShiftScale) { this->PauseShiftScale = pauseShiftScale; }
216  vtkGetMacro(PauseShiftScale, bool);
217  vtkBooleanMacro(PauseShiftScale, bool);
218 
219 protected:
221  ~vtkPolyDataMapper() override = default;
222 
228  virtual void ComputeBounds();
229 
230  int Piece;
234  bool SeamlessU, SeamlessV;
235  int ShiftScaleMethod; // for points
237 
238  int FillInputPortInformation(int, vtkInformation*) override;
239 
240 private:
241  vtkPolyDataMapper(const vtkPolyDataMapper&) = delete;
242  void operator=(const vtkPolyDataMapper&) = delete;
243 };
244 
245 VTK_ABI_NAMESPACE_END
246 #endif
virtual int GetVBOShiftScaleMethod()
void GetBounds(T a, double bds[6])
void ShallowCopy(vtkAbstractMapper *m) override
Make a shallow copy of this mapper.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
virtual MapperHashType GenerateHash(vtkPolyData *)
This hash integer is computed by concrete graphics implementation of this class.
Store vtkAlgorithm input/output information.
The default, automatic computation.
Do not shift/scale point coordinates. Ever!
abstract specification for renderers
Definition: vtkRenderer.h:61
virtual void RenderPiece(vtkRenderer *, vtkActor *)
Implemented by sub classes.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void SetPauseShiftScale(bool pauseShiftScale)
Pause per-render updates to VBO shift+scale parameters.
Always shift scale using auto computed values.
int vtkTypeBool
Definition: vtkABI.h:64
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
Shift scale based on camera settings.
std::uintptr_t MapperHashType
a simple class to control print indentation
Definition: vtkIndent.h:28
Manual shift/scale (for use with AppendVBO)
ShiftScaleMethodType
Methods for VBO coordinate shift+scale-computation.
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.
virtual void Update()
Bring this algorithm's outputs up-to-date.
#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:76
abstract class specifies interface to map data
map vtkPolyData to graphics primitives
create a window for renderers to draw into
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
std::map< DataSetType, DataSet > Piece
Definition: VTXTypes.h:43
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
vtkDataSet * GetInput()
Get the input as a vtkDataSet.
virtual void Render(vtkRenderer *ren, vtkActor *a)=0
Method initiates the mapping process.
virtual void SetVBOShiftScaleMethod(int)
A convenience method for enabling/disabling the VBO's shift+scale transform.