Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Scene.h

Go to the documentation of this file.
00001 
00002 /*
00003     TEDDY - General graphics application library
00004     Copyright (C) 1999-2002  Timo Suoranta
00005     tksuoran@cc.helsinki.fi
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2.1 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020     
00021     $Id: Scene.h,v 1.6 2002/01/17 18:57:38 tksuoran Exp $
00022 */
00023 
00024 
00025 #ifndef TEDDY__SCENES__SCENE__H
00026 #define TEDDY__SCENES__SCENE__H
00027 
00028 
00029 #include "Teddy/Graphics/Color.h"
00030 #include "Teddy/Materials/Light.h"
00031 #include "Teddy/Maths/Vector.h"
00032 #include "Teddy/MixIn/Named.h"
00033 #include "Teddy/MixIn/Mutex.h"
00034 #include "Teddy/SysSupport/StdList.h"
00035 
00036 
00037 namespace Teddy  {
00038 namespace Scenes {
00039 
00040 
00041 class Camera;
00042 class PostElement;
00043 
00044 
00069 class Scene : public Teddy::MixIn::Named, public Teddy::MixIn::Mutex {
00070 public:
00071     Scene( const std::string &name );
00072     
00073     void   add         ( Teddy::Materials::Light       *l );
00074     void   add         ( Teddy::Scenes   ::PostElement *p );
00075     void   add         ( Teddy::Models   ::Model       *i );
00076     void   remove      ( Teddy::Materials::Light       *l );
00077     void   remove      ( Teddy::Scenes   ::PostElement *p );
00078     void   remove      ( Teddy::Models   ::Model       *i );
00079 
00080     void   setAmbientColor( Teddy::Graphics::Color ambient_color );
00081 
00082     int    getCullCount    ();
00083     int    getDrawCount    ();
00084     float  getMaxObSize    ();
00085     float  getMaxObDistance();
00086 
00087     void                         draw            ( Camera *c, Teddy::PhysicalComponents::Projection *p );
00088     void                         drawPostElements( Camera *c, Teddy::PhysicalComponents::Projection *p );
00089     Teddy::Models::Model        *pick            ( Camera *c, Teddy::PhysicalComponents::Projection *p );
00090     void                         update          ( Teddy::PhysicalComponents::Projection    *p );
00091     list<Teddy::Models::Model*> &getModels       ();
00092 
00093 protected:
00094     list<Teddy::Materials::Light      *>  lights;
00095     list<Teddy::Models   ::Model      *>  models;
00096     list<Teddy::Scenes   ::PostElement*>  post_elements;
00097     Teddy::Graphics::Color                ambient_color;
00098     int                                   cull_count;
00099     int                                   draw_count;
00100     int                                   last_draw_count;
00101 };
00102 
00103 
00104 };  //  namespace Scenes
00105 };  //  namespace Teddy
00106 
00107 
00108 #endif  //  TEDDY__SCENES__SCENE__H
00109