MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / evaluate

Method evaluate

src/module/projectionmodule.cpp:31–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31Node* ProjectionModule::evaluate(const Context& ctx) const
32{
33 BooleanValue* cut=dynamic_cast<BooleanValue*>(ctx.getArgumentDeprecatedModule(0,"cut","'slice' module",reporter));
34 if(cut&&cut->isTrue()) {
35 auto* n=new SliceNode();
36 n->setChildren(ctx.getInputNodes());
37 return n;
38 }
39
40 bool base=false;
41 auto* baseVal=dynamic_cast<BooleanValue*>(getParameterArgument(ctx,0));
42 if(baseVal)
43 base=baseVal->isTrue();
44
45
46 auto* d = new ProjectionNode();
47 d->setChildren(ctx.getInputNodes());
48 d->setBase(base);
49 return d;
50}

Callers

nothing calls this directly

Calls 5

getInputNodesMethod · 0.80
setBaseMethod · 0.80
isTrueMethod · 0.45
setChildrenMethod · 0.45

Tested by

no test coverage detected