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


C++ ControlPoint::lengthID方法代码示例

本文整理汇总了C++中ControlPoint::lengthID方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlPoint::lengthID方法的具体用法?C++ ControlPoint::lengthID怎么用?C++ ControlPoint::lengthID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ControlPoint的用法示例。


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

示例1: getBoxById

void
CSPold::removeBox(unsigned int boxId, std::vector<unsigned int>& relationsRemoved, std::vector<unsigned int>& triggersRemoved)
{
	ConstrainedBox* cedBox = getBoxById(boxId);

	relationsRemoved.clear();
	triggersRemoved.clear();

	/*
     remove cedBox from the boxes hierarchy
	 */

//	for (vector<ConstrainedBox*>::iterator it = cedBox->children()->begin() ; it != cedBox->children()->end() ; it++)
//	{
//		removeBoundingRelation((*it)->boundingRelation());
//		(*it)->setMother(cedBox->mother(), addBoundingRelation(cedBox->mother(), (*it)));
//	}

	if (cedBox->mother())
	{
//		removeBoundingRelation(cedBox->boundingRelation());
//		cedBox->mother()->removeChild(cedBox);
	}

	/*
     remove temporal constraints implicating cedBox
	 */

	vector<BinaryTemporalRelation*> *relToRemove = links(cedBox);
	for (vector<BinaryTemporalRelation*>::iterator it = relToRemove->begin() ; it != relToRemove->end() ; it++)
	{
		unsigned int relationId = (*it)->getId();
		relationsRemoved.push_back(relationId);
		removeTemporalRelation((*it));
		delete (*it);
	}
	relToRemove->clear();
	delete relToRemove;

	vector<unsigned int>* controlPointID = new vector <unsigned int>;
	cedBox->getAllControlPointsId(controlPointID);

	for (unsigned int i = 0 ; i < controlPointID->size() ; ++i) {
		ControlPoint* currentControlPoint = cedBox->getControlPoint(controlPointID->at(i));

		if(currentControlPoint->getTriggerPoint() != NULL) {
			TriggerPoint* currentTriggerPoint = currentControlPoint->getTriggerPoint();
			triggersRemoved.push_back(currentTriggerPoint->getTriggerId());
			currentTriggerPoint->removeRelatedControlPoint();
		}

		relToRemove = links(currentControlPoint);
		for (vector<BinaryTemporalRelation*>::iterator it = relToRemove->begin() ; it != relToRemove->end() ; it++)
		{
			removeTemporalRelation((*it));
			delete (*it);
		}

		_solver->removeIntVar(currentControlPoint->beginID());
		_solver->removeIntVar(currentControlPoint->lengthID());
	}

	/*
    remove related variables from the solver
	 */

	_solver->removeIntVar(cedBox->beginID());
	_solver->removeIntVar(cedBox->lengthID());

	/*
    remove cedBox from the constrained objects' list of the CSPold
	 */

	_cedEntities->erase(boxId);
}
开发者ID:ChristianFrisson,项目名称:Score,代码行数:75,代码来源:CSPold.cpp


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