@Override public void copyTo(Geometry dst) { if (dst.getType() != getType()) throw new IllegalArgumentException(); Envelope envDst = (Envelope) dst; dst._touch(); envDst.m_description = m_description; envDst.m_envelope.setCoords(m_envelope); envDst.m_attributes = null; if (m_attributes != null) { envDst._ensureAttributes(); System.arraycopy(m_attributes, 0, envDst.m_attributes, 0, (m_description.getTotalComponentCount() - 2) * 2); } }
@Override public void copyTo(Geometry dst) { if (dst.getType() != getType()) throw new IllegalArgumentException(); Envelope envDst = (Envelope) dst; dst._touch(); envDst.m_description = m_description; envDst.m_envelope.setCoords(m_envelope); envDst.m_attributes = null; if (m_attributes != null) { envDst._ensureAttributes(); System.arraycopy(m_attributes, 0, envDst.m_attributes, 0, (m_description.getTotalComponentCount() - 2) * 2); } }
void setAttributeAsDblImpl_(int end_point, int semantics, int ordinate, double value) { assert (end_point == 0 || end_point == 1); if (semantics == VertexDescription.Semantics.POSITION) { if (end_point != 0) { if (ordinate != 0) m_envelope.ymax = value; else m_envelope.xmax = value; } else { if (ordinate != 0) m_envelope.ymin = value; else m_envelope.xmin = value; } return; } int ncomps = VertexDescription.getComponentCount(semantics); if (ordinate >= ncomps) throw new IllegalArgumentException(); addAttribute(semantics); _ensureAttributes(); int attribute_index = m_description.getAttributeIndex(semantics); m_attributes[getEndPointOffset(m_description, end_point) + m_description.getPointAttributeOffset_(attribute_index) - 2 + ordinate] = value; }
void setAttributeAsDblImpl_(int end_point, int semantics, int ordinate, double value) { assert (end_point == 0 || end_point == 1); if (semantics == VertexDescription.Semantics.POSITION) { if (end_point != 0) { if (ordinate != 0) m_envelope.ymax = value; else m_envelope.xmax = value; } else { if (ordinate != 0) m_envelope.ymin = value; else m_envelope.xmin = value; } return; } int ncomps = VertexDescription.getComponentCount(semantics); if (ordinate >= ncomps) throw new IllegalArgumentException(); addAttribute(semantics); _ensureAttributes(); int attribute_index = m_description.getAttributeIndex(semantics); m_attributes[getEndPointOffset(m_description, end_point) + m_description.getPointAttributeOffset_(attribute_index) - 2 + ordinate] = value; }
double _getAttributeAsDbl(int endPoint, int semantics, int ordinate) { if (m_envelope.isEmpty()) throw new GeometryException( "This operation was performed on an Empty Geometry."); // _ASSERT(endPoint == 0 || endPoint == 1); if (semantics == Semantics.POSITION) { if (endPoint != 0) { return ordinate != 0 ? m_envelope.ymax : m_envelope.xmax; } else { return ordinate != 0 ? m_envelope.ymin : m_envelope.xmin; } } int ncomps = VertexDescription.getComponentCount(semantics); if (ordinate >= ncomps) throw new IndexOutOfBoundsException(); int attributeIndex = m_description.getAttributeIndex(semantics); if (attributeIndex >= 0) { _ensureAttributes(); return m_attributes[_getEndPointOffset(m_description, endPoint) + m_description._getPointAttributeOffset(attributeIndex) - 2 + ordinate]; } else return VertexDescription.getDefaultValue(semantics); }
double getAttributeAsDblImpl_(int end_point, int semantics, int ordinate) { if (m_envelope.isEmpty()) throw new GeometryException("empty geometry"); assert (end_point == 0 || end_point == 1); if (semantics == VertexDescription.Semantics.POSITION) { if (end_point != 0) { return ordinate != 0 ? m_envelope.ymax : m_envelope.xmax; } else { return ordinate != 0 ? m_envelope.ymin : m_envelope.xmin; } } int ncomps = VertexDescription.getComponentCount(semantics); if (ordinate >= ncomps) throw new IllegalArgumentException(); int attribute_index = m_description.getAttributeIndex(semantics); _ensureAttributes(); if (attribute_index >= 0) { return m_attributes[getEndPointOffset(m_description, end_point) + m_description.getPointAttributeOffset_(attribute_index) - 2 + ordinate]; } return VertexDescription.getDefaultValue(semantics); }
double getAttributeAsDblImpl_(int end_point, int semantics, int ordinate) { if (m_envelope.isEmpty()) throw new GeometryException("empty geometry"); assert (end_point == 0 || end_point == 1); if (semantics == VertexDescription.Semantics.POSITION) { if (end_point != 0) { return ordinate != 0 ? m_envelope.ymax : m_envelope.xmax; } else { return ordinate != 0 ? m_envelope.ymin : m_envelope.xmin; } } int ncomps = VertexDescription.getComponentCount(semantics); if (ordinate >= ncomps) throw new IllegalArgumentException(); int attribute_index = m_description.getAttributeIndex(semantics); _ensureAttributes(); if (attribute_index >= 0) { return m_attributes[getEndPointOffset(m_description, end_point) + m_description.getPointAttributeOffset_(attribute_index) - 2 + ordinate]; } return VertexDescription.getDefaultValue(semantics); }
double _getAttributeAsDbl(int endPoint, int semantics, int ordinate) { if (m_envelope.isEmpty()) throw new GeometryException( "This operation was performed on an Empty Geometry."); // _ASSERT(endPoint == 0 || endPoint == 1); if (semantics == Semantics.POSITION) { if (endPoint != 0) { return ordinate != 0 ? m_envelope.ymax : m_envelope.xmax; } else { return ordinate != 0 ? m_envelope.ymin : m_envelope.xmin; } } int ncomps = VertexDescription.getComponentCount(semantics); if (ordinate >= ncomps) throw new IndexOutOfBoundsException(); int attributeIndex = m_description.getAttributeIndex(semantics); if (attributeIndex >= 0) { _ensureAttributes(); return m_attributes[_getEndPointOffset(m_description, endPoint) + m_description._getPointAttributeOffset(attributeIndex) - 2 + ordinate]; } else return VertexDescription.getDefaultValue(semantics); }
_ensureAttributes(); m_attributes[_getEndPointOffset(m_description, endPoint) + m_description._getPointAttributeOffset(attributeIndex) - 2
_ensureAttributes(); m_attributes[_getEndPointOffset(m_description, endPoint) + m_description._getPointAttributeOffset(attributeIndex) - 2