1 // Created by: Anastasia BORISOVA
2 // Copyright (c) 2016 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <AIS_AnimationCamera.hxx>
17 #include <Graphic3d_Camera.hxx>
18 #include <Precision.hxx>
19 #include <V3d_View.hxx>
21 IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationCamera, AIS_Animation)
23 //=============================================================================
24 //function : AIS_AnimationCamera
26 //=============================================================================
27 AIS_AnimationCamera::AIS_AnimationCamera (const TCollection_AsciiString& theAnimationName,
28 const Handle(V3d_View)& theView)
29 : AIS_Animation (theAnimationName),
35 //=============================================================================
38 //=============================================================================
39 void AIS_AnimationCamera::update (const AIS_AnimationProgress& theProgress)
42 || myCamStart.IsNull()
48 Handle(Graphic3d_Camera) aCamera = myView->Camera();
50 Graphic3d_CameraLerp aCamLerp (myCamStart, myCamEnd);
51 aCamLerp.Interpolate (theProgress.LocalNormalized, aCamera);
53 const Standard_Boolean aPrevImmUpdate = myView->SetImmediateUpdate (Standard_False);
54 myView->SetCamera (aCamera);
55 myView->SetImmediateUpdate (aPrevImmUpdate);