You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Src/nmNum/nmPlot/nmObjLineMeasuringScaleTool...

32 lines
948 B
C++

#include <QPainter>
#include "nmObjLineMeasuringScaleTool.h"
#include "nmMeasurementLineStyle.h"
#include "nmDataLogFile.h"
nmObjLineMeasuringScaleTool::nmObjLineMeasuringScaleTool()
{
setText(tr("nObjLineMeasuringScaleTool"));
m_oNot = NMOT_Line_MeasuringScale;
enableInteractionCursor();
enableEscapeCancellation();
nmDataLogFile::getInstance()->writeLog(" nmObjLineMeasuringScaleTool ++++++++ " + QString::number(m_oNot));
}
void nmObjLineMeasuringScaleTool::onPaint(QPainter* painter, const ZxPaintParam& param)
{
if (m_bCreationCancelled) return;
if (m_pObj != nullptr || !m_bTracking) {
nmObjLineTool::onPaint(painter, param);
return;
}
painter->save();
nmMeasurementLineStyle::drawScaleLine(painter, QLineF(m_ptStart, getCurrentPos()),
nmMeasurementLineStyle::scalePen());
painter->restore();
changeCursor(Qt::CrossCursor);
}