本文整理汇总了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);
}
}
示例2: Inflate
void Rectangle::Inflate(const VectorType &size) noexcept {
Inflate(size.X(), size.Y());
}
示例3: Offest
void Rectangle::Offest(const VectorType &vec) noexcept {
Offest(vec.X(), vec.Y());
}