feat: context can red parameters
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "Engine/Operator/Context.h"
|
||||
#include "Engine/Network/NetworkManager.h"
|
||||
#include "Engine/Parameter/Parameter.h"
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
|
||||
enzo::op::Context::Context(enzo::nt::OpId opId, enzo::nt::NetworkManager& networkManager)
|
||||
@@ -23,3 +25,13 @@ enzo::geo::Geometry enzo::op::Context::cloneInputGeo(unsigned int inputIndex)
|
||||
return networkManager_.getGeoOperator(inputConnection->getInputOpId()).getOutputGeo(inputConnection->getInputIndex());
|
||||
}
|
||||
|
||||
enzo::bt::floatT enzo::op::Context::evalFloatParm(const char* parmName) const
|
||||
{
|
||||
enzo::nt::GeometryOperator& selfOp = networkManager_.getGeoOperator(opId_);
|
||||
std::weak_ptr<prm::Parameter> parameter = selfOp.getParameter(parmName);
|
||||
|
||||
if(auto sharedParm = parameter.lock())
|
||||
{
|
||||
return sharedParm->evalFloat();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user