本文整理汇总了C++中ON_BoundingBox::Max方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BoundingBox::Max方法的具体用法?C++ ON_BoundingBox::Max怎么用?C++ ON_BoundingBox::Max使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BoundingBox
的用法示例。
在下文中一共展示了ON_BoundingBox::Max方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsValid
BOOL ON_HatchLoop::IsValid( ON_TextLog* text_log) const
{
BOOL rc = m_p2dCurve != NULL;
if( !rc)
{
if( text_log)
text_log->Print( "2d loop curve is NULL\n");
}
if( rc)
{
rc = m_p2dCurve->IsValid( text_log);
if( !rc)
{
if( text_log)
text_log->Print( "Loop curve is not valid\n");
}
}
if( rc)
{
ON_BoundingBox box;
m_p2dCurve->GetBoundingBox( box);
rc = ( box.Max().z == box.Min().z && box.Max().z == 0.0);
if( !rc)
{
if( text_log)
text_log->Print( "2d loop curve has non-zero z coordinates\n");
}
}
if( rc && m_type != ltOuter && m_type != ltInner)
{
if( text_log)
text_log->Print( "Loop type is invalid.\n");
rc = false;
}
return rc;
}
示例2: GetDistanceToBoundingBox
bool ON_Plane::GetDistanceToBoundingBox(const ON_BoundingBox& Box,
double* min, double* max) const
{
//min and max signed distance. Returns false if plane normal has zero length.
ON_3dVector UnitNormal = Normal();
if (!UnitNormal.Unitize())
return false;
double mind, maxd;
mind = maxd = (Box.Min() - Origin())*UnitNormal;
int i0, i1, i2;
for (i0=0;i0<2;i0++)
{
for(i1=0;i1<2;i1++)
{
for (i2=0;i2<2;i2++)
{
if (i0||i1||i2)
{
ON_3dPoint P;
P[0]=(i0)?Box.Max()[0]:Box.Min()[0];
P[1]=(i1)?Box.Max()[1]:Box.Min()[1];
P[2]=(i2)?Box.Max()[2]:Box.Min()[2];
double d = (P - Origin())*UnitNormal;
//double dd = P.DistanceTo(ClosestPointTo(P));
if (d < mind)
mind=d;
else if (d > maxd)
maxd=d;
}
}
}
}
*min = mind;
*max = maxd;
return true;
}