VTK  9.7.20260904
vtkSurfaceRepresentation.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
3
39
40#ifndef vtkSurfaceRepresentation_h
41#define vtkSurfaceRepresentation_h
42
43#include "vtkNew.h" // For ivars
45#include "vtkViewsScivisModule.h" // For export macro
46
47VTK_ABI_NAMESPACE_BEGIN
48class vtkActor;
51class vtkDataArray;
54class vtkProperty;
56class vtkScivisView;
57class vtkSelection;
58
59class VTKVIEWSSCIVIS_EXPORT vtkSurfaceRepresentation : public vtkScivisDataRepresentation
60{
61public:
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
73
92
94
103 void SetRepresentation(int type);
113
115
123 void SetColor(double r, double g, double b);
124 double* GetColor() VTK_SIZEHINT(3);
125 void SetOpacity(double val);
126 double GetOpacity();
127 void SetEdgeColor(double r, double g, double b);
130
132
151 void SetScalarVisibility(bool val);
153 void ColorByPointArray(const char* arrayName);
154 void ColorByPointArray(const char* arrayName, int component);
155 void ColorByCellArray(const char* arrayName);
156 void ColorByCellArray(const char* arrayName, int component);
157 void ColorByFieldArray(const char* arrayName);
158 void ColorByFieldArray(const char* arrayName, int component);
161
163
175 void SetColorMode(int mode);
180
182
192
194
202
216
218
225 void SetVisibility(bool val) override;
226 bool GetVisibility() override;
227 bool GetBounds(double bounds[6]) override;
228 const char* GetRenderedArrayName() override;
231 const char* arrayName, int fieldAssoc, double range[2], int component = -1) override;
232 void SetColorMap(vtkScalarsToColors* map) override;
235
237
254
256
269
270protected:
273
275
276 bool AddToView(vtkScivisView* view) override;
277 bool RemoveFromView(vtkScivisView* view) override;
278
280
281private:
283 void operator=(const vtkSurfaceRepresentation&) = delete;
284
289 bool IsColoringBy(const char* arrayName, int scalarMode);
290
295 void ColorByComponent(int component);
296
301 vtkDataArray* GetRenderedScalars(int& fieldAssoc);
302
305 vtkNew<vtkActor> Actor;
307 int RepresentationValue;
308
309 vtkNew<vtkExtractSelection> SelectionExtractor;
310 vtkNew<vtkGeometryFilterDispatcher> SelectionGeometryFilter;
312 vtkNew<vtkActor> SelectionActor;
313 int SelectionRepresentationValue;
314 bool UserSetSelectionRepresentation;
315};
316
317VTK_ABI_NAMESPACE_END
318#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Per-block appearance for a representation of composite data.
a class that renders hierarchical polygonal data
extract a subset from a vtkDataSet.
Geometry filter that does outlines for volumes.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:168
represent surface properties of a geometric object
Superclass for mapping scalar values to colors.
A ready-made rendering assembly for scientific visualization.
data object that represents a "selection" in VTK.
bool GetBounds(double bounds[6]) override
The vtkScivisDataRepresentation contract.
bool AddToView(vtkScivisView *view) override
Called when this representation is added to or removed from a view.
void SetVisibility(bool val) override
The vtkScivisDataRepresentation contract.
void SetRepresentationToPoints()
Set/get the representation mode.
ColorModeType
How the values of the color array become colors.
bool GetInterpolateScalarsBeforeMapping()
Whether scalars are interpolated across a cell before being turned into colors rather than after.
void SetRepresentationToSurfaceWithEdges()
Set/get the representation mode.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetColorMode(int mode)
How the values of the color array become colors.
void SetEdgeColor(double r, double g, double b)
The color the surface is drawn in when it is not colored by an array, and how opaque it is.
void SetRepresentationToWireframe()
Set/get the representation mode.
vtkGeometryFilterDispatcher * GetGeometryFilter()
The objects this representation is built from, for everything the API above does not cover.
double GetOpacity()
The color the surface is drawn in when it is not colored by an array, and how opaque it is.
bool GetVisibility() override
The vtkScivisDataRepresentation contract.
void ColorByCellArray(const char *arrayName)
Color by an array rather than by a single color.
void SetColorMap(vtkScalarsToColors *map) override
The vtkScivisDataRepresentation contract.
void SetOpacity(double val)
The color the surface is drawn in when it is not colored by an array, and how opaque it is.
vtkActor * GetActor()
The objects this representation is built from, for everything the API above does not cover.
int GetRenderedFieldAssociation() override
The vtkScivisDataRepresentation contract.
int GetSelectionRepresentation()
How a selection made in a view is drawn over the surface.
void SetInterpolateScalarsBeforeMapping(bool val)
Whether scalars are interpolated across a cell before being turned into colors rather than after.
vtkActor * GetSelectionActor()
The objects this representation is built from, for everything the API above does not cover.
vtkSelection * ConvertSelection(vtkScivisView *view, vtkSelection *selection) override
Turn a selection made in view into one expressed over this representation's own input.
int GetRepresentation()
Set/get the representation mode.
vtkMTimeType GetMTime() override
The representation stores its properties on the geometry filter, mapper and actor it owns rather than...
vtkScalarsToColors * GetColorMap() override
The vtkScivisDataRepresentation contract.
void SetRepresentationToSurface()
Set/get the representation mode.
RepresentationType
Representation type constants.
void SetColor(double r, double g, double b)
The color the surface is drawn in when it is not colored by an array, and how opaque it is.
void SetScalarVisibility(bool val)
Color by an array rather than by a single color.
bool GetScalarVisibility()
Color by an array rather than by a single color.
vtkBlockProperties * GetBlocks()
Per-block appearance for a composite input: whether a block is drawn, and in what color and opacity,...
bool RemoveFromView(vtkScivisView *view) override
Called when this representation is added to or removed from a view.
void SetSelectionRepresentation(int type)
How a selection made in a view is drawn over the surface.
int GetColorMode()
How the values of the color array become colors.
void SetFieldDataTupleId(vtkIdType id)
Which tuple of the array selected by ColorByFieldArray() to color with.
static vtkSurfaceRepresentation * New()
const char * GetRepresentationAsString()
Set/get the representation mode.
~vtkSurfaceRepresentation() override
void SetColorModeToMapScalars()
How the values of the color array become colors.
vtkIdType GetFieldDataTupleId()
Which tuple of the array selected by ColorByFieldArray() to color with.
double * GetEdgeColor()
The color the surface is drawn in when it is not colored by an array, and how opaque it is.
void SetRepresentationToFeatureEdges()
Set/get the representation mode.
const char * GetRenderedArrayName() override
The vtkScivisDataRepresentation contract.
void SetRepresentationToOutline()
Set/get the representation mode.
void SetColorModeToDirectScalars()
How the values of the color array become colors.
void SetRepresentation(int type)
Set/get the representation mode.
void ColorByPointArray(const char *arrayName)
Color by an array rather than by a single color.
double * GetColor()
The color the surface is drawn in when it is not colored by an array, and how opaque it is.
bool GetDataRange(const char *arrayName, int fieldAssoc, double range[2], int component=-1) override
The vtkScivisDataRepresentation contract.
vtkProperty * GetProperty()
The objects this representation is built from, for everything the API above does not cover.
void ColorByFieldArray(const char *arrayName)
Color by an array rather than by a single color.
void ResetColorArray()
Color by an array rather than by a single color.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)