VTK
dox/Views/Infovis/vtkRenderView.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkRenderView.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 -------------------------------------------------------------------------*/
00039 #ifndef __vtkRenderView_h
00040 #define __vtkRenderView_h
00041 
00042 #include "vtkViewsInfovisModule.h" // For export macro
00043 #include "vtkRenderViewBase.h"
00044 #include "vtkSmartPointer.h" // For SP ivars
00045 
00046 class vtkAbstractTransform;
00047 class vtkActor2D;
00048 class vtkAlgorithmOutput;
00049 class vtkArrayCalculator;
00050 class vtkBalloonRepresentation;
00051 class vtkDynamic2DLabelMapper;
00052 class vtkHardwareSelector;
00053 class vtkHoverWidget;
00054 class vtkInteractorObserver;
00055 class vtkLabelPlacementMapper;
00056 class vtkPolyDataMapper2D;
00057 class vtkSelection;
00058 class vtkTextProperty;
00059 class vtkTexture;
00060 class vtkTexturedActor2D;
00061 class vtkTransformCoordinateSystems;
00062 
00063 class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
00064 {
00065 public:
00066   static vtkRenderView* New();
00067   vtkTypeMacro(vtkRenderView, vtkRenderViewBase);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00073   virtual void SetInteractor(vtkRenderWindowInteractor *interactor);
00074 
00076   virtual void SetInteractorStyle(vtkInteractorObserver* style);
00077 
00079   virtual vtkInteractorObserver* GetInteractorStyle();
00080 
00084   virtual void SetRenderWindow(vtkRenderWindow *win);
00085 
00086   //BTX
00087   enum
00088     {
00089     INTERACTION_MODE_2D,
00090     INTERACTION_MODE_3D,
00091     INTERACTION_MODE_UNKNOWN
00092     };
00093   //ETX
00094   void SetInteractionMode(int mode);
00095   vtkGetMacro(InteractionMode, int);
00096 
00098 
00101   virtual void SetInteractionModeTo2D()
00102     { this->SetInteractionMode(INTERACTION_MODE_2D); }
00103   virtual void SetInteractionModeTo3D()
00104     { this->SetInteractionMode(INTERACTION_MODE_3D); }
00106 
00109   virtual void Render();
00110 
00112   virtual void ApplyViewTheme(vtkViewTheme* theme);
00113 
00115 
00117   virtual void SetTransform(vtkAbstractTransform* transform);
00118   vtkGetObjectMacro(Transform, vtkAbstractTransform);
00120 
00122 
00123   virtual void SetDisplayHoverText(bool b);
00124   vtkGetMacro(DisplayHoverText, bool);
00125   vtkBooleanMacro(DisplayHoverText, bool);
00127 
00128   //BTX
00129   enum {
00130     SURFACE = 0,
00131     FRUSTUM = 1
00132   };
00133   //ETX
00134 
00136 
00140   vtkSetClampMacro(SelectionMode, int, 0, 1);
00141   vtkGetMacro(SelectionMode, int);
00142   void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
00143   void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
00145 
00149   virtual void AddLabels(vtkAlgorithmOutput* conn);
00150 
00152   virtual void RemoveLabels(vtkAlgorithmOutput* conn);
00153 
00155 
00156   virtual void SetIconTexture(vtkTexture* texture);
00157   vtkGetObjectMacro(IconTexture, vtkTexture);
00159 
00161 
00162   vtkSetVector2Macro(IconSize, int);
00163   vtkGetVector2Macro(IconSize, int);
00165 
00167 
00170   vtkSetVector2Macro(DisplaySize, int);
00171   int* GetDisplaySize();
00172   void GetDisplaySize(int &dsx, int &dsy);
00174 
00175   //BTX
00176   enum
00177     {
00178     NO_OVERLAP,
00179     ALL
00180     };
00181   //ETX
00182 
00184 
00188   virtual void SetLabelPlacementMode(int mode);
00189   virtual int GetLabelPlacementMode();
00190   virtual void SetLabelPlacementModeToNoOverlap()
00191     { this->SetLabelPlacementMode(NO_OVERLAP); }
00192   virtual void SetLabelPlacementModeToAll()
00193     { this->SetLabelPlacementMode(ALL); }
00195 
00196   //BTX
00197   enum
00198     {
00199     FREETYPE,
00200     QT
00201     };
00202   //ETX
00203 
00205 
00207   virtual void SetLabelRenderMode(int mode);
00208   virtual int GetLabelRenderMode();
00209   virtual void SetLabelRenderModeToFreetype()
00210     { this->SetLabelRenderMode(FREETYPE); }
00211   virtual void SetLabelRenderModeToQt()
00212     { this->SetLabelRenderMode(QT); }
00214 
00216 
00217   void SetRenderOnMouseMove(bool b);
00218   vtkGetMacro(RenderOnMouseMove, bool);
00219   vtkBooleanMacro(RenderOnMouseMove, bool);
00220 protected:
00221   vtkRenderView();
00222   ~vtkRenderView();
00224 
00226 
00229   virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
00230     void* callData);
00232 
00234 
00236   virtual void GenerateSelection(
00237     void* callData, vtkSelection* selection);
00239 
00241   virtual void PrepareForRendering();
00242 
00244   virtual void UpdateHoverText();
00245 
00248   virtual void UpdateHoverWidgetState();
00249 
00252   void UpdatePickRender();
00253 
00254   int SelectionMode;
00255   int LabelRenderMode;
00256   bool DisplayHoverText;
00257   bool Interacting;
00258   bool InHoverTextRender;
00259   bool InPickRender;
00260   bool PickRenderNeedsUpdate;
00261 
00262   vtkAbstractTransform* Transform;
00263   vtkTexture* IconTexture;
00264   int IconSize[2];
00265   int DisplaySize[2];
00266 
00267   int InteractionMode;
00268   bool RenderOnMouseMove;
00269 
00270   //BTX
00271   vtkSmartPointer<vtkRenderer>                 LabelRenderer;
00272   vtkSmartPointer<vtkBalloonRepresentation>    Balloon;
00273   vtkSmartPointer<vtkLabelPlacementMapper>     LabelPlacementMapper;
00274   vtkSmartPointer<vtkTexturedActor2D>          LabelActor;
00275   vtkSmartPointer<vtkHoverWidget>              HoverWidget;
00276   vtkSmartPointer<vtkHardwareSelector>         Selector;
00277   //ETX
00278 
00279 private:
00280   vtkRenderView(const vtkRenderView&);  // Not implemented.
00281   void operator=(const vtkRenderView&);  // Not implemented.
00282 };
00283 
00284 #endif