Panda3D
 All Classes Functions Variables Enumerations
stereoDisplayRegion.h
00001 // Filename: stereoDisplayRegion.h
00002 // Created by:  drose (19Feb09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef STEREODISPLAYREGION_H
00016 #define STEREODISPLAYREGION_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "displayRegion.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : StereoDisplayRegion
00024 // Description : This is a special DisplayRegion wrapper that actually
00025 //               includes a pair of DisplayRegions internally: the
00026 //               left and right eyes.  The DisplayRegion represented
00027 //               here does not have a physical association with the
00028 //               window, but it pretends it does.  Instead, it
00029 //               maintains a pointer to the left and right
00030 //               DisplayRegions separately.
00031 //
00032 //               Operations on the StereoDisplayRegion object affect
00033 //               both left and right eyes together.  To access the
00034 //               left or right eyes independently, use get_left_eye()
00035 //               and get_right_eye().
00036 ////////////////////////////////////////////////////////////////////
00037 class EXPCL_PANDA_DISPLAY StereoDisplayRegion : public DisplayRegion {
00038 protected:
00039   StereoDisplayRegion(GraphicsOutput *window,
00040                       const LVecBase4 &dimensions,
00041                       DisplayRegion *left, DisplayRegion *right);
00042 
00043 public:
00044   virtual ~StereoDisplayRegion();
00045 
00046 PUBLISHED:
00047   // Inherited from DrawableRegion
00048   virtual void set_clear_active(int n, bool clear_aux_active);
00049   virtual void set_clear_value(int n, const LColor &clear_value);
00050   virtual void disable_clears();
00051   virtual void set_pixel_zoom(PN_stdfloat pixel_zoom);
00052 
00053   // Inherited from DisplayRegion
00054   virtual void set_dimensions(const LVecBase4 &dimensions);
00055   virtual bool is_stereo() const;
00056   virtual void set_camera(const NodePath &camera);
00057   virtual void set_active(bool active);
00058   virtual void set_sort(int sort);
00059   virtual void set_stereo_channel(Lens::StereoChannel stereo_channel);
00060   virtual void set_tex_view_offset(int tex_view_offset);
00061   virtual void set_incomplete_render(bool incomplete_render);
00062   virtual void set_texture_reload_priority(int texture_reload_priority);
00063   virtual void set_cull_traverser(CullTraverser *trav);
00064   virtual void set_cube_map_index(int cube_map_index);
00065 
00066   virtual void output(ostream &out) const;
00067   virtual PT(PandaNode) make_cull_result_graph();
00068 
00069   INLINE DisplayRegion *get_left_eye();
00070   INLINE DisplayRegion *get_right_eye();
00071 
00072 private:
00073   PT(DisplayRegion) _left_eye;
00074   PT(DisplayRegion) _right_eye;
00075 
00076 public:
00077   static TypeHandle get_class_type() {
00078     return _type_handle;
00079   }
00080   static void init_type() {
00081     DisplayRegion::init_type();
00082     register_type(_type_handle, "StereoDisplayRegion",
00083                   DisplayRegion::get_class_type());
00084   }
00085   virtual TypeHandle get_type() const {
00086     return get_class_type();
00087   }
00088   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00089 
00090 private:
00091   static TypeHandle _type_handle;
00092 
00093   friend class GraphicsOutput;
00094   friend class DisplayRegionPipelineReader;
00095 };
00096 
00097 #include "stereoDisplayRegion.I"
00098 
00099 #endif
 All Classes Functions Variables Enumerations