VTK
|
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 "vtkInteractionWidgetsModule.h" // For export macro 00080 #include "vtkHoverWidget.h" 00081 00082 class vtkBalloonRepresentation; 00083 class vtkProp; 00084 class vtkAbstractPropPicker; 00085 class vtkStdString; 00086 class vtkPropMap; 00087 class vtkImageData; 00088 00089 00090 class VTKINTERACTIONWIDGETS_EXPORT vtkBalloonWidget : public vtkHoverWidget 00091 { 00092 public: 00094 static vtkBalloonWidget *New(); 00095 00097 00098 vtkTypeMacro(vtkBalloonWidget,vtkHoverWidget); 00099 void PrintSelf(ostream& os, vtkIndent indent); 00101 00105 virtual void SetEnabled(int); 00106 00108 00111 void SetRepresentation(vtkBalloonRepresentation *r) 00112 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00114 00116 00117 vtkBalloonRepresentation *GetBalloonRepresentation() 00118 {return reinterpret_cast<vtkBalloonRepresentation*>(this->WidgetRep);} 00120 00122 void CreateDefaultRepresentation(); 00123 00125 00127 void AddBalloon(vtkProp *prop, vtkStdString *str, vtkImageData *img); 00128 void AddBalloon(vtkProp *prop, const char *str, vtkImageData *img); 00129 void AddBalloon(vtkProp *prop, const char *str) //for wrapping 00130 {this->AddBalloon(prop,str,NULL);} 00131 void RemoveBalloon(vtkProp *prop); 00133 00135 00139 const char *GetBalloonString(vtkProp *prop); 00140 vtkImageData *GetBalloonImage(vtkProp *prop); 00142 00144 00146 void UpdateBalloonString(vtkProp *prop, const char *str); 00147 void UpdateBalloonImage(vtkProp *prop, vtkImageData *image); 00149 00151 00153 virtual vtkProp *GetCurrentProp() 00154 {return this->CurrentProp;} 00156 00158 00162 void SetPicker(vtkAbstractPropPicker*); 00163 vtkGetObjectMacro(Picker,vtkAbstractPropPicker); 00165 00166 protected: 00167 vtkBalloonWidget(); 00168 ~vtkBalloonWidget(); 00169 00170 // This class implements the method called from its superclass. 00171 virtual int SubclassEndHoverAction(); 00172 virtual int SubclassHoverAction(); 00173 00174 // Classes for managing balloons 00175 vtkPropMap *PropMap; //PIMPL'd map of (vtkProp,vtkStdString) 00176 00177 // Support for picking 00178 vtkAbstractPropPicker *Picker; 00179 00180 // Register internal Pickers within PickingManager 00181 virtual void RegisterPickers(); 00182 00183 // The vtkProp that is being hovered over (which may be NULL) 00184 vtkProp *CurrentProp; 00185 00186 private: 00187 vtkBalloonWidget(const vtkBalloonWidget&); //Not implemented 00188 void operator=(const vtkBalloonWidget&); //Not implemented 00189 }; 00190 00191 #endif