Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pgraph/camera.h

Go to the documentation of this file.
00001 // Filename: camera.h
00002 // Created by:  drose (26Feb02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef CAMERA_H
00020 #define CAMERA_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "lensNode.h"
00025 #include "nodePath.h"
00026 #include "drawMask.h"
00027 
00028 class DisplayRegion;
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : Camera
00032 // Description : A node that can be positioned around in the scene
00033 //               graph to represent a point of view for rendering a
00034 //               scene.
00035 ////////////////////////////////////////////////////////////////////
00036 class EXPCL_PANDA Camera : public LensNode {
00037 PUBLISHED:
00038   Camera(const string &name);
00039 
00040 protected:
00041   Camera(const Camera &copy);
00042 public:
00043   virtual ~Camera();
00044 
00045   virtual PandaNode *make_copy() const;
00046   virtual bool safe_to_flatten() const;
00047   virtual bool safe_to_transform() const;
00048 
00049 PUBLISHED:
00050   INLINE void set_active(bool active);
00051   INLINE bool is_active() const;
00052 
00053   INLINE void set_scene(const NodePath &scene);
00054   INLINE const NodePath &get_scene() const;
00055 
00056   INLINE int get_num_display_regions() const;
00057   INLINE DisplayRegion *get_display_region(int n) const;
00058 
00059   INLINE void set_camera_mask(DrawMask mask);
00060   INLINE DrawMask get_camera_mask() const;
00061 
00062 private:
00063   void add_display_region(DisplayRegion *display_region);
00064   void remove_display_region(DisplayRegion *display_region);
00065 
00066   bool _active;
00067   NodePath _scene;
00068 
00069   DrawMask _camera_mask;
00070 
00071   typedef pvector<DisplayRegion *> DisplayRegions;
00072   DisplayRegions _display_regions;
00073 
00074 public:
00075   static void register_with_read_factory();
00076   virtual void write_datagram(BamWriter *manager, Datagram &dg);
00077 
00078 protected:
00079   static TypedWritable *make_from_bam(const FactoryParams &params);
00080   void fillin(DatagramIterator &scan, BamReader *manager);
00081 
00082 public:
00083   static TypeHandle get_class_type() {
00084     return _type_handle;
00085   }
00086   static void init_type() {
00087     LensNode::init_type();
00088     register_type(_type_handle, "Camera",
00089                   LensNode::get_class_type());
00090   }
00091   virtual TypeHandle get_type() const {
00092     return get_class_type();
00093   }
00094   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00095 
00096 private:
00097   static TypeHandle _type_handle;
00098 
00099   friend class DisplayRegion;
00100 };
00101 
00102 #include "camera.I"
00103 
00104 #endif

Generated on Fri May 2 00:41:08 2003 for Panda by doxygen1.3