VTK
vtkTexturedButtonRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTexturedButtonRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
49 #ifndef __vtkTexturedButtonRepresentation_h
50 #define __vtkTexturedButtonRepresentation_h
51 
53 
54 class vtkCellPicker;
55 class vtkActor;
56 class vtkProperty;
57 class vtkImageData;
58 class vtkTextureArray; //PIMPLd
59 class vtkPolyData;
60 class vtkPolyDataMapper;
61 class vtkAlgorithmOutput;
62 class vtkTexture;
63 class vtkFollower;
64 
66 {
67 public:
70 
72 
74  void PrintSelf(ostream& os, vtkIndent indent);
76 
78 
79  void SetButtonGeometry(vtkPolyData *pd);
80  void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
81  vtkPolyData *GetButtonGeometry();
83 
85 
87  vtkSetMacro(FollowCamera,int);
88  vtkGetMacro(FollowCamera,int);
89  vtkBooleanMacro(FollowCamera,int);
91 
93 
95  virtual void SetProperty(vtkProperty *p);
96  vtkGetObjectMacro(Property,vtkProperty);
98 
100 
101  virtual void SetHoveringProperty(vtkProperty *p);
102  vtkGetObjectMacro(HoveringProperty,vtkProperty);
104 
106 
107  virtual void SetSelectingProperty(vtkProperty *p);
108  vtkGetObjectMacro(SelectingProperty,vtkProperty);
110 
112 
114  void SetButtonTexture(int i, vtkImageData *image);
115  vtkImageData *GetButtonTexture(int i);
117 
124  virtual void PlaceWidget(double scale, double point[3], double normal[3]);
125 
127 
129  virtual int ComputeInteractionState(int X, int Y, int modify=0);
130  virtual void PlaceWidget(double bounds[6]);
131  virtual void BuildRepresentation();
132  virtual void Highlight(int state);
134 
136 
137  virtual void ShallowCopy(vtkProp *prop);
138  virtual double *GetBounds();
139  virtual void GetActors(vtkPropCollection *pc);
140  virtual void ReleaseGraphicsResources(vtkWindow*);
141  virtual int RenderOpaqueGeometry(vtkViewport*);
143  virtual int HasTranslucentPolygonalGeometry();
145 
146 protected:
149 
150  // Representing the button
155 
156  // Camera
158 
159  // Properties of the button
163  void CreateDefaultProperties();
164 
165  // Keep track of the images (textures) associated with the N
166  // states of the button. This is a PIMPLd stl map.
167  vtkTextureArray *TextureArray;
168 
169  // For picking the button
171 
172 private:
174  void operator=(const vtkTexturedButtonRepresentation&); //Not implemented
175 };
176 
177 #endif