/usr/include/KWWidgets/vtkKWPiecewiseFunctionEditor.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 | /*=========================================================================
Module: $RCSfile: vtkKWPiecewiseFunctionEditor.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 vtkKWPiecewiseFunctionEditor - a piecewise function editor
// .SECTION Description
// A widget that allows the user to edit a piecewise function.
// .SECTION Thanks
// This work is part of the National Alliance for Medical Image
// Computing (NAMIC), funded by the National Institutes of Health
// through the NIH Roadmap for Medical Research, Grant U54 EB005149.
// Information on the National Centers for Biomedical Computing
// can be obtained from http://nihroadmap.nih.gov/bioinformatics.
#ifndef __vtkKWPiecewiseFunctionEditor_h
#define __vtkKWPiecewiseFunctionEditor_h
#include "vtkKWParameterValueHermiteFunctionEditor.h"
class vtkKWCheckButton;
class vtkPiecewiseFunction;
class vtkKWScaleWithEntry;
class vtkColorTransferFunction;
class KWWidgets_EXPORT vtkKWPiecewiseFunctionEditor : public vtkKWParameterValueHermiteFunctionEditor
{
public:
static vtkKWPiecewiseFunctionEditor* New();
vtkTypeRevisionMacro(vtkKWPiecewiseFunctionEditor,vtkKWParameterValueHermiteFunctionEditor);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get/Set the function
// Note that the whole parameter range is automatically reset to the
// function range.
vtkGetObjectMacro(PiecewiseFunction, vtkPiecewiseFunction);
virtual void SetPiecewiseFunction(vtkPiecewiseFunction*);
// Description:
// Update the whole UI depending on the value of the Ivars
virtual void Update();
// Description:
// Get/Set an optional color transfer function to be used to retrieve
// the color of each point. It is likely you may want to turn
// ComputePointColorFromValue to On too.
vtkGetObjectMacro(PointColorTransferFunction, vtkColorTransferFunction);
virtual void SetPointColorTransferFunction(vtkColorTransferFunction*);
// Description:
// Set/Get the window/level mode. In that mode:
// - the end-points parameter are locked (similar to LockEndPointsParameter)
// - no point can be added or removed (similar to DisableAddAndRemove)
// - the first and second point have the same value (they move together)
// - the last and last-1 point have the same value (they move together)
// - the midpoint and sharpness are set to (0.5 / 0.0) and can not be edited
virtual void SetWindowLevelMode(int);
vtkBooleanMacro(WindowLevelMode, int);
vtkGetMacro(WindowLevelMode, int);
// Description:
// Specifies a command to associate with the widget. This command is
// typically invoked when the window/level *mode* is changed.
// 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.
// The following parameters are also passed to the command:
// - new histogram log mode: int
virtual void SetWindowLevelModeChangedCommand(
vtkObject *object,const char *method);
// Description:
// Set/Get the window/level mode button visibility.
// Note: set this parameter to the proper value before calling Create() in
// order to minimize the footprint of the object.
virtual void SetWindowLevelModeButtonVisibility(int);
vtkBooleanMacro(WindowLevelModeButtonVisibility, int);
vtkGetMacro(WindowLevelModeButtonVisibility, int);
// Description:
// Set/Get the window/level lock mode. In that mode, provided that
// WindowLevelMode is On:
// - the last and last-1 points values are locked (expected to be the same)
vtkSetMacro(WindowLevelModeLockEndPointValue, int);
vtkBooleanMacro(WindowLevelModeLockEndPointValue, int);
vtkGetMacro(WindowLevelModeLockEndPointValue, int);
// Description:
// Set/Get the window/level.
// This method will invoke FunctionChangedCommand. Use
// SetInteractiveWindowLevel to invoke FunctionChangingCommand instead.
virtual void SetWindowLevel(double window, double level);
virtual void SetInteractiveWindowLevel(double window, double level);
vtkGetMacro(Window, double);
vtkGetMacro(Level, double);
// Description:
// Set/Get the value entry UI visibility.
// Not shown if superclass PointEntriesVisibility is set to Off
// Note: set this parameter to the proper value before calling Create() in
// order to minimize the footprint of the object.
vtkBooleanMacro(ValueEntryVisibility, int);
virtual void SetValueEntryVisibility(int);
vtkGetMacro(ValueEntryVisibility, int);
// Description:
// Access the entry
// If you need to customize this object, make sure you first set
// ValueEntryVisibility to On and call Create().
vtkGetObjectMacro(ValueEntry, vtkKWEntryWithLabel);
// 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:
// Proxy to the function.
// See protected: section too.
virtual int HasFunction();
virtual int GetFunctionSize();
virtual unsigned long GetFunctionMTime();
virtual int GetFunctionPointParameter(int id, double *parameter);
virtual int GetFunctionPointDimensionality();
// Description:
// Is point locked, protected, removable ?
virtual int FunctionPointCanBeAdded();
virtual int FunctionPointCanBeRemoved(int id);
virtual int FunctionPointParameterIsLocked(int id);
virtual int FunctionPointValueIsLocked(int id);
// Description:
// Higher-level methods to manipulate the function.
virtual int MoveFunctionPoint(int id,double parameter,const double *values);
// Description:
// Callbacks. Internal, do not use.
virtual void ValueEntryCallback(const char *value);
virtual void WindowLevelModeCallback(int state);
protected:
vtkKWPiecewiseFunctionEditor();
~vtkKWPiecewiseFunctionEditor();
// Description:
// Create the widget.
virtual void CreateWidget();
// Description:
// Proxy to the function.
// Those are low-level manipulators, they do not check if points can
// be added/removed/locked, it is up to the higer-level methods to do it.
// IMPLEMENT those functions in the subclasses.
// See public: section too.
virtual int GetFunctionPointValues(int id, double *values);
virtual int SetFunctionPointValues(int id, const double *values);
virtual int InterpolateFunctionPointValues(double parameter, double *values);
virtual int AddFunctionPoint(double parameter, const double *values,int *id);
virtual int SetFunctionPoint(int id, double parameter, const double *values);
virtual int RemoveFunctionPoint(int id);
virtual int FunctionLineIsSampledBetweenPoints(int id1, int id2);
virtual int GetFunctionPointMidPoint(int id, double *pos);
virtual int SetFunctionPointMidPoint(int id, double pos);
virtual int GetFunctionPointSharpness(int id, double *sharpness);
virtual int SetFunctionPointSharpness(int id, double sharpness);
virtual int FunctionPointMidPointIsLocked(int id);
virtual int FunctionPointSharpnessIsLocked(int id);
virtual int GetMidPointVisibility();
// Description:
// Higher-level methods to manipulate the function.
virtual int GetFunctionPointColorInCanvas(int id, double rgb[3]);
virtual void UpdatePointEntries(int id);
//BTX
virtual void GetLineCoordinates(int id1, int id2, vtksys_ios::ostream *tk_cmd);
//ETX
vtkPiecewiseFunction *PiecewiseFunction;
vtkColorTransferFunction *PointColorTransferFunction;
int WindowLevelMode;
int ValueEntryVisibility;
int WindowLevelModeButtonVisibility;
int WindowLevelModeLockEndPointValue;
double Window;
double Level;
virtual void UpdatePointsFromWindowLevel(int interactive = 0);
virtual void UpdateWindowLevelFromPoints();
virtual void InvokeWindowLevelModeChangedCommand(int mode);
virtual void InvokeFunctionChangedCommand();
virtual void InvokeFunctionChangingCommand();
// Description:
// Pack the widget
virtual void Pack();
virtual void PackPointEntries();
// Commands
char *WindowLevelModeChangedCommand;
// GUI
vtkKWEntryWithLabel *ValueEntry;
vtkKWCheckButton *WindowLevelModeCheckButton;
// Description:
// Create some objects on the fly (lazy creation, to allow for a smaller
// footprint)
virtual void CreateWindowLevelModeCheckButton();
virtual void CreateValueEntry();
virtual int IsTopLeftFrameUsed();
virtual int IsPointEntriesFrameUsed();
virtual unsigned long GetRedrawFunctionTime();
private:
vtkKWPiecewiseFunctionEditor(const vtkKWPiecewiseFunctionEditor&); // Not implemented
void operator=(const vtkKWPiecewiseFunctionEditor&); // Not implemented
};
#endif
|