Skip to content

Commit

Permalink
Move all of pafmath in its own namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
pklampros committed Jul 24, 2024
1 parent ec15498 commit 57596e2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion depthmapX/views/3dview/3dview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void Q3DView::DrawScene() {
for (auto pixel : m_pixels) {
int &value = pixel.second.m_value;
if (value != -1) {
if (pafrand() % 10000 == 0) {
if (pafmath::pafrand() % 10000 == 0) {
value--;
}
PafColor color;
Expand Down
4 changes: 2 additions & 2 deletions depthmapX/views/depthmapview/depthmapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ void QDepthmapView::OutputEPSLine(std::ofstream &stream, Line &line, int spacer,
QPoint start = PhysicalUnits(line.start());
QPoint end = PhysicalUnits(line.end());
// 10 units corresponds to 1 pixel on the screen
if (sqrt(sqr(start.x() - end.x()) + sqr(start.y() - end.y())) > 5.0) {
if (sqrt(pafmath::sqr(start.x() - end.x()) + pafmath::sqr(start.y() - end.y())) > 5.0) {
stream << (start.x() / 10.0) << " " << (rect.height() - start.y()) / 10.0 << " M ";
stream << (end.x() / 10.0) << " " << (rect.height() - end.y()) / 10.0 << " L"
<< std::endl;
Expand All @@ -1947,7 +1947,7 @@ void QDepthmapView::OutputEPSPoly(std::ofstream &stream, const SalaShape &shape,
QPoint start = PhysicalUnits(line.t_start());
QPoint end = PhysicalUnits(line.t_end());
// 5.0 is about 1/2 pixel width
if (sqrt(sqr(start.x() - end.x()) + sqr(start.y() - end.y())) > 5.0) {
if (sqrt(pafmath::sqr(start.x() - end.x()) + pafmath::sqr(start.y() - end.y())) > 5.0) {
if (starter) {
stream << start.x() / 10.0 << " " << (rect.height() - start.y()) / 10.0
<< " M ";
Expand Down
2 changes: 1 addition & 1 deletion depthmapX/views/plotview/plotview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ bool QPlotView::Output(QPainter *pDC, QGraphDoc *pDoc, bool screendraw) {
if (m_view_rsquared) {
// set text formating
// hope ascii superscript 2 in place!
string = QString(tr("R\xb2 = %1").arg(sqr(m_regression.r())));
string = QString(tr("R\xb2 = %1").arg(pafmath::sqr(m_regression.r())));
pDC->drawText(QPointF(rect.width() - string.length() * 7, textpos), string);
textpos += texth;
}
Expand Down
2 changes: 1 addition & 1 deletion genlib
Submodule genlib updated 4 files
+16 −15 p2dpoly.cpp
+6 −5 p2dpoly.h
+15 −12 pafmath.cpp
+55 −54 pafmath.h

0 comments on commit 57596e2

Please sign in to comment.