本文整理汇总了C++中ccBBox::minCorner方法的典型用法代码示例。如果您正苦于以下问题:C++ ccBBox::minCorner方法的具体用法?C++ ccBBox::minCorner怎么用?C++ ccBBox::minCorner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ccBBox
的用法示例。
在下文中一共展示了ccBBox::minCorner方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void visit(ccKdTree::BaseNode* node)
{
assert(node);
if (node && node->parent)
{
assert(node->parent->isNode()); //a leaf can't have children!
ccKdTree::Node* parent = static_cast<ccKdTree::Node*>(node->parent);
//we choose the right 'side' of the box that corresponds to the parent's split plane
CCVector3& boxCorner = (parent->leftChild == node ? m_UpdatedBox.maxCorner() : m_UpdatedBox.minCorner());
//if this side has not been setup yet...
if (boxCorner.u[parent->splitDim] != boxCorner.u[parent->splitDim]) //NaN
boxCorner.u[parent->splitDim] = parent->splitValue;
visit(node->parent);
}
}
示例2: MakeSquare
//Helper
void MakeSquare(ccBBox& box, int pivotType, int defaultDim = -1)
{
assert(defaultDim<3);
assert(pivotType>=0 && pivotType<3);
CCVector3 W = box.getDiagVec();
if (W.x != W.y || W.x != W.z)
{
if (defaultDim < 0)
{
//we take the largest one!
defaultDim = 0;
if (W.u[1] > W.u[defaultDim])
defaultDim = 1;
if (W.u[2] > W.u[defaultDim])
defaultDim = 2;
}
CCVector3 newW(W.u[defaultDim], W.u[defaultDim], W.u[defaultDim]);
switch(pivotType)
{
case 0: //min corner
{
CCVector3 A = box.minCorner();
box = ccBBox(A, A + newW);
}
break;
case 1: //center
{
CCVector3 C = box.getCenter();
box = ccBBox(C - newW / 2.0, C + newW / 2.0);
}
break;
case 2: //max corner
{
CCVector3 B = box.maxCorner();
box = ccBBox(B-newW,B);
}
break;
}
}
}
示例3: ComputeVolume
bool ccVolumeCalcTool::ComputeVolume( ccRasterGrid& grid,
ccGenericPointCloud* ground,
ccGenericPointCloud* ceil,
const ccBBox& gridBox,
unsigned char vertDim,
double gridStep,
unsigned gridWidth,
unsigned gridHeight,
ccRasterGrid::ProjectionType projectionType,
ccRasterGrid::EmptyCellFillOption emptyCellFillStrategy,
ccVolumeCalcTool::ReportInfo& reportInfo,
double groundHeight = std::numeric_limits<double>::quiet_NaN(),
double ceilHeight = std::numeric_limits<double>::quiet_NaN(),
QWidget* parentWidget/*=0*/)
{
if ( gridStep <= 1.0e-8
|| gridWidth == 0
|| gridHeight == 0
|| vertDim > 2)
{
assert(false);
ccLog::Warning("[Volume] Invalid input parameters");
return false;
}
if (!ground && !ceil)
{
assert(false);
ccLog::Warning("[Volume] No valid input cloud");
return false;
}
if (!gridBox.isValid())
{
ccLog::Warning("[Volume] Invalid bounding-box");
return false;
}
//grid size
unsigned gridTotalSize = gridWidth * gridHeight;
if (gridTotalSize == 1)
{
if (parentWidget && QMessageBox::question(parentWidget, "Unexpected grid size", "The generated grid will only have 1 cell! Do you want to proceed anyway?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return false;
}
else if (gridTotalSize > 10000000)
{
if (parentWidget && QMessageBox::question(parentWidget, "Big grid size", "The generated grid will have more than 10.000.000 cells! Do you want to proceed anyway?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return false;
}
//memory allocation
CCVector3d minCorner = CCVector3d::fromArray(gridBox.minCorner().u);
if (!grid.init(gridWidth, gridHeight, gridStep, minCorner))
{
//not enough memory
return SendError("Not enough memory", parentWidget);
}
//progress dialog
QScopedPointer<ccProgressDialog> pDlg(0);
if (parentWidget)
{
pDlg.reset(new ccProgressDialog(true, parentWidget));
}
ccRasterGrid groundRaster;
if (ground)
{
if (!groundRaster.init(gridWidth, gridHeight, gridStep, minCorner))
{
//not enough memory
return SendError("Not enough memory", parentWidget);
}
if (groundRaster.fillWith( ground,
vertDim,
projectionType,
emptyCellFillStrategy == ccRasterGrid::INTERPOLATE,
ccRasterGrid::INVALID_PROJECTION_TYPE,
pDlg.data()))
{
groundRaster.fillEmptyCells(emptyCellFillStrategy, groundHeight);
ccLog::Print(QString("[Volume] Ground raster grid: size: %1 x %2 / heights: [%3 ; %4]").arg(groundRaster.width).arg(groundRaster.height).arg(groundRaster.minHeight).arg(groundRaster.maxHeight));
}
else
{
return false;
}
}
//ceil
ccRasterGrid ceilRaster;
if (ceil)
{
if (!ceilRaster.init(gridWidth, gridHeight, gridStep, minCorner))
{
//not enough memory
return SendError("Not enough memory", parentWidget);
}
//.........这里部分代码省略.........
示例4:
GetCellBBoxVisitor()
{
//invalidate the initial bounding box
m_UpdatedBox.maxCorner() = CCVector3(PC_NAN,PC_NAN,PC_NAN);
m_UpdatedBox.minCorner() = CCVector3(PC_NAN,PC_NAN,PC_NAN);
}