2024-01-07 20:39:34 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
enum class lcObjectPropertyId
|
|
|
|
{
|
|
|
|
PieceId,
|
|
|
|
PieceColor,
|
|
|
|
PieceStepShow,
|
|
|
|
PieceStepHide,
|
|
|
|
CameraName,
|
|
|
|
CameraType,
|
|
|
|
CameraFOV,
|
|
|
|
CameraNear,
|
|
|
|
CameraFar,
|
|
|
|
CameraPositionX,
|
|
|
|
CameraPositionY,
|
|
|
|
CameraPositionZ,
|
|
|
|
CameraTargetX,
|
|
|
|
CameraTargetY,
|
|
|
|
CameraTargetZ,
|
|
|
|
CameraUpX,
|
|
|
|
CameraUpY,
|
|
|
|
CameraUpZ,
|
|
|
|
LightName,
|
|
|
|
LightType,
|
|
|
|
LightColor,
|
2024-04-07 20:28:54 +02:00
|
|
|
LightBlenderPower,
|
|
|
|
LightPOVRayPower,
|
2024-01-07 20:39:34 +01:00
|
|
|
LightCastShadow,
|
2024-04-07 02:29:15 +02:00
|
|
|
LightPOVRayFadeDistance,
|
|
|
|
LightPOVRayFadePower,
|
2024-04-07 21:48:41 +02:00
|
|
|
LightPointBlenderRadius,
|
|
|
|
LightSpotBlenderRadius,
|
|
|
|
LightDirectionalBlenderAngle,
|
2024-01-07 20:39:34 +01:00
|
|
|
LightAreaSizeX,
|
|
|
|
LightAreaSizeY,
|
|
|
|
LightSpotConeAngle,
|
|
|
|
LightSpotPenumbraAngle,
|
2024-04-07 03:50:37 +02:00
|
|
|
LightSpotPOVRayTightness,
|
2024-01-07 20:39:34 +01:00
|
|
|
LightAreaShape,
|
2024-04-07 03:50:37 +02:00
|
|
|
LightAreaPOVRayGridX,
|
|
|
|
LightAreaPOVRayGridY,
|
2024-01-07 20:39:34 +01:00
|
|
|
ObjectPositionX,
|
|
|
|
ObjectPositionY,
|
|
|
|
ObjectPositionZ,
|
|
|
|
ObjectRotationX,
|
|
|
|
ObjectRotationY,
|
|
|
|
ObjectRotationZ,
|
|
|
|
Count
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct lcObjectPropertyKey
|
|
|
|
{
|
|
|
|
lcStep Step;
|
|
|
|
T Value;
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
class lcObjectProperty
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit lcObjectProperty(const T& DefaultValue)
|
|
|
|
: mValue(DefaultValue)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
operator const T& () const
|
|
|
|
{
|
|
|
|
return mValue;
|
|
|
|
}
|
|
|
|
|
2024-01-16 02:11:03 +01:00
|
|
|
void SetValue(const T& Value)
|
2024-01-07 20:39:34 +01:00
|
|
|
{
|
2024-01-16 02:11:03 +01:00
|
|
|
mValue = Value;
|
2024-01-07 20:39:34 +01:00
|
|
|
}
|
|
|
|
|
2024-01-16 02:11:03 +01:00
|
|
|
void RemoveAllKeys()
|
2024-01-07 20:39:34 +01:00
|
|
|
{
|
2024-01-16 01:48:09 +01:00
|
|
|
mKeys.clear();
|
2024-01-07 20:39:34 +01:00
|
|
|
}
|
|
|
|
|
2024-01-16 01:48:09 +01:00
|
|
|
void Update(lcStep Step);
|
2024-02-19 23:54:45 +01:00
|
|
|
bool ChangeKey(const T& Value, lcStep Step, bool AddKey);
|
2024-01-07 20:39:34 +01:00
|
|
|
void InsertTime(lcStep Start, lcStep Time);
|
|
|
|
void RemoveTime(lcStep Start, lcStep Time);
|
2024-01-15 02:41:01 +01:00
|
|
|
bool HasKeyFrame(lcStep Time) const;
|
2024-01-21 21:53:18 +01:00
|
|
|
bool SetKeyFrame(lcStep Time, bool KeyFrame);
|
2024-01-07 20:39:34 +01:00
|
|
|
|
2024-01-16 02:11:03 +01:00
|
|
|
void Save(QTextStream& Stream, const char* ObjectName, const char* VariableName, bool SaveEmpty) const;
|
2024-01-07 20:39:34 +01:00
|
|
|
bool Load(QTextStream& Stream, const QString& Token, const char* VariableName);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
T mValue;
|
|
|
|
std::vector<lcObjectPropertyKey<T>> mKeys;
|
|
|
|
};
|