File: vtkKWEvent.cxx

package info (click to toggle)
kwwidgets 1.0.0~cvs20090825-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 14,108 kB
  • ctags: 15,770
  • sloc: cpp: 128,146; ansic: 44,137; tcl: 30,595; python: 2,283; sh: 338; makefile: 69; xml: 10
file content (265 lines) | stat: -rw-r--r-- 8,273 bytes parent folder | download | duplicates (2)
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
253
254
255
256
257
258
259
260
261
262
263
264
265
/*=========================================================================

  Module:    $RCSfile: vtkKWEvent.cxx,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.

=========================================================================*/
#include "vtkKWEvent.h"
#include "vtkCommand.h"

static const char *vtkKWEventStrings[] = 
{
  "KWWidgetEvents",
  "MessageDialogInvokeEvent",
  "FocusInEvent",
  "FocusOutEvent",
  // VV    
  "AngleVisibilityChangedEvent",
  "AnnotationColorChangedEvent",
  "ApplicationAreaChangedEvent",
  "BackgroundColorChangedEvent",
  "ContourAnnotationActiveChangedEvent",
  "ContourAnnotationAddAtPositionEvent",
  "ContourAnnotationAddEvent",
  "ContourAnnotationColorByScalarsChangedEvent",
  "ContourAnnotationColorChangedEvent",
  "ContourAnnotationComputeStatisticsEvent",
  "ContourAnnotationLineWidthChangedEvent",
  "ContourAnnotationOpacityChangedEvent",
  "ContourAnnotationRemoveAllEvent",
  "ContourAnnotationRemoveEvent",
  "ContourAnnotationSurfacePropertyChangedEvent",
  "ContourAnnotationSurfaceQualityChangedEvent",
  "ContourAnnotationSurfaceRepresentationChangedEvent",
  "ContourAnnotationVisibilityChangedEvent",
  "ControlLeftMouseOptionChangedEvent",
  "ControlMiddleMouseOptionChangedEvent",
  "ControlRightMouseOptionChangedEvent",
  "CroppingPlanesPositionChangedEvent",
  "CroppingRegionFlagsChangedEvent",
  "CroppingRegionsVisibilityChangedEvent",
  "Cursor3DInteractiveStateChangedEvent",
  "Cursor3DPositionChangedEvent",
  "Cursor3DPositionChangingEvent",
  "Cursor3DTypeChangedEvent",
  "Cursor3DVisibilityChangedEvent",
  "Cursor3DXColorChangedEvent",
  "Cursor3DYColorChangedEvent",
  "Cursor3DZColorChangedEvent",
  "DataFileNameChangedEvent",
  "DistanceVisibilityChangedEvent",
  "EnableShadingEvent",
  "GradientOpacityFunctionChangedEvent",
  "GradientOpacityFunctionPresetApplyEvent",
  "GradientOpacityStateChangedEvent",
  "HistogramChangedEvent",
  "ImageAngleVisibilityChangedEvent",
  "ImageBackgroundColorChangedEvent",
  "ImageCameraFocalPointAndPositionChangedEvent",
  "ImageCameraResetEvent",
  "ImageColorMappingEvent",
  "ImageCornerAnnotationChangedEvent",
  "ImageDistanceVisibilityChangedEvent",
  "ImageHeaderAnnotationChangedEvent",
  "ImageInterpolateEvent",
  "ImageMouseBindingChangedEvent",
  "ImageScaleBarColorChangedEvent",
  "ImageScaleBarVisibilityChangedEvent",
  "BeginImageSliceChangeEvent",
  "ImageSliceChangedEvent",
  "ImageZoomFactorChangedEvent",
  "InteractionModeChangedEvent",
  "InteractiveRenderStartEvent",
  "LeftMouseOptionChangedEvent",
  "LightActiveChangedEvent",
  "LightColorChangedEvent",
  "LightIntensityChangedEvent",
  "LightPositionChangedEvent",
  "LightVisibilityChangedEvent",
  "LightboxOrientationChangedEvent",
  "LightboxResolutionChangedEvent",
  "Marker2DColorChangedEvent",
  "Marker2DPositionChangedEvent",
  "Marker2DVisibilityChangedEvent",
  "Marker3DAddMarkerEvent",
  "Marker3DAddMarkerInGroupEvent",
  "Marker3DAddMarkersGroupEvent",
  "Marker3DColorChangedEvent",
  "Marker3DPositionChangedEvent",
  "Marker3DRemoveAllMarkerGroupsEvent",
  "Marker3DRemoveAllMarkersEvent",
  "Marker3DRemoveSelectedMarkerEvent",
  "Marker3DRemoveSelectedMarkerGroupEvent",
  "Marker3DSelectMarkerGroupEvent",
  "Marker3DVisibilityChangedEvent",
  "MaterialPropertyChangedEvent",
  "MaterialPropertyChangingEvent",
  "MiddleMouseOptionChangedEvent",
  "MouseBindingChangedEvent",
  "MouseOperationsChangedEvent",
  "NotebookHidePageEvent",
  "NotebookPinPageEvent",
  "NotebookRaisePageEvent",
  "NotebookShowPageEvent",
  "NotebookUnpinPageEvent",
  "ObjectActionEvent",
  "ObjectNameChangedEvent",
  "ObjectSetChangedEvent",
  "ObjectStateChangedEvent",
  "ObliqueProbeColorChangedEvent",
  "ObliqueProbeMovementEvent",
  "ObliqueProbeResetEvent",
  "ObliqueProbeScalarsVisibilityChangedEvent",
  "ObliqueProbeVisibilityChangedEvent",
  "PerspectiveViewAngleChangedEvent",
  "PluginFilterApplyEvent",
  "PluginFilterApplyPrepareEvent",
  "PluginFilterCancelEvent",
  "PluginFilterListAddedEvent",
  "PluginFilterListEvent",
  "PluginFilterListRemovedEvent",
  "PluginFilterRedoEvent",
  "PluginFilterRemoveMeshEvent",
  "PluginFilterSelectEvent",
  "PluginFilterUndoEvent",
  "ProbeImageRollPlaneEvent",
  "ProbeImageTiltPlaneEvent",
  "ProbeImageTranslatePlaneEvent",
  "ProbeInformationChangedEvent",
  "ProbeInformationOffEvent",
  "ProjectionTypeChangedEvent",
  "ReceiveRemoteSessionEvent",
  "RenderEvent",
  "RenderWidgetInSelectionFrameChangedEvent",
  "ResliceChangedEvent",
  "ResliceChangingEvent",
  "RightMouseOptionChangedEvent",
  "ScalarColorFunctionChangedEvent",
  "ScalarColorFunctionPresetApplyEvent",
  "ScalarComponentChangedEvent",
  "ScalarComponentWeightChangedEvent",
  "ScalarComponentWeightChangingEvent",
  "ScalarOpacityFunctionChangedEvent",
  "ScalarOpacityFunctionPresetApplyEvent",
  "ScaleBarVisibilityChangedEvent",
  "SelectionChangedEvent",
  "ShiftLeftMouseOptionChangedEvent",
  "ShiftMiddleMouseOptionChangedEvent",
  "ShiftRightMouseOptionChangedEvent",
  "StandardInteractivityChangedEvent",
  "SurfacePropertyChangedEvent",
  "SurfacePropertyChangingEvent",
  "SwitchToVolumeProEvent",
  "TimeChangedEvent",
  "TransferFunctionsChangedEvent",
  "TransferFunctionsChangingEvent",
  "UserInterfaceVisibilityChangedEvent",
  "ViewAnnotationChangedEvent",
  "ViewSelectedEvent",
  "VolumeBackgroundColorChangedEvent",
  "VolumeBlendModeChangedEvent",
  "VolumeBoundingBoxColorChangedEvent",
  "VolumeBoundingBoxVisibilityChangedEvent",
  "VolumeCameraResetEvent",
  "VolumeCornerAnnotationChangedEvent",
  "VolumeDistanceVisibilityChangedEvent",
  "VolumeFlySpeedChangedEvent",
  "VolumeHeaderAnnotationChangedEvent",
  "VolumeMapperRenderEndEvent",
  "VolumeMapperRenderStartEvent",
  "VolumeMaterialPropertyChangedEvent",
  "VolumeMaterialPropertyChangingEvent",
  "VolumeMouseBindingChangedEvent",
  "VolumeOrientationMarkerColorChangedEvent",
  "VolumeOrientationMarkerVisibilityChangedEvent",
  "VolumePropertyChangedEvent",
  "VolumePropertyChangingEvent",
  "VolumeReformatBoxVisibilityChangedEvent",
  "VolumeReformatChangedEvent",
  "VolumeReformatManipulationStyleChangedEvent",
  "VolumeReformatPlaneChangedEvent",
  "VolumeReformatThicknessChangedEvent",
  "VolumeScalarBarComponentChangedEvent",
  "VolumeScalarBarWidgetChangedEvent",
  "VolumeScaleBarColorChangedEvent",
  "VolumeScaleBarVisibilityChangedEvent",
  "VolumeStandardCameraViewEvent",
  "VolumeZSamplingChangedEvent",
  "WindowInterfaceChangedEvent",
  "WindowLayoutChangedEvent",
  "WindowLevelChangedEvent",
  "WindowLevelChangingEndEvent",
  "WindowLevelChangingEvent",
  "WindowLevelResetEvent",
  // PV
  "ErrorMessageEvent",
  "InitializeTraceEvent",
  "ManipulatorModifiedEvent",
  "WarningMessageEvent",
  "InformationMessageEvent",
  "DebugMessageEvent",
  "SourceDeletedEvent",
  //
  "FinalBogusNotUsedEvent",
  0
};

//----------------------------------------------------------------------------
unsigned long vtkKWEvent::GetEventIdFromString(const char* cevent)
{
  unsigned long event = vtkCommand::GetEventIdFromString(cevent);
  if (event != vtkCommand::NoEvent)
    {
    return event;
    }
  
  int cc;
  for (cc = 0; vtkKWEventStrings[cc] != 0; cc++)
    {
    if (strcmp(cevent, vtkKWEventStrings[cc]) == 0)
      {
      return cc + vtkKWEvent::KWWidgetEvents;
      }
    }

  return vtkCommand::NoEvent;
}

//----------------------------------------------------------------------------
const char *vtkKWEvent::GetStringFromEventId(unsigned long event)
{
  static unsigned long numevents = 0;
  
  // Find length of table

  if (!numevents)
    {
    while (vtkKWEventStrings[numevents] != NULL)
      {
      numevents++;
      }
    }

  if (event < vtkKWEvent::KWWidgetEvents) 
    {
    return vtkCommand::GetStringFromEventId(event);
    }

  event -= vtkKWEvent::KWWidgetEvents;

  if (event < numevents)
    {
    return vtkKWEventStrings[event];
    }
  else
    {
    return "UnknownEvent";
    }
}