Пример #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;
  }
Пример #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;
  }