VTK  9.4.20250218
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
128#ifndef vtkPolyDataMapper_h
129#define vtkPolyDataMapper_h
130
131#include "vtkMapper.h"
132#include "vtkRenderingCoreModule.h" // For export macro
133#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
134
135#include <cstdint> // For uintptr_t
136
137VTK_ABI_NAMESPACE_BEGIN
138class vtkPolyData;
139class vtkRenderer;
140class vtkRenderWindow;
141
142class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPolyDataMapper : public vtkMapper
143{
144public:
147 void PrintSelf(ostream& os, vtkIndent indent) override;
148
152 virtual void RenderPiece(vtkRenderer*, vtkActor*) {}
153
157 void Render(vtkRenderer* ren, vtkActor* act) override;
158
159 using MapperHashType = std::uintptr_t;
169
171
177
179
182 void Update(int port) override;
183 void Update() override;
184 vtkTypeBool Update(int port, vtkInformationVector* requests) override;
185 vtkTypeBool Update(vtkInformation* requests) override;
187
189
192 vtkSetMacro(Piece, int);
193 vtkGetMacro(Piece, int);
194 vtkSetMacro(NumberOfPieces, int);
195 vtkGetMacro(NumberOfPieces, int);
196 vtkSetMacro(NumberOfSubPieces, int);
197 vtkGetMacro(NumberOfSubPieces, int);
199
201
204 vtkSetMacro(GhostLevel, int);
205 vtkGetMacro(GhostLevel, int);
207
209
217 vtkSetMacro(SeamlessU, bool);
218 vtkGetMacro(SeamlessU, bool);
219 vtkBooleanMacro(SeamlessU, bool);
220 vtkSetMacro(SeamlessV, bool);
221 vtkGetMacro(SeamlessV, bool);
222 vtkBooleanMacro(SeamlessV, bool);
224
226
232 vtkSetStringMacro(PointIdArrayName);
233 vtkGetStringMacro(PointIdArrayName);
234 vtkSetStringMacro(CellIdArrayName);
235 vtkGetStringMacro(CellIdArrayName);
237
239
249 vtkSetStringMacro(CompositeIdArrayName);
250 vtkGetStringMacro(CompositeIdArrayName);
252
254
260 vtkSetStringMacro(ProcessIdArrayName);
261 vtkGetStringMacro(ProcessIdArrayName);
263
268 double* GetBounds() VTK_SIZEHINT(6) override;
269 void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); }
270
275
288 virtual void MapDataArrayToVertexAttribute(const char* vertexAttributeName,
289 const char* dataArrayName, int fieldAssociation, int componentno = -1);
290
291 // Specify a data array to use as the texture coordinate
292 // for a named texture. See vtkProperty.h for how to
293 // name textures.
295 const char* textureName, const char* dataArrayName, int fieldAssociation, int componentno = -1);
296
300 virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
301
306
312
334 {
341 FOCAL_POINT_SHIFT_SCALE
342 };
343
347 virtual void SetVBOShiftScaleMethod(int) {}
348 virtual int GetVBOShiftScaleMethod() { return this->ShiftScaleMethod; }
349
364 virtual void SetPauseShiftScale(bool pauseShiftScale) { this->PauseShiftScale = pauseShiftScale; }
365 vtkGetMacro(PauseShiftScale, bool);
366 vtkBooleanMacro(PauseShiftScale, bool);
367
368protected:
371
377 virtual void ComputeBounds();
378
379 int Piece;
383 bool SeamlessU, SeamlessV;
384 int ShiftScaleMethod; // for points
386
387 // additional picking indirection
388 char* PointIdArrayName = nullptr;
389 char* CellIdArrayName = nullptr;
390 char* CompositeIdArrayName = nullptr;
391 char* ProcessIdArrayName = nullptr;
392
394
395private:
396 vtkPolyDataMapper(const vtkPolyDataMapper&) = delete;
397 void operator=(const vtkPolyDataMapper&) = delete;
398};
399
400VTK_ABI_NAMESPACE_END
401#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:151
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:98
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.
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.
void Render(vtkRenderer *ren, vtkActor *act) override
This calls RenderPiece (in a for loop if streaming is necessary).
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.
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.
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 void ComputeBounds()
Called in GetBounds().
~vtkPolyDataMapper() override
static vtkPolyDataMapper * New()
concrete dataset represents vertices, lines, polygons, and triangle strips
create a window for renderers to draw into
abstract specification for renderers
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO