H3D API  2.4.1
OrthoViewpoint.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __ORTHOVIEWPOINT_H__
30 #define __ORTHOVIEWPOINT_H__
31 
32 #include <H3D/X3DViewpointNode.h>
33 #include <H3D/FieldTemplates.h>
34 #include <H3D/MFFloat.h>
35 #include <H3DUtil/Exception.h>
36 
37 namespace H3D {
68  class H3DAPI_API OrthoViewpoint : public X3DViewpointNode {
69  public:
72  Inst< SFSetBind > _set_bind = 0,
73  Inst< SFVec3f > _centerOfRotation = 0,
74  Inst< SFString > _description = 0,
75  Inst< MFFloat > _fieldOfView = 0,
76  Inst< SFBool > _jump = 0,
77  Inst< SFNode > _metadata = 0,
78  Inst< SFOrientation> _orientation = 0,
79  Inst< SFPosition > _position = 0,
80  Inst< SFBool > _retainUserOffsets = 0,
81  Inst< SFTime > _bindTime = 0,
82  Inst< SFBool > _isBound = 0,
83  Inst< SFMatrix4f > _accForwardMatrix = 0,
84  Inst< SFMatrix4f > _accInverseMatrix = 0,
85  Inst< SFBool > _retainAspectRatio = 0 );
86 
87 
88  // calculate the horizontal and vertical field of view components
89  // as defined by the X3D spec for OrthoViewpoint.
90  virtual bool windowFromfieldOfView( H3DFloat width, H3DFloat height,
91  H3DFloat clip_near,
92  H3DFloat &top, H3DFloat &bottom,
93  H3DFloat &right, H3DFloat &left );
94 
98  virtual void setupProjection( EyeMode eye_mode,
99  H3DFloat width, H3DFloat height,
100  H3DFloat clip_near, H3DFloat clip_far,
101  StereoInfo * stereo_info = 0,
102  bool update_stereo_proj_shift = false );
103 
111  H3DUniquePtr< MFFloat > fieldOfView;
112 
122  H3DUniquePtr< SFBool > retainAspectRatio;
123 
124  static H3DNodeDatabase database;
125  };
126 }
127 
128 #endif
Contains different templates to modify field behaviour.
Contains the MFFloat field class.
Header file for X3DViewpointNode, X3D scene-graph node.
The OrthoViewpoint node defines a viewpoint that provides an orthographic view of the scene.
Definition: OrthoViewpoint.h:68
H3DUniquePtr< SFBool > retainAspectRatio
The retainAspectRatio field determines if the view should retain the same aspect ratio as the current...
Definition: OrthoViewpoint.h:122
H3DUniquePtr< MFFloat > fieldOfView
The fieldOfView field specifies minimum and maximum extents of the view in units of the local coordin...
Definition: OrthoViewpoint.h:111
The StereoInfo nis a bindable node that contains information used when rendering the scene in stereo.
Definition: StereoInfo.h:51
The X3DViewpointNode node defines a specific location in the local coordinate system from which the u...
Definition: X3DViewpointNode.h:239
EyeMode
Used with setupProjection function to indicate for which eye the frustum should be calculated.
Definition: X3DViewpointNode.h:244
float H3DFloat
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194