Skip to content

Commit

Permalink
[TD]sync .h and .cpp parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Nov 3, 2024
1 parent a1ef48c commit 98e2f11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/Mod/TechDraw/App/DrawGeomHatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ std::vector<LineSet> DrawGeomHatch::getTrimmedLines(DrawViewPart* source,
}

/* static */
std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(PATLineSpec hl, Bnd_Box b, double scale)
std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(PATLineSpec hatchLine, Bnd_Box bBox, double scale)
{
constexpr double RightAngleDegrees{90.0};
constexpr double HalfCircleDegrees{180.0};
std::vector<TopoDS_Edge> result;

double minX, maxX, minY, maxY, minZ, maxZ;
b.Get(minX, minY, minZ, maxX, maxY, maxZ);
bBox.Get(minX, minY, minZ, maxX, maxY, maxZ);
//make the overlay bigger to cover rotations. might need to be bigger than 2x.
double widthX = maxX - minX;
double widthY = maxY - minY;
Expand All @@ -406,20 +406,20 @@ std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(PATLineSpec hl, Bnd_Box
minY = centerY - width;
maxY = centerY + width;

Base::Vector3d origin = hl.getOrigin();
double interval = hl.getIntervalX() * scale;
double angle = hl.getAngle();
Base::Vector3d origin = hatchLine.getOrigin();
double interval = hatchLine.getIntervalX() * scale;
double angle = hatchLine.getAngle();

//only dealing with angles -180:180 for now
if (angle > RightAngleDegrees) {
angle = -(HalfCircleDegrees - angle);
} else if (angle < -RightAngleDegrees) {
angle = (HalfCircleDegrees + angle);
}
double slope = hl.getSlope();
double slope = hatchLine.getSlope();

if (angle == 0.0) { //odd case 1: horizontal lines
interval = hl.getInterval() * scale;
interval = hatchLine.getInterval() * scale;
double atomY = origin.y;
int repeatUp = (int) fabs((maxY - atomY)/interval);
int repeatDown = (int) fabs(((atomY - minY)/interval));
Expand All @@ -435,7 +435,7 @@ std::vector<TopoDS_Edge> DrawGeomHatch::makeEdgeOverlay(PATLineSpec hl, Bnd_Box
}
} else if (angle == RightAngleDegrees ||
angle == -RightAngleDegrees) { //odd case 2: vertical lines
interval = hl.getInterval() * scale;
interval = hatchLine.getInterval() * scale;
double atomX = origin.x;
int repeatRight = (int) fabs((maxX - atomX)/interval);
int repeatLeft = (int) fabs((atomX - minX)/interval);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/DrawGeomHatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TechDrawExport DrawGeomHatch : public App::DocumentObject
double scale , double hatchRotation = 0.0,
Base::Vector3d hatchOffset = Base::Vector3d(0.0, 0.0, 0.0));

static std::vector<TopoDS_Edge> makeEdgeOverlay(PATLineSpec hl, Bnd_Box bBox,
static std::vector<TopoDS_Edge> makeEdgeOverlay(PATLineSpec hatchLine, Bnd_Box bBox,
double scale);
static TopoDS_Edge makeLine(Base::Vector3d start, Base::Vector3d end);
static std::vector<PATLineSpec> getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern);
Expand Down

0 comments on commit 98e2f11

Please sign in to comment.