History

resolve conflicts and cleanup

SamGondelman committed 9 years ago

Commit 76869482 parents fb96996 58172cf31 files · +446 −239Browse files

Showing the changes to interface/src/raypick/PointerScriptingInterface.cpp (1 of 31 files). Show all

Unified · Split

interface/src/raypick/PointerScriptingInterface.cpp+9−36
@@ -9,10 +9,10 @@ · 8 unmodified lines
99 #include "PointerScriptingInterface.h"
1010
1111 #include <QtCore/QVariant>
12−
1312 #include <GLMHelpers.h>
1413
1514 #include "Application.h"
15+#include "LaserPointer.h"
1616
1717 void PointerScriptingInterface::setIgnoreItems(const QUuid& uid, const QScriptValue& ignoreItems) const {
1818 DependencyManager::get<PointerManager>()->setIgnoreItems(uid, qVectorQUuidFromScriptValue(ignoreItems));
@@ -48,6 +48,11 @@ QUuid PointerScriptingInterface::createLaserPointer(const QVariant& properties) · 29 unmodified lines
4848 lockEnd = propertyMap["lockEnd"].toBool();
4949 }
5050
51+ bool distanceScaleEnd = false;
52+ if (propertyMap["distanceScaleEnd"].isValid()) {
53+ distanceScaleEnd = propertyMap["distanceScaleEnd"].toBool();
54+ }
55+
5156 bool enabled = false;
5257 if (propertyMap["enabled"].isValid()) {
5358 enabled = propertyMap["enabled"].toBool();
@@ -61,7 +66,7 @@ QUuid PointerScriptingInterface::createLaserPointer(const QVariant& properties) · 7 unmodified lines
6166 QVariantMap renderStateMap = renderStateVariant.toMap();
6267 if (renderStateMap["name"].isValid()) {
6368 std::string name = renderStateMap["name"].toString().toStdString();
64− renderStates[name] = buildRenderState(renderStateMap);
69+ renderStates[name] = LaserPointer::buildRenderState(renderStateMap);
6570 }
6671 }
6772 }
@@ -76,13 +81,13 @@ QUuid PointerScriptingInterface::createLaserPointer(const QVariant& properties) · 8 unmodified lines
7681 if (renderStateMap["name"].isValid() && renderStateMap["distance"].isValid()) {
7782 std::string name = renderStateMap["name"].toString().toStdString();
7883 float distance = renderStateMap["distance"].toFloat();
79− defaultRenderStates[name] = std::pair<float, RenderState>(distance, buildRenderState(renderStateMap));
84+ defaultRenderStates[name] = std::pair<float, RenderState>(distance, LaserPointer::buildRenderState(renderStateMap));
8085 }
8186 }
8287 }
8388 }
8489
85− return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<LaserPointer>(properties, renderStates, defaultRenderStates, faceAvatar, centerEndY, lockEnd, enabled));
90+ return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<LaserPointer>(properties, renderStates, defaultRenderStates, faceAvatar, centerEndY, lockEnd, distanceScaleEnd, enabled));
8691 }
8792
8893 void PointerScriptingInterface::editRenderState(const QUuid& uid, const QString& renderState, const QVariant& properties) const {
@@ -104,36 +109,4 @@ void PointerScriptingInterface::editRenderState(const QUuid& uid, const QString& · 15 unmodified lines
104109 }
105110
106111 DependencyManager::get<PointerManager>()->editRenderState(uid, renderState.toStdString(), startProps, pathProps, endProps);
107−}
108−
109−RenderState PointerScriptingInterface::buildRenderState(const QVariantMap& propMap) {
110− QUuid startID;
111− if (propMap["start"].isValid()) {
112− QVariantMap startMap = propMap["start"].toMap();
113− if (startMap["type"].isValid()) {
114− startMap.remove("visible");
115− startID = qApp->getOverlays().addOverlay(startMap["type"].toString(), startMap);
116− }
117− }
118−
119− QUuid pathID;
120− if (propMap["path"].isValid()) {
121− QVariantMap pathMap = propMap["path"].toMap();
122− // right now paths must be line3ds
123− if (pathMap["type"].isValid() && pathMap["type"].toString() == "line3d") {
124− pathMap.remove("visible");
125− pathID = qApp->getOverlays().addOverlay(pathMap["type"].toString(), pathMap);
126− }
127− }
128−
129− QUuid endID;
130− if (propMap["end"].isValid()) {
131− QVariantMap endMap = propMap["end"].toMap();
132− if (endMap["type"].isValid()) {
133− endMap.remove("visible");
134− endID = qApp->getOverlays().addOverlay(endMap["type"].toString(), endMap);
135− }
136− }
137−
138− return RenderState(startID, pathID, endID);
139112 }