@Override
  public VarType evaluate() {
    Drawable d = null;
    VarType v = null;

    // try{
    Drawable aP = params.get(0).evaluate().asDrawable();
    Drawable bP = params.get(1).evaluate().asDrawable();
    // this.drawableEvent(CustomEvent.REMOVE_DRAWABLE, aP);
    // this.drawableEvent(CustomEvent.REMOVE_DRAWABLE, bP);

    d = PolyBoolean.union(aP.copy(), bP.copy());
    aP.hide();
    bP.hide();

    // d.setIdentifier(aP.getIdentifier());

    this.fireDrawableEvent(CustomEvent.DRAWABLE_CREATED, d);

    v = new VarType(d);

    d.setLine(line);

    // }
    /*catch (ClassCastException e){
    	throw new RuntimeException("Illegal union function call at line:"+ line+" : " + this);
    }*/
    return v;
  }
  @Override
  public VarType evaluate() {
    Drawable d;

    d = param.evaluate().asDrawable().copy();

    d.flatten(true, new Drawable());
    Drawable flattened = d.getFlattenedDrawable();
    flattened.setLine(line);
    this.fireDrawableEvent(CustomEvent.DRAWABLE_CREATED, d.getFlattenedDrawable());
    return new VarType(flattened);
    // throw new RuntimeException("Illegal function call: " + this);
  }