Beispiel #1
0
  public static NodeModelConf convert(final NodeModel nodeModel) throws Exception {

    NodeModelConf pm = new NodeModelConf();
    pm.setModel(nodeModel.getModel());
    pm.setModelParameter(nodeModel.getModelParameter());
    pm.setMatcher(compileMatch(nodeModel.getMatcher()));

    if (nodeModel.getTranslateX() != null
        && nodeModel.getTranslateY() != null
        && nodeModel.getTranslateZ() != null) {

      pm.setTranslate(
          new Expression() {
            @Override
            public Object evaluate(Context context) {

              return new Vector3d(
                  nodeModel.getTranslateX(), nodeModel.getTranslateY(), nodeModel.getTranslateZ());
            }
          });
    } else {
      pm.setTranslate(ExpressiongBuilder.build(nodeModel.getTranslate()));
    }

    String scale = nodeModel.getScale();

    pm.setScale(ExpressiongBuilder.build(scale));

    pm.setDirection(ExpressiongBuilder.build(nodeModel.getDirection()));

    return pm;
  }
Beispiel #2
0
  public static WayNodeModelConf convert(WayNodeModel wayNodeModel) throws Exception {

    WayNodeModelConf pm = new WayNodeModelConf();

    pm.setModel(wayNodeModel.getModel());
    pm.setModelParameter(wayNodeModel.getModelParameter());
    pm.setMatcher(compileMatch(wayNodeModel.getMatcher()));
    pm.setFilter(compileMatch(wayNodeModel.getFilter()));

    pm.setTranslate(ExpressiongBuilder.build(wayNodeModel.getTranslate()));

    pm.setScale(ExpressiongBuilder.build(wayNodeModel.getScale()));

    pm.setDirection(ExpressiongBuilder.build(wayNodeModel.getDirection()));

    pm.setOffset(ExpressiongBuilder.build(wayNodeModel.getOffset()));

    return pm;
  }