Track.h

Go to the documentation of this file.
00001 
00005 /* Copyright © 2009 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 #ifndef LIBTRACK_TRACK_H_
00012 #define LIBTRACK_TRACK_H_
00013 
00014 #include <istream>
00015 #include <vector>
00016 #include <boost/shared_ptr.hpp>
00017 
00018 #include "Theme.h"
00019 #include "path/Path.h"
00020 #include "Lighting.h"
00021 
00022 #include <BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h>
00023 
00027 namespace Track
00028 {
00029     
00034 class Track
00035 {
00036     friend std::ostream & operator<<(std::ostream & destination, const Track & track);
00037 public:
00047     Track(std::istream & stream, const Theme & theme, bool editor = false);
00048     
00050     Track(const Theme & theme, bool editor = false);
00051     
00052     virtual ~Track();
00053     
00055     const Path & get_path() const;
00056     
00058     Path & get_path();
00059     
00060     const Theme & get_theme() const;
00061     
00063     boost::shared_ptr<btCollisionShape> get_collision_shape() const;
00064     
00066     boost::shared_ptr<btCollisionShape> get_floor_shape() const;
00067     
00077     const MeshFaces & get_ai_mesh() const;
00078     
00082     const MeshFaces::Graph & get_ai_graph() const;
00083     
00087     void update_ai_mesh();
00088     
00093     btScalar get_lap_length() const;
00094     
00096     void set_filename(std::string filename);
00098     std::string get_filename() const;
00099     
00100     const Lighting & get_lighting() const;
00101     void set_lighting(const Lighting & lighting);
00102 protected:
00104     const unsigned int file_version;
00105     
00107     const Theme & theme;
00108     
00110     Path path;
00111     
00113     bool editor;
00114     
00118     void scan_theme();
00119     
00125     void scan_ai_graph();
00126     
00127     std::string filename;
00128     
00130     MeshFaces m_ai_mesh;
00132     MeshFaces::Graph m_ai_graph;
00134     btScalar m_lap_length;
00136     Lighting m_lighting;
00137 };
00138 
00148 std::ostream & operator<<(std::ostream & destination, const Track & track);
00149 
00150 }
00151 
00152 #endif /* LIBTRACK_TRACK_H_ */ 

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:12 2010 by Doxygen version 1.4.7 for Racer version svn335.