diff --git a/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp index e834d9d241..71ec537a8c 100644 --- a/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp +++ b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp @@ -157,6 +157,19 @@ int FrameAnimationControl::currentFrame() const return m_currentFrame; } +//-------------------------------------------------------------------------------------------------- +/// Set current frame without emitting signal +/// Used when views are linked and need to update current frame without emitting a signal +/// Emitting a signal will cause infinite recursion +//-------------------------------------------------------------------------------------------------- +void FrameAnimationControl::setCurrentFrameOnly(int frameIndex) +{ + if (frameIndex >= 0) + { + m_currentFrame = frameIndex; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h index 89023c76e6..f24ad7dba7 100644 --- a/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h +++ b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h @@ -58,6 +58,7 @@ public: void setNumFrames(int numFrames); int numFrames() const; int currentFrame() const; + void setCurrentFrameOnly(int frameIndex); bool isActive() const;