VTK  9.7.20260812
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
34
35#ifndef vtkSurfaceRepresentation_h
36#define vtkSurfaceRepresentation_h
37
39#include "vtkNew.h" // For ivars
40#include "vtkViewsRenderingModule.h" // For export macro
41
42VTK_ABI_NAMESPACE_BEGIN
43class vtkActor;
47class vtkProperty;
50class vtkSelection;
51
52class VTKVIEWSRENDERING_EXPORT vtkSurfaceRepresentation : public vtkDataRepresentation
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
67
86
88
97 void SetRepresentation(int type);
107
109
112 void SetColor(double r, double g, double b);
113 double* GetColor() VTK_SIZEHINT(3);
114 void SetOpacity(double val);
115 double GetOpacity();
116 void SetEdgeColor(double r, double g, double b);
118 void SetEdgeOpacity(double val);
120 void SetAmbient(double val);
121 double GetAmbient();
122 void SetDiffuse(double val);
123 double GetDiffuse();
124 void SetSpecular(double val);
125 double GetSpecular();
126 void SetSpecularPower(double val);
128 void SetLineWidth(double val);
129 double GetLineWidth();
130 void SetPointSize(double val);
131 double GetPointSize();
132 void SetLighting(bool val);
134 void SetInterpolation(int val);
138 void SetRenderLinesAsTubes(bool val);
140 void SetRoughness(double val);
141 double GetRoughness();
142 void SetMetallic(double val);
143 double GetMetallic();
145
147
166 void SetScalarVisibility(bool val);
168 void ColorByPointArray(const char* arrayName);
169 void ColorByPointArray(const char* arrayName, int component);
170 void ColorByCellArray(const char* arrayName);
171 void ColorByCellArray(const char* arrayName, int component);
172 void ColorByFieldArray(const char* arrayName);
173 void ColorByFieldArray(const char* arrayName, int component);
179
181
191
193
207 void SetFeatureAngle(double val);
209 void SetSplitting(bool val);
212
214
222 void SetTriangulate(bool val);
229
231
236 void SetPassThroughCellIds(bool val);
241
243
258
260
265 void SetGenerateProcessIds(bool val);
268
270
273 void SetVisibility(bool val);
275 void SetPickable(bool val);
277 void SetPosition(double x, double y, double z);
279 void SetOrientation(double x, double y, double z);
281 void SetScale(double x, double y, double z);
282 double* GetScale() VTK_SIZEHINT(3);
284
286
293
295
301 void SetSelectionColor(double r, double g, double b);
303 void SetSelectionOpacity(double val);
305 void SetSelectionLineWidth(double val);
307 void SetSelectionPointSize(double val);
323
328
333
334protected:
337
339
340 bool AddToView(vtkView* view) override;
341 bool RemoveFromView(vtkView* view) override;
342
343 vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
344
345private:
347 void operator=(const vtkSurfaceRepresentation&) = delete;
348
353 bool IsColoringBy(const char* arrayName, int scalarMode);
354
359 void ColorByComponent(int component);
360
361 vtkNew<vtkGeometryFilterDispatcher> GeometryFilter;
363 vtkNew<vtkActor> Actor;
364 vtkNew<vtkScalarBarActor> ScalarBar;
365 bool ScalarBarVisible;
366 int RepresentationValue;
367
368 vtkNew<vtkExtractSelection> SelectionExtractor;
369 vtkNew<vtkGeometryFilterDispatcher> SelectionGeometryFilter;
370 vtkNew<vtkCompositePolyDataMapper> SelectionMapper;
371 vtkNew<vtkActor> SelectionActor;
372 int SelectionRepresentationValue;
373 bool UserSetSelectionRepresentation;
374};
375
376VTK_ABI_NAMESPACE_END
377#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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
Create a scalar bar with labels.
Superclass for mapping scalar values to colors.
data object that represents a "selection" in VTK.
double GetPointSize()
Color and material properties (forwarded to vtkProperty).
void SetTriangulate(bool val)
Mesh processing options (forwarded to vtkGeometryFilterDispatcher).
void SetSpecularPower(double val)
Color and material properties (forwarded to vtkProperty).
void SetRenderLinesAsTubes(bool val)
Color and material properties (forwarded to vtkProperty).
void SetSpecular(double val)
Color and material properties (forwarded to vtkProperty).
void SetHideInternalAMRFaces(bool val)
Composite and AMR options (forwarded to vtkGeometryFilterDispatcher).
void SetLookupTable(vtkScalarsToColors *lut)
Scalar coloring (forwarded to mapper).
double GetSpecular()
Color and material properties (forwarded to vtkProperty).
bool GetVisibility()
Visibility, pickability, and actor transforms.
void SetRepresentationToPoints()
Set/get the representation mode.
double GetSpecularPower()
Color and material properties (forwarded to vtkProperty).
bool GetLighting()
Color and material properties (forwarded to vtkProperty).
double GetSelectionOpacity()
Selection display properties.
bool GetInterpolateScalarsBeforeMapping()
Scalar coloring (forwarded to mapper).
void SetPickable(bool val)
Visibility, pickability, and actor transforms.
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.
bool GetUseNonOverlappingAMRMetaDataForOutlines()
Composite and AMR options (forwarded to vtkGeometryFilterDispatcher).
void SetDiffuse(double val)
Color and material properties (forwarded to vtkProperty).
double * GetSelectionColor()
Selection display properties.
void SetEdgeColor(double r, double g, double b)
Color and material properties (forwarded to vtkProperty).
void SetMetallic(double val)
Color and material properties (forwarded to vtkProperty).
void SetRepresentationToWireframe()
Set/get the representation mode.
void SetLineWidth(double val)
Color and material properties (forwarded to vtkProperty).
void SetNonlinearSubdivisionLevel(int val)
Mesh processing options (forwarded to vtkGeometryFilterDispatcher).
bool GetGeneratePointNormals()
Normal generation (forwarded to vtkGeometryFilterDispatcher).
void SetLighting(bool val)
Color and material properties (forwarded to vtkProperty).
double * GetScale()
Visibility, pickability, and actor transforms.
double GetOpacity()
Color and material properties (forwarded to vtkProperty).
bool AddToView(vtkView *view) override
Adds the representation to the view.
void SetUseNonOverlappingAMRMetaDataForOutlines(bool val)
Composite and AMR options (forwarded to vtkGeometryFilterDispatcher).
void ColorByCellArray(const char *arrayName)
Scalar coloring (forwarded to mapper).
void SetPosition(double x, double y, double z)
Visibility, pickability, and actor transforms.
void SetBlockColorsDistinctValues(int val)
Composite and AMR options (forwarded to vtkGeometryFilterDispatcher).
void SetOpacity(double val)
Color and material properties (forwarded to vtkProperty).
vtkActor * GetActor()
Provide access to the internal actor for advanced usage.
vtkScalarsToColors * GetLookupTable()
Scalar coloring (forwarded to mapper).
vtkScalarBarActor * GetScalarBarActor()
Scalar bar control.
void SetInterpolation(int val)
Color and material properties (forwarded to vtkProperty).
int GetSelectionRepresentation()
Selection display properties.
void SetGeneratePointNormals(bool val)
Normal generation (forwarded to vtkGeometryFilterDispatcher).
void SetInterpolateScalarsBeforeMapping(bool val)
Scalar coloring (forwarded to mapper).
double * GetOrientation()
Visibility, pickability, and actor transforms.
void SetGenerateProcessIds(bool val)
Parallel option (forwarded to vtkGeometryFilterDispatcher).
void SetPassThroughPointIds(bool val)
Picking support (forwarded to vtkGeometryFilterDispatcher).
bool GetPassThroughPointIds()
Picking support (forwarded to vtkGeometryFilterDispatcher).
vtkActor * GetSelectionActor()
Provide access to the internal selection actor for advanced usage.
void SetSelectionPointSize(double val)
Selection display properties.
double GetEdgeOpacity()
Color and material properties (forwarded to vtkProperty).
int GetBlockColorsDistinctValues()
Composite and AMR options (forwarded to vtkGeometryFilterDispatcher).
int GetRepresentation()
Set/get the representation mode.
void SetRoughness(double val)
Color and material properties (forwarded to vtkProperty).
vtkMTimeType GetMTime() override
The representation stores its properties on the geometry filter, mapper, actor and scalar bar it owns...
void SetRepresentationToSurface()
Set/get the representation mode.
void SetPointSize(double val)
Color and material properties (forwarded to vtkProperty).
void SetVisibility(bool val)
Visibility, pickability, and actor transforms.
void SetFeatureAngle(double val)
Normal generation (forwarded to vtkGeometryFilterDispatcher).
double GetSelectionLineWidth()
Selection display properties.
RepresentationType
Representation type constants.
bool GetRenderLinesAsTubes()
Color and material properties (forwarded to vtkProperty).
void SetColor(double r, double g, double b)
Color and material properties (forwarded to vtkProperty).
void SetGenerateCellNormals(bool val)
Normal generation (forwarded to vtkGeometryFilterDispatcher).
void SetScalarVisibility(bool val)
Scalar coloring (forwarded to mapper).
void SetSelectionColor(double r, double g, double b)
Selection display properties.
int GetInterpolation()
Color and material properties (forwarded to vtkProperty).
bool GetScalarVisibility()
Scalar coloring (forwarded to mapper).
int GetNonlinearSubdivisionLevel()
Mesh processing options (forwarded to vtkGeometryFilterDispatcher).
void SetSelectionLineWidth(double val)
Selection display properties.
void SetSplitting(bool val)
Normal generation (forwarded to vtkGeometryFilterDispatcher).
double GetMetallic()
Color and material properties (forwarded to vtkProperty).
bool GetPassThroughCellIds()
Picking support (forwarded to vtkGeometryFilterDispatcher).
void SetSelectionRepresentation(int type)
The selection is drawn from the same geometry as the representation itself, so only the property-leve...
void SetRenderPointsAsSpheres(bool val)
Color and material properties (forwarded to vtkProperty).
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection) override
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
bool GetGenerateCellNormals()
Normal generation (forwarded to vtkGeometryFilterDispatcher).
bool GetGenerateProcessIds()
Parallel option (forwarded to vtkGeometryFilterDispatcher).
void SetFieldDataTupleId(vtkIdType id)
Which tuple of the array selected by ColorByFieldArray() to color with.
bool GetSplitting()
Normal generation (forwarded to vtkGeometryFilterDispatcher).
static vtkSurfaceRepresentation * New()
bool GetHideInternalAMRFaces()
Composite and AMR options (forwarded to vtkGeometryFilterDispatcher).
const char * GetRepresentationAsString()
Set/get the representation mode.
double GetSelectionPointSize()
Selection display properties.
double * GetPosition()
Visibility, pickability, and actor transforms.
vtkIdType GetFieldDataTupleId()
Which tuple of the array selected by ColorByFieldArray() to color with.
void SetSelectionOpacity(double val)
Selection display properties.
double * GetEdgeColor()
Color and material properties (forwarded to vtkProperty).
bool GetRenderPointsAsSpheres()
Color and material properties (forwarded to vtkProperty).
bool GetTriangulate()
Mesh processing options (forwarded to vtkGeometryFilterDispatcher).
bool GetMatchBoundariesIgnoringCellOrder()
Mesh processing options (forwarded to vtkGeometryFilterDispatcher).
void SetScalarBarVisibility(bool val)
Scalar bar control.
double GetRoughness()
Color and material properties (forwarded to vtkProperty).
void SetMatchBoundariesIgnoringCellOrder(bool val)
Mesh processing options (forwarded to vtkGeometryFilterDispatcher).
double GetDiffuse()
Color and material properties (forwarded to vtkProperty).
void SetPassThroughCellIds(bool val)
Picking support (forwarded to vtkGeometryFilterDispatcher).
void SetRepresentationToFeatureEdges()
Set/get the representation mode.
void SetAmbient(double val)
Color and material properties (forwarded to vtkProperty).
void SetScale(double x, double y, double z)
Visibility, pickability, and actor transforms.
void SetRepresentationToOutline()
Set/get the representation mode.
double GetLineWidth()
Color and material properties (forwarded to vtkProperty).
bool RemoveFromView(vtkView *view) override
Removes the representation to the view.
double GetFeatureAngle()
Normal generation (forwarded to vtkGeometryFilterDispatcher).
bool GetPickable()
Visibility, pickability, and actor transforms.
void SetRepresentation(int type)
Set/get the representation mode.
void ColorByPointArray(const char *arrayName)
Scalar coloring (forwarded to mapper).
void SetOrientation(double x, double y, double z)
Visibility, pickability, and actor transforms.
double * GetColor()
Color and material properties (forwarded to vtkProperty).
bool GetScalarBarVisibility()
Scalar bar control.
void ColorByFieldArray(const char *arrayName)
Scalar coloring (forwarded to mapper).
double GetAmbient()
Color and material properties (forwarded to vtkProperty).
void SetEdgeOpacity(double val)
Color and material properties (forwarded to vtkProperty).
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
int vtkIdType
Definition vtkType.h:363
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)