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


C++ multiset::clear方法代码示例

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


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

示例1: clear_sim

void clear_sim(void)
{
	invadedSites.clear();
	accessibleBonds.clear();
	growth.clear();
	removed.clear();
	r_squared_array.clear();
	counter = 0;
	chem_level_list.clear();
	burst_list.clear();
}
开发者ID:jqnorris,项目名称:Misc,代码行数:11,代码来源:simulation.cpp

示例2: SweepControllerPath

int plPXPhysicalControllerCore::SweepControllerPath(const hsPoint3& startPos, const hsPoint3& endPos, hsBool vsDynamics, hsBool vsStatics, 
                            uint32_t& vsSimGroups, std::multiset< plControllerSweepRecord >& WhatWasHitOut)
{
    NxCapsule tempCap;
    tempCap.p0 =plPXConvert::Point( startPos);
    tempCap.p0.z = tempCap.p0.z + fPreferedRadius;
    tempCap.radius = fPreferedRadius ;
    tempCap.p1 = tempCap.p0;
    tempCap.p1.z = tempCap.p1.z + fPreferedHeight;

    NxVec3 vec;
    vec.x = endPos.fX - startPos.fX;
    vec.y = endPos.fY - startPos.fY;
    vec.z = endPos.fZ - startPos.fZ;

    int numberofHits = 0;
    int HitsReturned = 0;
    WhatWasHitOut.clear();
    NxScene *myscene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
    NxSweepQueryHit whatdidIhit[10];
    unsigned int flags = NX_SF_ALL_HITS;
    if(vsDynamics)
        flags |= NX_SF_DYNAMICS;
    if(vsStatics)
        flags |= NX_SF_STATICS;
    numberofHits = myscene->linearCapsuleSweep(tempCap, vec, flags, nil, 10, whatdidIhit, nil, vsSimGroups);
    if(numberofHits)
    {//we hit a dynamic object lets make sure it is not animatable
        for(int i=0; i<numberofHits; i++)
        {
            plControllerSweepRecord CurrentHit;
            CurrentHit.ObjHit=(plPhysical*)whatdidIhit[i].hitShape->getActor().userData;
            CurrentHit.Norm.fX = whatdidIhit[i].normal.x;
            CurrentHit.Norm.fY = whatdidIhit[i].normal.y;
            CurrentHit.Norm.fZ = whatdidIhit[i].normal.z;
            if(CurrentHit.ObjHit != nil)
            {
                hsPoint3 where;
                where.fX = whatdidIhit[i].point.x;
                where.fY = whatdidIhit[i].point.y;
                where.fZ = whatdidIhit[i].point.z;
                CurrentHit.locHit = where;
                CurrentHit.TimeHit = whatdidIhit[i].t ;
                WhatWasHitOut.insert(CurrentHit);
                HitsReturned++;
            }
        }
    }

    return HitsReturned;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:51,代码来源:plPXPhysicalControllerCore.cpp

示例3: record_sim

void record_sim(int i)
{
	std::deque<str_and_Bond>::iterator iter;
	double temp_x;
	double temp_y;
	double temp_r_sq;

	for(iter=growth.begin(); iter!=growth.end(); iter++)
	{
		temp_x = iter->second.second.first;
		temp_y = iter->second.second.second;
		temp_r_sq = temp_x*temp_x+temp_y*temp_y;
		r_squared_array.insert(temp_r_sq);
	}

	long int count = 0;

	std::multiset<long long int>::iterator iter2 = r_squared_array.begin();

	for(int j=0; j<num_r_values; j++)
	{

		while(count<growth.size() && *iter2 < r[j]*r[j])
		{
			count++;
			iter2++;
		}
		M_array[i][j] = count;
	}

	for(iter=removed.begin(); iter!=removed.end(); iter++)
	{
		temp_x = iter->second.second.first;
		temp_y = iter->second.second.second;
		temp_r_sq = temp_x*temp_x+temp_y*temp_y;
		r_squared_array.insert(temp_r_sq);
	}

	count = 0;
	iter2 = r_squared_array.begin();

	for(int j=0; j<num_r_values; j++)
	{

		while(count<growth.size() + removed.size() && *iter2 < r[j]*r[j])
		{
			count++;
			iter2++;
		}
		Both_array[i][j] = count;
	}

	r_squared_array.clear();

	for(iter=removed.begin(); iter!=removed.end(); iter++)
	{
		temp_x = iter->second.second.first;
				temp_y = iter->second.second.second;
				temp_r_sq = temp_x*temp_x+temp_y*temp_y;
				r_squared_array.insert(temp_r_sq);
	}

	count = 0;
	iter2 = r_squared_array.begin();

	for(int j=0; j<num_r_values; j++)
	{

		while(count<removed.size() && *iter2 < r[j]*r[j])
		{
			count++;
			iter2++;
		}
		Removed_array[i][j] = count;
	}

	std::map<Site, int>::iterator iter3;

	for(iter3 = chem_level_list.begin(); iter3 != chem_level_list.end(); iter3++)
	{
		if(iter3->second < chem_level_cutoff)
		{
			chem_level_array[i][iter3->second]++;
		}
	}

	std::deque<boost::tuple<int, int, long int> >::iterator burst_iter = burst_list.begin();
	std::deque<boost::tuple<int, int, long int> >::iterator burst_list_end = burst_list.end();

	int burst_x;
	int burst_y;
	long int burst_size;

	while(burst_iter != burst_list_end)
	{
		burst_x = burst_iter->get<0>();
		burst_y = burst_iter->get<1>();
		burst_size = burst_iter->get<2>();

		burst_array.push_back(boost::make_tuple(i, burst_x, burst_y, burst_size));
//.........这里部分代码省略.........
开发者ID:jqnorris,项目名称:Misc,代码行数:101,代码来源:simulation.cpp


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