VTK
dox/Widgets/vtkTexturedButtonRepresentation2D.h
Go to the documentation of this file.
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 "vtkButtonRepresentation.h"
00050 
00051 class vtkProperty2D;
00052 class vtkImageData;
00053 class vtkTextureArray; //PIMPLd
00054 class vtkProperty2D;
00055 class vtkAlgorithmOutput;
00056 class vtkBalloonRepresentation;
00057 class vtkCoordinate;
00058 
00059 
00060 class VTK_WIDGETS_EXPORT vtkTexturedButtonRepresentation2D : public vtkButtonRepresentation
00061 {
00062 public:
00064   static vtkTexturedButtonRepresentation2D *New();
00065 
00067 
00068   vtkTypeMacro(vtkTexturedButtonRepresentation2D,vtkButtonRepresentation);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073 
00075   virtual void SetProperty(vtkProperty2D *p);
00076   vtkGetObjectMacro(Property,vtkProperty2D);
00078 
00080 
00081   virtual void SetHoveringProperty(vtkProperty2D *p);
00082   vtkGetObjectMacro(HoveringProperty,vtkProperty2D);
00084 
00086 
00087   virtual void SetSelectingProperty(vtkProperty2D *p);
00088   vtkGetObjectMacro(SelectingProperty,vtkProperty2D);
00090 
00092 
00094   void SetButtonTexture(int i, vtkImageData *image);
00095   vtkImageData *GetButtonTexture(int i);
00097 
00100   vtkBalloonRepresentation *GetBalloon() {return this->Balloon;}
00101 
00103 
00105   virtual int ComputeInteractionState(int X, int Y, int modify=0);
00106   virtual void BuildRepresentation();
00107   virtual void Highlight(int state);
00109 
00116   virtual void PlaceWidget(double bounds[6]);
00117 
00127   virtual void PlaceWidget(double anchor[3], int size[2]);
00128 
00130 
00131   virtual void ShallowCopy(vtkProp *prop);
00132   virtual double *GetBounds();
00133   virtual void GetActors(vtkPropCollection *pc);
00134   virtual void ReleaseGraphicsResources(vtkWindow*);
00135   virtual int RenderOverlay(vtkViewport*);
00136   virtual int HasTranslucentPolygonalGeometry();
00138 
00139 protected:
00140   vtkTexturedButtonRepresentation2D();
00141   ~vtkTexturedButtonRepresentation2D();
00142 
00143   // Representing the button
00144   vtkBalloonRepresentation *Balloon;
00145 
00146   // Properties of the button
00147   vtkProperty2D *Property;
00148   vtkProperty2D *HoveringProperty;
00149   vtkProperty2D *SelectingProperty;
00150   void CreateDefaultProperties();
00151 
00152   // Keep track of the images (textures) associated with the N
00153   // states of the button.
00154   vtkTextureArray *TextureArray;
00155 
00156   // Tracking world position
00157   vtkCoordinate *Anchor;
00158 
00159 private:
00160   vtkTexturedButtonRepresentation2D(const vtkTexturedButtonRepresentation2D&);  //Not implemented
00161   void operator=(const vtkTexturedButtonRepresentation2D&);  //Not implemented
00162 };
00163 
00164 #endif