Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TrackNode.cc

Go to the documentation of this file.
00001 #ifdef TGT_HAS_HEAD
00002 #include "Crew/Lookout.h"
00003 #endif
00004 
00005 #include "Events/LookoutEvents.h"
00006 
00007 #include "TrackNode.h"
00008 
00009 void TrackNode::preStart() {
00010   StateNode::preStart();
00011   cancelFlag = false;
00012   const LookoutTrackRequest *p = tryExtractSignal<LookoutTrackRequest>(event);
00013   if ( p )
00014     trackreq = *p;
00015 }
00016 
00017 void TrackNode::postStart() {
00018   StateNode::postStart();
00019   if ( !cancelFlag ) {
00020     erouter->addListener(this, EventBase::lookoutEGID, (size_t)this, EventBase::statusETID);
00021 #ifdef TGT_HAS_HEAD
00022     VRmixin::lookout->executeRequest(this,trackreq);
00023 #endif
00024   }
00025 }
00026 
00027 void TrackNode::stop() {
00028 #ifdef TGT_HAS_HEAD
00029   VRmixin::lookout->stopTrack();  // in case the request was still executing when we exited
00030 #endif
00031   StateNode::stop();
00032 }
00033 
00034 void TrackNode::doEvent() {
00035   postStateCompletion();
00036 }
00037 
00038 void TrackNode::cancelThisRequest() {
00039   cancelFlag = true;
00040   postStateFailure();
00041 }

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:52 2016 by Doxygen 1.6.3