glc_world.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  Version 2.0.0 Beta 1, packaged on April 2010.
00006 
00007  http://glc-lib.sourceforge.net
00008 
00009  GLC-lib is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation; either version 2 of the License, or
00012  (at your option) any later version.
00013 
00014  GLC-lib is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with GLC-lib; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023 *****************************************************************************/
00024 
00026 
00027 #ifndef GLC_WORLD_H_
00028 #define GLC_WORLD_H_
00029 
00030 #include "glc_3dviewcollection.h"
00031 #include "glc_structoccurence.h"
00032 #include "glc_structreference.h"
00033 #include "glc_structinstance.h"
00034 #include "glc_worldhandle.h"
00035 
00036 #include "../glc_config.h"
00037 
00040 
00047 
00048 class GLC_LIB_EXPORT GLC_World
00049 {
00051 
00053 
00054 public:
00056         GLC_World();
00057 
00059         GLC_World(const GLC_World&);
00060 
00062         virtual ~GLC_World();
00064 
00066 
00068 
00069 public:
00071         inline GLC_BoundingBox boundingBox()
00072         { return m_pWorldHandle->collection()->boundingBox();}
00073 
00075         inline GLC_StructOccurence* rootOccurence() const
00076         {return m_pRoot;}
00077 
00079         inline GLC_3DViewCollection* collection()
00080         {return m_pWorldHandle->collection();}
00081 
00083         inline int size() const
00084         {return m_pWorldHandle->collection()->size();}
00085 
00087         inline bool isEmpty() const
00088         {return  m_pWorldHandle->collection()->isEmpty();}
00089 
00091         inline int numberOfFaces() const
00092         {return m_pRoot->numberOfFaces();}
00093 
00095         inline int numberOfVertex() const
00096         {return m_pRoot->numberOfVertex();}
00097 
00099         inline int numberOfMaterials() const
00100         {return m_pRoot->numberOfMaterials();}
00101 
00103         inline QList<GLC_Material*> listOfMaterials() const
00104         {return m_pRoot->materialSet().toList();}
00105 
00107         inline QList<GLC_3DViewInstance*> instancesHandle() const
00108         {return m_pWorldHandle->collection()->instancesHandle();}
00109 
00111         inline QList<GLC_3DViewInstance*> visibleInstancesHandle() const
00112         {return m_pWorldHandle->collection()->visibleInstancesHandle();}
00113 
00115         inline QList<QString> instanceNamesFromShadingGroup(GLuint id) const
00116         {return m_pWorldHandle->collection()->instanceNamesFromShadingGroup(id);}
00117 
00119         inline int numberOfUsedShadingGroup() const
00120         {return m_pWorldHandle->collection()->numberOfUsedShadingGroup();}
00121 
00123         inline GLC_WorldHandle* worldHandle()
00124         {return m_pWorldHandle;}
00125 
00127 
00128         inline GLC_StructOccurence* occurence(GLC_uint id) const
00129         {return m_pWorldHandle->getOccurence(id);}
00130 
00132         inline QList<GLC_StructOccurence*> listOfOccurence() const
00133         {return m_pWorldHandle->occurences();}
00134 
00136         inline int numberOfOccurence() const
00137         {return m_pWorldHandle->numberOfOccurence();}
00138 
00140         inline int contains(GLC_uint id) const
00141         {return m_pWorldHandle->contains(id);}
00142 
00144         inline QList<GLC_StructInstance*> instances() const
00145         {return m_pWorldHandle->instances();}
00146 
00148         inline QList<GLC_StructReference*> references() const
00149         {return m_pWorldHandle->references();}
00150 
00152         inline int numberOfBody() const
00153         {return m_pWorldHandle->numberOfBody();}
00154 
00156         inline GLC_Vector3d upVector() const
00157         {return m_pWorldHandle->upVector();}
00158 
00159 
00161 
00163 
00165 
00166 public:
00168         void mergeWithAnotherWorld(GLC_World &);
00169 
00171         inline void reversePartNormal() {m_pRoot->reverseNormals();}
00172 
00174         GLC_World& clear() {return *this= GLC_World();}
00175 
00177         inline void setRootName(const QString& name)
00178         {
00179                 m_pRoot->setName(name);
00180         }
00181 
00183         inline void setUpVector(const GLC_Vector3d& vect)
00184         {m_pWorldHandle->setUpVector(vect);}
00185 
00187 
00189 
00191 
00192 public:
00194         GLC_World& operator=(const GLC_World&);
00196 
00198 
00200 
00201 public:
00203         inline void render(GLuint groupId, glc::RenderFlag renderFlag= glc::ShadingFlag)
00204         {m_pWorldHandle->collection()->render(groupId, renderFlag);}
00205 
00207         inline void renderShaderGroup(glc::RenderFlag renderFlag= glc::ShadingFlag)
00208         {m_pWorldHandle->collection()->renderShaderGroup(renderFlag);}
00209 
00211 
00212 // private members
00214 private:
00216         GLC_WorldHandle* m_pWorldHandle;
00217 
00219         GLC_StructOccurence* m_pRoot;
00220 };
00221 
00222 #endif /*GLC_WORLD_H_*/

SourceForge.net Logo

©2005 Laurent Ribon