VTK  9.1.0
vtkGraphMapper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkGraphMapper.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
30#ifndef vtkGraphMapper_h
31#define vtkGraphMapper_h
32
33#include "vtkMapper.h"
34#include "vtkRenderingCoreModule.h" // For export macro
35
36#include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
37
38class vtkActor2D;
40class vtkCamera;
41class vtkFollower;
42class vtkGraph;
43class vtkGlyph3D;
46class vtkCellCenters;
47class vtkPolyData;
50class vtkLookupTable;
52class vtkTexture;
55
56class VTKRENDERINGCORE_EXPORT vtkGraphMapper : public vtkMapper
57{
58public:
60 vtkTypeMacro(vtkGraphMapper, vtkMapper);
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62 void Render(vtkRenderer* ren, vtkActor* act) override;
63
65
68 void SetVertexColorArrayName(const char* name);
71
73
76 void SetColorVertices(bool vis);
81
83
89 void SetScaledGlyphs(bool arg);
90 vtkGetMacro(ScaledGlyphs, bool);
91 vtkBooleanMacro(ScaledGlyphs, bool);
93
95
98 vtkSetStringMacro(ScalingArrayName);
99 vtkGetStringMacro(ScalingArrayName);
101
103
106 void SetEdgeVisibility(bool vis);
108 vtkBooleanMacro(EdgeVisibility, bool);
110
112
115 void SetEdgeColorArrayName(const char* name);
118
120
123 void SetColorEdges(bool vis);
128
130
133 vtkSetStringMacro(EnabledEdgesArrayName);
134 vtkGetStringMacro(EnabledEdgesArrayName);
136
138
141 vtkSetMacro(EnableEdgesByArray, vtkTypeBool);
142 vtkGetMacro(EnableEdgesByArray, vtkTypeBool);
143 vtkBooleanMacro(EnableEdgesByArray, vtkTypeBool);
145
147
150 vtkSetStringMacro(EnabledVerticesArrayName);
151 vtkGetStringMacro(EnabledVerticesArrayName);
153
155
158 vtkSetMacro(EnableVerticesByArray, vtkTypeBool);
159 vtkGetMacro(EnableVerticesByArray, vtkTypeBool);
160 vtkBooleanMacro(EnableVerticesByArray, vtkTypeBool);
162
164
167 void SetIconArrayName(const char* name);
168 const char* GetIconArrayName();
170
176 void AddIconType(const char* type, int index);
177
182
184
187 void SetIconSize(int* size);
190
195 void SetIconAlignment(int alignment);
196
198
204
206
209 void SetIconVisibility(bool vis);
211 vtkBooleanMacro(IconVisibility, bool);
213
215
218 vtkGetMacro(VertexPointSize, float);
221
223
226 vtkGetMacro(EdgeLineWidth, float);
227 void SetEdgeLineWidth(float width);
229
236
241
243
246 void SetInputData(vtkGraph* input);
249
254 double* GetBounds() VTK_SIZEHINT(6) override;
255 void GetBounds(double* bounds) override { Superclass::GetBounds(bounds); }
256
258
261 vtkGetObjectMacro(EdgeLookupTable, vtkLookupTable);
262 vtkGetObjectMacro(VertexLookupTable, vtkLookupTable);
264
265protected:
267 ~vtkGraphMapper() override;
268
270
273 vtkGetStringMacro(VertexColorArrayNameInternal);
274 vtkSetStringMacro(VertexColorArrayNameInternal);
275 vtkGetStringMacro(EdgeColorArrayNameInternal);
276 vtkSetStringMacro(EdgeColorArrayNameInternal);
280
285
286 vtkGetStringMacro(IconArrayNameInternal);
287 vtkSetStringMacro(IconArrayNameInternal);
289
292
298
303
308
309 // Color maps
312
314
315 // see algorithm for more info
317
318private:
319 vtkGraphMapper(const vtkGraphMapper&) = delete;
320 void operator=(const vtkGraphMapper&) = delete;
321
322 // Helper function
323 vtkPolyData* CreateCircle(bool filled);
324
325 float VertexPointSize;
326 float EdgeLineWidth;
327 bool ScaledGlyphs;
328 char* ScalingArrayName;
329};
330
331#endif
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
a actor that draws 2D data
Definition: vtkActor2D.h:149
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
generate points at center of cells
a subclass of actor that always faces the camera
Definition: vtkFollower.h:120
Detect and break reference loops.
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:216
map vtkGraph and derived classes to graphics primitives
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
void ColorEdgesOn()
Whether to color edges.
~vtkGraphMapper() override
bool GetEdgeVisibility()
Whether to show edges or not.
vtkSmartPointer< vtkTexturedActor2D > IconActor
void SetColorEdges(bool vis)
Whether to color edges.
void SetVertexColorArrayName(const char *name)
The array to use for coloring vertices.
vtkGraph * GetInput()
Set the Input of this mapper.
char * EnabledVerticesArrayName
vtkSmartPointer< vtkGraphToPolyData > GraphToPoly
vtkLookupTable * EdgeLookupTable
bool GetIconVisibility()
Whether to show icons.
void ClearIconTypes()
Clear all icon mappings.
vtkSmartPointer< vtkPolyDataMapper > EdgeMapper
vtkSmartPointer< vtkPolyDataMapper > VertexMapper
int * GetIconSize()
Specify the Width and Height, in pixels, of an icon in the icon sheet.
void SetIconVisibility(bool vis)
Whether to show icons.
void AddIconType(const char *type, int index)
Associate the icon at index "index" in the vtkTexture to all vertices containing "type" as a value in...
void ColorVerticesOff()
Whether to color vertices.
const char * GetEdgeColorArrayName()
The array to use for coloring edges.
bool GetColorVertices()
Whether to color vertices.
void SetColorVertices(bool vis)
Whether to color vertices.
vtkSmartPointer< vtkMapArrayValues > IconTypeToIndex
void ReportReferences(vtkGarbageCollector *) override
vtkSmartPointer< vtkIconGlyphFilter > IconGlyph
char * EdgeColorArrayNameInternal
Used to store the vertex and edge color array names.
vtkSmartPointer< vtkPolyDataMapper > OutlineMapper
vtkSmartPointer< vtkVertexGlyphFilter > VertexGlyph
vtkSmartPointer< vtkTransformCoordinateSystems > IconTransform
void SetScaledGlyphs(bool arg)
Whether scaled glyphs are on or not.
vtkTypeBool EnableEdgesByArray
char * IconArrayNameInternal
vtkTexture * GetIconTexture()
The texture containing the icon sheet.
void SetIconSize(int *size)
Specify the Width and Height, in pixels, of an icon in the icon sheet.
const char * GetVertexColorArrayName()
The array to use for coloring vertices.
void SetInputData(vtkGraph *input)
Set the Input of this mapper.
void ColorVerticesOn()
Whether to color vertices.
vtkSmartPointer< vtkActor > EdgeActor
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkLookupTable * VertexLookupTable
char * VertexColorArrayNameInternal
Used to store the vertex and edge color array names.
bool GetColorEdges()
Whether to color edges.
void SetIconAlignment(int alignment)
Specify where the icons should be placed in relation to the vertex.
static vtkGraphMapper * New()
char * EnabledEdgesArrayName
vtkSmartPointer< vtkPolyDataMapper2D > IconMapper
vtkSmartPointer< vtkGlyph3D > CircleGlyph
vtkSmartPointer< vtkActor > OutlineActor
void SetIconArrayName(const char *name)
The array to use for assigning icons.
vtkSmartPointer< vtkActor > VertexActor
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool EnableVerticesByArray
const char * GetIconArrayName()
The array to use for assigning icons.
void ColorEdgesOff()
Whether to color edges.
void SetIconTexture(vtkTexture *texture)
The texture containing the icon sheet.
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
void SetEdgeVisibility(bool vis)
Whether to show edges or not.
vtkSmartPointer< vtkGlyph3D > CircleOutlineGlyph
void Render(vtkRenderer *ren, vtkActor *act) override
Method initiates the mapping process.
void SetEdgeLineWidth(float width)
Get/Set the edge line width.
void SetEdgeColorArrayName(const char *name)
The array to use for coloring edges.
void SetVertexPointSize(float size)
Get/Set the vertex point size.
vtkMTimeType GetMTime() override
Get the mtime also considering the lookup table.
convert a vtkGraph to vtkPolyData
Base class for graph data types.
Definition: vtkGraph.h:339
Filter that generates a polydata consisting of quads with texture coordinates referring to a set of i...
a simple class to control print indentation
Definition: vtkIndent.h:113
Store vtkAlgorithm input/output information.
map scalar values into colors via a lookup table
Map values in an input array to different values in an output array of (possibly) different type.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:171
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
abstract specification for renderers
Definition: vtkRenderer.h:173
handles properties associated with a texture map
Definition: vtkTexture.h:175
actor that draws 2D data with texture support
transform points into different coordinate systems
Make a vtkPolyData with a vertex on each point.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
void GetBounds(T a, double bds[6])
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ type
Definition: vtkX3D.h:522
@ filled
Definition: vtkX3D.h:355
@ name
Definition: vtkX3D.h:225
@ size
Definition: vtkX3D.h:259
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_SIZEHINT(...)