refactor: move GOP_test to plugin system

This commit is contained in:
parker
2025-07-16 16:37:14 +01:00
parent 1ac5af190b
commit d2dda549eb
8 changed files with 60 additions and 56 deletions

View File

@@ -0,0 +1,40 @@
#include "OpDefs/GopTransform.hpp"
#include "Engine/Operator/AttributeHandle.h"
GopTransform::GopTransform(enzo::nt::OpId opId)
: enzo::nt::GeometryOpDef(opId)
{
}
void GopTransform::cookOp(enzo::op::Context context)
{
using namespace enzo;
if(outputRequested(0))
{
// copy input geometry
geo::Geometry geo = context.cloneInputGeo(0);
// ----
// create geometry start
// ----
auto PAttr = geo.getAttribByName(ga::AttrOwner::POINT, "P");
ga::AttributeHandleVector3 PAttrHandle(PAttr);
for(int i=0; i<PAttrHandle.getAllValues().size(); ++i)
{
enzo::bt::Vector3 vector = PAttrHandle.getValue(i);
vector.y()+=2.5;
PAttrHandle.setValue(i, vector);
}
// ----
// set output geometry
setOutputGeometry(0, geo);
}
}