- Cal3D 0.11 API Reference -

corematerial.h

00001 //****************************************************************************//
00002 // corematerial.h                                                             //
00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger                       //
00004 //****************************************************************************//
00005 // This library is free software; you can redistribute it and/or modify it    //
00006 // under the terms of the GNU Lesser General Public License as published by   //
00007 // the Free Software Foundation; either version 2.1 of the License, or (at    //
00008 // your option) any later version.                                            //
00009 //****************************************************************************//
00010 
00011 #ifndef CAL_COREMATERIAL_H
00012 #define CAL_COREMATERIAL_H
00013 
00014 
00015 #include "cal3d/global.h"
00016 #include "cal3d/refcounted.h"
00017 #include "cal3d/refptr.h"
00018 
00019 
00020 // Maximum length of mapType string buffer, including terminating zero.
00021 #define CalCoreMaterialMapTypeLengthMax ( 128 )
00022 class CAL3D_API CalCoreMaterial : public cal3d::RefCounted
00023 {
00024 public:
00025   struct Color
00026   {
00027     unsigned char red;
00028     unsigned char green;
00029     unsigned char blue;
00030     unsigned char alpha;
00031   };
00032 
00033   struct Map
00034   {
00035     std::string strFilename;
00036     std::string mapType;
00037     Cal::UserData userData;
00038   };
00039 
00040   CalCoreMaterial();
00041   CalCoreMaterial( const CalCoreMaterial& inOther );
00042 
00043 protected:
00044   ~CalCoreMaterial() { }
00045 
00046 public:
00047   const Color& getAmbientColor() const;
00048   const Color& getDiffuseColor() const;
00049   int getMapCount() const;
00050   const std::string& getMapFilename(int mapId) const;
00051   const std::string& getMapType(int mapId);
00052   Cal::UserData getMapUserData(int mapId);
00053   const Cal::UserData getMapUserData(int mapId) const;
00054   float getShininess() const;
00055   const Color& getSpecularColor() const;
00056   Cal::UserData getUserData();
00057   const Cal::UserData getUserData() const;
00058   std::vector<Map>& getVectorMap();
00059   const std::vector<Map>& getVectorMap() const;
00060   bool reserve(int mapCount);
00061   void setAmbientColor(const Color& ambientColor);
00062   void setDiffuseColor(const Color& diffuseColor);
00063   bool setMap(int mapId, const Map& map);
00064   bool setMapUserData(int mapId, Cal::UserData userData);
00065   void setShininess(float shininess);
00066   void setSpecularColor(const Color& specularColor);
00067   void setFilename(const std::string& filename);
00068   const std::string& getFilename(void) const;
00069   void setName(const std::string& name);
00070   const std::string& getName(void) const;
00071   void setUserData(Cal::UserData userData);
00072   bool getAlphaBlending() { return false; } // No check box available in max.
00073   bool getTwoSided() { return getMapCount() > 1; } // Should come from check box.
00074   bool getSelfIllumination() { return false; } // Should come from check box.
00075 
00076 private:
00077   Color            m_ambientColor;
00078   Color            m_diffuseColor;
00079   Color            m_specularColor;
00080   float            m_shininess;
00081   std::vector<Map> m_vectorMap;
00082   Cal::UserData    m_userData;
00083   std::string      m_name;
00084   std::string      m_filename;
00085 };
00086 typedef cal3d::RefPtr<CalCoreMaterial> CalCoreMaterialPtr;
00087 
00088 #endif
00089 
00090 //****************************************************************************//

Generated by The Cal3D Team with Doxygen 1.7.3