VTK
dox/Views/vtkGraphLayoutView.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkGraphLayoutView.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 -------------------------------------------------------------------------*/
00047 #ifndef __vtkGraphLayoutView_h
00048 #define __vtkGraphLayoutView_h
00049 
00050 #include "vtkRenderView.h"
00051 
00052 class vtkEdgeLayoutStrategy;
00053 class vtkGraphLayoutStrategy;
00054 class vtkRenderedGraphRepresentation;
00055 class vtkViewTheme;
00056 
00057 class VTK_VIEWS_EXPORT vtkGraphLayoutView : public vtkRenderView
00058 {
00059 public:
00060   static vtkGraphLayoutView *New();
00061   vtkTypeMacro(vtkGraphLayoutView, vtkRenderView);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00065 
00066   void SetVertexLabelArrayName(const char* name);
00067   const char* GetVertexLabelArrayName();
00069   
00071 
00072   void SetEdgeLabelArrayName(const char* name);
00073   const char* GetEdgeLabelArrayName();
00075   
00077 
00078   void SetVertexLabelVisibility(bool vis);
00079   bool GetVertexLabelVisibility();
00080   vtkBooleanMacro(VertexLabelVisibility, bool);
00082 
00084 
00086   void SetHideVertexLabelsOnInteraction(bool vis);
00087   bool GetHideVertexLabelsOnInteraction();
00088   vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
00090 
00092 
00093   void SetEdgeVisibility(bool vis);
00094   bool GetEdgeVisibility();
00095   vtkBooleanMacro(EdgeVisibility, bool);
00097   
00099 
00100   void SetEdgeLabelVisibility(bool vis);
00101   bool GetEdgeLabelVisibility();
00102   vtkBooleanMacro(EdgeLabelVisibility, bool);
00104   
00106 
00108   void SetHideEdgeLabelsOnInteraction(bool vis);
00109   bool GetHideEdgeLabelsOnInteraction();
00110   vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
00112 
00114 
00115   void SetVertexColorArrayName(const char* name);
00116   const char* GetVertexColorArrayName();
00118   
00120 
00121   void SetColorVertices(bool vis);
00122   bool GetColorVertices();
00123   vtkBooleanMacro(ColorVertices, bool);
00125   
00127 
00128   void SetEdgeColorArrayName(const char* name);
00129   const char* GetEdgeColorArrayName();
00131   
00133 
00134   void SetColorEdges(bool vis);
00135   bool GetColorEdges();
00136   vtkBooleanMacro(ColorEdges, bool);
00138 
00140 
00141   void SetEnabledEdgesArrayName(const char* name);
00142   const char* GetEnabledEdgesArrayName();
00144   
00146 
00147   void SetEnableEdgesByArray(bool vis);
00148   int GetEnableEdgesByArray();
00150 
00152 
00153   void SetEnabledVerticesArrayName(const char* name);
00154   const char* GetEnabledVerticesArrayName();
00156   
00158 
00159   void SetEnableVerticesByArray(bool vis);
00160   int GetEnableVerticesByArray();
00162 
00164 
00165   void SetScalingArrayName(const char* name);
00166   const char* GetScalingArrayName();
00168   
00170 
00171   void SetScaledGlyphs(bool arg);
00172   bool GetScaledGlyphs();
00173   vtkBooleanMacro(ScaledGlyphs, bool);
00175   
00177 
00189   void SetLayoutStrategy(const char* name);
00190   void SetLayoutStrategyToRandom()
00191     { this->SetLayoutStrategy("Random"); }
00192   void SetLayoutStrategyToForceDirected()
00193     { this->SetLayoutStrategy("Force Directed"); }
00194   void SetLayoutStrategyToSimple2D()
00195     { this->SetLayoutStrategy("Simple 2D"); }
00196   void SetLayoutStrategyToClustering2D()
00197     { this->SetLayoutStrategy("Clustering 2D"); }
00198   void SetLayoutStrategyToCommunity2D()
00199     { this->SetLayoutStrategy("Community 2D"); }
00200   void SetLayoutStrategyToFast2D()
00201     { this->SetLayoutStrategy("Fast 2D"); }
00202   void SetLayoutStrategyToPassThrough()
00203     { this->SetLayoutStrategy("Pass Through"); }
00204   void SetLayoutStrategyToCircular()
00205     { this->SetLayoutStrategy("Circular"); }
00206   void SetLayoutStrategyToTree()
00207     { this->SetLayoutStrategy("Tree"); }
00208   void SetLayoutStrategyToCosmicTree()
00209     { this->SetLayoutStrategy("Cosmic Tree"); }
00210   void SetLayoutStrategyToCone()
00211     { this->SetLayoutStrategy("Cone"); }
00212   void SetLayoutStrategyToSpanTree()
00213     { this->SetLayoutStrategy("Span Tree"); }
00214   const char* GetLayoutStrategyName();
00216 
00218 
00221   vtkGraphLayoutStrategy* GetLayoutStrategy();
00222   void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
00224 
00226 
00230   void SetEdgeLayoutStrategy(const char* name);
00231   void SetEdgeLayoutStrategyToArcParallel()
00232     { this->SetEdgeLayoutStrategy("Arc Parallel"); }
00233   void SetEdgeLayoutStrategyToPassThrough()
00234     { this->SetEdgeLayoutStrategy("Pass Through"); }
00235   const char* GetEdgeLayoutStrategyName();
00237 
00239 
00242   vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
00243   void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s);
00245   
00249   void AddIconType(char *type, int index);
00250 
00252   void ClearIconTypes();
00253 
00256   void SetIconAlignment(int alignment);
00257 
00259 
00260   void SetIconVisibility(bool b);
00261   bool GetIconVisibility();
00262   vtkBooleanMacro(IconVisibility, bool);
00264 
00266 
00267   void SetIconArrayName(const char* name);
00268   const char* GetIconArrayName();
00270 
00272 
00273   void SetGlyphType(int type);
00274   int GetGlyphType();
00276   
00278 
00279   virtual void SetVertexLabelFontSize(const int size);
00280   virtual int GetVertexLabelFontSize();
00282   
00284 
00285   virtual void SetEdgeLabelFontSize(const int size);
00286   virtual int GetEdgeLabelFontSize();
00288 
00290 
00291   void SetEdgeScalarBarVisibility(bool vis);
00292   bool GetEdgeScalarBarVisibility();
00294 
00296 
00297   void SetVertexScalarBarVisibility(bool vis);
00298   bool GetVertexScalarBarVisibility();
00300 
00302   void ZoomToSelection();
00303 
00307   virtual int IsLayoutComplete();
00308   
00313   virtual void UpdateLayout();
00314 
00315 protected:
00316   vtkGraphLayoutView();
00317   ~vtkGraphLayoutView();
00318 
00320 
00322   virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
00323   virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
00324   // Called to process events.  Overrides behavior in vtkRenderView.
00325   virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
00327 
00328 private:
00329   vtkGraphLayoutView(const vtkGraphLayoutView&);  // Not implemented.
00330   void operator=(const vtkGraphLayoutView&);  // Not implemented.
00331   bool VertexLabelsRequested;
00332   bool EdgeLabelsRequested;
00333   bool Interacting;
00334 };
00335 
00336 #endif