1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (C) 2004-2012 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | * Author: Leif Delgass <ldelgass@purdue.edu> |
---|
6 | */ |
---|
7 | |
---|
8 | #ifndef VTKVIS_RENDERER_H |
---|
9 | #define VTKVIS_RENDERER_H |
---|
10 | |
---|
11 | #include <string> |
---|
12 | #include <vector> |
---|
13 | #include <tr1/unordered_map> |
---|
14 | #include <typeinfo> |
---|
15 | |
---|
16 | #include <vtkSmartPointer.h> |
---|
17 | #ifdef USE_CUSTOM_AXES |
---|
18 | #include "vtkRpCubeAxesActor.h" |
---|
19 | #else |
---|
20 | #include <vtkCubeAxesActor.h> |
---|
21 | #endif |
---|
22 | #include <vtkAxesActor.h> |
---|
23 | #include <vtkAnnotatedCubeActor.h> |
---|
24 | #include <vtkScalarBarActor.h> |
---|
25 | #include <vtkRenderer.h> |
---|
26 | #include <vtkRenderWindow.h> |
---|
27 | #include <vtkUnsignedCharArray.h> |
---|
28 | |
---|
29 | #include "ColorMap.h" |
---|
30 | #include "Types.h" |
---|
31 | #include "DataSet.h" |
---|
32 | #include "Arc.h" |
---|
33 | #include "Arrow.h" |
---|
34 | #include "Box.h" |
---|
35 | #include "Cone.h" |
---|
36 | #include "Contour2D.h" |
---|
37 | #include "Contour3D.h" |
---|
38 | #include "Cutplane.h" |
---|
39 | #include "Cylinder.h" |
---|
40 | #include "Disk.h" |
---|
41 | #include "Glyphs.h" |
---|
42 | #include "Group.h" |
---|
43 | #include "HeightMap.h" |
---|
44 | #include "Image.h" |
---|
45 | #include "LIC.h" |
---|
46 | #include "Line.h" |
---|
47 | #include "Molecule.h" |
---|
48 | #include "Outline.h" |
---|
49 | #include "Parallelepiped.h" |
---|
50 | #include "PolyData.h" |
---|
51 | #include "Polygon.h" |
---|
52 | #include "PseudoColor.h" |
---|
53 | #include "Sphere.h" |
---|
54 | #include "Streamlines.h" |
---|
55 | #include "Text3D.h" |
---|
56 | #include "Volume.h" |
---|
57 | #include "Warp.h" |
---|
58 | #include "Trace.h" |
---|
59 | |
---|
60 | // Controls if TGA format is sent to client |
---|
61 | //#define RENDER_TARGA |
---|
62 | #define TARGA_BYTES_PER_PIXEL 3 |
---|
63 | |
---|
64 | namespace VtkVis { |
---|
65 | |
---|
66 | /** |
---|
67 | * \brief VTK Renderer |
---|
68 | */ |
---|
69 | class Renderer |
---|
70 | { |
---|
71 | public: |
---|
72 | Renderer(); |
---|
73 | virtual ~Renderer(); |
---|
74 | |
---|
75 | enum AxisRangeMode { |
---|
76 | RANGE_AUTO = 0, |
---|
77 | RANGE_SCALE_BOUNDS, |
---|
78 | RANGE_EXPLICIT |
---|
79 | }; |
---|
80 | |
---|
81 | enum AxesFlyMode { |
---|
82 | FLY_OUTER_EDGES = 0, |
---|
83 | FLY_CLOSEST_TRIAD, |
---|
84 | FLY_FURTHEST_TRIAD, |
---|
85 | FLY_STATIC_EDGES, |
---|
86 | FLY_STATIC_TRIAD |
---|
87 | }; |
---|
88 | |
---|
89 | enum AxesTickPosition { |
---|
90 | TICKS_INSIDE, |
---|
91 | TICKS_OUTSIDE, |
---|
92 | TICKS_BOTH |
---|
93 | }; |
---|
94 | |
---|
95 | enum CameraMode { |
---|
96 | PERSPECTIVE, |
---|
97 | ORTHO, |
---|
98 | IMAGE |
---|
99 | }; |
---|
100 | |
---|
101 | enum Aspect { |
---|
102 | ASPECT_NATIVE, |
---|
103 | ASPECT_SQUARE, |
---|
104 | ASPECT_WINDOW |
---|
105 | }; |
---|
106 | |
---|
107 | enum LegendType { |
---|
108 | LEGEND_SCALAR, |
---|
109 | LEGEND_VECTOR_MAGNITUDE, |
---|
110 | LEGEND_VECTOR_X, |
---|
111 | LEGEND_VECTOR_Y, |
---|
112 | LEGEND_VECTOR_Z |
---|
113 | }; |
---|
114 | |
---|
115 | typedef std::string DataSetId; |
---|
116 | typedef std::string ColorMapId; |
---|
117 | typedef std::string FieldId; |
---|
118 | |
---|
119 | // Data sets |
---|
120 | |
---|
121 | void addDataSet(const DataSetId& id); |
---|
122 | |
---|
123 | void deleteDataSet(const DataSetId& id); |
---|
124 | |
---|
125 | DataSet *getDataSet(const DataSetId& id); |
---|
126 | |
---|
127 | void getDataSetNames(std::vector<std::string>& names); |
---|
128 | |
---|
129 | bool setData(const DataSetId& id, char *data, int nbytes); |
---|
130 | |
---|
131 | bool setDataFile(const DataSetId& id, const char *filename); |
---|
132 | |
---|
133 | bool setDataSetActiveScalars(const DataSetId& id, const char *scalarName); |
---|
134 | |
---|
135 | bool setDataSetActiveVectors(const DataSetId& id, const char *vectorName); |
---|
136 | |
---|
137 | bool getScalarValueAtPixel(const DataSetId& id, int x, int y, double *value); |
---|
138 | |
---|
139 | bool getScalarValue(const DataSetId& id, double x, double y, double z, double *value); |
---|
140 | |
---|
141 | bool getVectorValueAtPixel(const DataSetId& id, int x, int y, double vector[3]); |
---|
142 | |
---|
143 | bool getVectorValue(const DataSetId& id, double x, double y, double z, double vector[3]); |
---|
144 | |
---|
145 | void setDataSetOpacity(const DataSetId& id, double opacity); |
---|
146 | |
---|
147 | void setDataSetVisibility(const DataSetId& id, bool state); |
---|
148 | |
---|
149 | void setUseCumulativeDataRange(bool state, bool onlyVisible = false); |
---|
150 | |
---|
151 | bool getUseCumulativeRange(); |
---|
152 | |
---|
153 | bool setCumulativeDataRange(double *range, const char *name, |
---|
154 | DataSet::DataAttributeType type, |
---|
155 | int numComponents, |
---|
156 | int component = -1); |
---|
157 | |
---|
158 | bool getCumulativeDataRange(double *range, const char *name, |
---|
159 | int numComponents, |
---|
160 | int component = -1); |
---|
161 | |
---|
162 | bool getCumulativeDataRange(double *range, const char *name, |
---|
163 | DataSet::DataAttributeType type, |
---|
164 | int numComponents, |
---|
165 | int component = -1); |
---|
166 | |
---|
167 | // Render window |
---|
168 | |
---|
169 | /// Get the VTK render window object this Renderer uses |
---|
170 | vtkRenderWindow *getRenderWindow() |
---|
171 | { |
---|
172 | return _renderWindow; |
---|
173 | } |
---|
174 | |
---|
175 | void setWindowSize(int width, int height); |
---|
176 | |
---|
177 | int getWindowWidth() const; |
---|
178 | |
---|
179 | int getWindowHeight() const; |
---|
180 | |
---|
181 | // Lights |
---|
182 | |
---|
183 | int addLight(float pos[3]); |
---|
184 | |
---|
185 | vtkLight *getLight(int lightIdx); |
---|
186 | |
---|
187 | void setLightSwitch(int lightIdx, bool state); |
---|
188 | |
---|
189 | // Camera controls |
---|
190 | |
---|
191 | void setViewAngle(int height); |
---|
192 | |
---|
193 | /// Return the VTK camera object this Renderer uses |
---|
194 | vtkCamera *getVtkCamera() |
---|
195 | { |
---|
196 | if (_renderer != NULL) |
---|
197 | return _renderer->GetActiveCamera(); |
---|
198 | else |
---|
199 | return NULL; |
---|
200 | } |
---|
201 | |
---|
202 | bool isCameraMaximized() |
---|
203 | { |
---|
204 | return (_cameraZoomRatio == 1.0 && |
---|
205 | _cameraPan[0] == 0.0 && |
---|
206 | _cameraPan[1] == 0.0); |
---|
207 | } |
---|
208 | |
---|
209 | void getImageCameraSizes(int *imgWidthPx, int *imgHeightPx, |
---|
210 | int *_pxOffsetX = NULL, int *_pxOffsetY = NULL); |
---|
211 | |
---|
212 | double getImageCameraAspect(); |
---|
213 | |
---|
214 | void setCameraMode(CameraMode mode); |
---|
215 | |
---|
216 | CameraMode getCameraMode() const; |
---|
217 | |
---|
218 | void setCameraAspect(Aspect aspect); |
---|
219 | |
---|
220 | void resetVtkCamera(double *bounds = NULL); |
---|
221 | |
---|
222 | void resetCamera(bool resetOrientation = true); |
---|
223 | |
---|
224 | void resetCameraClippingRange(); |
---|
225 | |
---|
226 | bool setCameraZoomRegionPixels(int x, int y, int width, int height); |
---|
227 | |
---|
228 | bool setCameraZoomRegion(double x, double y, double width, double height); |
---|
229 | |
---|
230 | void getCameraZoomRegion(double xywh[4]) const; |
---|
231 | |
---|
232 | void getScreenWorldCoords(double xywh[4]) const; |
---|
233 | |
---|
234 | void rotateCamera(double yaw, double pitch, double roll); |
---|
235 | |
---|
236 | void setCameraOrientation(const double quat[4], bool absolute = true); |
---|
237 | |
---|
238 | void panCamera(double x, double y, bool absolute = true); |
---|
239 | |
---|
240 | void zoomCamera(double z, bool absolute = true); |
---|
241 | |
---|
242 | void setCameraOrientationAndPosition(const double position[3], |
---|
243 | const double focalPoint[3], |
---|
244 | const double viewUp[3]); |
---|
245 | |
---|
246 | void getCameraOrientationAndPosition(double position[3], |
---|
247 | double focalPoint[3], |
---|
248 | double viewUp[3]); |
---|
249 | |
---|
250 | void eventuallyResetCamera() |
---|
251 | { |
---|
252 | _needsCameraReset = true; |
---|
253 | } |
---|
254 | |
---|
255 | bool needsCameraReset() |
---|
256 | { |
---|
257 | return _needsCameraReset; |
---|
258 | } |
---|
259 | |
---|
260 | void eventuallyResetCameraClippingRange() |
---|
261 | { |
---|
262 | _needsCameraClippingRangeReset = true; |
---|
263 | } |
---|
264 | |
---|
265 | bool needsCameraClippingRangeReset() |
---|
266 | { |
---|
267 | return _needsCameraClippingRangeReset; |
---|
268 | } |
---|
269 | |
---|
270 | // Rendering an image |
---|
271 | |
---|
272 | void setBackgroundColor(float color[3]); |
---|
273 | |
---|
274 | void setClipPlane(Axis axis, double ratio, int direction); |
---|
275 | |
---|
276 | void setUseTwoSidedLighting(bool state); |
---|
277 | |
---|
278 | void setUseDepthPeeling(bool state); |
---|
279 | |
---|
280 | void setDepthPeelingParams(double occlusionRatio = 0.0, int maxPeels = 0); |
---|
281 | |
---|
282 | void eventuallyRender(); |
---|
283 | |
---|
284 | bool render(); |
---|
285 | |
---|
286 | void getRenderedFrame(vtkUnsignedCharArray *imgData); |
---|
287 | |
---|
288 | // Axes |
---|
289 | |
---|
290 | void setAxesOrigin(double x, double y, double z, bool useCustom = true); |
---|
291 | |
---|
292 | void setAxesAutoBounds(bool state); |
---|
293 | |
---|
294 | void setAxesBounds(double min, double max); |
---|
295 | |
---|
296 | void setAxesAutoRange(bool state); |
---|
297 | |
---|
298 | void setAxisBounds(Axis axis, double min, double max); |
---|
299 | |
---|
300 | void setAxesScale(double scale); |
---|
301 | |
---|
302 | void setAxesRange(double min, double max); |
---|
303 | |
---|
304 | void setAxesLabelPowerScaling(int xPow, int yPow, int zPow, bool useCustom = true); |
---|
305 | |
---|
306 | void setAxisAutoBounds(Axis axis, bool state); |
---|
307 | |
---|
308 | void setAxisAutoRange(Axis axis, bool state); |
---|
309 | |
---|
310 | void setAxisScale(Axis axis, double scale); |
---|
311 | |
---|
312 | void setAxisRange(Axis axis, double min, double max); |
---|
313 | |
---|
314 | void setAxesFlyMode(AxesFlyMode mode); |
---|
315 | |
---|
316 | void setAxesVisibility(bool state); |
---|
317 | |
---|
318 | void setAxesGridVisibility(bool state); |
---|
319 | |
---|
320 | void setAxesInnerGridVisibility(bool state); |
---|
321 | |
---|
322 | void setAxesGridpolysVisibility(bool state); |
---|
323 | |
---|
324 | void setAxesLabelVisibility(bool state); |
---|
325 | |
---|
326 | void setAxesTickVisibility(bool state); |
---|
327 | |
---|
328 | void setAxesMinorTickVisibility(bool state); |
---|
329 | |
---|
330 | void setAxesTickPosition(AxesTickPosition pos); |
---|
331 | |
---|
332 | void setAxesColor(double color[3], double opacity = 1.0); |
---|
333 | |
---|
334 | void setAxesTitleColor(double color[3], double opacity = 1.0); |
---|
335 | |
---|
336 | void setAxesLabelColor(double color[3], double opacity = 1.0); |
---|
337 | |
---|
338 | void setAxesLinesColor(double color[3], double opacity = 1.0); |
---|
339 | |
---|
340 | void setAxesGridlinesColor(double color[3], double opacity = 1.0); |
---|
341 | |
---|
342 | void setAxesInnerGridlinesColor(double color[3], double opacity = 1.0); |
---|
343 | |
---|
344 | void setAxesGridpolysColor(double color[3], double opacity = 1.0); |
---|
345 | |
---|
346 | void setAxesLabelScaling(bool autoScale, int xpow, int ypow, int zpow); |
---|
347 | |
---|
348 | void setAxesPixelFontSize(double screenSize); |
---|
349 | |
---|
350 | void setAxesTitleFont(const char *fontName); |
---|
351 | |
---|
352 | void setAxesTitleFontSize(int sz); |
---|
353 | |
---|
354 | void setAxesTitleOrientation(double orientation); |
---|
355 | |
---|
356 | void setAxesLabelFont(const char *fontName); |
---|
357 | |
---|
358 | void setAxesLabelFontSize(int sz); |
---|
359 | |
---|
360 | void setAxesLabelOrientation(double orientation); |
---|
361 | |
---|
362 | void setAxesLabelFormat(const char *format); |
---|
363 | |
---|
364 | void setAxisVisibility(Axis axis, bool state); |
---|
365 | |
---|
366 | void setAxisGridVisibility(Axis axis, bool state); |
---|
367 | |
---|
368 | void setAxisInnerGridVisibility(Axis axis, bool state); |
---|
369 | |
---|
370 | void setAxisGridpolysVisibility(Axis axis, bool state); |
---|
371 | |
---|
372 | void setAxisLabelVisibility(Axis axis, bool state); |
---|
373 | |
---|
374 | void setAxisTickVisibility(Axis axis, bool state); |
---|
375 | |
---|
376 | void setAxisMinorTickVisibility(Axis axis, bool state); |
---|
377 | |
---|
378 | void setAxisColor(Axis axis, double color[3], double opacity = 1.0); |
---|
379 | |
---|
380 | void setAxisTitleColor(Axis axis, double color[3], double opacity = 1.0); |
---|
381 | |
---|
382 | void setAxisLabelColor(Axis axis, double color[3], double opacity = 1.0); |
---|
383 | |
---|
384 | void setAxisLinesColor(Axis axis, double color[3], double opacity = 1.0); |
---|
385 | |
---|
386 | void setAxisGridlinesColor(Axis axis, double color[3], double opacity = 1.0); |
---|
387 | |
---|
388 | void setAxisInnerGridlinesColor(Axis axis, double color[3], double opacity = 1.0); |
---|
389 | |
---|
390 | void setAxisGridpolysColor(Axis axis, double color[3], double opacity = 1.0); |
---|
391 | |
---|
392 | void setAxisTitle(Axis axis, const char *title); |
---|
393 | |
---|
394 | void setAxisUnits(Axis axis, const char *units); |
---|
395 | |
---|
396 | void setAxisTitleFont(Axis axis, const char *fontName); |
---|
397 | |
---|
398 | void setAxisTitleFontSize(Axis axis, int sz); |
---|
399 | |
---|
400 | void setAxisTitleOrientation(Axis axis, double orientation); |
---|
401 | |
---|
402 | void setAxisLabelFont(Axis axis, const char *fontName); |
---|
403 | |
---|
404 | void setAxisLabelFontSize(Axis axis, int sz); |
---|
405 | |
---|
406 | void setAxisLabelOrientation(Axis axis, double orientation); |
---|
407 | |
---|
408 | void setAxisLabelFormat(Axis axis, const char *format); |
---|
409 | |
---|
410 | void eventuallyResetAxes() |
---|
411 | { |
---|
412 | _needsAxesReset = true; |
---|
413 | } |
---|
414 | |
---|
415 | bool needsAxesReset() |
---|
416 | { |
---|
417 | return _needsAxesReset; |
---|
418 | } |
---|
419 | |
---|
420 | // Colormaps |
---|
421 | |
---|
422 | void addColorMap(const ColorMapId& id, ColorMap *colorMap); |
---|
423 | |
---|
424 | void deleteColorMap(const ColorMapId& id); |
---|
425 | |
---|
426 | ColorMap *getColorMap(const ColorMapId& id); |
---|
427 | |
---|
428 | void setColorMapNumberOfTableEntries(const ColorMapId& id, int numEntries); |
---|
429 | |
---|
430 | bool renderColorMap(const ColorMapId& id, |
---|
431 | int width, int height, |
---|
432 | bool opaque, |
---|
433 | vtkUnsignedCharArray *imgData); |
---|
434 | |
---|
435 | bool renderColorMap(const ColorMapId& id, |
---|
436 | const DataSetId& dataSetID, |
---|
437 | LegendType legendType, |
---|
438 | const char *fieldName, |
---|
439 | DataSet::DataAttributeType type, |
---|
440 | std::string& title, |
---|
441 | double range[2], |
---|
442 | int width, int height, |
---|
443 | bool opaque, |
---|
444 | int numLabels, |
---|
445 | vtkUnsignedCharArray *imgData); |
---|
446 | |
---|
447 | bool renderColorMap(const ColorMapId& id, |
---|
448 | const DataSetId& dataSetID, |
---|
449 | LegendType legendType, |
---|
450 | const char *fieldName, |
---|
451 | std::string& title, |
---|
452 | double range[2], |
---|
453 | int width, int height, |
---|
454 | bool opaque, |
---|
455 | int numLabels, |
---|
456 | vtkUnsignedCharArray *imgData); |
---|
457 | |
---|
458 | bool renderColorMap(const ColorMapId& id, |
---|
459 | const DataSetId& dataSetID, |
---|
460 | LegendType legendType, |
---|
461 | std::string& title, |
---|
462 | double range[2], |
---|
463 | int width, int height, |
---|
464 | bool opaque, |
---|
465 | int numLabels, |
---|
466 | vtkUnsignedCharArray *imgData); |
---|
467 | |
---|
468 | // Generic GraphicsObject methods |
---|
469 | |
---|
470 | GraphicsObject *getGenericGraphicsObject(const DataSetId& id); |
---|
471 | |
---|
472 | template<class T> |
---|
473 | T *getGraphicsObject(const DataSetId& id); |
---|
474 | |
---|
475 | template<class T> |
---|
476 | bool addGraphicsObject(const DataSetId& id); |
---|
477 | |
---|
478 | template<class T> |
---|
479 | void deleteGraphicsObject(const DataSetId& id); |
---|
480 | |
---|
481 | template<class T> |
---|
482 | void deleteAllGraphicsObjects(); |
---|
483 | |
---|
484 | template<class T> |
---|
485 | void mergeGraphicsObjectBounds(double *bounds, bool onlyVisible); |
---|
486 | |
---|
487 | template<class T> |
---|
488 | void mergeGraphicsObjectUnscaledBounds(double *bounds, bool onlyVisible); |
---|
489 | |
---|
490 | template<class T> |
---|
491 | void updateGraphicsObjectFieldRanges(); |
---|
492 | |
---|
493 | template<class T> |
---|
494 | void setGraphicsObjectClippingPlanes(vtkPlaneCollection *planes); |
---|
495 | |
---|
496 | template<class T> |
---|
497 | void setGraphicsObjectAspect(double aspectRatio); |
---|
498 | |
---|
499 | template<class T> |
---|
500 | void setGraphicsObjectInterpolateBeforeMapping(const DataSetId& id, bool state); |
---|
501 | |
---|
502 | template<class T> |
---|
503 | void setGraphicsObjectColorMap(const DataSetId& id, const ColorMapId& colorMapId); |
---|
504 | |
---|
505 | template<class T> |
---|
506 | void updateGraphicsObjectColorMap(ColorMap *cmap); |
---|
507 | |
---|
508 | template<class T> |
---|
509 | bool graphicsObjectColorMapUsed(ColorMap *cmap); |
---|
510 | |
---|
511 | template<class T> |
---|
512 | void setGraphicsObjectVolumeSlice(const DataSetId& id, Axis axis, double ratio); |
---|
513 | |
---|
514 | // Prop/Prop3D properties |
---|
515 | |
---|
516 | template<class T> |
---|
517 | void setGraphicsObjectOrientation(const DataSetId& id, double quat[4]); |
---|
518 | |
---|
519 | template<class T> |
---|
520 | void setGraphicsObjectOrientation(const DataSetId& id, double angle, double axis[3]); |
---|
521 | |
---|
522 | template<class T> |
---|
523 | void setGraphicsObjectOrigin(const DataSetId& id, double origin[3]); |
---|
524 | |
---|
525 | template<class T> |
---|
526 | void setGraphicsObjectPosition(const DataSetId& id, double pos[3]); |
---|
527 | |
---|
528 | template<class T> |
---|
529 | void setGraphicsObjectAspect(const DataSetId& id, double aspect); |
---|
530 | |
---|
531 | template<class T> |
---|
532 | void setGraphicsObjectScale(const DataSetId& id, double scale[3]); |
---|
533 | |
---|
534 | template<class T> |
---|
535 | void setGraphicsObjectTransform(const DataSetId& id, vtkMatrix4x4 *trans); |
---|
536 | |
---|
537 | template<class T> |
---|
538 | void setGraphicsObjectVisibility(const DataSetId& id, bool state); |
---|
539 | |
---|
540 | // Actor properties |
---|
541 | |
---|
542 | template<class T> |
---|
543 | void setGraphicsObjectColor(const DataSetId& id, float color[3]); |
---|
544 | |
---|
545 | template<class T> |
---|
546 | void setGraphicsObjectCullFace(const DataSetId& id, GraphicsObject::CullFace state); |
---|
547 | |
---|
548 | template<class T> |
---|
549 | void setGraphicsObjectCulling(const DataSetId& id, bool state); |
---|
550 | |
---|
551 | template<class T> |
---|
552 | void setGraphicsObjectEdgeVisibility(const DataSetId& id, bool state); |
---|
553 | |
---|
554 | template<class T> |
---|
555 | void setGraphicsObjectEdgeColor(const DataSetId& id, float color[3]); |
---|
556 | |
---|
557 | template<class T> |
---|
558 | void setGraphicsObjectEdgeWidth(const DataSetId& id, float edgeWidth); |
---|
559 | |
---|
560 | template<class T> |
---|
561 | void setGraphicsObjectAmbient(const DataSetId& id, double coeff); |
---|
562 | |
---|
563 | template<class T> |
---|
564 | void setGraphicsObjectDiffuse(const DataSetId& id, double coeff); |
---|
565 | |
---|
566 | template<class T> |
---|
567 | void setGraphicsObjectShadingModel(const DataSetId& id, GraphicsObject::ShadingModel state); |
---|
568 | |
---|
569 | template<class T> |
---|
570 | void setGraphicsObjectSpecular(const DataSetId& id, double coeff, double power); |
---|
571 | |
---|
572 | template<class T> |
---|
573 | void setGraphicsObjectLighting(const DataSetId& id, bool state); |
---|
574 | |
---|
575 | template<class T> |
---|
576 | void setGraphicsObjectOpacity(const DataSetId& id, double opacity); |
---|
577 | |
---|
578 | template<class T> |
---|
579 | void setGraphicsObjectPointSize(const DataSetId& id, float size); |
---|
580 | |
---|
581 | template<class T> |
---|
582 | void setGraphicsObjectWireframe(const DataSetId& id, bool state); |
---|
583 | |
---|
584 | // For Shapes: |
---|
585 | |
---|
586 | template<class T> |
---|
587 | void setGraphicsObjectFlipNormals(const DataSetId& id, bool state); |
---|
588 | |
---|
589 | // Arcs |
---|
590 | |
---|
591 | bool addArc(const DataSetId& id, double center[3], double pt1[3], |
---|
592 | double normal[3], double angle); |
---|
593 | |
---|
594 | void setArcResolution(const DataSetId& id, int res); |
---|
595 | |
---|
596 | // Arrows |
---|
597 | |
---|
598 | bool addArrow(const DataSetId& id, double tipRadius, double shaftRadius, |
---|
599 | double tipLength, bool flipNormals = false); |
---|
600 | |
---|
601 | void setArrowResolution(const DataSetId& id, int resTip, int resShaft); |
---|
602 | |
---|
603 | // Boxes |
---|
604 | |
---|
605 | bool addBox(const DataSetId& id, double xLen, double yLen, double zLen, |
---|
606 | bool flipNormals = false); |
---|
607 | |
---|
608 | // Cones |
---|
609 | |
---|
610 | bool addCone(const DataSetId& id, double radius, double height, bool cap, |
---|
611 | bool flipNormals = false); |
---|
612 | |
---|
613 | void setConeResolution(const DataSetId& id, int res); |
---|
614 | |
---|
615 | // 2D Contour plots |
---|
616 | |
---|
617 | bool addContour2D(const DataSetId& id, int numContours); |
---|
618 | |
---|
619 | bool addContour2D(const DataSetId& id, const std::vector<double>& contours); |
---|
620 | |
---|
621 | void setContour2DContourField(const DataSetId& id, const char *fieldName); |
---|
622 | |
---|
623 | void setContour2DNumContours(const DataSetId& id, int numContours); |
---|
624 | |
---|
625 | void setContour2DContourList(const DataSetId& id, const std::vector<double>& contours); |
---|
626 | |
---|
627 | void setContour2DColorMode(const DataSetId& id, |
---|
628 | Contour2D::ColorMode mode, |
---|
629 | const char *name, double range[2] = NULL); |
---|
630 | |
---|
631 | void setContour2DColorMode(const DataSetId& id, |
---|
632 | Contour2D::ColorMode mode, |
---|
633 | DataSet::DataAttributeType type, |
---|
634 | const char *name, double range[2] = NULL); |
---|
635 | |
---|
636 | // 3D Contour (isosurface) plots |
---|
637 | |
---|
638 | bool addContour3D(const DataSetId& id, int numContours); |
---|
639 | |
---|
640 | bool addContour3D(const DataSetId& id, const std::vector<double>& contours); |
---|
641 | |
---|
642 | void setContour3DContourField(const DataSetId& id, const char *fieldName); |
---|
643 | |
---|
644 | void setContour3DNumContours(const DataSetId& id, int numContours); |
---|
645 | |
---|
646 | void setContour3DContourList(const DataSetId& id, const std::vector<double>& contours); |
---|
647 | |
---|
648 | void setContour3DColorMode(const DataSetId& id, |
---|
649 | Contour3D::ColorMode mode, |
---|
650 | const char *name, double range[2] = NULL); |
---|
651 | |
---|
652 | void setContour3DColorMode(const DataSetId& id, |
---|
653 | Contour3D::ColorMode mode, |
---|
654 | DataSet::DataAttributeType type, |
---|
655 | const char *name, double range[2] = NULL); |
---|
656 | |
---|
657 | // Cutplanes |
---|
658 | |
---|
659 | void setCutplaneCloudStyle(const DataSetId& id, |
---|
660 | Cutplane::CloudStyle style); |
---|
661 | |
---|
662 | void setCutplaneOutlineVisibility(const DataSetId& id, bool state); |
---|
663 | |
---|
664 | void setCutplaneSliceVisibility(const DataSetId& id, Axis axis, bool state); |
---|
665 | |
---|
666 | void setCutplaneColorMode(const DataSetId& id, |
---|
667 | Cutplane::ColorMode mode, |
---|
668 | const char *name, double range[2] = NULL); |
---|
669 | |
---|
670 | void setCutplaneColorMode(const DataSetId& id, |
---|
671 | Cutplane::ColorMode mode, |
---|
672 | DataSet::DataAttributeType type, |
---|
673 | const char *name, double range[2] = NULL); |
---|
674 | |
---|
675 | // Cylinders |
---|
676 | |
---|
677 | bool addCylinder(const DataSetId& id, double radius, double height, bool cap, bool flipNormals = false); |
---|
678 | |
---|
679 | void setCylinderCapping(const DataSetId& id, bool state); |
---|
680 | |
---|
681 | void setCylinderResolution(const DataSetId& id, int res); |
---|
682 | |
---|
683 | // Disks |
---|
684 | |
---|
685 | bool addDisk(const DataSetId& id, double innerRadius, double outerRadius, bool flipNormals = false); |
---|
686 | |
---|
687 | void setDiskResolution(const DataSetId& id, int resRadial, int resCircum); |
---|
688 | |
---|
689 | // Glyphs |
---|
690 | |
---|
691 | bool addGlyphs(const DataSetId& id, Glyphs::GlyphShape shape); |
---|
692 | |
---|
693 | void setGlyphsShape(const DataSetId& id, Glyphs::GlyphShape shape); |
---|
694 | |
---|
695 | void setGlyphsOrientMode(const DataSetId& id, bool state, const char *name); |
---|
696 | |
---|
697 | void setGlyphsQuality(const DataSetId& id, double quality); |
---|
698 | |
---|
699 | void setGlyphsColorMode(const DataSetId& id, |
---|
700 | Glyphs::ColorMode mode, |
---|
701 | const char *name, |
---|
702 | double range[2] = NULL); |
---|
703 | |
---|
704 | void setGlyphsScalingMode(const DataSetId& id, |
---|
705 | Glyphs::ScalingMode mode, |
---|
706 | const char *name, |
---|
707 | double range[2] = NULL); |
---|
708 | |
---|
709 | void setGlyphsNormalizeScale(const DataSetId& id, bool normalize); |
---|
710 | |
---|
711 | void setGlyphsScaleFactor(const DataSetId& id, double scale); |
---|
712 | |
---|
713 | void setGlyphsMaximumNumberOfGlyphs(const DataSetId& id, int max, |
---|
714 | bool random = true, |
---|
715 | int offset = 0, int ratio = 1); |
---|
716 | |
---|
717 | // Groups |
---|
718 | |
---|
719 | bool addGroup(const DataSetId& id, const std::vector<Group::NodeId>& nodeList); |
---|
720 | |
---|
721 | void addChildrenToGroup(const DataSetId& id, const std::vector<Group::NodeId>& nodeList); |
---|
722 | |
---|
723 | void removeChildrenFromGroup(const DataSetId& id, const std::vector<Group::NodeId>& nodeList); |
---|
724 | |
---|
725 | // Height maps |
---|
726 | |
---|
727 | bool addHeightMap(const DataSetId& id, int numContours, double heightScale); |
---|
728 | |
---|
729 | bool addHeightMap(const DataSetId& id, const std::vector<double>& contours, double heightScale); |
---|
730 | |
---|
731 | void setHeightMapHeightScale(const DataSetId& id, double scale); |
---|
732 | |
---|
733 | void setHeightMapCloudStyle(const DataSetId& id, |
---|
734 | HeightMap::CloudStyle style); |
---|
735 | |
---|
736 | void setHeightMapNumContours(const DataSetId& id, int numContours); |
---|
737 | |
---|
738 | void setHeightMapContourList(const DataSetId& id, const std::vector<double>& contours); |
---|
739 | |
---|
740 | void setHeightMapContourSurfaceVisibility(const DataSetId& id, bool state); |
---|
741 | |
---|
742 | void setHeightMapContourLineVisibility(const DataSetId& id, bool state); |
---|
743 | |
---|
744 | void setHeightMapContourLineColorMapEnabled(const DataSetId& id, bool mode); |
---|
745 | |
---|
746 | void setHeightMapContourEdgeColor(const DataSetId& id, float color[3]); |
---|
747 | |
---|
748 | void setHeightMapContourEdgeWidth(const DataSetId& id, float edgeWidth); |
---|
749 | |
---|
750 | void setHeightMapColorMode(const DataSetId& id, |
---|
751 | HeightMap::ColorMode mode, |
---|
752 | const char *name, double range[2] = NULL); |
---|
753 | |
---|
754 | void setHeightMapColorMode(const DataSetId& id, |
---|
755 | HeightMap::ColorMode mode, |
---|
756 | DataSet::DataAttributeType type, |
---|
757 | const char *name, double range[2] = NULL); |
---|
758 | |
---|
759 | // Images |
---|
760 | |
---|
761 | void setImageBackground(const DataSetId& id, bool state); |
---|
762 | |
---|
763 | void setImageBacking(const DataSetId& id, bool state); |
---|
764 | |
---|
765 | void setImageBorder(const DataSetId& id, bool state); |
---|
766 | |
---|
767 | // For ImageActor/ImageSliceMapper only |
---|
768 | void setImageExtents(const DataSetId& id, int extents[6]); |
---|
769 | |
---|
770 | void setImageLevel(const DataSetId& id, double level); |
---|
771 | |
---|
772 | void setImageWindow(const DataSetId& id, double window); |
---|
773 | |
---|
774 | void setImageSlicePlane(const DataSetId& id, double normal[3], double origin[3]); |
---|
775 | |
---|
776 | void setImageSliceFollowsCamera(const DataSetId& id, bool state); |
---|
777 | |
---|
778 | // For ImageActor/ImageSliceMapper only |
---|
779 | void setImageZSlice(const DataSetId& id, int z); |
---|
780 | |
---|
781 | // Lines |
---|
782 | |
---|
783 | bool addLine(const DataSetId& id, double pt1[3], double pt2[3]); |
---|
784 | |
---|
785 | bool addLine(const DataSetId& id, std::vector<double> points); |
---|
786 | |
---|
787 | // Molecules |
---|
788 | |
---|
789 | void setMoleculeAtomQuality(const DataSetId& id, double quality); |
---|
790 | |
---|
791 | void setMoleculeBondQuality(const DataSetId& id, double quality); |
---|
792 | |
---|
793 | void setMoleculeAtomRadiusScale(const DataSetId& id, double scale); |
---|
794 | |
---|
795 | void setMoleculeBondRadiusScale(const DataSetId& id, double scale); |
---|
796 | |
---|
797 | void setMoleculeAtomScaling(const DataSetId& id, Molecule::AtomScaling scaling); |
---|
798 | |
---|
799 | void setMoleculeAtomVisibility(const DataSetId& id, bool state); |
---|
800 | |
---|
801 | void setMoleculeAtomLabelField(const DataSetId& id, const char *fieldName); |
---|
802 | |
---|
803 | void setMoleculeAtomLabelVisibility(const DataSetId& id, bool state); |
---|
804 | |
---|
805 | void setMoleculeBondVisibility(const DataSetId& id, bool state); |
---|
806 | |
---|
807 | void setMoleculeBondStyle(const DataSetId& id, Molecule::BondStyle style); |
---|
808 | |
---|
809 | void setMoleculeBondColorMode(const DataSetId& id, Molecule::BondColorMode mode); |
---|
810 | |
---|
811 | void setMoleculeBondColor(const DataSetId& id, float color[3]); |
---|
812 | |
---|
813 | void setMoleculeColorMode(const DataSetId& id, |
---|
814 | Molecule::ColorMode mode, |
---|
815 | const char *name, double range[2] = NULL); |
---|
816 | |
---|
817 | void setMoleculeColorMode(const DataSetId& id, |
---|
818 | Molecule::ColorMode mode, |
---|
819 | DataSet::DataAttributeType type, |
---|
820 | const char *name, double range[2] = NULL); |
---|
821 | |
---|
822 | // Parallelepipeds |
---|
823 | |
---|
824 | bool addParallelepiped(const DataSetId& id, double vec1[3], double vec2[3], double vec3[3], |
---|
825 | bool flipNormals = false); |
---|
826 | |
---|
827 | // PolyData meshes |
---|
828 | |
---|
829 | void setPolyDataCloudStyle(const DataSetId& id, |
---|
830 | PolyData::CloudStyle style); |
---|
831 | |
---|
832 | void setPolyDataColorMode(const DataSetId& id, |
---|
833 | PolyData::ColorMode mode, |
---|
834 | const char *name, double range[2] = NULL); |
---|
835 | |
---|
836 | void setPolyDataColorMode(const DataSetId& id, |
---|
837 | PolyData::ColorMode mode, |
---|
838 | DataSet::DataAttributeType type, |
---|
839 | const char *name, double range[2] = NULL); |
---|
840 | |
---|
841 | // N-sided Regular Polygons |
---|
842 | |
---|
843 | bool addPolygon(const DataSetId& id, int numSides, double center[3], double normal[3], double radius); |
---|
844 | |
---|
845 | // Color-mapped surfaces |
---|
846 | |
---|
847 | void setPseudoColorCloudStyle(const DataSetId& id, |
---|
848 | PseudoColor::CloudStyle style); |
---|
849 | |
---|
850 | void setPseudoColorColorMode(const DataSetId& id, |
---|
851 | PseudoColor::ColorMode mode, |
---|
852 | const char *name, double range[2] = NULL); |
---|
853 | |
---|
854 | void setPseudoColorColorMode(const DataSetId& id, |
---|
855 | PseudoColor::ColorMode mode, |
---|
856 | DataSet::DataAttributeType type, |
---|
857 | const char *name, double range[2] = NULL); |
---|
858 | |
---|
859 | // Spheres |
---|
860 | |
---|
861 | bool addSphere(const DataSetId& id, double center[3], double radius, bool flipNormals = false); |
---|
862 | |
---|
863 | void setSphereSection(const DataSetId& id, |
---|
864 | double thetaStart, double thetaEnd, |
---|
865 | double phiStart, double phiEnd); |
---|
866 | |
---|
867 | void setSphereResolution(const DataSetId& id, int thetaRes, int phiRes); |
---|
868 | |
---|
869 | // Streamlines |
---|
870 | |
---|
871 | void setStreamlinesColorMode(const DataSetId& id, |
---|
872 | Streamlines::ColorMode mode, |
---|
873 | const char *name, double range[2] = NULL); |
---|
874 | |
---|
875 | void setStreamlinesColorMode(const DataSetId& id, |
---|
876 | Streamlines::ColorMode mode, |
---|
877 | DataSet::DataAttributeType type, |
---|
878 | const char *name, double range[2] = NULL); |
---|
879 | |
---|
880 | void setStreamlinesLength(const DataSetId& id, double length); |
---|
881 | |
---|
882 | void setStreamlinesNumberOfSeedPoints(const DataSetId& id, int numPoints); |
---|
883 | |
---|
884 | void setStreamlinesSeedColor(const DataSetId& id, float color[3]); |
---|
885 | |
---|
886 | void setStreamlinesSeedPointSize(const DataSetId& id, float size); |
---|
887 | |
---|
888 | void setStreamlinesSeedToMeshPoints(const DataSetId& id, |
---|
889 | int maxPoints = 500); |
---|
890 | |
---|
891 | void setStreamlinesSeedToFilledMesh(const DataSetId& id, int numPoints); |
---|
892 | |
---|
893 | bool setStreamlinesSeedToMeshPoints(const DataSetId& id, |
---|
894 | char *data, size_t nbytes, |
---|
895 | int maxPoints = 500); |
---|
896 | |
---|
897 | bool setStreamlinesSeedToFilledMesh(const DataSetId& id, |
---|
898 | char *data, size_t nbytes, |
---|
899 | int numPoints); |
---|
900 | |
---|
901 | void setStreamlinesSeedToRake(const DataSetId& id, |
---|
902 | double start[3], double end[3], |
---|
903 | int numPoints); |
---|
904 | |
---|
905 | void setStreamlinesSeedToDisk(const DataSetId& id, |
---|
906 | double center[3], double normal[3], |
---|
907 | double radius, double innerRadius, |
---|
908 | int numPoints); |
---|
909 | |
---|
910 | void setStreamlinesSeedToPolygon(const DataSetId& id, |
---|
911 | double center[3], double normal[3], |
---|
912 | double angle, double radius, |
---|
913 | int numSides); |
---|
914 | |
---|
915 | void setStreamlinesSeedToFilledPolygon(const DataSetId& id, |
---|
916 | double center[3], double normal[3], |
---|
917 | double angle, double radius, |
---|
918 | int numSides, int numPoints); |
---|
919 | |
---|
920 | void setStreamlinesSeedVisibility(const DataSetId& id, bool state); |
---|
921 | |
---|
922 | void setStreamlinesTerminalSpeed(const DataSetId& id, double speed); |
---|
923 | |
---|
924 | void setStreamlinesTypeToLines(const DataSetId& id); |
---|
925 | |
---|
926 | void setStreamlinesTypeToTubes(const DataSetId& id, int numSides, double radius); |
---|
927 | |
---|
928 | void setStreamlinesTypeToRibbons(const DataSetId& id, double width, double angle); |
---|
929 | |
---|
930 | // Text3Ds |
---|
931 | |
---|
932 | bool addText3D(const DataSetId& id, const char *string, |
---|
933 | const char *fontFamily, int fontSize, |
---|
934 | bool bold = false, bool italic = false, bool shadow = false); |
---|
935 | |
---|
936 | void setText3DBold(const DataSetId& id, bool state); |
---|
937 | |
---|
938 | void setText3DFollowCamera(const DataSetId& id, bool state); |
---|
939 | |
---|
940 | void setText3DFont(const DataSetId& id, const char *fontFamily); |
---|
941 | |
---|
942 | void setText3DFontSize(const DataSetId& id, int size); |
---|
943 | |
---|
944 | void setText3DItalic(const DataSetId& id, bool state); |
---|
945 | |
---|
946 | void setText3DShadow(const DataSetId& id, bool state); |
---|
947 | |
---|
948 | void setText3DText(const DataSetId& id, const char *text); |
---|
949 | |
---|
950 | // Volumes |
---|
951 | |
---|
952 | void setVolumeBlendMode(const DataSetId& id, Volume::BlendMode mode); |
---|
953 | |
---|
954 | void setVolumeSampleDistance(const DataSetId& id, double distance); |
---|
955 | |
---|
956 | // Warps |
---|
957 | |
---|
958 | void setWarpCloudStyle(const DataSetId& id, |
---|
959 | Warp::CloudStyle style); |
---|
960 | |
---|
961 | void setWarpColorMode(const DataSetId& id, |
---|
962 | Warp::ColorMode mode, |
---|
963 | const char *name, double range[2] = NULL); |
---|
964 | |
---|
965 | void setWarpColorMode(const DataSetId& id, |
---|
966 | Warp::ColorMode mode, |
---|
967 | DataSet::DataAttributeType type, |
---|
968 | const char *name, double range[2] = NULL); |
---|
969 | |
---|
970 | |
---|
971 | void setWarpWarpScale(const DataSetId& id, double scale); |
---|
972 | |
---|
973 | private: |
---|
974 | typedef std::tr1::unordered_map<DataSetId, DataSet *> DataSetHashmap; |
---|
975 | typedef std::tr1::unordered_map<FieldId, double *> FieldRangeHashmap; |
---|
976 | typedef std::tr1::unordered_map<ColorMapId, ColorMap *> ColorMapHashmap; |
---|
977 | |
---|
978 | typedef std::tr1::unordered_map<DataSetId, Arc *> ArcHashmap; |
---|
979 | typedef std::tr1::unordered_map<DataSetId, Arrow *> ArrowHashmap; |
---|
980 | typedef std::tr1::unordered_map<DataSetId, Box *> BoxHashmap; |
---|
981 | typedef std::tr1::unordered_map<DataSetId, Cone *> ConeHashmap; |
---|
982 | typedef std::tr1::unordered_map<DataSetId, Contour2D *> Contour2DHashmap; |
---|
983 | typedef std::tr1::unordered_map<DataSetId, Contour3D *> Contour3DHashmap; |
---|
984 | typedef std::tr1::unordered_map<DataSetId, Cutplane *> CutplaneHashmap; |
---|
985 | typedef std::tr1::unordered_map<DataSetId, Cylinder *> CylinderHashmap; |
---|
986 | typedef std::tr1::unordered_map<DataSetId, Disk *> DiskHashmap; |
---|
987 | typedef std::tr1::unordered_map<DataSetId, Glyphs *> GlyphsHashmap; |
---|
988 | typedef std::tr1::unordered_map<DataSetId, Group *> GroupHashmap; |
---|
989 | typedef std::tr1::unordered_map<DataSetId, HeightMap *> HeightMapHashmap; |
---|
990 | typedef std::tr1::unordered_map<DataSetId, Image *> ImageHashmap; |
---|
991 | typedef std::tr1::unordered_map<DataSetId, LIC *> LICHashmap; |
---|
992 | typedef std::tr1::unordered_map<DataSetId, Line *> LineHashmap; |
---|
993 | typedef std::tr1::unordered_map<DataSetId, Molecule *> MoleculeHashmap; |
---|
994 | typedef std::tr1::unordered_map<DataSetId, Outline *> OutlineHashmap; |
---|
995 | typedef std::tr1::unordered_map<DataSetId, Parallelepiped *> ParallelepipedHashmap; |
---|
996 | typedef std::tr1::unordered_map<DataSetId, PolyData *> PolyDataHashmap; |
---|
997 | typedef std::tr1::unordered_map<DataSetId, Polygon *> PolygonHashmap; |
---|
998 | typedef std::tr1::unordered_map<DataSetId, PseudoColor *> PseudoColorHashmap; |
---|
999 | typedef std::tr1::unordered_map<DataSetId, Sphere *> SphereHashmap; |
---|
1000 | typedef std::tr1::unordered_map<DataSetId, Streamlines *> StreamlinesHashmap; |
---|
1001 | typedef std::tr1::unordered_map<DataSetId, Text3D *> Text3DHashmap; |
---|
1002 | typedef std::tr1::unordered_map<DataSetId, Volume *> VolumeHashmap; |
---|
1003 | typedef std::tr1::unordered_map<DataSetId, Warp *> WarpHashmap; |
---|
1004 | |
---|
1005 | void _setCameraZoomRegionPixels(int x, int y, int width, int height); |
---|
1006 | |
---|
1007 | void _setCameraZoomRegion(double x, double y, double width, double height); |
---|
1008 | |
---|
1009 | //static void printCameraInfo(vtkCamera *camera); |
---|
1010 | |
---|
1011 | static void setCameraFromMatrix(vtkCamera *camera, vtkMatrix4x4 &mat); |
---|
1012 | |
---|
1013 | static void mergeBounds(double *boundsDest, const double *bounds1, const double *bounds2); |
---|
1014 | |
---|
1015 | template<class T> |
---|
1016 | std::tr1::unordered_map<DataSetId, T *>& getGraphicsObjectHashmap(); |
---|
1017 | |
---|
1018 | void setObjectAspects(double aspectRatio); |
---|
1019 | |
---|
1020 | void collectBounds(double *bounds, bool onlyVisible); |
---|
1021 | |
---|
1022 | void collectUnscaledBounds(double *bounds, bool onlyVisible); |
---|
1023 | |
---|
1024 | void collectDataRanges(); |
---|
1025 | |
---|
1026 | void collectDataRanges(double *range, const char *name, |
---|
1027 | DataSet::DataAttributeType type, |
---|
1028 | int component, bool onlyVisible); |
---|
1029 | |
---|
1030 | void clearFieldRanges(); |
---|
1031 | |
---|
1032 | void clearUserFieldRanges(); |
---|
1033 | |
---|
1034 | void initFieldRanges(); |
---|
1035 | |
---|
1036 | void updateFieldRanges(); |
---|
1037 | |
---|
1038 | void updateColorMap(ColorMap *cmap); |
---|
1039 | |
---|
1040 | bool colorMapUsed(ColorMap *cmap); |
---|
1041 | |
---|
1042 | void computeDisplayToWorld(double x, double y, double z, double worldPt[4]); |
---|
1043 | |
---|
1044 | void computeWorldToDisplay(double x, double y, double z, double displayPt[3]); |
---|
1045 | |
---|
1046 | void computeScreenWorldCoords(); |
---|
1047 | |
---|
1048 | bool is2D(const double bounds[6], |
---|
1049 | PrincipalPlane *plane, |
---|
1050 | double *offset) const; |
---|
1051 | |
---|
1052 | void initCamera(bool initCameraMode = false); |
---|
1053 | |
---|
1054 | void sceneBoundsChanged(); |
---|
1055 | |
---|
1056 | void initOrientationMarkers(); |
---|
1057 | |
---|
1058 | void initAxes(); |
---|
1059 | |
---|
1060 | void resetAxes(double bounds[6] = NULL); |
---|
1061 | |
---|
1062 | void setAxesBounds(double bounds[6] = NULL); |
---|
1063 | |
---|
1064 | void setAxesRanges(); |
---|
1065 | |
---|
1066 | void computeAxesScale(); |
---|
1067 | |
---|
1068 | void setCameraClippingPlanes(); |
---|
1069 | |
---|
1070 | bool _needsRedraw; |
---|
1071 | bool _needsAxesReset; |
---|
1072 | bool _needsCameraClippingRangeReset; |
---|
1073 | bool _needsCameraReset; |
---|
1074 | |
---|
1075 | int _windowWidth, _windowHeight; |
---|
1076 | CameraMode _cameraMode; |
---|
1077 | Aspect _cameraAspect; |
---|
1078 | double _imgWorldOrigin[2]; |
---|
1079 | double _imgWorldDims[2]; |
---|
1080 | double _imgWindowWorldDims[2]; |
---|
1081 | double _userImgWorldOrigin[2]; |
---|
1082 | double _userImgWorldDims[2]; |
---|
1083 | PrincipalPlane _imgCameraPlane; |
---|
1084 | double _imgCameraOffset; |
---|
1085 | double _screenWorldCoords[4]; |
---|
1086 | double _cameraOrientation[4]; |
---|
1087 | double _cameraZoomRatio; |
---|
1088 | double _cameraPan[2]; |
---|
1089 | float _bgColor[3]; |
---|
1090 | bool _useCumulativeRange; |
---|
1091 | bool _cumulativeRangeOnlyVisible; |
---|
1092 | |
---|
1093 | FieldRangeHashmap _scalarPointDataRange; |
---|
1094 | FieldRangeHashmap _vectorPointDataRange; |
---|
1095 | FieldRangeHashmap _vectorCompPointDataRange[3]; |
---|
1096 | FieldRangeHashmap _scalarCellDataRange; |
---|
1097 | FieldRangeHashmap _vectorCellDataRange; |
---|
1098 | FieldRangeHashmap _vectorCompCellDataRange[3]; |
---|
1099 | FieldRangeHashmap _scalarFieldDataRange; |
---|
1100 | FieldRangeHashmap _vectorFieldDataRange; |
---|
1101 | FieldRangeHashmap _vectorCompFieldDataRange[3]; |
---|
1102 | |
---|
1103 | FieldRangeHashmap _userScalarPointDataRange; |
---|
1104 | FieldRangeHashmap _userVectorPointDataRange; |
---|
1105 | FieldRangeHashmap _userVectorCompPointDataRange[3]; |
---|
1106 | FieldRangeHashmap _userScalarCellDataRange; |
---|
1107 | FieldRangeHashmap _userVectorCellDataRange; |
---|
1108 | FieldRangeHashmap _userVectorCompCellDataRange[3]; |
---|
1109 | FieldRangeHashmap _userScalarFieldDataRange; |
---|
1110 | FieldRangeHashmap _userVectorFieldDataRange; |
---|
1111 | FieldRangeHashmap _userVectorCompFieldDataRange[3]; |
---|
1112 | |
---|
1113 | bool _axesAutoBounds[3]; |
---|
1114 | double _axesUserBounds[6]; |
---|
1115 | AxisRangeMode _axesRangeMode[3]; |
---|
1116 | double _axesScale[3]; |
---|
1117 | |
---|
1118 | ColorMapHashmap _colorMaps; |
---|
1119 | DataSetHashmap _dataSets; |
---|
1120 | ArcHashmap _arcs; |
---|
1121 | ArrowHashmap _arrows; |
---|
1122 | BoxHashmap _boxes; |
---|
1123 | ConeHashmap _cones; |
---|
1124 | Contour2DHashmap _contour2Ds; |
---|
1125 | Contour3DHashmap _contour3Ds; |
---|
1126 | CutplaneHashmap _cutplanes; |
---|
1127 | CylinderHashmap _cylinders; |
---|
1128 | DiskHashmap _disks; |
---|
1129 | GlyphsHashmap _glyphs; |
---|
1130 | GroupHashmap _groups; |
---|
1131 | HeightMapHashmap _heightMaps; |
---|
1132 | ImageHashmap _images; |
---|
1133 | LICHashmap _lics; |
---|
1134 | LineHashmap _lines; |
---|
1135 | MoleculeHashmap _molecules; |
---|
1136 | OutlineHashmap _outlines; |
---|
1137 | ParallelepipedHashmap _parallelepipeds; |
---|
1138 | PolyDataHashmap _polyDatas; |
---|
1139 | PolygonHashmap _polygons; |
---|
1140 | PseudoColorHashmap _pseudoColors; |
---|
1141 | SphereHashmap _spheres; |
---|
1142 | StreamlinesHashmap _streamlines; |
---|
1143 | Text3DHashmap _text3Ds; |
---|
1144 | VolumeHashmap _volumes; |
---|
1145 | WarpHashmap _warps; |
---|
1146 | |
---|
1147 | vtkSmartPointer<vtkPlane> _cameraClipPlanes[4]; |
---|
1148 | vtkSmartPointer<vtkPlane> _userClipPlanes[6]; |
---|
1149 | vtkSmartPointer<vtkPlaneCollection> _activeClipPlanes; |
---|
1150 | #ifdef USE_CUSTOM_AXES |
---|
1151 | vtkSmartPointer<vtkRpCubeAxesActor> _cubeAxesActor; |
---|
1152 | #else |
---|
1153 | vtkSmartPointer<vtkCubeAxesActor> _cubeAxesActor; |
---|
1154 | #endif |
---|
1155 | vtkSmartPointer<vtkAxesActor> _axesActor; |
---|
1156 | vtkSmartPointer<vtkAnnotatedCubeActor> _annotatedCubeActor; |
---|
1157 | vtkSmartPointer<vtkScalarBarActor> _scalarBarActor; |
---|
1158 | vtkSmartPointer<vtkRenderer> _renderer; |
---|
1159 | vtkSmartPointer<vtkRenderer> _legendRenderer; |
---|
1160 | vtkSmartPointer<vtkRenderWindow> _renderWindow; |
---|
1161 | vtkSmartPointer<vtkRenderWindow> _legendRenderWindow; |
---|
1162 | }; |
---|
1163 | |
---|
1164 | } |
---|
1165 | |
---|
1166 | #endif |
---|