/** * Merges this envelope with the extent of the given envelope. If this * envelope is empty, the coordinates of the given envelope * are assigned. If the given envelope is empty, this envelope is unchanged. * * @param other * The envelope to merge. */ public void merge(Envelope other) { _touch(); if (other.isEmpty()) return; VertexDescription otherVD = other.m_description; if (otherVD != m_description) mergeVertexDescription(otherVD); m_envelope.merge(other.m_envelope); for (int iattrib = 1, nattrib = otherVD.getAttributeCount(); iattrib < nattrib; iattrib++) { int semantics = otherVD.getSemantics(iattrib); int ncomps = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomps; iord++) { Envelope1D intervalOther = other.queryInterval(semantics, iord); Envelope1D interval = queryInterval(semantics, iord); interval.merge(intervalOther); setInterval(semantics, iord, interval); } } }
/** * Merges this envelope with the extent of the given envelope. If this * envelope is empty, the coordinates of the given envelope * are assigned. If the given envelope is empty, this envelope is unchanged. * * @param other * The envelope to merge. */ public void merge(Envelope other) { _touch(); if (other.isEmpty()) return; VertexDescription otherVD = other.m_description; if (otherVD != m_description) mergeVertexDescription(otherVD); m_envelope.merge(other.m_envelope); for (int iattrib = 1, nattrib = otherVD.getAttributeCount(); iattrib < nattrib; iattrib++) { int semantics = otherVD.getSemantics(iattrib); int ncomps = VertexDescription.getComponentCount(semantics); for (int iord = 0; iord < ncomps; iord++) { Envelope1D intervalOther = other.queryInterval(semantics, iord); Envelope1D interval = queryInterval(semantics, iord); interval.merge(intervalOther); setInterval(semantics, iord, interval); } } }