@Override public void replaceNaNs(int semantics, double value) { addAttribute(semantics); if (isEmpty()) return; int ncomps = VertexDescription.getComponentCount(semantics); for (int i = 0; i < ncomps; i++) { double v = getAttributeAsDbl(semantics, i); if (Double.isNaN(v)) setAttribute(semantics, i, value); } } }
@Override public void replaceNaNs(int semantics, double value) { addAttribute(semantics); if (isEmpty()) return; int ncomps = VertexDescription.getComponentCount(semantics); for (int i = 0; i < ncomps; i++) { double v = getAttributeAsDbl(semantics, i); if (Double.isNaN(v)) setAttribute(semantics, i, value); } } }
@Override void applyTransformation(Transformation3D transform) { if (isEmptyImpl()) return; addAttribute(Semantics.Z); Point3D pt = getXYZ(); setXYZ(transform.transform(pt)); }
@Override void applyTransformation(Transformation3D transform) { if (isEmptyImpl()) return; addAttribute(Semantics.Z); Point3D pt = getXYZ(); setXYZ(transform.transform(pt)); }
/** * Sets the value of the attribute. * * @param semantics * The attribute semantics. * @param ordinate * The ordinate of the attribute. * @param value * Is the array to write values to. The attribute type and the * number of elements must match the persistence type, as well as * the number of components of the attribute. */ public void setAttribute(int semantics, int ordinate, double value) { _touch(); int ncomps = VertexDescription.getComponentCount(semantics); if (ncomps < ordinate) throw new IndexOutOfBoundsException(); int attributeIndex = m_description.getAttributeIndex(semantics); if (attributeIndex < 0) { addAttribute(semantics); attributeIndex = m_description.getAttributeIndex(semantics); } if (m_attributes == null) _setToDefault(); m_attributes[m_description._getPointAttributeOffset(attributeIndex) + ordinate] = value; }
/** * Sets the XYZ coordinates of this point. * * @param pt * The point to create the XYZ coordinate from. */ public void setXYZ(Point3D pt) { _touch(); boolean bHasZ = hasAttribute(Semantics.Z); if (!bHasZ && !VertexDescription.isDefaultValue(Semantics.Z, pt.z)) {// add // Z // only // if // pt.z // is // not // a // default // value. addAttribute(Semantics.Z); bHasZ = true; } if (m_attributes == null) _setToDefault(); m_attributes[0] = pt.x; m_attributes[1] = pt.y; if (bHasZ) m_attributes[2] = pt.z; }
/** * Sets the XYZ coordinates of this point. * * @param pt * The point to create the XYZ coordinate from. */ public void setXYZ(Point3D pt) { _touch(); boolean bHasZ = hasAttribute(Semantics.Z); if (!bHasZ && !VertexDescription.isDefaultValue(Semantics.Z, pt.z)) {// add // Z // only // if // pt.z // is // not // a // default // value. addAttribute(Semantics.Z); bHasZ = true; } if (m_attributes == null) _setToDefault(); m_attributes[0] = pt.x; m_attributes[1] = pt.y; if (bHasZ) m_attributes[2] = pt.z; }
/** * Sets the value of the attribute. * * @param semantics * The attribute semantics. * @param ordinate * The ordinate of the attribute. * @param value * Is the array to write values to. The attribute type and the * number of elements must match the persistence type, as well as * the number of components of the attribute. */ public void setAttribute(int semantics, int ordinate, double value) { _touch(); int ncomps = VertexDescription.getComponentCount(semantics); if (ncomps < ordinate) throw new IndexOutOfBoundsException(); int attributeIndex = m_description.getAttributeIndex(semantics); if (attributeIndex < 0) { addAttribute(semantics); attributeIndex = m_description.getAttributeIndex(semantics); } if (m_attributes == null) _setToDefault(); m_attributes[m_description._getPointAttributeOffset(attributeIndex) + ordinate] = value; }
point.addAttribute(VertexDescription.Semantics.Z); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_m) { point.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_zm) { point.addAttribute(VertexDescription.Semantics.Z); point.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken();
point.addAttribute(VertexDescription.Semantics.Z); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_m) { point.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken(); } else if (current_token == WktParser.WktToken.attribute_zm) { point.addAttribute(VertexDescription.Semantics.Z); point.addAttribute(VertexDescription.Semantics.M); wkt_parser.nextToken();
point.addAttribute(VertexDescription.Semantics.Z); if (!bEmpty) point.setZ(z); point.addAttribute(VertexDescription.Semantics.M); if (!bEmpty) point.setM(m);
point.addAttribute(VertexDescription.Semantics.Z); if (!bEmpty) point.setZ(z); point.addAttribute(VertexDescription.Semantics.M); if (!bEmpty) point.setM(m);
point.addAttribute(Semantics.Z); if (!bEmpty) point.setZ(Interop.translateFromAVNaN(z)); point.addAttribute(Semantics.M); if (!bEmpty) point.setM(Interop.translateFromAVNaN(m)); point.addAttribute(Semantics.ID); if (!bEmpty) point.setID(id);
point.addAttribute(Semantics.Z); if (!bEmpty) point.setZ(Interop.translateFromAVNaN(z)); point.addAttribute(Semantics.M); if (!bEmpty) point.setM(Interop.translateFromAVNaN(m)); point.addAttribute(Semantics.ID); if (!bEmpty) point.setID(id);