VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTexturedButtonRepresentation2D.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 =========================================================================*/ 00046 #ifndef __vtkTexturedButtonRepresentation2D_h 00047 #define __vtkTexturedButtonRepresentation2D_h 00048 00049 #include "vtkInteractionWidgetsModule.h" // For export macro 00050 #include "vtkButtonRepresentation.h" 00051 00052 class vtkProperty2D; 00053 class vtkImageData; 00054 class vtkTextureArray; //PIMPLd 00055 class vtkProperty2D; 00056 class vtkAlgorithmOutput; 00057 class vtkBalloonRepresentation; 00058 class vtkCoordinate; 00059 00060 00061 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D : public vtkButtonRepresentation 00062 { 00063 public: 00065 static vtkTexturedButtonRepresentation2D *New(); 00066 00068 00069 vtkTypeMacro(vtkTexturedButtonRepresentation2D,vtkButtonRepresentation); 00070 void PrintSelf(ostream& os, vtkIndent indent); 00072 00074 00076 virtual void SetProperty(vtkProperty2D *p); 00077 vtkGetObjectMacro(Property,vtkProperty2D); 00079 00081 00082 virtual void SetHoveringProperty(vtkProperty2D *p); 00083 vtkGetObjectMacro(HoveringProperty,vtkProperty2D); 00085 00087 00088 virtual void SetSelectingProperty(vtkProperty2D *p); 00089 vtkGetObjectMacro(SelectingProperty,vtkProperty2D); 00091 00093 00095 void SetButtonTexture(int i, vtkImageData *image); 00096 vtkImageData *GetButtonTexture(int i); 00098 00101 vtkBalloonRepresentation *GetBalloon() {return this->Balloon;} 00102 00104 00106 virtual int ComputeInteractionState(int X, int Y, int modify=0); 00107 virtual void BuildRepresentation(); 00108 virtual void Highlight(int state); 00110 00117 virtual void PlaceWidget(double bounds[6]); 00118 00128 virtual void PlaceWidget(double anchor[3], int size[2]); 00129 00131 00132 virtual void ShallowCopy(vtkProp *prop); 00133 virtual double *GetBounds(); 00134 virtual void GetActors(vtkPropCollection *pc); 00135 virtual void ReleaseGraphicsResources(vtkWindow*); 00136 virtual int RenderOverlay(vtkViewport*); 00137 virtual int HasTranslucentPolygonalGeometry(); 00139 00140 protected: 00141 vtkTexturedButtonRepresentation2D(); 00142 ~vtkTexturedButtonRepresentation2D(); 00143 00144 // Representing the button 00145 vtkBalloonRepresentation *Balloon; 00146 00147 // Properties of the button 00148 vtkProperty2D *Property; 00149 vtkProperty2D *HoveringProperty; 00150 vtkProperty2D *SelectingProperty; 00151 void CreateDefaultProperties(); 00152 00153 // Keep track of the images (textures) associated with the N 00154 // states of the button. 00155 vtkTextureArray *TextureArray; 00156 00157 // Tracking world position 00158 vtkCoordinate *Anchor; 00159 00160 private: 00161 vtkTexturedButtonRepresentation2D(const vtkTexturedButtonRepresentation2D&); //Not implemented 00162 void operator=(const vtkTexturedButtonRepresentation2D&); //Not implemented 00163 }; 00164 00165 #endif