rename the enums for surface classification in the SShell class.
This commit is contained in:
parent
2e2aceb5ed
commit
604335f1c9
@ -270,10 +270,10 @@ void SSurface::TrimFromEdgeList(SEdgeList *el, bool asUv) {
|
|||||||
|
|
||||||
static bool KeepRegion(SSurface::CombineAs type, bool opA, SShell::Class shell, SShell::Class orig)
|
static bool KeepRegion(SSurface::CombineAs type, bool opA, SShell::Class shell, SShell::Class orig)
|
||||||
{
|
{
|
||||||
bool inShell = (shell == SShell::Class::INSIDE),
|
bool inShell = (shell == SShell::Class::SURF_INSIDE),
|
||||||
outSide = (shell == SShell::Class::OUTSIDE),
|
outSide = (shell == SShell::Class::SURF_OUTSIDE),
|
||||||
inSame = (shell == SShell::Class::COINC_SAME),
|
inSame = (shell == SShell::Class::SURF_COINC_SAME),
|
||||||
inOrig = (orig == SShell::Class::INSIDE);
|
inOrig = (orig == SShell::Class::SURF_INSIDE);
|
||||||
|
|
||||||
if(!inOrig) return false;
|
if(!inOrig) return false;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
@ -318,29 +318,29 @@ static void TagByClassifiedEdge(SBspUv::Class bspclass, SShell::Class *indir, SS
|
|||||||
{
|
{
|
||||||
switch(bspclass) {
|
switch(bspclass) {
|
||||||
case SBspUv::Class::INSIDE:
|
case SBspUv::Class::INSIDE:
|
||||||
*indir = SShell::Class::INSIDE;
|
*indir = SShell::Class::SURF_INSIDE;
|
||||||
*outdir = SShell::Class::INSIDE;
|
*outdir = SShell::Class::SURF_INSIDE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SBspUv::Class::OUTSIDE:
|
case SBspUv::Class::OUTSIDE:
|
||||||
*indir = SShell::Class::OUTSIDE;
|
*indir = SShell::Class::SURF_OUTSIDE;
|
||||||
*outdir = SShell::Class::OUTSIDE;
|
*outdir = SShell::Class::SURF_OUTSIDE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SBspUv::Class::EDGE_PARALLEL:
|
case SBspUv::Class::EDGE_PARALLEL:
|
||||||
*indir = SShell::Class::INSIDE;
|
*indir = SShell::Class::SURF_INSIDE;
|
||||||
*outdir = SShell::Class::OUTSIDE;
|
*outdir = SShell::Class::SURF_OUTSIDE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SBspUv::Class::EDGE_ANTIPARALLEL:
|
case SBspUv::Class::EDGE_ANTIPARALLEL:
|
||||||
*indir = SShell::Class::OUTSIDE;
|
*indir = SShell::Class::SURF_OUTSIDE;
|
||||||
*outdir = SShell::Class::INSIDE;
|
*outdir = SShell::Class::SURF_INSIDE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dbp("TagByClassifiedEdge: fail!");
|
dbp("TagByClassifiedEdge: fail!");
|
||||||
*indir = SShell::Class::OUTSIDE;
|
*indir = SShell::Class::SURF_OUTSIDE;
|
||||||
*outdir = SShell::Class::OUTSIDE;
|
*outdir = SShell::Class::SURF_OUTSIDE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -612,8 +612,8 @@ SSurface SSurface::MakeCopyTrimAgainst(SShell *parent,
|
|||||||
|
|
||||||
SShell::Class indir_shell, outdir_shell, indir_orig, outdir_orig;
|
SShell::Class indir_shell, outdir_shell, indir_orig, outdir_orig;
|
||||||
|
|
||||||
indir_orig = SShell::Class::INSIDE;
|
indir_orig = SShell::Class::SURF_INSIDE;
|
||||||
outdir_orig = SShell::Class::OUTSIDE;
|
outdir_orig = SShell::Class::SURF_OUTSIDE;
|
||||||
|
|
||||||
agnst->ClassifyEdge(&indir_shell, &outdir_shell,
|
agnst->ClassifyEdge(&indir_shell, &outdir_shell,
|
||||||
ret.PointAt(auv), ret.PointAt(buv), pt,
|
ret.PointAt(auv), ret.PointAt(buv), pt,
|
||||||
|
@ -398,14 +398,14 @@ SShell::Class SShell::ClassifyRegion(Vector edge_n, Vector inter_surf_n,
|
|||||||
// are coincident. Test the edge's surface normal
|
// are coincident. Test the edge's surface normal
|
||||||
// to see if it's with same or opposite normals.
|
// to see if it's with same or opposite normals.
|
||||||
if(inter_surf_n.Dot(edge_surf_n) > 0) {
|
if(inter_surf_n.Dot(edge_surf_n) > 0) {
|
||||||
return Class::COINC_SAME;
|
return Class::SURF_COINC_SAME;
|
||||||
} else {
|
} else {
|
||||||
return Class::COINC_OPP;
|
return Class::SURF_COINC_OPP;
|
||||||
}
|
}
|
||||||
} else if(dot > 0) {
|
} else if(dot > 0) {
|
||||||
return Class::OUTSIDE;
|
return Class::SURF_OUTSIDE;
|
||||||
} else {
|
} else {
|
||||||
return Class::INSIDE;
|
return Class::SURF_INSIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ bool SShell::ClassifyEdge(Class *indir, Class *outdir,
|
|||||||
swap(inter_edge_n[0], inter_edge_n[1]);
|
swap(inter_edge_n[0], inter_edge_n[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Class coinc = (surf_n.Dot(inter_surf_n[0])) > 0 ? Class::COINC_SAME : Class::COINC_OPP;
|
Class coinc = (surf_n.Dot(inter_surf_n[0])) > 0 ? Class::SURF_COINC_SAME : Class::SURF_COINC_OPP;
|
||||||
|
|
||||||
if(fabs(dotp[0]) < DOTP_TOL && fabs(dotp[1]) < DOTP_TOL) {
|
if(fabs(dotp[0]) < DOTP_TOL && fabs(dotp[1]) < DOTP_TOL) {
|
||||||
// This is actually an edge on face case, just that the face
|
// This is actually an edge on face case, just that the face
|
||||||
@ -484,25 +484,25 @@ bool SShell::ClassifyEdge(Class *indir, Class *outdir,
|
|||||||
} else if(fabs(dotp[0]) < DOTP_TOL && dotp[1] > DOTP_TOL) {
|
} else if(fabs(dotp[0]) < DOTP_TOL && dotp[1] > DOTP_TOL) {
|
||||||
if(edge_n_out.Dot(inter_edge_n[0]) > 0) {
|
if(edge_n_out.Dot(inter_edge_n[0]) > 0) {
|
||||||
*indir = coinc;
|
*indir = coinc;
|
||||||
*outdir = Class::OUTSIDE;
|
*outdir = Class::SURF_OUTSIDE;
|
||||||
} else {
|
} else {
|
||||||
*indir = Class::INSIDE;
|
*indir = Class::SURF_INSIDE;
|
||||||
*outdir = coinc;
|
*outdir = coinc;
|
||||||
}
|
}
|
||||||
} else if(fabs(dotp[0]) < DOTP_TOL && dotp[1] < -DOTP_TOL) {
|
} else if(fabs(dotp[0]) < DOTP_TOL && dotp[1] < -DOTP_TOL) {
|
||||||
if(edge_n_out.Dot(inter_edge_n[0]) > 0) {
|
if(edge_n_out.Dot(inter_edge_n[0]) > 0) {
|
||||||
*indir = coinc;
|
*indir = coinc;
|
||||||
*outdir = Class::INSIDE;
|
*outdir = Class::SURF_INSIDE;
|
||||||
} else {
|
} else {
|
||||||
*indir = Class::OUTSIDE;
|
*indir = Class::SURF_OUTSIDE;
|
||||||
*outdir = coinc;
|
*outdir = coinc;
|
||||||
}
|
}
|
||||||
} else if(dotp[0] > DOTP_TOL && dotp[1] > DOTP_TOL) {
|
} else if(dotp[0] > DOTP_TOL && dotp[1] > DOTP_TOL) {
|
||||||
*indir = Class::INSIDE;
|
*indir = Class::SURF_INSIDE;
|
||||||
*outdir = Class::OUTSIDE;
|
*outdir = Class::SURF_OUTSIDE;
|
||||||
} else if(dotp[0] < -DOTP_TOL && dotp[1] < -DOTP_TOL) {
|
} else if(dotp[0] < -DOTP_TOL && dotp[1] < -DOTP_TOL) {
|
||||||
*indir = Class::OUTSIDE;
|
*indir = Class::SURF_OUTSIDE;
|
||||||
*outdir = Class::INSIDE;
|
*outdir = Class::SURF_INSIDE;
|
||||||
} else {
|
} else {
|
||||||
// Edge is tangent to the shell at shell's edge, so can't be
|
// Edge is tangent to the shell at shell's edge, so can't be
|
||||||
// a boundary of the surface.
|
// a boundary of the surface.
|
||||||
@ -557,8 +557,8 @@ bool SShell::ClassifyEdge(Class *indir, Class *outdir,
|
|||||||
/*asSegment=*/false, /*trimmed=*/true, /*inclTangent=*/false);
|
/*asSegment=*/false, /*trimmed=*/true, /*inclTangent=*/false);
|
||||||
|
|
||||||
// no intersections means it's outside
|
// no intersections means it's outside
|
||||||
*indir = Class::OUTSIDE;
|
*indir = Class::SURF_OUTSIDE;
|
||||||
*outdir = Class::OUTSIDE;
|
*outdir = Class::SURF_OUTSIDE;
|
||||||
double dmin = VERY_POSITIVE;
|
double dmin = VERY_POSITIVE;
|
||||||
bool onEdge = false;
|
bool onEdge = false;
|
||||||
edge_inters = 0;
|
edge_inters = 0;
|
||||||
@ -584,11 +584,11 @@ bool SShell::ClassifyEdge(Class *indir, Class *outdir,
|
|||||||
// Edge does not lie on surface; either strictly inside
|
// Edge does not lie on surface; either strictly inside
|
||||||
// or strictly outside
|
// or strictly outside
|
||||||
if((si->surfNormal).Dot(ray) > 0) {
|
if((si->surfNormal).Dot(ray) > 0) {
|
||||||
*indir = Class::INSIDE;
|
*indir = Class::SURF_INSIDE;
|
||||||
*outdir = Class::INSIDE;
|
*outdir = Class::SURF_INSIDE;
|
||||||
} else {
|
} else {
|
||||||
*indir = Class::OUTSIDE;
|
*indir = Class::SURF_OUTSIDE;
|
||||||
*outdir = Class::OUTSIDE;
|
*outdir = Class::SURF_OUTSIDE;
|
||||||
}
|
}
|
||||||
onEdge = si->onEdge;
|
onEdge = si->onEdge;
|
||||||
}
|
}
|
||||||
|
@ -407,10 +407,10 @@ public:
|
|||||||
// outside, or coincident (with parallel or antiparallel normal) with a
|
// outside, or coincident (with parallel or antiparallel normal) with a
|
||||||
// shell.
|
// shell.
|
||||||
enum class Class : uint32_t {
|
enum class Class : uint32_t {
|
||||||
INSIDE = 100,
|
SURF_INSIDE = 100,
|
||||||
OUTSIDE = 200,
|
SURF_OUTSIDE = 200,
|
||||||
COINC_SAME = 300,
|
SURF_COINC_SAME = 300,
|
||||||
COINC_OPP = 400
|
SURF_COINC_OPP = 400
|
||||||
};
|
};
|
||||||
static const double DOTP_TOL;
|
static const double DOTP_TOL;
|
||||||
Class ClassifyRegion(Vector edge_n, Vector inter_surf_n,
|
Class ClassifyRegion(Vector edge_n, Vector inter_surf_n,
|
||||||
|
Loading…
Reference in New Issue
Block a user