EditableDatumLabel: Extend with function to differentiate positioning from dimensioning OVPs

This commit is contained in:
Abdullah Tahiri
2023-11-07 15:53:42 +01:00
committed by abdullahtahiriyo
parent d0f9869f6d
commit 5a4267a58e
2 changed files with 19 additions and 2 deletions

View File

@@ -346,9 +346,10 @@ void EditableDatumLabel::setPoints(Base::Vector3d p1, Base::Vector3d p2)
}
// NOLINTNEXTLINE
void EditableDatumLabel::setLabelType(SoDatumLabel::Type type)
void EditableDatumLabel::setLabelType(SoDatumLabel::Type type, Function funct)
{
label->datumtype = type;
function = funct;
}
// NOLINTNEXTLINE
@@ -393,4 +394,10 @@ void EditableDatumLabel::setSpinboxVisibleToMouse(bool val)
spinBox->setAttribute(Qt::WA_TransparentForMouseEvents, !val);
}
EditableDatumLabel::Function EditableDatumLabel::getFunction()
{
return function;
}
#include "moc_EditableDatumLabel.cpp" // NOLINT

View File

@@ -46,6 +46,12 @@ class GuiExport EditableDatumLabel : public QObject
public:
EditableDatumLabel(View3DInventorViewer* view, const Base::Placement& plc, SbColor color, bool autoDistance = false, bool avoidMouseCursor = false);
enum class Function {
Positioning,
Dimensioning
};
~EditableDatumLabel() override;
void activate();
@@ -63,7 +69,7 @@ public:
void setPoints(SbVec3f p1, SbVec3f p2);
void setPoints(Base::Vector3d p1, Base::Vector3d p2);
void setFocusToSpinbox();
void setLabelType(SoDatumLabel::Type type);
void setLabelType(SoDatumLabel::Type type, Function function = Function::Positioning);
void setLabelDistance(double val);
void setLabelStartAngle(double val);
void setLabelRange(double val);
@@ -71,6 +77,8 @@ public:
void setLabelAutoDistanceReverse(bool val);
void setSpinboxVisibleToMouse(bool val);
Function getFunction();
// NOLINTBEGIN
SoDatumLabel* label;
bool isSet;
@@ -94,6 +102,8 @@ private:
QuantitySpinBox* spinBox;
SoNodeSensor* cameraSensor;
SbVec3f midpos;
Function function;
};
}