mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Merge pull request #11891 from ctrlaltdavid/21625
Add missing line3d overlay property getters and setters
This commit is contained in:
commit
314265fa86
1 changed files with 23 additions and 4 deletions
|
@ -166,26 +166,36 @@ void Line3DOverlay::setProperties(const QVariantMap& originalProperties) {
|
|||
bool newEndSet { false };
|
||||
|
||||
auto start = properties["start"];
|
||||
// if "start" property was not there, check to see if they included aliases: startPoint
|
||||
// If "start" property was not there, check to see if they included aliases: startPoint, p1
|
||||
if (!start.isValid()) {
|
||||
start = properties["startPoint"];
|
||||
}
|
||||
if (!start.isValid()) {
|
||||
start = properties["p1"];
|
||||
}
|
||||
if (start.isValid()) {
|
||||
newStart = vec3FromVariant(start);
|
||||
newStartSet = true;
|
||||
}
|
||||
properties.remove("start"); // so that Base3DOverlay doesn't respond to it
|
||||
properties.remove("startPoint");
|
||||
properties.remove("p1");
|
||||
|
||||
auto end = properties["end"];
|
||||
// if "end" property was not there, check to see if they included aliases: endPoint
|
||||
// If "end" property was not there, check to see if they included aliases: endPoint, p2
|
||||
if (!end.isValid()) {
|
||||
end = properties["endPoint"];
|
||||
}
|
||||
if (!end.isValid()) {
|
||||
end = properties["p2"];
|
||||
}
|
||||
if (end.isValid()) {
|
||||
newEnd = vec3FromVariant(end);
|
||||
newEndSet = true;
|
||||
}
|
||||
properties.remove("end"); // so that Base3DOverlay doesn't respond to it
|
||||
properties.remove("endPoint");
|
||||
properties.remove("p2");
|
||||
|
||||
auto length = properties["length"];
|
||||
if (length.isValid()) {
|
||||
|
@ -252,14 +262,23 @@ QVariant Line3DOverlay::getProperty(const QString& property) {
|
|||
if (property == "end" || property == "endPoint" || property == "p2") {
|
||||
return vec3toVariant(getEnd());
|
||||
}
|
||||
if (property == "length") {
|
||||
return QVariant(getLength());
|
||||
}
|
||||
if (property == "endParentID") {
|
||||
return _endParentID;
|
||||
}
|
||||
if (property == "endParentJointIndex") {
|
||||
return _endParentJointIndex;
|
||||
}
|
||||
if (property == "localStart") {
|
||||
return vec3toVariant(getLocalStart());
|
||||
}
|
||||
if (property == "localEnd") {
|
||||
return vec3toVariant(getLocalEnd());
|
||||
}
|
||||
if (property == "length") {
|
||||
return QVariant(getLength());
|
||||
if (property == "glow") {
|
||||
return getGlow();
|
||||
}
|
||||
if (property == "lineWidth") {
|
||||
return _lineWidth;
|
||||
|
|
Loading…
Reference in a new issue