00001
00002
00003
00004
00005
00006
00007
00008
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 class CAL3D_API CalCoreMaterial : public cal3d::RefCounted
00021 {
00022 public:
00023 struct Color
00024 {
00025 unsigned char red;
00026 unsigned char green;
00027 unsigned char blue;
00028 unsigned char alpha;
00029 };
00030
00031 struct Map
00032 {
00033 std::string strFilename;
00034 Cal::UserData userData;
00035 };
00036
00037 CalCoreMaterial();
00038
00039 protected:
00040 ~CalCoreMaterial() { }
00041
00042 public:
00043 Color& getAmbientColor();
00044 Color& getDiffuseColor();
00045 int getMapCount();
00046 const std::string& getMapFilename(int mapId);
00047 Cal::UserData getMapUserData(int mapId);
00048 float getShininess();
00049 Color& getSpecularColor();
00050 Cal::UserData getUserData();
00051 std::vector<Map>& getVectorMap();
00052 bool reserve(int mapCount);
00053 void setAmbientColor(const Color& ambientColor);
00054 void setDiffuseColor(const Color& diffuseColor);
00055 bool setMap(int mapId, const Map& map);
00056 bool setMapUserData(int mapId, Cal::UserData userData);
00057 void setShininess(float shininess);
00058 void setSpecularColor(const Color& specularColor);
00059 void setFilename(const std::string& filename);
00060 const std::string& getFilename(void);
00061 void setName(const std::string& name);
00062 const std::string& getName(void);
00063 void setUserData(Cal::UserData userData);
00064
00065 private:
00066 Color m_ambientColor;
00067 Color m_diffuseColor;
00068 Color m_specularColor;
00069 float m_shininess;
00070 std::vector<Map> m_vectorMap;
00071 Cal::UserData m_userData;
00072 std::string m_name;
00073 std::string m_filename;
00074 };
00075 typedef cal3d::RefPtr<CalCoreMaterial> CalCoreMaterialPtr;
00076
00077 #endif
00078
00079