Beispiel #1
0
  public BoundingBox calcBoundingBox() {
    BoundingBox bbox = new BoundingBox();

    if (isSetCurveMember()) {
      for (CurveProperty curveProperty : getCurveMember())
        if (curveProperty.isSetCurve()) bbox.update(curveProperty.getCurve().calcBoundingBox());
    }

    if (isSetCurveMembers()) {
      CurveArrayProperty curveArrayProperty = getCurveMembers();

      if (curveArrayProperty.isSetCurve())
        for (AbstractCurve abstractCurve : curveArrayProperty.getCurve())
          bbox.update(abstractCurve.calcBoundingBox());
    }

    if (bbox.getLowerCorner().isEqual(Double.MAX_VALUE)
        && bbox.getUpperCorner().isEqual(-Double.MAX_VALUE)) return null;
    else return bbox;
  }
Beispiel #2
0
  @Override
  public Object copyTo(Object target, CopyBuilder copyBuilder) {
    MultiCurve copy = (target == null) ? new MultiCurve() : (MultiCurve) target;
    super.copyTo(copy, copyBuilder);

    if (isSetCurveMember()) {
      for (CurveProperty part : curveMember) {
        CurveProperty copyPart = (CurveProperty) copyBuilder.copy(part);
        copy.addCurveMember(copyPart);

        if (part != null && copyPart == part) part.setParent(this);
      }
    }

    if (isSetCurveMembers()) {
      copy.setCurveMembers((CurveArrayProperty) copyBuilder.copy(curveMembers));
      if (copy.getCurveMembers() == curveMembers) curveMembers.setParent(this);
    }

    return copy;
  }
Beispiel #3
0
  public void unsetCurveMembers() {
    if (isSetCurveMembers()) curveMembers.unsetParent();

    curveMembers = null;
  }
Beispiel #4
0
  public void setCurveMembers(CurveArrayProperty curveMembers) {
    if (curveMembers != null) curveMembers.setParent(this);

    this.curveMembers = curveMembers;
  }