mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 10:26:14 +02:00
Give the pointer its own copy of the script parameters in case its pick is deleted
This commit is contained in:
parent
715f6a4473
commit
30482c2db4
3 changed files with 11 additions and 1 deletions
|
@ -62,6 +62,8 @@ unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType&
|
|||
|
||||
propertyMap["type"] = (int)type;
|
||||
|
||||
pointer->setScriptParameters(propertyMap);
|
||||
|
||||
return DependencyManager::get<PointerManager>()->addPointer(pointer);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,12 @@ QVariantMap Pointer::toVariantMap() const {
|
|||
return qVariantMap;
|
||||
}
|
||||
|
||||
void Pointer::setScriptParameters(const QVariantMap& scriptParameters) {
|
||||
_scriptParameters = scriptParameters;
|
||||
}
|
||||
|
||||
QVariantMap Pointer::getScriptParameters() const {
|
||||
return DependencyManager::get<PickManager>()->getPickScriptParameters(_pickUID);
|
||||
return _scriptParameters;
|
||||
}
|
||||
|
||||
void Pointer::setPrecisionPicking(bool precisionPicking) {
|
||||
|
|
|
@ -52,6 +52,7 @@ public:
|
|||
virtual void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) = 0;
|
||||
|
||||
virtual QVariantMap toVariantMap() const;
|
||||
virtual void setScriptParameters(const QVariantMap& scriptParameters);
|
||||
virtual QVariantMap getScriptParameters() const;
|
||||
|
||||
virtual void setPrecisionPicking(bool precisionPicking);
|
||||
|
@ -86,6 +87,9 @@ protected:
|
|||
bool _enabled;
|
||||
bool _hover;
|
||||
|
||||
// The parameters used to create this pointer when created through a script
|
||||
QVariantMap _scriptParameters;
|
||||
|
||||
virtual PointerEvent buildPointerEvent(const PickedObject& target, const PickResultPointer& pickResult, const std::string& button = "", bool hover = true) = 0;
|
||||
|
||||
virtual PickedObject getHoveredObject(const PickResultPointer& pickResult) = 0;
|
||||
|
|
Loading…
Reference in a new issue