MCPcopy Create free account
hub / github.com/Kitware/ParaView / UpdateValue

Method UpdateValue

Remoting/Animation/vtkPVRampKeyFrame.cxx:19–58  ·  view source on GitHub ↗

---------------------------------------------------------------------------- remember that currenttime is 0 at the KeyTime of this key frame and 1 and the KeyTime of the next key frame. Hence, currenttime belongs to the interval [0,1).

Source from the content-addressed store, hash-verified

17// and 1 and the KeyTime of the next key frame. Hence,
18// currenttime belongs to the interval [0,1).
19void vtkPVRampKeyFrame::UpdateValue(double currenttime, vtkPVAnimationCue* cue, vtkPVKeyFrame* next)
20{
21 if (!next)
22 {
23 return;
24 }
25
26 cue->BeginUpdateAnimationValues();
27 int animated_element = cue->GetAnimatedElement();
28 if (animated_element != -1)
29 {
30 double vmax = next->GetKeyValue();
31 double vmin = this->GetKeyValue();
32 double value = vmin + currenttime * (vmax - vmin);
33 cue->SetAnimationValue(animated_element, value);
34 }
35 else
36 {
37 unsigned int i;
38 unsigned int start_novalues = this->GetNumberOfKeyValues();
39 unsigned int end_novalues = next->GetNumberOfKeyValues();
40 unsigned int min = (start_novalues < end_novalues) ? start_novalues : end_novalues;
41
42 // interpolate common indices.
43 for (i = 0; i < min; i++)
44 {
45 double vmax = next->GetKeyValue(i);
46 double vmin = this->GetKeyValue(i);
47 double value = vmin + currenttime * (vmax - vmin);
48 cue->SetAnimationValue(i, value);
49 }
50
51 // add any additional indices in start key frame.
52 for (i = min; i < start_novalues; i++)
53 {
54 cue->SetAnimationValue(i, this->GetKeyValue(i));
55 }
56 }
57 cue->EndUpdateAnimationValues();
58}
59
60//----------------------------------------------------------------------------
61void vtkPVRampKeyFrame::PrintSelf(ostream& os, vtkIndent indent)

Callers

nothing calls this directly

Calls 5

GetKeyValueMethod · 0.80
GetNumberOfKeyValuesMethod · 0.80
SetAnimationValueMethod · 0.45

Tested by

no test coverage detected