diff --git a/src/XCAFDoc/XCAFDoc_AnimationTool.cxx b/src/XCAFDoc/XCAFDoc_AnimationTool.cxx index 10eeea7350..bbd8d8647c 100644 --- a/src/XCAFDoc/XCAFDoc_AnimationTool.cxx +++ b/src/XCAFDoc/XCAFDoc_AnimationTool.cxx @@ -36,6 +36,26 @@ namespace static Standard_GUID aGlobalFPSID("C7E7AF70-2FB3-40FD-BD38-CC79D9343D7A"); return aGlobalFPSID; } + + //======================================================================= + //function : GetStartTimeCodeGUID + //purpose : + //======================================================================= + const Standard_GUID& GetStartTimeCodeGUID() + { + static Standard_GUID aStartTimeCodeGUID("379BC1C5-E9DA-4B57-9938-B2612158722A"); + return aStartTimeCodeGUID; + } + + //======================================================================= + //function : GetEndTimeCodeGUID + //purpose : + //======================================================================= + const Standard_GUID& GetEndTimeCodeGUID() + { + static Standard_GUID aEndTimeCodeGUID("EF5305A3-961D-48AE-9A78-AC744A110A26"); + return aEndTimeCodeGUID; + } } //======================================================================= @@ -147,6 +167,66 @@ void XCAFDoc_AnimationTool::SetGlobalFPS(const double theFPS) const TDataStd_Real::Set(BaseLabel(), GetGlobalFPSGUID(), theFPS); } +//======================================================================= +//function : GetStartTimeCode +//purpose : +//======================================================================= +bool XCAFDoc_AnimationTool::GetStartTimeCode(double& theCode) const +{ + Handle(TDataStd_Real) aCodeAttr; + if (BaseLabel().FindAttribute(GetStartTimeCodeGUID(), aCodeAttr)) + { + theCode = aCodeAttr->Get(); + return true; + } + return false; +} + +//======================================================================= +//function : SetStartTimeCode +//purpose : +//======================================================================= +void XCAFDoc_AnimationTool::SetStartTimeCode(const double theCode) const +{ + Handle(TDataStd_Real) aCodeAttr; + if (BaseLabel().FindAttribute(GetStartTimeCodeGUID(), aCodeAttr)) + { + aCodeAttr->Set(theCode); + return; + } + TDataStd_Real::Set(BaseLabel(), GetStartTimeCodeGUID(), theCode); +} + +//======================================================================= +//function : GetEndTimeCode +//purpose : +//======================================================================= +bool XCAFDoc_AnimationTool::GetEndTimeCode(double& theCode) const +{ + Handle(TDataStd_Real) aCodeAttr; + if (BaseLabel().FindAttribute(GetEndTimeCodeGUID(), aCodeAttr)) + { + theCode = aCodeAttr->Get(); + return true; + } + return false; +} + +//======================================================================= +//function : SetEndTimeCode +//purpose : +//======================================================================= +void XCAFDoc_AnimationTool::SetEndTimeCode(const double theCode) const +{ + Handle(TDataStd_Real) aCodeAttr; + if (BaseLabel().FindAttribute(GetEndTimeCodeGUID(), aCodeAttr)) + { + aCodeAttr->Set(theCode); + return; + } + TDataStd_Real::Set(BaseLabel(), GetEndTimeCodeGUID(), theCode); +} + //======================================================================= //function : GetAnimationLabels //purpose : diff --git a/src/XCAFDoc/XCAFDoc_AnimationTool.hxx b/src/XCAFDoc/XCAFDoc_AnimationTool.hxx index df66527a76..ef85f5118c 100644 --- a/src/XCAFDoc/XCAFDoc_AnimationTool.hxx +++ b/src/XCAFDoc/XCAFDoc_AnimationTool.hxx @@ -64,6 +64,18 @@ public: //! Standard_EXPORT void SetGlobalFPS(const double theFPS) const; + //! + Standard_EXPORT bool GetStartTimeCode(double& theCode) const; + + //! + Standard_EXPORT void SetStartTimeCode(const double theCode) const; + + //! + Standard_EXPORT bool GetEndTimeCode(double& theCode) const; + + //! + Standard_EXPORT void SetEndTimeCode(const double theCode) const; + //! Returns a sequence of Animation labels currently stored //! in the Animation table. Standard_EXPORT void GetAnimationLabels(TDF_LabelSequence& theLabels) const;