VTK  9.7.20260805
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
18
19#ifndef vtkPolyDataMapper_h
20#define vtkPolyDataMapper_h
21
22#include "vtkMapper.h"
23#include "vtkRenderingCoreModule.h" // For export macro
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26#include <cstdint> // For uintptr_t
27#include <limits> // For std::numeric_limits<>
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkPolyData;
31class vtkRenderer;
32class vtkRenderWindow;
33
34class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPolyDataMapper : public vtkMapper
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 virtual void RenderPiece(vtkRenderer*, vtkActor*) {}
45
49 void Render(vtkRenderer* ren, vtkActor* act) override;
50
51 using MapperHashType = std::uintptr_t;
60 virtual MapperHashType GenerateHash(vtkPolyData*) { return 0; }
61
70 {
71 return std::numeric_limits<vtkIdType>::max();
72 }
73
75
81
83
86 bool Update(int port) override;
87 bool Update() override;
88 vtkTypeBool Update(int port, vtkInformationVector* requests) override;
89 vtkTypeBool Update(vtkInformation* requests) override;
91
93
96 vtkSetMacro(Piece, int);
97 vtkGetMacro(Piece, int);
98 vtkSetMacro(NumberOfPieces, int);
99 vtkGetMacro(NumberOfPieces, int);
100 vtkSetMacro(NumberOfSubPieces, int);
101 vtkGetMacro(NumberOfSubPieces, int);
103
105
108 vtkSetMacro(GhostLevel, int);
109 vtkGetMacro(GhostLevel, int);
111
113
121 vtkSetMacro(SeamlessU, bool);
122 vtkGetMacro(SeamlessU, bool);
123 vtkBooleanMacro(SeamlessU, bool);
124 vtkSetMacro(SeamlessV, bool);
125 vtkGetMacro(SeamlessV, bool);
126 vtkBooleanMacro(SeamlessV, bool);
128
130
136 vtkSetStringMacro(PointIdArrayName);
137 vtkGetStringMacro(PointIdArrayName);
138 vtkSetStringMacro(CellIdArrayName);
139 vtkGetStringMacro(CellIdArrayName);
141
143
153 vtkSetStringMacro(CompositeIdArrayName);
154 vtkGetStringMacro(CompositeIdArrayName);
156
158
164 vtkSetStringMacro(ProcessIdArrayName);
165 vtkGetStringMacro(ProcessIdArrayName);
167
172 double* GetBounds() VTK_SIZEHINT(6) override;
173 void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); }
174
179
192 virtual void MapDataArrayToVertexAttribute(const char* vertexAttributeName,
193 const char* dataArrayName, int fieldAssociation, int componentno = -1);
194
195 // Specify a data array to use as the texture coordinate
196 // for a named texture. See vtkProperty.h for how to
197 // name textures.
199 const char* textureName, const char* dataArrayName, int fieldAssociation, int componentno = -1);
200
204 virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
205
210
216
247
251 virtual void SetVBOShiftScaleMethod(int) {}
252 virtual int GetVBOShiftScaleMethod() { return this->ShiftScaleMethod; }
253
268 virtual void SetPauseShiftScale(bool pauseShiftScale) { this->PauseShiftScale = pauseShiftScale; }
269 vtkGetMacro(PauseShiftScale, bool);
270 vtkBooleanMacro(PauseShiftScale, bool);
271
272protected:
275
281 virtual void ComputeBounds();
282
283 int Piece;
288 int ShiftScaleMethod; // for points
290
291 // additional picking indirection
292 char* PointIdArrayName = nullptr;
293 char* CellIdArrayName = nullptr;
294 char* CompositeIdArrayName = nullptr;
295 char* ProcessIdArrayName = nullptr;
296
298
299private:
300 vtkPolyDataMapper(const vtkPolyDataMapper&) = delete;
301 void operator=(const vtkPolyDataMapper&) = delete;
302};
303
304VTK_ABI_NAMESPACE_END
305#endif
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
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.
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
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.
bool Update(int port) override
Bring this algorithm's outputs up-to-date.
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.
@ FOCAL_POINT_SHIFT_SCALE
Shift scale based on camera settings.
@ 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.
void Render(vtkRenderer *ren, vtkActor *act) override
This calls RenderPiece (in a for loop if streaming is necessary).
bool Update() override
Bring this algorithm's outputs up-to-date.
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
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.
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.
virtual int GetVBOShiftScaleMethod()
virtual void SetPauseShiftScale(bool pauseShiftScale)
Pause per-render updates to VBO shift+scale parameters.
vtkPolyData * GetInput()
Specify the input data to map.
virtual vtkIdType GetMaximumNumberOfTriangles(vtkRenderer *)
Returns an estimate of the number of triangles that can be rendered by the underlying graphics implem...
virtual void ComputeBounds()
Called in GetBounds().
~vtkPolyDataMapper() override
static vtkPolyDataMapper * New()
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:64
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:363
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO