/usr/include/vtk-5.10/vtkTexturedButtonRepresentation.h is in libvtk5-dev 5.10.1+dfsg-2.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkTexturedButtonRepresentation.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkTexturedButtonRepresentation - defines a representation for a vtkButtonWidget
// .SECTION Description
// This class implements one type of vtkButtonRepresentation. It changes the
// appearance of a user-provided polydata by assigning textures according to the
// current button state. It also provides highlighting (when hovering and
// selecting the button) by fiddling with the actor's property.
//
// To use this representation, always begin by specifying the number of
// button states. Then provide a polydata (the polydata should have associated
// texture coordinates), and a list of textures cooresponding to the button
// states. Optionally, the HoveringProperty and SelectionProperty can be
// adjusted to obtain the appropriate appearance.
//
// This widget representation has two placement methods. The conventional
// PlaceWidget() method is used to locate the textured button inside of a
// user-specified bounding box (note that the button geometry is uniformly
// scaled to fit, thus two of the three dimensions can be "large" and the
// third used to perform the scaling). However this PlaceWidget() method will
// align the geometry within x-y-z oriented bounds. To further control the
// placement, use the additional PlaceWidget(scale,point,normal) method. This
// scales the geometry, places its center at the specified point position,
// and orients the geometry's z-direction parallel to the specified normal.
// This can be used to attach "sticky notes" or "sticky buttons" to the
// surface of objects.
// .SECTION See Also
// vtkButtonWidget vtkButtonRepresentation vtkButtonSource vtkEllipticalButtonSource
// vtkRectangularButtonSource
#ifndef __vtkTexturedButtonRepresentation_h
#define __vtkTexturedButtonRepresentation_h
#include "vtkButtonRepresentation.h"
class vtkCellPicker;
class vtkActor;
class vtkProperty;
class vtkImageData;
class vtkTextureArray; //PIMPLd
class vtkPolyData;
class vtkPolyDataMapper;
class vtkAlgorithmOutput;
class vtkTexture;
class vtkFollower;
class VTK_WIDGETS_EXPORT vtkTexturedButtonRepresentation : public vtkButtonRepresentation
{
public:
// Description:
// Instantiate the class.
static vtkTexturedButtonRepresentation *New();
// Description:
// Standard methods for instances of the class.
vtkTypeMacro(vtkTexturedButtonRepresentation,vtkButtonRepresentation);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set/Get the polydata which defines the button geometry.
void SetButtonGeometry(vtkPolyData *pd);
void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
vtkPolyData *GetButtonGeometry();
// Description:
// Specify whether the button should always face the camera. If enabled,
// the button rotates as the camera moves.
vtkSetMacro(FollowCamera,int);
vtkGetMacro(FollowCamera,int);
vtkBooleanMacro(FollowCamera,int);
// Description:
// Specify the property to use when the button is to appear "normal"
// i.e., the mouse pointer is not hovering or selecting the button.
virtual void SetProperty(vtkProperty *p);
vtkGetObjectMacro(Property,vtkProperty);
// Description:
// Specify the property to use when the hovering over the button.
virtual void SetHoveringProperty(vtkProperty *p);
vtkGetObjectMacro(HoveringProperty,vtkProperty);
// Description:
// Specify the property to use when selecting the button.
virtual void SetSelectingProperty(vtkProperty *p);
vtkGetObjectMacro(SelectingProperty,vtkProperty);
// Description:
// Add the ith texture corresponding to the ith button state.
// The parameter i should be (0 <= i < NumberOfStates).
void SetButtonTexture(int i, vtkImageData *image);
vtkImageData *GetButtonTexture(int i);
// Description:
// Alternative method for placing a button at a given position (defined by
// point[3]); at a given orientation (normal[3], where the z-axis of the
// button geometry is parallel to the normal); and scaled by the scale
// parameter. This method can bs used to attach "sticky notes" or "sticky
// buttons" to objects. A great way to attach interactive meta-data to 3D
// actors.
virtual void PlaceWidget(double scale, double point[3], double normal[3]);
// Description:
// Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
virtual int ComputeInteractionState(int X, int Y, int modify=0);
virtual void PlaceWidget(double bounds[6]);
virtual void BuildRepresentation();
virtual void Highlight(int state);
// Description:
// Provide the necessary methods to satisfy the rendering API.
virtual void ShallowCopy(vtkProp *prop);
virtual double *GetBounds();
virtual void GetActors(vtkPropCollection *pc);
virtual void ReleaseGraphicsResources(vtkWindow*);
virtual int RenderOpaqueGeometry(vtkViewport*);
virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
virtual int HasTranslucentPolygonalGeometry();
protected:
vtkTexturedButtonRepresentation();
~vtkTexturedButtonRepresentation();
// Representing the button
vtkActor *Actor;
vtkFollower *Follower;
vtkPolyDataMapper *Mapper;
vtkTexture *Texture;
// Camera
int FollowCamera;
// Properties of the button
vtkProperty *Property;
vtkProperty *HoveringProperty;
vtkProperty *SelectingProperty;
void CreateDefaultProperties();
// Keep track of the images (textures) associated with the N
// states of the button. This is a PIMPLd stl map.
vtkTextureArray *TextureArray;
// For picking the button
vtkCellPicker *Picker;
private:
vtkTexturedButtonRepresentation(const vtkTexturedButtonRepresentation&); //Not implemented
void operator=(const vtkTexturedButtonRepresentation&); //Not implemented
};
#endif
|