VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGraphMapper.h 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 -------------------------------------------------------------------------*/ 00032 #ifndef __vtkGraphMapper_h 00033 #define __vtkGraphMapper_h 00034 00035 #include "vtkRenderingCoreModule.h" // For export macro 00036 #include "vtkMapper.h" 00037 00038 #include "vtkSmartPointer.h" // Required for smart pointer internal ivars. 00039 00040 class vtkActor2D; 00041 class vtkMapArrayValues; 00042 class vtkCamera; 00043 class vtkFollower; 00044 class vtkGraph; 00045 class vtkGlyph3D; 00046 class vtkGraphToPolyData; 00047 class vtkIconGlyphFilter; 00048 class vtkCellCenters; 00049 class vtkPolyData; 00050 class vtkPolyDataMapper; 00051 class vtkPolyDataMapper2D; 00052 class vtkLookupTable; 00053 class vtkTransformCoordinateSystems; 00054 class vtkTexture; 00055 class vtkTexturedActor2D; 00056 class vtkVertexGlyphFilter; 00057 00058 class VTKRENDERINGCORE_EXPORT vtkGraphMapper : public vtkMapper 00059 { 00060 public: 00061 static vtkGraphMapper *New(); 00062 vtkTypeMacro(vtkGraphMapper, vtkMapper); 00063 void PrintSelf(ostream& os, vtkIndent indent); 00064 void Render(vtkRenderer *ren, vtkActor *act); 00065 00067 00068 void SetVertexColorArrayName(const char* name); 00069 const char* GetVertexColorArrayName(); 00071 00073 00074 void SetColorVertices(bool vis); 00075 bool GetColorVertices(); 00076 void ColorVerticesOn(); 00077 void ColorVerticesOff(); 00079 00081 00085 void SetScaledGlyphs(bool arg); 00086 vtkGetMacro(ScaledGlyphs, bool); 00087 vtkBooleanMacro(ScaledGlyphs, bool); 00089 00091 00092 vtkSetStringMacro(ScalingArrayName); 00093 vtkGetStringMacro(ScalingArrayName); 00095 00097 00098 void SetEdgeVisibility(bool vis); 00099 bool GetEdgeVisibility(); 00100 vtkBooleanMacro(EdgeVisibility, bool); 00102 00104 00105 void SetEdgeColorArrayName(const char* name); 00106 const char* GetEdgeColorArrayName(); 00108 00110 00111 void SetColorEdges(bool vis); 00112 bool GetColorEdges(); 00113 void ColorEdgesOn(); 00114 void ColorEdgesOff(); 00116 00118 00119 vtkSetStringMacro(EnabledEdgesArrayName); 00120 vtkGetStringMacro(EnabledEdgesArrayName); 00122 00124 00125 vtkSetMacro(EnableEdgesByArray, int); 00126 vtkGetMacro(EnableEdgesByArray, int); 00127 vtkBooleanMacro(EnableEdgesByArray, int); 00129 00131 00132 vtkSetStringMacro(EnabledVerticesArrayName); 00133 vtkGetStringMacro(EnabledVerticesArrayName); 00135 00137 00139 vtkSetMacro(EnableVerticesByArray, int); 00140 vtkGetMacro(EnableVerticesByArray, int); 00141 vtkBooleanMacro(EnableVerticesByArray, int); 00143 00145 00146 void SetIconArrayName(const char* name); 00147 const char* GetIconArrayName(); 00149 00153 void AddIconType(char *type, int index); 00154 00156 void ClearIconTypes(); 00157 00159 00161 void SetIconSize(int *size); 00162 int *GetIconSize(); 00164 00167 void SetIconAlignment(int alignment); 00168 00170 00171 vtkTexture *GetIconTexture(); 00172 void SetIconTexture(vtkTexture *texture); 00174 00176 00177 void SetIconVisibility(bool vis); 00178 bool GetIconVisibility(); 00179 vtkBooleanMacro(IconVisibility, bool); 00181 00183 00184 vtkGetMacro(VertexPointSize,float); 00185 void SetVertexPointSize(float size); 00187 00189 00190 vtkGetMacro(EdgeLineWidth,float); 00191 void SetEdgeLineWidth(float width); 00193 00197 void ReleaseGraphicsResources(vtkWindow *); 00198 00200 unsigned long GetMTime(); 00201 00203 00204 void SetInputData(vtkGraph *input); 00205 vtkGraph *GetInput(); 00207 00209 00211 virtual double *GetBounds(); 00212 virtual void GetBounds(double* bounds) 00213 { Superclass::GetBounds(bounds); } 00215 00217 00218 vtkGetObjectMacro(EdgeLookupTable, vtkLookupTable); 00219 vtkGetObjectMacro(VertexLookupTable, vtkLookupTable); 00221 00222 protected: 00223 vtkGraphMapper(); 00224 ~vtkGraphMapper(); 00225 00227 00228 vtkGetStringMacro(VertexColorArrayNameInternal); 00229 vtkSetStringMacro(VertexColorArrayNameInternal); 00230 vtkGetStringMacro(EdgeColorArrayNameInternal); 00231 vtkSetStringMacro(EdgeColorArrayNameInternal); 00232 char* VertexColorArrayNameInternal; 00233 char* EdgeColorArrayNameInternal; 00235 00236 char* EnabledEdgesArrayName; 00237 char* EnabledVerticesArrayName; 00238 int EnableEdgesByArray; 00239 int EnableVerticesByArray; 00240 00241 vtkGetStringMacro(IconArrayNameInternal); 00242 vtkSetStringMacro(IconArrayNameInternal); 00243 char* IconArrayNameInternal; 00244 00245 //BTX 00246 vtkSmartPointer<vtkGlyph3D> CircleGlyph; 00247 vtkSmartPointer<vtkGlyph3D> CircleOutlineGlyph; 00248 00249 vtkSmartPointer<vtkGraphToPolyData> GraphToPoly; 00250 vtkSmartPointer<vtkVertexGlyphFilter> VertexGlyph; 00251 vtkSmartPointer<vtkIconGlyphFilter> IconGlyph; 00252 vtkSmartPointer<vtkMapArrayValues> IconTypeToIndex; 00253 vtkSmartPointer<vtkTransformCoordinateSystems> IconTransform; 00254 00255 vtkSmartPointer<vtkPolyDataMapper> EdgeMapper; 00256 vtkSmartPointer<vtkPolyDataMapper> VertexMapper; 00257 vtkSmartPointer<vtkPolyDataMapper> OutlineMapper; 00258 vtkSmartPointer<vtkPolyDataMapper2D> IconMapper; 00259 00260 vtkSmartPointer<vtkActor> EdgeActor; 00261 vtkSmartPointer<vtkActor> VertexActor; 00262 vtkSmartPointer<vtkActor> OutlineActor; 00263 vtkSmartPointer<vtkTexturedActor2D> IconActor; 00264 //ETX 00265 00266 // Color maps 00267 vtkLookupTable* EdgeLookupTable; 00268 vtkLookupTable* VertexLookupTable; 00269 00270 virtual void ReportReferences(vtkGarbageCollector*); 00271 00272 // see algorithm for more info 00273 virtual int FillInputPortInformation(int port, vtkInformation* info); 00274 00275 private: 00276 vtkGraphMapper(const vtkGraphMapper&); // Not implemented. 00277 void operator=(const vtkGraphMapper&); // Not implemented. 00278 00279 // Helper function 00280 vtkPolyData* CreateCircle(bool filled); 00281 00282 float VertexPointSize; 00283 float EdgeLineWidth; 00284 bool ScaledGlyphs; 00285 char* ScalingArrayName; 00286 }; 00287 00288 #endif