97{
99
100 if (
m_c->animationFrameNumber>=
sequence().getNumFrames()) {
103 return;
104 }
105
106 SoNode * rootnode =
m_c->viewer->getSceneGraph();
107 if (!rootnode) {
108 VP1Msg::messageDebug(
"AnimationSequencer::nextAnimationFrame WARNING: No scenegraph set. Ignoring.");
109 return;
110 }
111 if ( ! ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) ) {
112 VP1Msg::messageDebug(
"AnimationSequencer::nextAnimationFrame WARNING: Root node does not derive from SoGroup. Ignoring.");
113 return;
114 }
115
116
117
118
119
120
121
122 SoCamera * camera =
m_c->viewer->getCamera();
123 if (!camera) {
124 VP1Msg::messageDebug(
"AnimationSequencer::nextAnimationFrame WARNING: Could not get camera. Ignoring.");
125 return;
126 }
127
128 rootnode->ref();
129 SoGroup *
root =
static_cast<SoGroup*
>(rootnode);
130
131 unsigned int i =
m_c->animationFrameNumber;
132
133
134
136
137
138 if (
f.time==0.0&&!
f.camState.isEmpty())
139 {
142 else
144 } else {
145 VP1CameraHelper *
helper(0);
146 if (
f.camState.isEmpty()) {
147
148 camera->ref();
149 bool notifyenabled =
root->enableNotify(
false);
151 camera->getTypeId().isDerivedFrom(SoPerspectiveCamera::getClassTypeId()));
152 camera->unrefNoDelete();
153
154 SbVec3f lookat=
f.dir, upvec =
f.upvec;
155 root->insertChild(regionsphere,0);
157 helper =
VP1CameraHelper::animatedZoomToSubTree(camera,root,regionsphere,
f.time,
f.clipVolPercent,
m_c->last_clipVolPercent,0.1,lookat,upvec,
f.variableSpeed,
f.forceCircular);
158
159 root->removeChild(regionsphere);
160
161 if (notifyenabled) {
162 root->enableNotify(
true);
164 }
165
166 } else {
167
169 }
170
171 if (
m_c->movieEnabled)
172 helper->setOutputImagesMode(
m_c->viewer,
m_c->movieOutdir,
m_c->movieWidth,
m_c->movieHeight,
m_c->movieFPS,
m_c->frameFileNamePrefix);
173
177
178 }
179
180 m_c->last_clipVolPercent =
f.clipVolPercent;
181
182
183 rootnode->unrefNoDelete();
184 m_c->animationFrameNumber++;
185
186}
const Frame & getFrame(unsigned int i) const
void animationFinishedSuccessfully()
void clipVolumePercentOfATLAS(double)
void nextAnimationFrame()
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
static VP1CameraHelper * animatedZoomToCameraState(SoCamera *camera, SoGroup *sceneroot, const QByteArray &camstate, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, bool varySpeed=true, bool forceCircular=false)
static void messageDebug(const QString &)
static bool deserializeSoCameraParameters(QByteArray &, SoCamera &)