00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2008 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef opengl_C3DSScene_H 00029 #define opengl_C3DSScene_H 00030 00031 #include <mrpt/opengl/CRenderizable.h> 00032 #include <mrpt/opengl/COpenGLScene.h> 00033 #include <mrpt/utils/CMemoryChunk.h> 00034 00035 namespace mrpt 00036 { 00037 namespace opengl 00038 { 00039 class MRPTDLLIMPEXP C3DSScene; 00040 00041 // This must be added to any CSerializable derived class: 00042 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( C3DSScene, CRenderizable ) 00043 00044 00048 class MRPTDLLIMPEXP C3DSScene : public CRenderizable 00049 { 00050 DEFINE_SERIALIZABLE( C3DSScene ) 00051 00052 protected: 00053 00054 public: 00055 00058 void render(); 00059 00064 void loadFrom3DSFile( const std::string &file_name ); 00065 00067 static C3DSScenePtr Create() 00068 { 00069 return C3DSScenePtr ( new C3DSScene() ); 00070 } 00071 00074 void initializeAllTextures(); 00075 00077 void clear(); 00078 00081 void evaluateAnimation( double time_anim ); 00082 00084 void setScale( double s ) { m_scale_x = m_scale_y = m_scale_z = s; } 00085 00087 void setScale( double sx,double sy, double sz ) { m_scale_x = sx; m_scale_y = sy; m_scale_z = sz; } 00088 00090 void enableExtraAmbientLight(bool enable=true) { m_enable_extra_lighting=enable; } 00091 00092 00093 private: 00096 C3DSScene( ); 00097 00099 virtual ~C3DSScene(); 00100 00103 struct TImpl3DS 00104 { 00105 TImpl3DS(); 00106 ~TImpl3DS(); 00107 void *file; 00108 }; 00109 00112 stlplus::smart_ptr<TImpl3DS> m_3dsfile; 00113 00115 double m_scale_x,m_scale_y,m_scale_z; 00116 00117 bool m_enable_extra_lighting; 00118 }; 00119 00120 00121 } // end namespace 00122 00123 } // End of namespace 00124 00125 00126 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |