/*************************************************************** * Function: setObjectEnabled() * * Description: * ***************************************************************/ void DSSketchBook::setObjectEnabled(bool flag) { mObjEnabledFlag = flag; if (flag) setAllChildrenOn(); if (!mPATransFwd || !mPATransBwd) return; AnimationPathCallback* animCallback = NULL; if (flag) { setSingleChildOn(0); mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mPageEntryArray[mPageIdx]->mPageGeode); animCallback = dynamic_cast <AnimationPathCallback*> (mPATransFwd->getUpdateCallback()); } else { /* setSingleChildOn(1); mDSIntersector->loadRootTargetNode(NULL, NULL); animCallback = dynamic_cast <AnimationPathCallback*> (mPATransBwd->getUpdateCallback()); */ } if (animCallback) { animCallback->reset(); } }
/*************************************************************** * Function: setObjectEnabled() * * Description: * ***************************************************************/ void DSVirtualEarth::setObjectEnabled(bool flag) { mObjEnabledFlag = flag; mDSParticleSystemPtr->setEmitterEnabled(flag); /* set geometry switches when state is enabled / diabled */ if (flag) stateSwitchHandler(); else { mState = SET_NULL; this->setSingleChildOn(0); mEclipticSwitch->setAllChildrenOff(); mTrackballController->setActive(false); mDSIntersector->loadRootTargetNode(NULL, NULL); } if (!mPATransFwd || !mPATransBwd) return; AnimationPathCallback* animCallback = NULL; if (flag) { mEquatorSwitch->setSingleChildOn(1); // child #1: Load Forward Animation animCallback = dynamic_cast <AnimationPathCallback*> (mPATransFwd->getUpdateCallback()); } else { mEquatorSwitch->setSingleChildOn(2); // child #2: Load Backward Animation animCallback = dynamic_cast <AnimationPathCallback*> (mPATransBwd->getUpdateCallback()); } if (animCallback) animCallback->reset(); }
/*************************************************************** * Function: setObjectEnabled() * * Description: * ***************************************************************/ void DSTexturePallette::setObjectEnabled(bool flag) { //std::cout << "setEnabled" << std::endl; mObjEnabledFlag = flag; if (flag) setAllChildrenOn(); if (!mPATransFwd || !mPATransBwd) return; AnimationPathCallback* animCallback = NULL; if (flag) { if (!mIsOpen) { this->setSingleChildOn(0); animCallback = dynamic_cast <AnimationPathCallback*> (mPATransFwd->getUpdateCallback()); mSelectStateSwitch->setAllChildrenOn(); for (int i = 0; i < mNumTexs; i++) { mTextureStatesSelectEntryArray[i]->mStateAnimationArray[0]->reset(); mTextureStatesSelectEntryArray[i]->mEntrySwitch->setSingleChildOn(0); } resetIntersectionRootTarget(); mIsOpen = true; mTexturingState = SELECT_TEXTURE; } else { for (int i = 0; i < mNumTexs; i++) { mTextureStatesSelectEntryArray[i]->mStateAnimationArray[1]->reset(); mTextureStatesSelectEntryArray[i]->mEntrySwitch->setSingleChildOn(1); } mTexturingState = IDLE; mIsOpen = false; } } else { //texturingStateTransitionHandle(mTexturingState, IDLE); //this->setSingleChildOn(1); //animCallback = dynamic_cast <AnimationPathCallback*> (mPATransBwd->getUpdateCallback()); //mDSIntersector->loadRootTargetNode(NULL, NULL); //mDOIntersector->loadRootTargetNode(NULL, NULL); mTexturingState = IDLE; for (int i = 0; i < mNumTexs; i++) { mTextureStatesSelectEntryArray[i]->mStateAnimationArray[1]->reset(); mTextureStatesSelectEntryArray[i]->mEntrySwitch->setSingleChildOn(1); } mIsOpen = false; resetIntersectionRootTarget(); } if (animCallback) animCallback->reset(); }
/*************************************************************** * Function: setObjectEnabled() * * Description: * ***************************************************************/ void DSObjectPlacer::setObjectEnabled(bool flag) { mDrawingState = IDLE; mObjEnabledFlag = flag; AnimationPathCallback* animCallback = NULL; setAllChildrenOff(); if (flag && !mIsOpen) // open menu { setSingleChildOn(0); for (int i = 0; i < mFwdVec.size(); ++i) { setChildValue(mFwdVec[i], true); animCallback = dynamic_cast <AnimationPathCallback*> (mFwdVec[i]->getUpdateCallback()); mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mFwdVec[i]->getChild(0)); if (animCallback) { animCallback->reset(); } } mIsOpen = true; } else // close menu { setSingleChildOn(0); for (int i = 1; i < mBwdVec.size(); ++i) { setChildValue(mBwdVec[i], true); animCallback = dynamic_cast <AnimationPathCallback*> (mBwdVec[i]->getUpdateCallback()); mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mBwdVec[i]); if (animCallback) { animCallback->reset(); } } mIsOpen = false; } mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mFwdVec[0]->getChild(0)); }
/*************************************************************** * Function: setObjectEnabled() * * Description: * ***************************************************************/ void DSGeometryCreator::setObjectEnabled(bool flag) { mObjEnabledFlag = flag; mDrawingState = IDLE; if (flag) setAllChildrenOn(); if (!mPATransFwd || !mPATransBwd) return; AnimationPathCallback* animCallback = NULL; if (flag) { if (!mIsOpen) { this->setSingleChildOn(0); animCallback = dynamic_cast <AnimationPathCallback*> (mPATransFwd->getUpdateCallback()); // load intersection root and targets when state is enabled, no need to change till disabled mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mSphereExteriorGeode); mDOIntersector->loadRootTargetNode(gDesignObjectRootGroup, NULL); for (int i = 0; i < mNumShapeSwitches; ++i) { mShapeSwitchEntryArray[i]->mSwitch->setSingleChildOn(0); mShapeSwitchEntryArray[i]->mFlipUpFwdAnim->reset(); } mIsOpen = true; } else { for (int i = 0; i < mNumShapeSwitches; ++i) { mShapeSwitchEntryArray[i]->mSwitch->setSingleChildOn(2); mShapeSwitchEntryArray[i]->mFlipUpBwdAnim->reset(); } mIsOpen = false; mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mSphereExteriorGeode); } //mShapeSwitchEntryArray[mShapeSwitchIdx]->mSwitch->setSingleChildOn(0); //mShapeSwitchEntryArray[mShapeSwitchIdx]->mFlipUpFwdAnim->reset(); } else { for (int i = 0; i < mNumShapeSwitches; ++i) { mShapeSwitchEntryArray[i]->mSwitch->setSingleChildOn(2); mShapeSwitchEntryArray[i]->mFlipUpBwdAnim->reset(); } mIsOpen = false; mDSIntersector->loadRootTargetNode(gDesignStateRootGroup, mSphereExteriorGeode); /* setSingleChildOn(1); animCallback = dynamic_cast <AnimationPathCallback*> (mPATransBwd->getUpdateCallback()); mDSIntersector->loadRootTargetNode(NULL, NULL); mDOIntersector->loadRootTargetNode(NULL, NULL); // turn off all geometry objects associated with DesignObjectHanlder mDOGeometryCreator->setReferencePlaneMasking(false, false, false); mDOGeometryCreator->setReferenceAxisMasking(false); mDOGeometryCreator->setWireframeActiveID(-1); mDOGeometryCreator->setSolidshapeActiveID(-1); DrawingStateTransitionHandle(mDrawingState, IDLE); */ } mDrawingState = IDLE; if (animCallback) animCallback->reset(); }