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