VTK  9.6.20260221
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
127
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#include <limits> // For std::numeric_limits<>
137
138VTK_ABI_NAMESPACE_BEGIN
139class vtkPolyData;
140class vtkRenderer;
141class vtkRenderWindow;
142
143class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPolyDataMapper : public vtkMapper
144{
145public:
148 void PrintSelf(ostream& os, vtkIndent indent) override;
149
153 virtual void RenderPiece(vtkRenderer*, vtkActor*) {}
154
158 void Render(vtkRenderer* ren, vtkActor* act) override;
159
160 using MapperHashType = std::uintptr_t;
170
179 {
180 return std::numeric_limits<vtkIdType>::max();
181 }
182
184
190
192
195 bool Update(int port) override;
196 bool Update() override;
197 vtkTypeBool Update(int port, vtkInformationVector* requests) override;
198 vtkTypeBool Update(vtkInformation* requests) override;
200
202
205 vtkSetMacro(Piece, int);
206 vtkGetMacro(Piece, int);
207 vtkSetMacro(NumberOfPieces, int);
208 vtkGetMacro(NumberOfPieces, int);
209 vtkSetMacro(NumberOfSubPieces, int);
210 vtkGetMacro(NumberOfSubPieces, int);
212
214
217 vtkSetMacro(GhostLevel, int);
218 vtkGetMacro(GhostLevel, int);
220
222
230 vtkSetMacro(SeamlessU, bool);
231 vtkGetMacro(SeamlessU, bool);
232 vtkBooleanMacro(SeamlessU, bool);
233 vtkSetMacro(SeamlessV, bool);
234 vtkGetMacro(SeamlessV, bool);
235 vtkBooleanMacro(SeamlessV, bool);
237
239
245 vtkSetStringMacro(PointIdArrayName);
246 vtkGetStringMacro(PointIdArrayName);
247 vtkSetStringMacro(CellIdArrayName);
248 vtkGetStringMacro(CellIdArrayName);
250
252
262 vtkSetStringMacro(CompositeIdArrayName);
263 vtkGetStringMacro(CompositeIdArrayName);
265
267
273 vtkSetStringMacro(ProcessIdArrayName);
274 vtkGetStringMacro(ProcessIdArrayName);
276
281 double* GetBounds() VTK_SIZEHINT(6) override;
282 void GetBounds(double bounds[6]) override { this->Superclass::GetBounds(bounds); }
283
288
301 virtual void MapDataArrayToVertexAttribute(const char* vertexAttributeName,
302 const char* dataArrayName, int fieldAssociation, int componentno = -1);
303
304 // Specify a data array to use as the texture coordinate
305 // for a named texture. See vtkProperty.h for how to
306 // name textures.
308 const char* textureName, const char* dataArrayName, int fieldAssociation, int componentno = -1);
309
313 virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
314
319
325
356
360 virtual void SetVBOShiftScaleMethod(int) {}
361 virtual int GetVBOShiftScaleMethod() { return this->ShiftScaleMethod; }
362
377 virtual void SetPauseShiftScale(bool pauseShiftScale) { this->PauseShiftScale = pauseShiftScale; }
378 vtkGetMacro(PauseShiftScale, bool);
379 vtkBooleanMacro(PauseShiftScale, bool);
380
381protected:
384
390 virtual void ComputeBounds();
391
392 int Piece;
397 int ShiftScaleMethod; // for points
399
400 // additional picking indirection
401 char* PointIdArrayName = nullptr;
402 char* CellIdArrayName = nullptr;
403 char* CompositeIdArrayName = nullptr;
404 char* ProcessIdArrayName = nullptr;
405
407
408private:
409 vtkPolyDataMapper(const vtkPolyDataMapper&) = delete;
410 void operator=(const vtkPolyDataMapper&) = delete;
411};
412
413VTK_ABI_NAMESPACE_END
414#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:151
a simple class to control print indentation
Definition vtkIndent.h:108
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
create a window for renderers to draw into
abstract specification for renderers
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:363
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO