00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkGeoGraphRepresentation2D.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00035 #ifndef __vtkGeoGraphRepresentation2D_h 00036 #define __vtkGeoGraphRepresentation2D_h 00037 00038 #include "vtkDataRepresentation.h" 00039 #include "vtkSmartPointer.h" // for ivars 00040 00041 class vtkActor; 00042 class vtkActor2D; 00043 class vtkAlgorithmOutput; 00044 class vtkDataObject; 00045 class vtkDynamic2DLabelMapper; 00046 class vtkEdgeCenters; 00047 class vtkEdgeLayout; 00048 class vtkEdgeLayoutStrategy; 00049 class vtkExtractSelectedGraph; 00050 class vtkGeoAssignCoordinates; 00051 class vtkGraphMapper; 00052 class vtkGraphToPolyData; 00053 class vtkLabeledDataMapper; 00054 class vtkLabelPlacer; 00055 class vtkLabelSizeCalculator; 00056 class vtkPerturbCoincidentVertices; 00057 class vtkPointSetToLabelHierarchy; 00058 class vtkPolyDataMapper; 00059 class vtkSelection; 00060 class vtkAbstractTransform; 00061 class vtkView; 00062 class vtkViewTheme; 00063 00064 class VTK_GEOVIS_EXPORT vtkGeoGraphRepresentation2D : public vtkDataRepresentation 00065 { 00066 public: 00067 static vtkGeoGraphRepresentation2D *New(); 00068 vtkTypeRevisionMacro(vtkGeoGraphRepresentation2D, vtkDataRepresentation); 00069 void PrintSelf(ostream& os, vtkIndent indent); 00070 00072 virtual void SetInputConnection(vtkAlgorithmOutput* conn); 00073 00075 00076 virtual void SetVertexLabelArrayName(const char* name); 00077 virtual const char* GetVertexLabelArrayName(); 00079 00081 00082 virtual void SetVertexLabelVisibility(bool b); 00083 virtual bool GetVertexLabelVisibility(); 00084 vtkBooleanMacro(VertexLabelVisibility, bool); 00086 00088 00089 virtual void SetLatitudeArrayName(const char* name); 00090 virtual const char* GetLatitudeArrayName(); 00092 00094 00095 virtual void SetLongitudeArrayName(const char* name); 00096 virtual const char* GetLongitudeArrayName(); 00098 00100 00101 void SetVertexLabelFontSize(int size); 00102 int GetVertexLabelFontSize(); 00104 00106 00107 void SetColorVertices(bool b); 00108 bool GetColorVertices(); 00109 vtkBooleanMacro(ColorVertices, bool); 00111 00113 00114 void SetVertexColorArrayName(const char* name); 00115 const char* GetVertexColorArrayName(); 00117 00119 00120 void SetEdgeLabelVisibility(bool b); 00121 bool GetEdgeLabelVisibility(); 00122 vtkBooleanMacro(EdgeLabelVisibility, bool); 00124 00126 00127 void SetEdgeLabelArrayName(const char* name); 00128 const char* GetEdgeLabelArrayName(); 00130 00132 00134 virtual void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy* strategy); 00135 virtual vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy(); 00136 virtual void SetEdgeLayoutStrategyToArcParallel(); 00137 virtual void SetEdgeLayoutStrategyToPassThrough(); 00139 00141 00142 void SetEdgeLabelFontSize(int size); 00143 int GetEdgeLabelFontSize(); 00145 00147 00148 void SetColorEdges(bool b); 00149 bool GetColorEdges(); 00150 vtkBooleanMacro(ColorEdges, bool); 00152 00154 00155 void SetEdgeColorArrayName(const char* name); 00156 const char* GetEdgeColorArrayName(); 00158 00160 00162 void SetTransform(vtkAbstractTransform* trans); 00163 vtkAbstractTransform* GetTransform(); 00165 00167 void ApplyViewTheme(vtkViewTheme* theme); 00168 00170 virtual void PrepareForRendering(); 00171 00173 00175 void SetUseLabelHierarchy(bool b); 00176 vtkGetMacro(UseLabelHierarchy, bool); 00177 vtkBooleanMacro(UseLabelHierarchy, bool); 00179 00180 protected: 00181 vtkGeoGraphRepresentation2D(); 00182 ~vtkGeoGraphRepresentation2D(); 00183 00186 virtual bool AddToView(vtkView* view); 00187 00190 virtual bool RemoveFromView(vtkView* view); 00191 00195 virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection); 00196 00197 //BTX 00199 00200 vtkSmartPointer<vtkGeoAssignCoordinates> AssignCoordinates; 00201 vtkSmartPointer<vtkPerturbCoincidentVertices> PerturbCoincidentVertices; 00202 vtkSmartPointer<vtkLabelSizeCalculator> LabelSize; 00203 vtkSmartPointer<vtkPointSetToLabelHierarchy> LabelHierarchy; 00204 vtkSmartPointer<vtkLabelPlacer> LabelPlacer; 00205 vtkSmartPointer<vtkLabeledDataMapper> LabelMapper; 00206 vtkSmartPointer<vtkActor2D> LabelActor; 00207 vtkSmartPointer<vtkDynamic2DLabelMapper> DynamicLabelMapper; 00208 vtkSmartPointer<vtkActor2D> DynamicLabelActor; 00209 vtkSmartPointer<vtkEdgeLayout> EdgeLayout; 00210 vtkSmartPointer<vtkGraphMapper> GraphMapper; 00211 vtkSmartPointer<vtkActor> GraphActor; 00212 vtkSmartPointer<vtkGraphToPolyData> GraphToPolyData; 00213 vtkSmartPointer<vtkEdgeCenters> EdgeCenters; 00214 vtkSmartPointer<vtkDynamic2DLabelMapper> EdgeLabelMapper; 00215 vtkSmartPointer<vtkActor2D> EdgeLabelActor; 00216 vtkSmartPointer<vtkExtractSelectedGraph> ExtractSelection; 00217 vtkSmartPointer<vtkGraphMapper> SelectionMapper; 00218 vtkSmartPointer<vtkActor> SelectionActor; 00219 //ETX 00221 00222 bool UseLabelHierarchy; 00223 00224 private: 00225 vtkGeoGraphRepresentation2D(const vtkGeoGraphRepresentation2D&); // Not implemented. 00226 void operator=(const vtkGeoGraphRepresentation2D&); // Not implemented. 00227 }; 00228 00229 #endif