ViewObject::ViewObject(ModelObjectPtr aModelObject) : objectId(ObjectId::newObjectId()), modelObject(aModelObject) { if(modelObject) { handleNotificationsFor(*modelObject); } }
/** * This function will call ModelObject::addReference. * It will stop handling the notifications for the old object, * start handling the notifications for the new object * and reset this ViewObject (derived) class. * * See ViewObject::resetViewObject */ void ViewObject::rebindModelObject(ModelObjectPtr aModelObject) { if(modelObject) { stopHandlingNotificationsFor(*modelObject); } modelObject = aModelObject; if(modelObject) { handleNotificationsFor(*modelObject); } }
void Robot::calculateRoute(GoalPtr aGoal) { path.clear(); if (aGoal) { // Turn off logging if not debugging AStar Logger::setDisable(); front = Vector( aGoal->getPosition(), position); handleNotificationsFor( astar); path = astar.search( position, aGoal->getPosition(), size); stopHandlingNotificationsFor( astar); Logger::setDisable( false); } }
void QFMotionPlayer::gotHeader() { #ifdef TRACE stampTime(); *debugOutput << "Got header:" << '\t' << &qf << endl; #endif if (qf.window() && !window_p) setWindow(*qf.window()); if (qf.disabled()) return; if (moviePlayer) // In case we are retrying open in response to error { stopHandlingNotificationsFor(*moviePlayer); moviePlayer->disableNotification(); delete moviePlayer; } else qf.playerCreated(); // Tell plugin we're here (on thread 1, first time only) // Create player and launch thread to prepare the movie if (isMusicOnly_p) moviePlayer = new IMMSequencer(false); else if (isSoundOnly_p) moviePlayer = new IMMWaveAudio(false); else moviePlayer = new IMMDigitalVideo(false); moviePlayer->enableNotification(); handleNotificationsFor(*moviePlayer); if (qf.streamDone()) { autoStartPointReached = true; finishStream(); if (qf.controller()) qf.controller()->setFullPercent(1.0); } prepareThread = new IThread(new IThreadMemberFn<QFMotionPlayer>(*this, QFMotionPlayer::prepare)); }