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


C++ VectorType::Y方法代码示例

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


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

示例1: Scalar

void BallTree<_Scalar>::buildNode(Node& node, std::vector<int>& indices, AxisAlignedBoxType aabb, int level)
{
	Scalar avgradius = 0.;
	for (std::vector<int>::const_iterator it=indices.begin(), end=indices.end() ; it!=end ; ++it)
			avgradius += mRadii[*it];
	avgradius = mRadiusScale * avgradius / Scalar(indices.size());
	VectorType diag = aabb.max - aabb.min;
	if  (int(indices.size())<mTargetCellSize
		|| avgradius*0.9 > std::max(std::max(diag.X(), diag.Y()), diag.Z())
		|| int(level)>=mMaxTreeDepth)
	{
		node.leaf = true;
		node.size = indices.size();
		node.indices = new unsigned int[node.size];
		for (unsigned int i=0 ; i<node.size ; ++i)
			node.indices[i] = indices[i];
		return;
	}
	unsigned int dim = vcg::MaxCoeffId(diag);
	node.dim = dim;
	node.splitValue = Scalar(0.5*(aabb.max[dim] + aabb.min[dim]));
  node.leaf = 0;

	AxisAlignedBoxType aabbLeft=aabb, aabbRight=aabb;
	aabbLeft.max[dim] = node.splitValue;
	aabbRight.min[dim] = node.splitValue;

	std::vector<int> iLeft, iRight;
	split(indices, aabbLeft, aabbRight, iLeft,iRight);

	// we don't need the index list anymore
	indices.clear();

	{
		// left child
		//mNodes.resize(mNodes.size()+1);
		Node* pChild = new Node();
		node.children[0] = pChild;
		buildNode(*pChild, iLeft, aabbLeft, level+1);
	}

	{
		// right child
		//mNodes.resize(mNodes.size()+1);
		Node* pChild = new Node();
		node.children[1] = pChild;
		buildNode(*pChild, iRight, aabbRight, level+1);
	}
}
开发者ID:GuoXinxiao,项目名称:meshlab,代码行数:49,代码来源:balltree.cpp

示例2: Inflate

void Rectangle::Inflate(const VectorType &size) noexcept {
    Inflate(size.X(), size.Y());
}
开发者ID:riteme,项目名称:ne2d,代码行数:3,代码来源:Rectangle.cpp

示例3: Offest

void Rectangle::Offest(const VectorType &vec) noexcept {
    Offest(vec.X(), vec.Y());
}
开发者ID:riteme,项目名称:ne2d,代码行数:3,代码来源:Rectangle.cpp


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