/usr/include/KWWidgets/vtkKWMaterialPropertyWidget.h is in libkwwidgets1-dev 1.0.0~cvs20100930-8.
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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | /*=========================================================================
Module: $RCSfile: vtkKWMaterialPropertyWidget.h,v $
Copyright (c) Kitware, Inc.
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 vtkKWMaterialPropertyWidget - widget to control the material property of a volume
// .SECTION Description
#ifndef __vtkKWMaterialPropertyWidget_h
#define __vtkKWMaterialPropertyWidget_h
#include "vtkKWCompositeWidget.h"
class vtkKWFrame;
class vtkKWLabel;
class vtkKWFrameWithLabel;
class vtkKWLabelWithLabel;
class vtkKWPushButtonSetWithLabel;
class vtkKWPopupButtonWithLabel;
class vtkKWPushButton;
class vtkKWScaleWithEntry;
class vtkKWMaterialPropertyWidgetInternals;
class KWWidgets_EXPORT vtkKWMaterialPropertyWidget : public vtkKWCompositeWidget
{
public:
vtkTypeRevisionMacro(vtkKWMaterialPropertyWidget, vtkKWCompositeWidget);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Display the UI as a popup (default is off). The pushbutton will display
// a representation of the current properties.
// This has to be called before Create().
vtkSetMacro(PopupMode, int);
vtkGetMacro(PopupMode, int);
vtkBooleanMacro(PopupMode, int);
vtkGetObjectMacro(PopupButton, vtkKWPopupButtonWithLabel);
// Description:
// Refresh the interface given the value extracted from the current widget.
virtual void Update();
// Description:
// Update the preview according to current settings
virtual void UpdatePreview();
// Description:
// Set/Get the size of the preview, presets and popup preview images
virtual void SetPreviewSize(int);
virtual void SetPresetSize(int);
virtual void SetPopupPreviewSize(int);
vtkGetMacro(PreviewSize, int);
vtkGetMacro(PresetSize, int);
vtkGetMacro(PopupPreviewSize, int);
// Description:
// Set/Get the grid opacity in the preview/presets
virtual void SetGridOpacity(double);
vtkGetMacro(GridOpacity, double);
// Description:
// Set/Get the color of the preview/presets.
vtkGetVector3Macro(MaterialColor, double);
void SetMaterialColor(double r, double g, double b);
void SetMaterialColor(double color[3])
{ this->SetMaterialColor(color[0], color[1], color[2]); }
// Description:
// Set/Get the lighting parameters visibility.
// If set to Off, none of the ambient, diffuse, specular (etc.) scales
// will be displayed.
virtual void SetLightingParametersVisibility(int);
vtkBooleanMacro(LightingParametersVisibility, int);
vtkGetMacro(LightingParametersVisibility, int);
// Description:
// Set/Get the event invoked when the property is changed/changing.
// Defaults to vtkKWEvent::MaterialPropertyChanged/ingEvent, this default
// is likely to change in subclasses to reflect what kind of property
// is changed (vtkKWEvent::VolumeMaterialPropertyChangedEvent for example).
vtkSetMacro(PropertyChangedEvent, int);
vtkGetMacro(PropertyChangedEvent, int);
vtkSetMacro(PropertyChangingEvent, int);
vtkGetMacro(PropertyChangingEvent, int);
// Description:
// Specifies commands to associate with the widget.
// 'PropertyChangedCommand' is invoked when the property has
// changed (i.e. at the end of the user interaction).
// 'PropertyChangingCommand' is invoked when the selected color is
// changing (i.e. during the user interaction).
// The need for a '...ChangedCommand' and '...ChangingCommand' can be
// explained as follows: the former can be used to be notified about any
// changes made to this widget *after* the corresponding user interaction has
// been performed (say, after releasing the mouse button that was dragging
// a slider, or after clicking on a checkbutton). The later can be set
// *additionally* to be notified about the intermediate changes that
// occur *during* the corresponding user interaction (say, *while* dragging
// a slider). While setting '...ChangedCommand' is enough to be notified
// about any changes, setting '...ChangingCommand' is an application-specific
// choice that is likely to depend on how fast you want (or can) answer to
// rapid changes occuring during a user interaction, if any.
// The 'object' argument is the object that will have the method called on
// it. The 'method' argument is the name of the method to be called and any
// arguments in string form. If the object is NULL, the method is still
// evaluated as a simple command.
virtual void SetPropertyChangedCommand(
vtkObject *object, const char *method);
virtual void SetPropertyChangingCommand(
vtkObject *object, const char *method);
// Description:
// Update the "enable" state of the object and its internal parts.
// Depending on different Ivars (this->Enabled, the application's
// Limited Edition Mode, etc.), the "enable" state of the object is updated
// and propagated to its internal parts/subwidgets. This will, for example,
// enable/disable parts of the widget UI, enable/disable the visibility
// of 3D widgets, etc.
virtual void UpdateEnableState();
// Description:
// Callbacks. Internal, do not use.
virtual void PropertyChangingCallback(double value);
virtual void PropertyChangedCallback(double value);
virtual void PresetMaterialCallback(int preset_idx);
protected:
vtkKWMaterialPropertyWidget();
~vtkKWMaterialPropertyWidget();
// Description:
// Create the widget.
virtual void CreateWidget();
int PopupMode;
int PreviewSize;
int PresetSize;
int PopupPreviewSize;
double GridOpacity;
int LightingParametersVisibility;
double MaterialColor[3];
// Description:
// Events
int PropertyChangedEvent;
int PropertyChangingEvent;
// Description:
// Commands
char *PropertyChangedCommand;
char *PropertyChangingCommand;
virtual void InvokePropertyChangedCommand();
virtual void InvokePropertyChangingCommand();
// Presets
//BTX
class Preset
{
public:
double Ambient;
double Diffuse;
double Specular;
double SpecularPower;
char *HelpString;
Preset() { this->HelpString = 0; };
};
// PIMPL Encapsulation for STL containers
vtkKWMaterialPropertyWidgetInternals *Internals;
friend class vtkKWMaterialPropertyWidgetInternals;
//ETX
// UI
vtkKWPopupButtonWithLabel *PopupButton;
vtkKWFrameWithLabel *MaterialPropertiesFrame;
vtkKWFrame *ControlFrame;
vtkKWFrame *LightingFrame;
vtkKWScaleWithEntry *AmbientScale;
vtkKWScaleWithEntry *DiffuseScale;
vtkKWScaleWithEntry *SpecularScale;
vtkKWScaleWithEntry *SpecularPowerScale;
vtkKWFrame *PresetsFrame;
vtkKWLabelWithLabel *PreviewLabel;
vtkKWPushButtonSetWithLabel *PresetPushButtonSet;
// Description:
// Pack
virtual void Pack();
// Description:
// Create a preview image given some material properties
virtual void CreateImage(unsigned char *data,
double ambient,
double diffuse,
double specular,
double specular_power,
int size);
// Description:
// Send an event representing the state of the widget
virtual void SendStateEvent(int event);
// Description:
// Add default presets
virtual void AddDefaultPresets();
// Description:
// Create the presets
virtual void CreatePresets();
// Description:
// Update the popup preview according to current settings
virtual void UpdatePopupPreview();
// Description:
// Update the property from the interface values or a preset
// Return 1 if the property was modified, 0 otherwise
virtual int UpdatePropertyFromInterface() = 0;
virtual int UpdatePropertyFromPreset(const Preset *preset) = 0;
// Description:
// Update the scales from a preset
virtual int UpdateScalesFromPreset(const Preset *preset);
virtual void UpdateScales(double ambient,
double diffuse,
double specular,
double specular_power);
// Description:
// Return 1 if the controls should be enabled.
virtual int AreControlsEnabled() { return 1; };
private:
vtkKWMaterialPropertyWidget(const vtkKWMaterialPropertyWidget&); //Not implemented
void operator=(const vtkKWMaterialPropertyWidget&); //Not implemented
};
#endif
|