当前位置: 首页>>代码示例>>C++>>正文


C++ removeChild函数代码示例

本文整理汇总了C++中removeChild函数的典型用法代码示例。如果您正苦于以下问题:C++ removeChild函数的具体用法?C++ removeChild怎么用?C++ removeChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了removeChild函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addChild

void CCMenuItemSprite::setDisabledImage(CCNode* pImage)
{
    if (pImage != m_pNormalImage)
    {
        if (pImage)
        {
            addChild(pImage, 0, kDisableTag);
            //MMDBG: for image magnifying.
            pImage->setAnchorPoint(ccp(0, 0));
//            pImage->setAnchorPoint(ccp(0.5, 0.5));
//            pImage->setPosition(ccp(pImage->getContentSize().width * 0.5, pImage->getContentSize().height * 0.5));
        }

        if (m_pDisabledImage)
        {
            removeChild(m_pDisabledImage, true);
        }

        m_pDisabledImage = pImage;
        this->updateImagesVisibility();
    }
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:22,代码来源:CCMenuItem.cpp

示例2: removeChild

void BonusPanel::cbCommDlg(CCObject* pObj)
{
    CommDlgRet* pRet = (CommDlgRet*)pObj;
    bool isOk = pRet->bOk;
    
    if(m_commDlg != NULL){
        removeChild(m_commDlg, true);
        m_commDlg = NULL;
    }
    
    MainScene::Inst()->enableBottomPanel(true);
    
    if(isOk == true){
        if (m_cntryDialog->assignOneCoin())
        {
            scheduleUpdate();
        }
    }
    else {
        CGameData::Inst()->clearReqStat();
    }
}
开发者ID:haoliumilan,项目名称:AgainstSango,代码行数:22,代码来源:BonusPanel.cpp

示例3: attackDetection

void Warrior::attackDetection()
{
	auto map = this->getParent();
	Vector<Node*> garbege;
	for (int i = 0; i < map->getChildren().size(); i++)
	{
		auto sprite = map->getChildren().at(i);
		if (sprite->getName() != "skull")
			continue;
		if (weapon->getBoundingBox().containsPoint(Vec2(sprite->getBoundingBox().getMidX(), sprite->getBoundingBox().getMidY())))
		{
			((BaseObject*)sprite)->setFeelHurt(true);
			if (((BaseObject*)sprite)->getHealth() == 0)
				((BaseObject*)sprite)->die();
				//garbege.pushBack(sprite);
		}
	}
	for (int i = 0; i < garbege.size(); i++)
	{
		map->removeChild(garbege.at(i));
	}
}
开发者ID:hymen81,项目名称:Iswear_Game,代码行数:22,代码来源:Warrior.cpp

示例4: Rect

void Dog::hitCat(Cat* cat)
{
	//是否砸到猫
	if (cat->getReady() == false)
	{
		return;
	}
	for (auto it = bullets.begin(); it != bullets.end();)
	{
		TubeBullet* temp = it->second;
		Rect temp1 = Rect(temp->getPositionX() - temp->getHitRect().size.width / 2,
			temp->getPositionY() - temp->getHitRect().size.height / 2,
			temp->getHitRect().size.width, temp->getHitRect().size.height);

		Rect temp2 = Rect(cat->getPositionX() - cat->getHitRect().size.width / 2,
			cat->getPositionY() - cat->getHitRect().size.height / 2,
			cat->getHitRect().size.width, cat->getHitRect().size.height);

		if (temp1.intersectsRect(temp2))
		{
			log("Dog Hit:: { %d }", it->second->getID());
			TubeBullet* temp = bullets.at(it->first);
			auto parent = temp->getParent();
			if (parent != NULL)
			{
				parent->removeChild(temp, true);
			}
			//猫咪爆炸
			cat->displayExplode();
			NotificationCenter::getInstance()->postNotification("HitCat");
			//下一个迭代器定位的元素位置
			it = bullets.erase(it);
		}
		else
		{
			it++;
		}
	}
}
开发者ID:kakaxi1100,项目名称:CocosHeaven,代码行数:39,代码来源:Dog.cpp

示例5: l

  void ModelInModelOutJob::mergeJobImpl(const boost::shared_ptr<Job_Impl> &t_parent, const boost::shared_ptr<Job_Impl> &t_job) 
  {


    QWriteLocker l(&m_mutex);
    boost::shared_ptr<ModelInModelOutJob> mimojob = boost::dynamic_pointer_cast<ModelInModelOutJob>(t_job);

    if (!mimojob)
    {
      throw MergeJobError("Mismatched job types");
    }

    if (mimojob->jobType() != t_parent->jobType())
    {
      throw MergeJobError("Mismatched job types");
    }


    if (t_parent->finishedJob() == t_job)
    {
      throw MergeJobError("RHS is finished job - refusing to merge");
    }

    LOG(Info, "Merging Job " << openstudio::toString(t_job->uuid()) << " into " << openstudio::toString(uuid()));
    
    removeChild(t_job);
    std::vector<boost::shared_ptr<Job_Impl> > children = t_job->children();
    std::for_each(children.begin(), children.end(), boost::bind(&Job_Impl::addChild, t_parent, _1));

    std::vector<boost::shared_ptr<ModelInModelOutJob> > existing_merged_jobs = mimojob->m_mergedJobs;
    mimojob->m_mergedJobs.clear();

    m_mergedJobs.push_back(mimojob);

    // make sure we merge the already merged jobs too
    m_mergedJobs.insert(m_mergedJobs.begin(), existing_merged_jobs.begin(), existing_merged_jobs.end());
   

  }
开发者ID:airguider,项目名称:OpenStudio,代码行数:39,代码来源:ModelInModelOutJob.cpp

示例6: ILOG_TRACE_W

void
AppCompositor::removeWindow(DFBWindowID windowID)
{
    ILOG_TRACE_W(ILX_APPCOMPOSITOR);
    ILOG_DEBUG(ILX_APPCOMPOSITOR, " -> windowID: %u\n", windowID);
    for (WidgetList::iterator it = _children.begin(); it != _children.end(); ++it)
    {
        SurfaceView* view = dynamic_cast<SurfaceView*>(*it);
        if (view && view->dfbWindowID() == windowID)
        {
            if (removeChild(*it))
            {
                ILOG_DEBUG(ILX_APPCOMPOSITOR, " -> removeChild( %p )\n", (*it));
                sigGeometryUpdated();
                setWindowFocus();
                update();
                break;
            } else
                ILOG_ERROR(ILX_APPCOMPOSITOR, " -> Cannot remove child window!\n");
        }
    }
}
开发者ID:Ecro,项目名称:ilixi,代码行数:22,代码来源:AppCompositor.cpp

示例7: firstChild

void Element::normalize()
{
	Node* pCur = firstChild();
	while (pCur)
	{
		if (pCur->nodeType() == Node::ELEMENT_NODE)
		{
			pCur->normalize();
		}
		else if (pCur->nodeType() == Node::TEXT_NODE)
		{
			Node* pNext = pCur->nextSibling();
			while (pNext && pNext->nodeType() == Node::TEXT_NODE)
			{
				static_cast<Text*>(pCur)->appendData(pNext->nodeValue());
				removeChild(pNext);
				pNext = pCur->nextSibling();
			}
		}
		pCur = pCur->nextSibling();
	}
}
开发者ID:119,项目名称:vdc,代码行数:22,代码来源:Element.cpp

示例8: parent

//parent child handling
void DrawingManager::parent(double x, double y){
   if(currentShapes!=NULL){
    if (_parent ==NULL){
        for(int i=0;i<currentShapes->size();i++){
            Shape* s=  (*currentShapes)[ i ]->checkSelect(x, y);
            if(s!=NULL) {
                _parent=s;
                s->parentSelected= true;
               ((*currentShapes)[ i ])->selected = false;
                //cout<<"parent_selected"<<endl;
                
            }
            
            
            break;
        }
    }
    else {
        for(int i=0;i<currentShapes->size();i++){
            Shape* s=  (*currentShapes)[ i ]->checkSelect(x, y);
            if(s!=NULL && s!=_parent) {
                if(removeChild(s)){
                    _parent->AddChildNode(s);
                    s->childSelected= true;
                    s->selected = false;
                    
                    //cout<<"parent_child created"<<endl;
                    _parent = NULL;
                    break;
                }
            }
            
        }
        _parent = NULL;
        
    }
   }
    
}
开发者ID:pixelmaid,项目名称:evodraw,代码行数:40,代码来源:DrawingManager.cpp

示例9: debug

GameObject::~GameObject() {
	//dtor

	parent->removeChild(getUniqueID());

	delete mesh;
	debug("deleted mesh");
	delete behaviour;
	debug("deleted behaviour");
	delete collider;
	debug("deleted collider");
	delete colorMap;
	debug("deleted colorMap");
	for (vector<GameObject*>::iterator iter = children->begin(); iter != children->end(); ++iter) {
		removeChild(((GameObject*)* iter)->getUniqueID());
	}
	delete children;
	debug("deleted children");
	setParent(NULL);
	debug("no more parents");

}
开发者ID:Sander-Meijer,项目名称:GameProgramming-FabianSander,代码行数:22,代码来源:GameObject.cpp

示例10: removeChild

//==============================================================================
void WorldNode::clearUnusedNodes()
{
  std::vector<dart::dynamics::Frame*> unused;
  unused.reserve(mFrameToNode.size());

  // Find unusued ShapeFrameNodes
  for(auto& node_pair : mFrameToNode)
  {
    ShapeFrameNode* node = node_pair.second;
    if(node && !node->wasUtilized())
      unused.push_back(node_pair.first);
  }

  // Clear unused ShapeFrameNodes
  for(dart::dynamics::Frame* frame : unused)
  {
    NodeMap::iterator it = mFrameToNode.find(frame);
    ShapeFrameNode* node = it->second;
    removeChild(node);
    mFrameToNode.erase(it);
  }
}
开发者ID:jslee02,项目名称:wafr2016,代码行数:23,代码来源:WorldNode.cpp

示例11: LoadPlist

//---------------------------------------------------------
//
//
void CMessageBoxYesNo::onEnter()
{
    CCXMLLayer::onEnter();
    
    LoadPlist( "tip_1.plist" );
    
    const char *MenuButton[] = { "button_yes", "button_no" };
    
    const char *YesNo[] = { "YES", "NO" };
    for( int i = 0; i < 2; i++ )
	{
		CCSprite *pSprite= (CCSprite*)GetXMLNodeFromKey( MenuButton[i] );
		CCMenu *pMenu = CreatGameUIWithSprite( pSprite, menu_selector(CMessageBoxYesNo::menuCallback), i, this, pSprite->getPosition() );
		addChild( pMenu, pSprite->getZOrder() );
        removeChild( pSprite, true );
        
        
        CCLabelTTF* pLabelTTF = CCLabelTTF::labelWithString( YesNo[i], kFontSystem[FONT_GRAND].fontName, kFontSystem[FONT_GRAND].fontSize );
        pLabelTTF->setPosition( pMenu->getPosition() );
        CCRenderTexture* pstroke = createStroke(pLabelTTF, 1, kFontSystem[FONT_GRAND].strokeColor);
        addChild( pstroke,100 );
        addChild( pLabelTTF,100 );
	}
    
    CCNode *pNode =  GetXMLNodeFromKey( "t2dSceneObject_Message" );
	CCLabelTTF* pLabelTTF = CCLabelTTF::labelWithString( m_szBuffer, kFontSystem[FONT_THIN].fontName, kFontSystem[FONT_THIN].fontSize );
	pLabelTTF->setPosition( pNode->getPosition() );
    CCRenderTexture* pstroke = createStroke(pLabelTTF, 1, kFontSystem[FONT_THIN].strokeColor);
    addChild( pstroke,100 );
	addChild( pLabelTTF,100 );
    
    //pNode =  GetXMLNodeFromKey( "t2dSceneObject_tipname" );
	//pLabelTTF = CCLabelTTF::labelWithString( m_TitleBuffer, kFontSystem[FONT_THIN].fontName, kFontSystem[FONT_THIN].fontSize );
	//pLabelTTF->setPosition( pNode->getPosition() );
    //pstroke = createStroke(pLabelTTF, 1, kFontSystem[FONT_THIN].strokeColor);
    //addChild( pstroke,100 );
	//addChild( pLabelTTF,100 );
}
开发者ID:huyanoperation,项目名称:magicpet,代码行数:41,代码来源:CMessageBoxYesNo.cpp

示例12: nodeFromIndex

void QScriptDebuggerLocalsModelPrivate::reallySyncIndex(const QModelIndex &index,
                                                        const QScriptDebuggerObjectSnapshotDelta &delta)
{
    if (!index.isValid())
        return;
    QScriptDebuggerLocalsModelNode *node = nodeFromIndex(index);
    // update or remove existing children
    for (int i = 0; i < node->children.count(); ++i) {
        QScriptDebuggerLocalsModelNode *child = node->children.at(i);
        int j;
        for (j = 0; j < delta.changedProperties.count(); ++j) {
            if (child->property.name() == delta.changedProperties.at(j).name()) {
                child->property = delta.changedProperties.at(j);
                child->changed = true;
                emitDataChanged(index, index.sibling(0, 1));
                repopulate(child);
                break;
            }
        }
        if (j != delta.changedProperties.count())
            continue; // was changed
        for (j = 0; j < delta.removedProperties.count(); ++j) {
            if (child->property.name() == delta.removedProperties.at(j)) {
                removeChild(index, node, i);
                --i;
                break;
            }
        }
        if (j != delta.removedProperties.count())
            continue; // was removed
        // neither changed nor removed, but its children might be
        if (child->populationState == QScriptDebuggerLocalsModelNode::Populated) {
            QScriptDebuggerJob *job = new SyncModelIndexJob(indexFromNode(child), commandScheduler);
            jobScheduler->scheduleJob(job);
        }
    }
    addChildren(index, node, delta.addedProperties);
}
开发者ID:phen89,项目名称:rtqt,代码行数:38,代码来源:qscriptdebuggerlocalsmodel.cpp

示例13: removeChild

void UFunctionTag::setArgs(const QStringList& list)
{
    removeChild(hintTag);
    foreach(QTreeWidgetItem* item,takeChildren())
    {
        delete item;
    }

    addChild(hintTag);
    QMutableStringListIterator iterator(*((QList<QString>*)&list));
    while(iterator.hasNext())
    {
        QString item=iterator.next();
        item=item.trimmed();
        UStaticTag* child=new UStaticTag("arg");
        child->setIcon(QIcon(":/images/algorithm/var.png"));
        child->setText(item);
        addChild(child);
        iterator.setValue(item);
    }
    args=list.join(",");
    emit argsChanged(list);
}
开发者ID:davidaq,项目名称:Uranus2,代码行数:23,代码来源:ufunctiontag.cpp

示例14: if

// 运行动画
void CustomAnimation::runMyAnimation(float delta)
{
    _currentFrame++;
    
    if (_currentFrame <= _framesToAnimate) {
        if (_currentFrame < 10) {
            _someSprite->setTexture(CCSprite::create(CCString::createWithFormat("arts/game_main_scenes/%s_000%d.png", _fileNameToAnimate->getCString(), _currentFrame)->getCString())->getTexture());
        } else if (_currentFrame < 100) {
            _someSprite->setTexture(CCSprite::create(CCString::createWithFormat("arts/game_main_scenes/%s_00%d.png", _fileNameToAnimate->getCString(), _currentFrame)->getCString())->getTexture());
        } else {
            _someSprite->setTexture(CCSprite::create(CCString::createWithFormat("arts/game_main_scenes/%s_0%d.png", _fileNameToAnimate->getCString(), _currentFrame)->getCString())->getTexture());
        }
    } else {
        if (_doesTheAnimationLoop == true && _useRandomFrameToLoop == false) {
            _currentFrame = _framesToStartWith;
        } else if (_doesTheAnimationLoop == true && _useRandomFrameToLoop == true) {
            _currentFrame = arc4random() % _framesToAnimate;
        } else {
            removeChild(_someSprite, true);
            unschedule(schedule_selector(CustomAnimation::runMyAnimation));
        }
    }
}
开发者ID:renxueaiw,项目名称:AngryPanda,代码行数:24,代码来源:CustomAnimation.cpp

示例15: ASSERT

RenderObject* RenderRubyAsBlock::removeChild(RenderObject& child)
{
    // If the child's parent is *this (must be a ruby run or generated content or anonymous block),
    // just use the normal remove method.
    if (child.parent() == this) {
#ifndef ASSERT_DISABLED
        ASSERT(isRubyChildForNormalRemoval(child));
#endif
        return RenderBlockFlow::removeChild(child);
    }
    // If the child's parent is an anoymous block (must be generated :before/:after content)
    // just use the block's remove method.
    if (isAnonymousRubyInlineBlock(child.parent())) {
        ASSERT(child.isBeforeContent() || child.isAfterContent());
        RenderObject* next = child.parent()->removeChild(child);
        removeChild(*child.parent());
        return next;
    }

    // Otherwise find the containing run and remove it from there.
    RenderRubyRun& run = findRubyRunParent(child);
    return run.removeChild(child);
}
开发者ID:sinoory,项目名称:webv8,代码行数:23,代码来源:RenderRuby.cpp


注:本文中的removeChild函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。