本文整理汇总了C++中pointField::setSize方法的典型用法代码示例。如果您正苦于以下问题:C++ pointField::setSize方法的具体用法?C++ pointField::setSize怎么用?C++ pointField::setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pointField
的用法示例。
在下文中一共展示了pointField::setSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forAll
void findNearest
(
const searchableSurfaces& geometry,
const labelList& surfaces,
const pointField& start,
const scalarField& distSqr,
pointField& near,
List<pointConstraint>& constraint
)
{
// Multi-surface findNearest
vectorField normal;
List<pointIndexHit> info;
geometry[surfaces[0]].findNearest(start, distSqr, info);
geometry[surfaces[0]].getNormal(info, normal);
// Extract useful info
near.setSize(info.size());
forAll(info, i)
{
near[i] = info[i].hitPoint();
}
constraint.setSize(near.size());
if (surfaces.size() == 1)
{
constraint = pointConstraint();
forAll(constraint, i)
{
constraint[i].applyConstraint(normal[i]);
}
示例2:
void Foam::searchableCylinder::boundingSpheres
(
pointField& centres,
scalarField& radiusSqr
) const
{
centres.setSize(1);
centres[0] = 0.5*(point1_ + point2_);
radiusSqr.setSize(1);
radiusSqr[0] = Foam::magSqr(point1_-centres[0]) + Foam::sqr(radius_);
// Add a bit to make sure all points are tested inside
radiusSqr += Foam::sqr(SMALL);
}
示例3:
void Foam::searchablePlate::boundingSpheres
(
pointField& centres,
scalarField& radiusSqr
) const
{
centres.setSize(1);
centres[0] = origin_ + 0.5*span_;
radiusSqr.setSize(1);
radiusSqr[0] = Foam::magSqr(0.5*span_);
// Add a bit to make sure all points are tested inside
radiusSqr += Foam::sqr(SMALL);
}
示例4: sqr
void Foam::searchableDisk::boundingSpheres
(
pointField& centres,
scalarField& radiusSqr
) const
{
centres.setSize(1);
centres[0] = origin_;
radiusSqr.setSize(1);
radiusSqr[0] = sqr(radius_);
// Add a bit to make sure all points are tested inside
radiusSqr += Foam::sqr(small);
}
示例5: forAll
void Foam::hexCellLooper::makeFace
(
const labelList& loop,
const scalarField& loopWeights,
labelList& faceVerts,
pointField& facePoints
) const
{
facePoints.setSize(loop.size());
faceVerts.setSize(loop.size());
forAll(loop, cutI)
{
label cut = loop[cutI];
if (isEdge(cut))
{
label edgeI = getEdge(cut);
const edge& e = mesh().edges()[edgeI];
const point& v0 = mesh().points()[e.start()];
const point& v1 = mesh().points()[e.end()];
facePoints[cutI] =
loopWeights[cutI]*v1 + (1.0-loopWeights[cutI])*v0;
}
else
{
label vertI = getVertex(cut);
facePoints[cutI] = mesh().points()[vertI];
}
faceVerts[cutI] = cutI;
}