/** * This source file is part of OgreColladaPlugin * an addon for OGRE (Object-oriented Graphics Rendering Engine) * For the latest info, see http://www.ogre3d.org/ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt. * * @author Philipp Hartl * @see README */ #ifndef __COLLADA_TEXTURE_H__ #define __COLLADA_TEXTURE_H__ #include "OgreColladaPrerequisites.h" #include "OgreColladaEntity.h" namespace Ogre { /** * a object * currently no raw data is supported */ class ColladaImage : public ColladaEntity { public: ColladaImage(ColladaDocument *d, xmlNode *n); virtual ~ColladaImage(void); /** * import node * * @see base class */ virtual bool doImport(void); virtual EntityTypes getEntityType(void) const { return IMAGE; } virtual MovableObject *getOgreInstance(void) const { return NULL; } const String &getSource(void) const { return mSource; } const String &getFormat(void) const { return mFormat; } const uint &getHeight(void) const { return mHeight; } const uint &getWidth(void) const { return mWidth; } const uint &getDepth(void) const { return mDepth; } private: String mSource; // the filename (URL) String mFormat; // image format uint mHeight; // image height in pixel units uint mWidth; // image width in pixel units uint mDepth; // image depth in pixel units, default is 1 (2D) }; /** * texture types */ namespace ColladaTextureSpecific { enum Type { AMBIENT = 0, DIFFUSE, EMISSION, SHININESS, SPECULAR, UNKNOWN = -1 }; /** * compare the string with collada syntax * * @param s the semantic string we have * @return the corresponding texture type */ Type getType(const String &s); } /** * a object */ class ColladaTexture : public ColladaEntity { public: ColladaTexture(ColladaDocument *d, xmlNode *n); virtual ~ColladaTexture(void); /** * import node * * @see base class */ virtual bool doImport(void); virtual EntityTypes getEntityType(void) const { return TEXTURE; } ColladaImage *getImage(void) const { return mImage; } virtual MovableObject *getOgreInstance(void) const { return NULL; } // ColladaTextureSpecific::Type getType(void) const { return mType; } private: ColladaImage *mImage; // the image this texture holds ColladaTextureSpecific::Type mType; // the texture type }; } #endif // __COLLADA_TEXTURE_H__