File: vtkVRRenderer.h

package info (click to toggle)
paraview 5.11.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 497,236 kB
  • sloc: cpp: 3,171,290; ansic: 1,315,072; python: 134,290; xml: 103,324; sql: 65,887; sh: 5,286; javascript: 4,901; yacc: 4,383; java: 3,977; perl: 2,363; lex: 1,909; f90: 1,255; objc: 143; makefile: 119; tcl: 59; pascal: 50; fortran: 29
file content (100 lines) | stat: -rw-r--r-- 2,853 bytes parent folder | download
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
/*=========================================================================

Program:   Visualization Toolkit
Module:    vtkVRRenderer.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.

=========================================================================*/
/**
 * @class   vtkVRRenderer
 * @brief   VR renderer
 *
 * vtkVRRenderer is an abstract vtkRenderer class that is meant to be used in VR context.
 * It defines a floor actor with a grid fading with the distance.
 *
 * Subclasses must define MakeCamera()
 */

#ifndef vtkVRRenderer_h
#define vtkVRRenderer_h

#include "vtkNew.h" // for ivar
#include "vtkOpenGLRenderer.h"
#include "vtkRenderingVRModule.h" // For export macro

VTK_ABI_NAMESPACE_BEGIN
class vtkActor;

class VTKRENDERINGVR_EXPORT vtkVRRenderer : public vtkOpenGLRenderer
{
public:
  vtkTypeMacro(vtkVRRenderer, vtkOpenGLRenderer);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  using vtkRenderer::ResetCamera;

  /**
   * Automatically set up the camera based on a specified bounding box
   * (xmin,xmax, ymin,ymax, zmin,zmax). Camera will reposition itself so
   * that its focal point is the center of the bounding box, and adjust its
   * distance and position to preserve its initial view plane normal
   * (i.e., vector defined from camera position to focal point). Note: if
   * the view plane is parallel to the view up axis, the view up axis will
   * be reset to one of the three coordinate axes.
   */
  void ResetCamera(const double bounds[6]) override;

  using vtkRenderer::ResetCameraClippingRange;

  ///@{
  /**
   * Reset the camera clipping range based on a bounding box.
   */
  void ResetCameraClippingRange() override;
  void ResetCameraClippingRange(const double bounds[6]) override;
  ///@}

  /**
   * Abstract function that creates a new Camera suitable for use with this type of Renderer.
   */
  VTK_NEWINSTANCE vtkCamera* MakeCamera() override = 0;

  /**
   * Store in \p transform the floor transform.
   */
  virtual void GetFloorTransform(vtkTransform* transform);

  /**
   * Render the floor using GetFloorTransform
   */
  void DeviceRender() override;

  ///@{
  /**
   * Show the floor of the VR world
   */
  virtual void SetShowFloor(bool);
  virtual bool GetShowFloor() { return this->ShowFloor; }
  ///@}

protected:
  vtkVRRenderer();
  ~vtkVRRenderer() override = default;

  vtkNew<vtkActor> FloorActor;
  bool ShowFloor = false;

private:
  vtkVRRenderer(const vtkVRRenderer&) = delete;
  void operator=(const vtkVRRenderer&) = delete;
};

VTK_ABI_NAMESPACE_END
#endif