Hello guys, I have onde question about childNode/subNode in URCAP, my code in actual moment:
public void addAproximacaoSubNode() {
float[] poseArray = installationContribution.getCapturedPoseArray();
undoRedoManager.recordChanges(() -> {
try {
ProgramNodeFactory factory = programModel.getProgramNodeFactory();
TreeNode thisNode = programModel.getRootTreeNode(this);
URCapProgramNode aproxNode = factory.createURCapProgramNode(AproximacaoNodeService.class);
thisNode.addChild(aproxNode);
AproximacaoNodeContribution childContribution = aproxNode.getAs(AproximacaoNodeContribution.class);
if (childContribution != null) {
childContribution.setPose(poseArray);
} else {
System.err.println("Erro: Interface AproximacaoNodeInterface não implementada no nó filho.");
}
} catch (TreeStructureException e) {
System.err.println("Erro ao adicionar o subnó de aproximação.");
e.printStackTrace();
}
});
}
error:
the error is in line
AproximacaoNodeContribution childContribution = aproxNode.getAs(AproximacaoNodeContribution.class);
I’m not able to call my subnode’s class, could anyone help me with a solution?
