/// <summary>Sets the XYZ coordinates of this point.</summary> /// <param name="pt">The point to create the XYZ coordinate from.</param> public virtual void SetXYZ(com.epl.geometry.Point3D pt) { _touch(); bool bHasZ = HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z); if (!bHasZ && !com.epl.geometry.VertexDescription.IsDefaultValue(com.epl.geometry.VertexDescription.Semantics.Z, pt.z)) { // add // Z // only // if // pt.z // is // not // a // default // value. AddAttribute(com.epl.geometry.VertexDescription.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; } }
/// <summary>Adds a Point to this MultiPoint with given x, y, z coordinates.</summary> public void Add(double x, double y, double z) { Resize(m_pointCount + 1); com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); pt.SetCoords(x, y, z); SetXYZ(m_pointCount - 1, pt); }
private void _setXYZ(int endPoint, com.epl.geometry.Point3D pt) { _touch(); bool bHasZ = HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z); if (!bHasZ && !com.epl.geometry.VertexDescription.IsDefaultValue(com.epl.geometry.VertexDescription.Semantics.Z, pt.z)) { // add // Z // only // if // pt.z // is // not // a // default // value. AddAttribute(com.epl.geometry.VertexDescription.Semantics.Z); bHasZ = true; } if (endPoint != 0) { m_xEnd = pt.x; m_yEnd = pt.y; } else { m_xStart = pt.x; m_yStart = pt.y; } if (bHasZ) { m_attributes[_getEndPointOffset(m_description, endPoint)] = pt.z; } }
/// <summary>Creates a 3D point with specified X, Y and Z coordinates.</summary> /// <remarks> /// Creates a 3D point with specified X, Y and Z coordinates. In case of /// Geographic Coordinate Systems, the X coordinate is the longitude and the /// Y is the latitude. /// </remarks> /// <param name="x">The X coordinate of the new 3D point.</param> /// <param name="y">The Y coordinate of the new 3D point.</param> /// <param name="z">The Z coordinate of the new 3D point.</param> public Point(double x, double y, double z) { m_description = com.epl.geometry.VertexDescriptionDesignerImpl.GetDefaultDescriptor2D(); com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); pt.SetCoords(x, y, z); SetXYZ(pt); }
internal override void ApplyTransformation(com.epl.geometry.Transformation3D transform) { if (IsEmpty()) { return; } _verifyAllStreams(); AddAttribute(com.epl.geometry.VertexDescription.Semantics.Z); _verifyAllStreams(); com.epl.geometry.AttributeStreamOfDbl points = (com.epl.geometry.AttributeStreamOfDbl)m_vertexAttributes[0]; com.epl.geometry.AttributeStreamOfDbl zs = (com.epl.geometry.AttributeStreamOfDbl)m_vertexAttributes[1]; com.epl.geometry.Point3D pt3 = new com.epl.geometry.Point3D(); for (int ipoint = 0; ipoint < m_pointCount; ipoint++) { pt3.x = points.Read(ipoint * 2); pt3.y = points.Read(ipoint * 2 + 1); pt3.z = zs.Read(ipoint); com.epl.geometry.Point3D res = transform.Transform(pt3); points.Write(ipoint * 2, res.x); points.Write(ipoint * 2 + 1, res.y); zs.Write(ipoint, res.z); } // REFACTOR: reset the exact envelope only and transform the loose // envelope NotifyModified(com.epl.geometry.MultiVertexGeometryImpl.DirtyFlags.DirtyCoordinates); }
public com.epl.geometry.Point3D Transform(com.epl.geometry.Point3D src) { com.epl.geometry.Point3D res = new com.epl.geometry.Point3D(); res.x = xx * src.x + xy * src.y + xz * src.z + xd; res.y = yx * src.x + yy * src.y + yz * src.z + yd; res.z = zx * src.x + zy * src.y + zz * src.z + zd; return(res); }
public void Move(com.epl.geometry.Point3D vector) { xmin += vector.x; ymin += vector.y; zmin += vector.z; xmax += vector.x; ymax += vector.y; zmax += vector.z; }
public void SetCoords(com.epl.geometry.Point3D center, double width, double height, double depth) { xmin = center.x - width * 0.5; xmax = xmin + width; ymin = center.y - height * 0.5; ymax = ymin + height; zmin = center.z - depth * 0.5; zmax = zmin + depth; Normalize(); }
internal override void ApplyTransformation(com.epl.geometry.Transformation3D transform) { if (IsEmptyImpl()) { return; } AddAttribute(com.epl.geometry.VertexDescription.Semantics.Z); com.epl.geometry.Point3D pt = GetXYZ(); SetXYZ(transform.Transform(pt)); }
internal void Transform(com.epl.geometry.Point3D[] pointsIn, int count, com.epl.geometry.Point3D[] pointsOut) { for (int i = 0; i < count; i++) { com.epl.geometry.Point3D res = new com.epl.geometry.Point3D(); com.epl.geometry.Point3D src = pointsIn[i]; res.x = xx * src.x + xy * src.y + xz * src.z + xd; res.y = yx * src.x + yy * src.y + yz * src.z + yd; res.z = zx * src.x + zy * src.y + zz * src.z + zd; pointsOut[i] = res; } }
/// <summary>Transforms an envelope.</summary> /// <remarks> /// Transforms an envelope. The result is the bounding box of the transformed /// envelope. /// </remarks> public com.epl.geometry.Envelope3D Transform(com.epl.geometry.Envelope3D env) { if (env.IsEmpty()) { return(env); } com.epl.geometry.Point3D[] buf = new com.epl.geometry.Point3D[8]; env.QueryCorners(buf); Transform(buf, 8, buf); env.SetFromPoints(buf); return(env); }
public void Transform(com.epl.geometry.Point3D[] points, int start, int count) { int n = System.Math.Min(points.Length, start + count); for (int i = start; i < n; i++) { com.epl.geometry.Point3D res = new com.epl.geometry.Point3D(); com.epl.geometry.Point3D src = points[i]; res.x = xx * src.x + xy * src.y + xz * src.z + xd; res.y = yx * src.x + yy * src.y + yz * src.z + yd; res.z = zx * src.x + zy * src.y + zz * src.z + zd; points[i] = res; } }
// Checked vs. Jan 11, 2011 internal override void SetXYZ(int index, com.epl.geometry.Point3D pt) { if (index < 0 || index >= GetPointCount()) { throw new System.IndexOutOfRangeException(); } AddAttribute(com.epl.geometry.VertexDescription.Semantics.Z); _verifyAllStreams(); NotifyModified(com.epl.geometry.MultiVertexGeometryImpl.DirtyFlags.DirtyCoordinates); com.epl.geometry.AttributeStreamOfDbl v = (com.epl.geometry.AttributeStreamOfDbl)m_vertexAttributes[0]; v.Write(index * 2, pt.x); v.Write(index * 2 + 1, pt.y); m_vertexAttributes[1].WriteAsDbl(index, pt.z); }
internal override void QueryEnvelope3D(com.epl.geometry.Envelope3D env) { if (IsEmptyImpl()) { env.SetEmpty(); return; } com.epl.geometry.Point3D pt = GetXYZ(); env.xmin = pt.x; env.ymin = pt.y; env.zmin = pt.z; env.xmax = pt.x; env.ymax = pt.y; env.zmax = pt.z; }
public void QueryCorners(com.epl.geometry.Point3D[] corners) { if ((corners == null) || (corners.Length < 8)) { throw new System.ArgumentException(); } corners[0] = new com.epl.geometry.Point3D(xmin, ymin, zmin); corners[1] = new com.epl.geometry.Point3D(xmin, ymax, zmin); corners[2] = new com.epl.geometry.Point3D(xmax, ymax, zmin); corners[3] = new com.epl.geometry.Point3D(xmax, ymin, zmin); corners[4] = new com.epl.geometry.Point3D(xmin, ymin, zmax); corners[5] = new com.epl.geometry.Point3D(xmin, ymax, zmax); corners[6] = new com.epl.geometry.Point3D(xmax, ymax, zmax); corners[7] = new com.epl.geometry.Point3D(xmax, ymin, zmax); }
public void SetFromPoints(com.epl.geometry.Point3D[] points) { if (points == null || points.Length == 0) { SetEmpty(); return; } com.epl.geometry.Point3D p = points[0]; SetCoords(p.x, p.y, p.z); for (int i = 1; i < points.Length; i++) { com.epl.geometry.Point3D pt = points[i]; MergeNE(pt.x, pt.y, pt.z); } }
/// <summary>Returns XYZ coordinates of the point.</summary> /// <remarks>Returns XYZ coordinates of the point. Z will be set to 0 if Z is missing.</remarks> public virtual com.epl.geometry.Point3D GetXYZ() { if (IsEmptyImpl()) { throw new com.epl.geometry.GeometryException("This operation should not be performed on an empty geometry."); } com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); pt.x = m_attributes[0]; pt.y = m_attributes[1]; if (m_description.HasZ()) { pt.z = m_attributes[2]; } else { pt.z = com.epl.geometry.VertexDescription.GetDefaultValue(com.epl.geometry.VertexDescription.Semantics.Z); } return(pt); }
internal override void ApplyTransformation(com.epl.geometry.Transformation3D transform) { _touch(); com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); pt.x = m_xStart; pt.y = m_yStart; pt.z = _getAttributeAsDbl(0, com.epl.geometry.VertexDescription.Semantics.Z, 0); pt = transform.Transform(pt); m_xStart = pt.x; m_yStart = pt.y; _setAttribute(0, com.epl.geometry.VertexDescription.Semantics.Z, 0, pt.z); pt.x = m_xEnd; pt.y = m_yEnd; pt.z = _getAttributeAsDbl(1, com.epl.geometry.VertexDescription.Semantics.Z, 0); pt = transform.Transform(pt); m_xEnd = pt.x; m_yEnd = pt.y; _setAttribute(1, com.epl.geometry.VertexDescription.Semantics.Z, 0, pt.z); }
private com.epl.geometry.Point3D _getXYZ(int endPoint) { com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); if (endPoint != 0) { pt.x = m_xEnd; pt.y = m_yEnd; } else { pt.x = m_xStart; pt.y = m_yStart; } if (m_description.HasZ()) { pt.z = m_attributes[_getEndPointOffset(m_description, endPoint)]; } else { pt.z = com.epl.geometry.VertexDescription.GetDefaultValue(com.epl.geometry.VertexDescription.Semantics.Z); } return(pt); }
// Checked vs. Jan 11, 2011 internal override com.epl.geometry.Point3D GetXYZ(int index) { if (index < 0 || index >= GetPointCount()) { throw new System.IndexOutOfRangeException(); } _verifyAllStreams(); com.epl.geometry.AttributeStreamOfDbl v = (com.epl.geometry.AttributeStreamOfDbl)m_vertexAttributes[0]; com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); pt.x = v.Read(index * 2); pt.y = v.Read(index * 2 + 1); // TODO check excluded if statement componenet if (HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z)) { // && (m_vertexAttributes[1] != null)) pt.z = m_vertexAttributes[1].ReadAsDbl(index); } else { pt.z = com.epl.geometry.VertexDescription.GetDefaultValue(com.epl.geometry.VertexDescription.Semantics.Z); } return(pt); }
internal override void SetXYZ(int index, com.epl.geometry.Point3D pt) { m_impl.SetXYZ(index, pt); }
public Point3D(com.epl.geometry.Point3D other) { SetCoords(other); }
public static com.epl.geometry.Point3D Construct(double x, double y, double z) { com.epl.geometry.Point3D pt = new com.epl.geometry.Point3D(); pt.SetCoords(x, y, z); return(pt); }
/// <summary>Sets XYZ coordinates of the given vertex of the Geometry.</summary> /// <remarks> /// Sets XYZ coordinates of the given vertex of the Geometry. If Z attribute /// is not present in this Geometry, it is added. All other attributes are /// unchanged. /// </remarks> internal abstract void SetXYZ(int index, com.epl.geometry.Point3D pt);
/// <summary>Returns XYZ coordinates as an array.</summary> internal virtual com.epl.geometry.Point3D[] GetCoordinates3D() { com.epl.geometry.Point3D[] arr = new com.epl.geometry.Point3D[GetPointCount()]; QueryCoordinates(arr); return(arr); }
public void SetCoords(com.epl.geometry.Point3D other) { SetCoords(other.x, other.y, other.z); }
public double DotProduct(com.epl.geometry.Point3D other) { return(x * other.x + y * other.y + z * other.z); }
internal virtual void StartPath(com.epl.geometry.Point3D point) { m_impl.StartPath(point); }
internal virtual void LineTo(com.epl.geometry.Point3D endPoint) { m_impl.LineTo(endPoint); }
public void Merge(com.epl.geometry.Point3D pt) { Merge(pt.x, pt.y); }