1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
|
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkTreeLayoutView.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*----------------------------------------------------------------------------
Copyright (c) Sandia Corporation
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
// .NAME vtkTreeLayoutView - Lays out and displays a tree.
//
// .SECTION Description
// vtkTreeLayoutView displays a tree in radial or standard "top-down" format.
// You may specify the vertex labels and colors.
#ifndef __vtkTreeLayoutView_h
#define __vtkTreeLayoutView_h
#include "vtkRenderView.h"
class vtkActor;
class vtkActor2D;
class vtkCoordinate;
class vtkDynamic2DLabelMapper;
class vtkExtractSelectedGraph;
class vtkGraphLayout;
class vtkGraphToPolyData;
class vtkInteractorStyleRubberBand2D;
class vtkKdTreeSelector;
class vtkLookupTable;
class vtkPolyDataMapper;
class vtkTreeLayoutStrategy;
class vtkVertexGlyphFilter;
class vtkViewTheme;
class vtkVisibleCellSelector;
class VTK_VIEWS_EXPORT vtkTreeLayoutView : public vtkRenderView
{
public:
static vtkTreeLayoutView *New();
vtkTypeRevisionMacro(vtkTreeLayoutView, vtkRenderView);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// The array to use for labeling. Default is "label".
void SetLabelArrayName(const char* name);
const char* GetLabelArrayName();
// Description:
// Whether to show labels. Default is off.
void SetLabelVisibility(bool vis);
bool GetLabelVisibility();
void LabelVisibilityOn();
void LabelVisibilityOff();
// Description:
// The array to use for coloring vertices. Default is "color".
void SetVertexColorArrayName(const char* name);
const char* GetVertexColorArrayName();
// Description:
// Whether to show labels. Default is off.
void SetColorVertices(bool vis);
bool GetColorVertices();
void ColorVerticesOn();
void ColorVerticesOff();
// Description:
// The array to use for coloring edges. Default is "color".
void SetEdgeColorArrayName(const char* name);
const char* GetEdgeColorArrayName();
// Description:
// Whether to show labels. Default is off.
void SetColorEdges(bool vis);
bool GetColorEdges();
void ColorEdgesOn();
void ColorEdgesOff();
// Description:
// The sweep angle of the tree.
// For a standard tree layout, this should be between 0 and 180.
// For a radial tree layout, this can be between 0 and 360.
void SetAngle(double angle);
double GetAngle();
// Description:
// If set, the tree is laid out with levels on concentric circles
// around the root. If unset (default), the tree is laid out with
// levels on horizontal lines.
void SetRadial(bool radial);
bool GetRadial();
void RadialOn();
void RadialOff();
// Description:
// The spacing of tree levels. Levels near zero give more space
// to levels near the root, while levels near one (the default)
// create evenly-spaced levels.
void SetLogSpacingValue(double value);
double GetLogSpacingValue();
// Description:
// The spacing of leaves. Levels near one evenly space leaves
// with no gaps between subtrees. Levels near zero creates
// large gaps between subtrees.
void SetLeafSpacing(double value);
double GetLeafSpacing();
// Description:
const char* GetDistanceArrayName();
void SetDistanceArrayName(const char* name);
// Description:
// Sets up interactor style.
virtual void SetupRenderWindow(vtkRenderWindow* win);
// Description:
// Apply the theme to this view.
virtual void ApplyViewTheme(vtkViewTheme* theme);
protected:
vtkTreeLayoutView();
~vtkTreeLayoutView();
// Description:
// Called to process the user event from the interactor style.
virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
void* callData);
// Description:
// Connects the algorithm output to the internal pipeline.
// This view only supports a single representation.
virtual void AddInputConnection(vtkAlgorithmOutput* conn);
// Description:
// Removes the algorithm output from the internal pipeline.
virtual void RemoveInputConnection(vtkAlgorithmOutput* conn);
// Description:
// Connects the selection link to the internal pipeline.
virtual void SetSelectionLink(vtkSelectionLink* link);
// Decsription:
// Prepares the view for rendering.
virtual void PrepareForRendering();
// Description:
// May a display coordinate to a world coordinate on the x-y plane.
void MapToXYPlane(double displayX, double displayY, double &x, double &y);
// Description:
// Used to store the vertex and edge color array names
vtkGetStringMacro(VertexColorArrayNameInternal);
vtkSetStringMacro(VertexColorArrayNameInternal);
vtkGetStringMacro(EdgeColorArrayNameInternal);
vtkSetStringMacro(EdgeColorArrayNameInternal);
char* VertexColorArrayNameInternal;
char* EdgeColorArrayNameInternal;
// Used for coordinate conversion
vtkCoordinate* Coordinate;
// Representation objects
vtkGraphLayout* GraphLayout;
vtkTreeLayoutStrategy* TreeStrategy;
vtkGraphToPolyData* GraphToPolyData;
vtkVertexGlyphFilter* VertexGlyph;
vtkPolyDataMapper* VertexMapper;
vtkLookupTable* VertexColorLUT;
vtkActor* VertexActor;
vtkPolyDataMapper* OutlineMapper;
vtkActor* OutlineActor;
vtkPolyDataMapper* EdgeMapper;
vtkLookupTable* EdgeColorLUT;
vtkActor* EdgeActor;
vtkDynamic2DLabelMapper* LabelMapper;
vtkActor2D* LabelActor;
// Selection objects
vtkKdTreeSelector* KdTreeSelector;
vtkVisibleCellSelector* VisibleCellSelector;
vtkExtractSelectedGraph* ExtractSelectedGraph;
vtkGraphToPolyData* SelectionToPolyData;
vtkVertexGlyphFilter* SelectionVertexGlyph;
vtkPolyDataMapper* SelectionVertexMapper;
vtkActor* SelectionVertexActor;
vtkPolyDataMapper* SelectionEdgeMapper;
vtkActor* SelectionEdgeActor;
private:
vtkTreeLayoutView(const vtkTreeLayoutView&); // Not implemented.
void operator=(const vtkTreeLayoutView&); // Not implemented.
};
#endif
|