VTK
dox/Widgets/vtkBalloonWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBalloonWidget.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 =========================================================================*/
00076 #ifndef __vtkBalloonWidget_h
00077 #define __vtkBalloonWidget_h
00078 
00079 #include "vtkHoverWidget.h"
00080 
00081 class vtkBalloonRepresentation;
00082 class vtkProp;
00083 class vtkAbstractPropPicker;
00084 class vtkStdString;
00085 class vtkPropMap;
00086 class vtkImageData;
00087 
00088 
00089 class VTK_WIDGETS_EXPORT vtkBalloonWidget : public vtkHoverWidget
00090 {
00091 public:
00093   static vtkBalloonWidget *New();
00094 
00096 
00097   vtkTypeMacro(vtkBalloonWidget,vtkHoverWidget);
00098   void PrintSelf(ostream& os, vtkIndent indent);
00100 
00104   virtual void SetEnabled(int);
00105 
00107 
00110   void SetRepresentation(vtkBalloonRepresentation *r)
00111     {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
00113   
00115   void CreateDefaultRepresentation();
00116 
00118 
00120   void AddBalloon(vtkProp *prop, vtkStdString *str, vtkImageData *img);
00121   void AddBalloon(vtkProp *prop, const char *str, vtkImageData *img);
00122   void AddBalloon(vtkProp *prop, const char *str) //for wrapping
00123     {this->AddBalloon(prop,str,NULL);}
00124   void RemoveBalloon(vtkProp *prop);
00126   
00128 
00132   const char *GetBalloonString(vtkProp *prop);
00133   vtkImageData *GetBalloonImage(vtkProp *prop);
00135 
00137 
00139   virtual vtkProp *GetCurrentProp()
00140     {return this->CurrentProp;}
00142   
00144 
00148   void SetPicker(vtkAbstractPropPicker*);
00149   vtkGetObjectMacro(Picker,vtkAbstractPropPicker);
00151 
00152 protected:
00153   vtkBalloonWidget();
00154   ~vtkBalloonWidget();
00155 
00156   // This class implements the method called from its superclass.
00157   virtual int SubclassEndHoverAction();
00158   virtual int SubclassHoverAction();
00159   
00160   // Classes for managing balloons
00161   vtkPropMap *PropMap; //PIMPL'd map of (vtkProp,vtkStdString)
00162 
00163   // Support for picking
00164   vtkAbstractPropPicker *Picker;
00165 
00166   // The vtkProp that is being hovered over (which may be NULL)
00167   vtkProp *CurrentProp;
00168   
00169 private:
00170   vtkBalloonWidget(const vtkBalloonWidget&);  //Not implemented
00171   void operator=(const vtkBalloonWidget&);  //Not implemented
00172 };
00173 
00174 #endif