|
//点表比较函数,配合std::sort使用
//点按xyz排序,小写字母表示从小到大排序,大写则从大到小排序,在前的字母先排序
int cmp_xyz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_xYz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_xYZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_xyZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_XYZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_XyZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_Xyz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_XYz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_xy (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.y < p2.y?1:0;
}
int cmp_xY (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.y > p2.y?1:0;
}
int cmp_Xy (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.y < p2.y?1:0;
}
int cmp_XY (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.y > p2.y?1:0;
}
int cmp_x(AcGePoint3d p1,AcGePoint3d p2)
{
return p1.x < p2.x?1:0;
}
int cmp_X(AcGePoint3d p1,AcGePoint3d p2)
{
return p1.x > p2.x?1:0;
}
int cmp_y(AcGePoint3d p1,AcGePoint3d p2)
{
return p1.y < p2.y?1:0;
}
int cmp_Y(AcGePoint3d p1,AcGePoint3d p2)
{
return p1.y > p2.y?1:0;
}
int cmp_z(AcGePoint3d p1,AcGePoint3d p2)
{
return p1.z < p2.z?1:0;
}
int cmp_Z(AcGePoint3d p1,AcGePoint3d p2)
{
return p1.z > p2.z?1:0;
}
int cmp_YX (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.x > p2.x?1:0;
}
int cmp_Yx (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.x < p2.x?1:0;
}
int cmp_yx (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.x < p2.x?1:0;
}
int cmp_yX (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.x > p2.x?1:0;
}
int cmp_yxz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_yXz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_yXZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_yxZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_YXZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_YxZ (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.z > p2.z?1:0;
}
int cmp_Yxz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_YXz (AcGePoint3d p1,AcGePoint3d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.z < p2.z?1:0;
}
int cmp_2d_xy (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.y < p2.y?1:0;
}
int cmp_2d_xY (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.x != p2.x)
return p1.x < p2.x?1:0;
else
return p1.y > p2.y?1:0;
}
int cmp_2d_Xy (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.y < p2.y?1:0;
}
int cmp_2d_XY (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.x != p2.x)
return p1.x > p2.x?1:0;
else
return p1.y > p2.y?1:0;
}
int cmp_2d_x (AcGePoint2d p1,AcGePoint2d p2)
{
return p1.x < p2.x?1:0;
}
int cmp_2d_X(AcGePoint2d p1,AcGePoint2d p2)
{
return p1.x > p2.x?1:0;
}
int cmp_2d_y (AcGePoint2d p1,AcGePoint2d p2)
{
return p1.y < p2.y?1:0;
}
int cmp_2d_Y(AcGePoint2d p1,AcGePoint2d p2)
{
return p1.y > p2.y?1:0;
}
int cmp_2d_YX(AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.x > p2.x?1:0;
}
int cmp_2d_Yx (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.y != p2.y)
return p1.y > p2.y?1:0;
else
return p1.x < p2.x?1:0;
}
int cmp_2d_yx (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.x < p2.x?1:0;
}
int cmp_2d_yX (AcGePoint2d p1,AcGePoint2d p2)
{
if (p1.y != p2.y)
return p1.y < p2.y?1:0;
else
return p1.x > p2.x?1:0;
}
int cmp_up (int &a,int &b)
{
return a<b?1:0;
}
int cmp_up (double &a,double &b)
{
return a<b?1:0;
}
int cmp_down (const int &a, const int &b)
{
return a>b?1:0;
}
int cmp_down (double &a,double &b)
{
return a>b?1:0;
}
int cmp_2Point (AcGePoint3d p1,AcGePoint3d p2,CString &cmpstr)
{
if (p1.x != p2.x)
return acutWcMatch(cmpstr, _T("X*") )== RTNORM? p1.x > p2.x : p1.x < p2.x ;
else if (p1.y != p2.y)
return acutWcMatch(cmpstr, _T("?Y*") )== RTNORM? p1.y > p2.y : p1.y < p2.y;
else
return acutWcMatch(cmpstr, _T("*Z") )== RTNORM? p1.z > p2.z : p1.z < p2.z;
} |
|