GteViewVolumeNode.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
10 #include <Graphics/GteViewVolume.h>
11 #include <Graphics/GteNode.h>
12 #include <functional>
13 
14 namespace gte
15 {
16 
18 {
19 public:
20  // Construction. The node's world translation is used as the view volume's
21  // location. The node's world rotation matrix is used for the view volume's
22  // coordinate axes. Column 0 of the world rotation matrix is the view volume's
23  // direction vector, column 1 of the world rotation matrix is the view volume's
24  // up vector, and column 2 of the world rotation matrix is the view volume's
25  // right vector.
26  //
27  // On construction, the node's local transformation is set to the view volume's
28  // coordinate system.
29  // local translation = view volume location
30  // local rotation column 0 = view volume direction
31  // local rotation column 1 = view volume up
32  // local rotation column 2 = view volume right
33  ViewVolumeNode(std::shared_ptr<ViewVolume> const& viewVolume = nullptr);
34 
35  // When you set the view volume, the node's local transformation is set to the
36  // view volumes's current current coordinate system. The node's world
37  // transformation is computed, and the view volume's coordinate system is set
38  // to use the node's world transformation.
39  void SetViewVolume(std::shared_ptr<ViewVolume> const& viewVolume);
40  inline std::shared_ptr<ViewVolume> const& GetViewVolume() const;
41 
42  // Additional semantics may be applied after UpdateWorldData updates the
43  // view volume.
44  inline void SetOnUpdate(std::function<void(ViewVolumeNode*)> const& onUpdate);
45  inline std::function<void(ViewVolumeNode*)> const& GetOnUpdate() const;
46 
47 protected:
48  // Geometric updates.
49  virtual void UpdateWorldData(double applicationTime);
50 
51  std::shared_ptr<ViewVolume> mViewVolume;
52  std::function<void(ViewVolumeNode*)> mOnUpdate;
53 };
54 
55 inline std::shared_ptr<ViewVolume> const& ViewVolumeNode::GetViewVolume() const
56 {
57  return mViewVolume;
58 }
59 
60 inline void ViewVolumeNode::SetOnUpdate(std::function<void(ViewVolumeNode*)> const& onUpdate)
61 {
62  mOnUpdate = onUpdate;
63 }
64 
65 inline std::function<void(ViewVolumeNode*)> const& ViewVolumeNode::GetOnUpdate() const
66 {
67  return mOnUpdate;
68 }
69 
70 }
std::function< void(ViewVolumeNode *)> const & GetOnUpdate() const
void SetOnUpdate(std::function< void(ViewVolumeNode *)> const &onUpdate)
std::shared_ptr< ViewVolume > mViewVolume
std::function< void(ViewVolumeNode *)> mOnUpdate
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63
std::shared_ptr< ViewVolume > const & GetViewVolume() const


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:02