[每日一码] ARX点表比较函数等
//点表比较函数,配合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;
}
页:
[1]