Panda3D
stereoDisplayRegion.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file stereoDisplayRegion.h
10  * @author drose
11  * @date 2009-02-19
12  */
13 
14 #ifndef STEREODISPLAYREGION_H
15 #define STEREODISPLAYREGION_H
16 
17 #include "pandabase.h"
18 
19 #include "displayRegion.h"
20 
21 /**
22  * This is a special DisplayRegion wrapper that actually includes a pair of
23  * DisplayRegions internally: the left and right eyes. The DisplayRegion
24  * represented here does not have a physical association with the window, but
25  * it pretends it does. Instead, it maintains a pointer to the left and right
26  * DisplayRegions separately.
27  *
28  * Operations on the StereoDisplayRegion object affect both left and right
29  * eyes together. To access the left or right eyes independently, use
30  * get_left_eye() and get_right_eye().
31  */
32 class EXPCL_PANDA_DISPLAY StereoDisplayRegion : public DisplayRegion {
33 protected:
35  const LVecBase4 &dimensions,
36  DisplayRegion *left, DisplayRegion *right);
37 
38 public:
39  virtual ~StereoDisplayRegion();
40 
41 PUBLISHED:
42  // Inherited from DrawableRegion
43  virtual void set_clear_active(int n, bool clear_aux_active);
44  virtual void set_clear_value(int n, const LColor &clear_value);
45  virtual void disable_clears();
46  virtual void set_pixel_zoom(PN_stdfloat pixel_zoom);
47 
48  // Inherited from DisplayRegion
49  virtual void set_dimensions(int i, const LVecBase4 &dimensions);
50  virtual bool is_stereo() const;
51  virtual void set_camera(const NodePath &camera);
52  virtual void set_active(bool active);
53  virtual void set_sort(int sort);
54  virtual void set_stereo_channel(Lens::StereoChannel stereo_channel);
55  virtual void set_tex_view_offset(int tex_view_offset);
56  virtual void set_incomplete_render(bool incomplete_render);
57  virtual void set_texture_reload_priority(int texture_reload_priority);
58  virtual void set_cull_traverser(CullTraverser *trav);
59  virtual void set_target_tex_page(int page);
60 
61  virtual void output(std::ostream &out) const;
62  virtual PT(PandaNode) make_cull_result_graph();
63 
64  INLINE DisplayRegion *get_left_eye();
65  INLINE DisplayRegion *get_right_eye();
66  MAKE_PROPERTY(left_eye, get_left_eye);
67  MAKE_PROPERTY(right_eye, get_right_eye);
68 
69 private:
70  PT(DisplayRegion) _left_eye;
71  PT(DisplayRegion) _right_eye;
72 
73 public:
74  static TypeHandle get_class_type() {
75  return _type_handle;
76  }
77  static void init_type() {
78  DisplayRegion::init_type();
79  register_type(_type_handle, "StereoDisplayRegion",
80  DisplayRegion::get_class_type());
81  }
82  virtual TypeHandle get_type() const {
83  return get_class_type();
84  }
85  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
86 
87 private:
88  static TypeHandle _type_handle;
89 
90  friend class GraphicsOutput;
91  friend class DisplayRegionPipelineReader;
92 };
93 
94 #include "stereoDisplayRegion.I"
95 
96 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
Encapsulates the data from a DisplayRegion, pre-fetched for one stage of the pipeline.
set_cull_traverser
Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion.
virtual void set_clear_active(int n, bool clear_aux_active)
Sets the clear-active flag for any bitplane.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void set_clear_value(int n, const LColor &clear_value)
Sets the clear value for any bitplane.
set_stereo_channel
Specifies whether the DisplayRegion represents the left or right channel of a stereo pair,...
set_incomplete_render
Sets the incomplete_render flag.
set_tex_view_offset
Sets the current texture view offset for this DisplayRegion.
virtual void disable_clears()
Disables both the color and depth clear.
set_texture_reload_priority
Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned w...
This is a base class for the various different classes that represent the result of a frame of render...
This is a special DisplayRegion wrapper that actually includes a pair of DisplayRegions internally: t...
set_target_tex_page
This is a special parameter that is only used when rendering the faces of a cube map or multipage and...
set_camera
Sets the camera that is associated with this DisplayRegion.
Definition: displayRegion.h:94
set_pixel_zoom
Sets the amount by which the pixels of the region are scaled internally when filling the image intera...
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:57
set_active
Sets the active flag associated with the DisplayRegion.
Definition: displayRegion.h:98
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
set_dimensions
Changes the portion of the framebuffer this DisplayRegion corresponds to.
Definition: displayRegion.h:83
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161
set_sort
Sets the sort value associated with the DisplayRegion.
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
Definition: cullTraverser.h:45