int old_offset0 = _getEndPointOffset(m_description, 0); int old_offset1 = _getEndPointOffset(m_description, 1); int new_offset0 = _getEndPointOffset(newDescription, 0); int new_offset1 = _getEndPointOffset(newDescription, 1);
int old_offset0 = _getEndPointOffset(m_description, 0); int old_offset1 = _getEndPointOffset(m_description, 1); int new_offset0 = _getEndPointOffset(newDescription, 0); int new_offset1 = _getEndPointOffset(newDescription, 1);
void _ensureAttributes() { _touch(); if (m_attributes == null && m_description.getTotalComponentCount() > 2) { m_attributes = new double[(m_description.getTotalComponentCount() - 2) * 2]; int offset0 = _getEndPointOffset(m_description, 0); int offset1 = _getEndPointOffset(m_description, 1); int j = 0; for (int i = 1, n = m_description.getAttributeCount(); i < n; i++) { int semantics = m_description.getSemantics(i); int nords = VertexDescription.getComponentCount(semantics); double d = VertexDescription.getDefaultValue(semantics); for (int ord = 0; ord < nords; ord++) { m_attributes[offset0 + j] = d; m_attributes[offset1 + j] = d; j++; } } } }
void _ensureAttributes() { _touch(); if (m_attributes == null && m_description.getTotalComponentCount() > 2) { m_attributes = new double[(m_description.getTotalComponentCount() - 2) * 2]; int offset0 = _getEndPointOffset(m_description, 0); int offset1 = _getEndPointOffset(m_description, 1); int j = 0; for (int i = 1, n = m_description.getAttributeCount(); i < n; i++) { int semantics = m_description.getSemantics(i); int nords = VertexDescription.getComponentCount(semantics); double d = VertexDescription.getDefaultValue(semantics); for (int ord = 0; ord < nords; ord++) { m_attributes[offset0 + j] = d; m_attributes[offset1 + j] = d; j++; } } } }
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 _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); }
m_attributes[_getEndPointOffset(m_description, endPoint) + m_description._getPointAttributeOffset(attributeIndex) - 2 + ordinate] = value;
m_attributes[_getEndPointOffset(m_description, endPoint) + m_description._getPointAttributeOffset(attributeIndex) - 2 + ordinate] = value;