leocad/common/lc_model.h
2014-05-26 22:58:08 +00:00

110 lines
2.3 KiB
C++

#ifndef _LC_MODEL_H_
#define _LC_MODEL_H_
#include "lc_math.h"
#include "str.h"
#include "object.h"
enum lcBackgroundType
{
LC_BACKGROUND_SOLID,
LC_BACKGROUND_GRADIENT,
LC_BACKGROUND_IMAGE
};
class lcModelProperties
{
public:
void LoadDefaults();
void SaveDefaults();
bool operator==(const lcModelProperties& Properties)
{
if (mName != Properties.mName || mAuthor != Properties.mAuthor ||
mDescription != Properties.mDescription || mComments != Properties.mComments)
return false;
if (mBackgroundType != Properties.mBackgroundType || mBackgroundSolidColor != Properties.mBackgroundSolidColor ||
mBackgroundGradientColor1 != Properties.mBackgroundGradientColor1 || mBackgroundGradientColor2 != Properties.mBackgroundGradientColor2 ||
mBackgroundImage != Properties.mBackgroundImage || mBackgroundImageTile != Properties.mBackgroundImageTile)
return false;
if (mFogEnabled != Properties.mFogEnabled || mFogDensity != Properties.mFogDensity ||
mFogColor != Properties.mFogColor || mAmbientColor != Properties.mAmbientColor)
return false;
return true;
}
String mName;
String mAuthor;
String mDescription;
String mComments;
lcBackgroundType mBackgroundType;
lcVector3 mBackgroundSolidColor;
lcVector3 mBackgroundGradientColor1;
lcVector3 mBackgroundGradientColor2;
String mBackgroundImage;
bool mBackgroundImageTile;
bool mFogEnabled;
float mFogDensity;
lcVector3 mFogColor;
lcVector3 mAmbientColor;
};
enum lcTool
{
LC_TOOL_INSERT,
LC_TOOL_LIGHT,
LC_TOOL_SPOTLIGHT,
LC_TOOL_CAMERA,
LC_TOOL_SELECT,
LC_TOOL_MOVE,
LC_TOOL_ROTATE,
LC_TOOL_ERASER,
LC_TOOL_PAINT,
LC_TOOL_ZOOM,
LC_TOOL_PAN,
LC_TOOL_ROTATE_VIEW,
LC_TOOL_ROLL,
LC_TOOL_ZOOM_REGION
};
class lcModel
{
public:
lcModel();
~lcModel();
const lcArray<lcPiece*>& GetPieces() const
{
return mPieces;
}
const lcArray<lcCamera*>& GetCameras() const
{
return mCameras;
}
const lcArray<lcLight*>& GetLights() const
{
return mLights;
}
const lcArray<lcGroup*>& GetGroups() const
{
return mGroups;
}
protected:
lcModelProperties mProperties;
lcArray<lcPiece*> mPieces;
lcArray<lcCamera*> mCameras;
lcArray<lcLight*> mLights;
lcArray<lcGroup*> mGroups;
};
#endif // _LC_MODEL_H_