- modificata definizione di min/max per incompatibilità.
This commit is contained in:
SaraP
2023-11-23 16:05:51 +01:00
parent de65914f43
commit 96e52a607a
8 changed files with 20 additions and 20 deletions
+5 -5
View File
@@ -69,7 +69,7 @@ void vroniObject::ApproxArcsHeuristic(int approx)
assert(approx > 0);
x_dist = bb_max.x - bb_min.x;
y_dist = bb_max.y - bb_min.y;
dist = Max(x_dist, y_dist);
dist = VroniMax(x_dist, y_dist);
assert(dist > 0.0);
if (eq(dist, ZERO)) dist = 1.0;
@@ -110,7 +110,7 @@ void vroniObject::ApproxArcsHeuristic(int approx)
else
incr = M_2PI;
min = (angle_e - angle_s) / 2.99;
incr = Min(incr, min);
incr = VroniMin(incr, min);
angle_e -= incr;
alpha = angle_s + incr;
@@ -191,7 +191,7 @@ void vroniObject::ApproxArcsHeuristic(int approx)
else
incr = M_2PI;
min = (angle_e - angle_s) / 2.99;
incr = Min(incr, min);
incr = VroniMin(incr, min);
angle_s += incr;
alpha = angle_e - incr;
@@ -466,7 +466,7 @@ void vroniObject::SampleData(int sample)
x_dist = bb_max.x - bb_min.x;
y_dist = bb_max.y - bb_min.y;
dist = Max(x_dist, y_dist);
dist = VroniMax(x_dist, y_dist);
assert(dist > 0.0);
if (eq(dist, ZERO)) dist = 1.0;
@@ -530,7 +530,7 @@ void vroniObject::SampleData(int sample)
else
incr = M_2PI;
min = (angle_e - angle_s) / 2.99;
incr = Min(incr, min);
incr = VroniMin(incr, min);
angle_e -= incr;
alpha = angle_s + incr;
+2 -2
View File
@@ -877,8 +877,8 @@ void vroniObject::ScaleData(void)
x_ext = bb_max.x - bb_min.x;
y_ext = bb_max.y - bb_min.y;
xy = Max(x_ext, y_ext);
xy = Max(xy, ZERO);
xy = VroniMax(x_ext, y_ext);
xy = VroniMax(xy, ZERO);
scale_factor = 1.0;
shift.x = (bb_min.x + bb_max.x)/2.0;
+2 -2
View File
@@ -612,7 +612,7 @@ vr_bool vroniObject::ComputeParabolaData(int i, e_formula *coeff)
dx = PntPntDistSq(u_min, v);
dy = PntPntDistSq(u_min, w);
if (eq(dx, ZERO_MAX) && eq(dy, ZERO_MAX)) {
if (Max(dv, dx) > Max(dw, dy)) coeff->sign = false;
if (VroniMax(dv, dx) > VroniMax(dw, dy)) coeff->sign = false;
else coeff->sign = true;
}
else {
@@ -1258,7 +1258,7 @@ vr_bool vroniObject::ComputeHyperbolaEllipseData(int i, e_formula *coeff)
}
}
*/
if (Max(dv, dx) > Max(dw, dy)) coeff->sign = false;
if (VroniMax(dv, dx) > VroniMax(dw, dy)) coeff->sign = false;
else coeff->sign = true;
}
else {
+2 -2
View File
@@ -219,7 +219,7 @@ void SetWorldDimensions(double_arg xmin, double_arg xmax, double_arg ymin, doubl
void SetScaleFactor(void)
{
scale = Min((ipe_x_max - ipe_x_min) / (x_max - x_min),
scale = VroniMin((ipe_x_max - ipe_x_min) / (x_max - x_min),
(ipe_y_max - ipe_y_min) / (y_max - y_min));
return;
@@ -238,7 +238,7 @@ void InitIpeDimensions(double_arg xmin, double_arg ymin, double_arg xmax, double
y_min = ymin;
y_max = ymax;
scale = Min((ipe_x_max - ipe_x_min) / (x_max - x_min),
scale = VroniMin((ipe_x_max - ipe_x_min) / (x_max - x_min),
(ipe_y_max - ipe_y_min) / (y_max - y_min));
return;
+1 -1
View File
@@ -604,7 +604,7 @@ double vroniObject::NodeEdgeClassificator(int e, const coord & p, double eps)
/* check whether the new node is on the same side of i1 and i2 as the */
/* old nodes */
/* */
if (gt(Max(r1, r2), ZERO)) {
if (gt(VroniMax(r1, r2), ZERO)) {
if (r1 >= r2) q3 = q1;
else q3 = q2;
if (t1 != PNT) d3 = NodeSidednessClassificator(i1, t1, q3, p);
+3 -3
View File
@@ -700,7 +700,7 @@ vr_bool vroniObject::IterativeIntersection(/* object types */
/* sample the parameter interval and hope for good luck... */
/* */
t_z = (t_e - t_s) / COUNTER_MAGIC;
t_z = Max(t_z, ZERO);
t_z = VroniMax(t_z, ZERO);
t = t_s + t_z;
keep_going = (t < t_e);
while (keep_going) {
@@ -774,7 +774,7 @@ vr_bool vroniObject::IterativeIntersection(/* object types */
/* intersection */
/* */
t_z = t - ZERO;
t_z = Max(t_z, t_s);
t_z = VroniMax(t_z, t_s);
EvalObjParam(type2, p2, v2, r2, t_z, p);
EvalObjDist(type1, a, b, c, c1, r1, p, dist_z);
sign_z = Sign(dist_z);
@@ -792,7 +792,7 @@ vr_bool vroniObject::IterativeIntersection(/* object types */
}
else {
t_z = t + ZERO;
t_z = Min(t_z, t_e);
t_z = VroniMin(t_z, t_e);
EvalObjParam(type2, p2, v2, r2, t_z, p);
EvalObjDist(type1, a, b, c, c1, r1, p, dist_z);
sign_z = Sign(dist_z);
+4 -4
View File
@@ -219,7 +219,7 @@ void vroniObject::ComputeIsolatedOffsets(double_arg t0, double_arg d_off)
do {
n2 = GetOtherNode(e, n1);
tn2 = GetNodeParam(n2);
min_t = Min(min_t, tn2);
min_t = VroniMin(min_t, tn2);
n1 = n2;
e = GetCCWEdge(e, n1);
} while (e != e0);
@@ -372,8 +372,8 @@ void vroniObject::ComputeOff(int step_size, vr_bool time, char off_file[],
delete_it = false;
if (GetEdgeFlagNew(i)) {
GetEdgeParam(i, &t1, &t2);
if (t >= Min(t1, t2)) {
if (t < Max(t1, t2)) {
if (t >= VroniMin(t1, t2)) {
if (t < VroniMax(t1, t2)) {
/* */
/* this edge will be intersected by an offset curve. let's */
/* compute this offset curve. */
@@ -648,7 +648,7 @@ void vroniObject::ComputeOffset(int i, double_arg t)
n2 = GetEndNode(i);
t1 = GetNodeParam(n1);
t2 = GetNodeParam(n2);
if ((t >= Min(t1, t2)) && (t < Max(t1, t2))) {
if ((t >= VroniMin(t1, t2)) && (t < VroniMax(t1, t2))) {
keep_going = false;
}
else {
+1 -1
View File
@@ -437,7 +437,7 @@ void vroniObject::ComputeInitialVD(void)
/* need more nodes and edges than predicted by theory since we subdivide */
/* conic edges at their apices. */
/* */
number = Max(num_pnts, num_segs);
number = VroniMax(num_pnts, num_segs);
InitNodes(4 * number);
InitEdges(6 * number);