Package com.esri.core.geometry
Class MultiVertexGeometryImpl
- java.lang.Object
-
- com.esri.core.geometry.Geometry
-
- com.esri.core.geometry.MultiVertexGeometry
-
- com.esri.core.geometry.MultiVertexGeometryImpl
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
MultiPathImpl,MultiPointImpl
abstract class MultiVertexGeometryImpl extends MultiVertexGeometry
This class is a base for geometries with many vertices. The vertex attributes are stored in separate arrays of corresponding type. There are as many arrays as there are attributes in the vertex. It uses lazy allocation for the vertex attributes. This means, the actual AttributeStream is allocated only when the users asks for it, or sets a non-default value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMultiVertexGeometryImpl.DirtyFlagsstatic interfaceMultiVertexGeometryImpl.GeometryXSimple-
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
-
-
Field Summary
Fields Modifier and Type Field Description (package private) GeometryAcceleratorsm_accelerators(package private) Envelopem_envelopeprotected intm_flagsMaskprotected intm_pointCountprotected intm_reservedPointCountprotected doublem_simpleTolerance(package private) AttributeStreamBase[]m_vertexAttributesprivate static longserialVersionUID-
Fields inherited from class com.esri.core.geometry.Geometry
m_description, m_touchFlag
-
-
Constructor Summary
Constructors Constructor Description MultiVertexGeometryImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void_assignVertexDescriptionImpl(VertexDescription newDescription)boolean_attributeStreamIsAllocated(int semantics)abstract boolean_buildQuadTreeAccelerator(Geometry.GeometryAccelerationDegree d)abstract boolean_buildRasterizedGeometryAccelerator(double toleranceXY, Geometry.GeometryAccelerationDegree accelDegree)(package private) void_clearAccelerators()(package private) abstract void_copyToImpl(MultiVertexGeometryImpl mvg)\internal CHildren implement this method to copy additional information(package private) void_copyToUnsafe(MultiVertexGeometryImpl dst)GeometryAccelerators_getAccelerators()(package private) double_getShortestDistance(int vertex1, int vertex2)(package private) double_getSimpleTolerance()protected boolean_hasDirtyFlag(int flag)(package private) void_interpolateTwoVertices(int vertex1, int vertex2, double f, Point outPoint)protected abstract void_notifyModifiedAllImpl()(package private) void_resizeImpl(int pointCount)protected void_setDirtyFlag(int flag, boolean bYesNo)(package private) void_setEmptyImpl()protected void_updateAllDirtyIntervals(boolean bExact)protected void_updateEnvelope(Envelope2D env)protected void_updateEnvelope(Envelope3D env)protected void_updateLooseEnvelope(Envelope2D env)protected void_updateLooseEnvelope(Envelope3D env)\internal Calculates loose envelope.void_updateXYImpl(boolean bExact)\internal Updates x, y intervals.protected void_verifyAllStreams()protected void_verifyAllStreamsImpl()\internal Verifies all streams (calls _VerifyStream for every attribute).protected abstract void_verifyStreamsImpl()\internal Called inside of the VerifyAllStreams to get a child class a chance to do additional verify.(package private) voidcalculateEnvelope2D(Envelope2D env, boolean bExact)voidcopyTo(Geometry dstGeom)Copies this geometry to another geometry of the same type.booleanequals(java.lang.Object other)doublegetAttributeAsDbl(int semantics, int offset, int ordinate)Returns value of the given vertex attribute as double.intgetAttributeAsInt(int semantics, int offset, int ordinate)Returns value of the given vertex attribute as int.AttributeStreamBasegetAttributeStreamRef(int semantics)VertexDescriptiongetDescriptionImpl()intgetIsSimple(double tolerance)PointgetPoint(int index)Returns given vertex of the Geometry.voidgetPointByVal(int index, Point dst)Returns given vertex of the Geometry.intgetPointCount()Returns the total vertex count in this Geometry.Point2DgetXY(int index)Returns XY coordinates of the given vertex of the Geometry.voidgetXY(int index, Point2D pt)Point3DgetXYZ(int index)Returns XYZ coordinates of the given vertex of the Geometry.inthashCode()booleanisEmpty()IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.(package private) booleanisEmptyImpl()voidnotifyModified(int flags)Notifies the Geometry of changes made to the vertices so that it could reset cached structures.voidqueryCoordinates(Point[] dst)voidqueryCoordinates(Point2D[] dst)Queries XY coordinates as an array.(package private) intqueryCoordinates(Point2D[] dst, int dstSize, int beginIndex, int endIndex)voidqueryCoordinates(Point3D[] dst)Queries XYZ coordinates as an array.(package private) intQueryCoordinates(Point3D[] dst, int dstSize, int beginIndex, int endIndex)voidqueryEnvelope(Envelope env)Returns the axis aligned bounding box of the geometry.voidqueryEnvelope2D(Envelope2D env)Returns tight bbox of the Geometry in X, Y plane.voidqueryEnvelope3D(Envelope3D env)Returns tight bbox of the Geometry in 3D.Envelope1DqueryInterval(int semantics, int ordinate)Returns the min and max attribute values at the ordinate of the Geometry.voidqueryLooseEnvelope2D(Envelope2D env)Returns the conservative bbox of the Geometry in X, Y plane.voidqueryLooseEnvelope3D(Envelope3D env)Returns tight conservative box of the Geometry in 3D.voidreplaceNaNs(int semantics, double value)Replaces NaNs in the attribute with the given value.voidsetAttribute(int semantics, int offset, int ordinate, double value)Sets the value of given attribute at given posisiotnsis.voidsetAttribute(int semantics, int offset, int ordinate, int value)Same as above, but works with ints.voidsetAttributeStreamRef(int semantics, AttributeStreamBase stream)Sets a reference to the given AttributeStream of the Geometry.voidsetEnvelope(Envelope env)Sets the envelope of the Geometry.(package private) voidsetIsSimple(int isSimpleRes, double tolerance, boolean ogc_known)voidsetPoint(int index, Point src)Sets the vertex at given index of the Geometry.voidsetPointByVal(int index, Point src)Sets the vertex at given index of the Geometry.voidsetXY(int index, double x, double y)voidsetXY(int index, Point2D pt)Sets XY coordinates of the given vertex of the Geometry.voidsetXYZ(int index, Point3D pt)Sets XYZ coordinates of the given vertex of the Geometry.protected voidthrowIfEmpty()java.lang.StringtoString()The output of this method can be only used for debugging.-
Methods inherited from class com.esri.core.geometry.MultiVertexGeometry
getCoordinates2D, getCoordinates3D, getPoint
-
Methods inherited from class com.esri.core.geometry.Geometry
_clone, _getImpl, _touch, addAttribute, addID, addM, addZ, applyTransformation, applyTransformation, assignVertexDescription, calculateArea2D, calculateLength2D, copy, createInstance, dropAllAttributes, dropAttribute, estimateMemorySize, estimateMemorySize, getBoundary, getDescription, getDimension, getDimensionFromType, getStateFlag, getType, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, mergeVertexDescription, setEmpty, vertex_count, writeReplace
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_vertexAttributes
AttributeStreamBase[] m_vertexAttributes
-
m_accelerators
GeometryAccelerators m_accelerators
-
m_envelope
Envelope m_envelope
-
m_pointCount
protected int m_pointCount
-
m_reservedPointCount
protected int m_reservedPointCount
-
m_flagsMask
protected int m_flagsMask
-
m_simpleTolerance
protected double m_simpleTolerance
-
-
Method Detail
-
_copyToImpl
abstract void _copyToImpl(MultiVertexGeometryImpl mvg)
\internal CHildren implement this method to copy additional information
-
_notifyModifiedAllImpl
protected abstract void _notifyModifiedAllImpl()
-
_verifyStreamsImpl
protected abstract void _verifyStreamsImpl()
\internal Called inside of the VerifyAllStreams to get a child class a chance to do additional verify.
-
getPointCount
public int getPointCount()
Returns the total vertex count in this Geometry.- Specified by:
getPointCountin classMultiVertexGeometry- Returns:
- total vertex count in this Geometry.
-
isEmpty
public boolean isEmpty()
Description copied from class:GeometryIsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.
-
getDescriptionImpl
public VertexDescription getDescriptionImpl()
-
isEmptyImpl
boolean isEmptyImpl()
-
_hasDirtyFlag
protected boolean _hasDirtyFlag(int flag)
-
_setDirtyFlag
protected void _setDirtyFlag(int flag, boolean bYesNo)
-
_verifyAllStreams
protected void _verifyAllStreams()
-
throwIfEmpty
protected void throwIfEmpty()
-
getPointByVal
public void getPointByVal(int index, Point dst)Description copied from class:MultiVertexGeometryReturns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.- Specified by:
getPointByValin classMultiVertexGeometry
-
setPointByVal
public void setPointByVal(int index, Point src)Description copied from class:MultiVertexGeometrySets the vertex at given index of the Geometry.- Specified by:
setPointByValin classMultiVertexGeometry- Parameters:
index- The index of the vertex being changed.src- The Point instance to set given vertex attributes from. The pointSrc can not be empty.
The method throws if the pointSrc is not of the Point type.
The attributes, that are present in the pointSrc and missing in this Geometry, will be added to the Geometry.
The vertex attributes missing in the pointSrc but present in the Geometry will be set to the default values (see VertexDescription::GetDefaultValue).
-
getXY
public Point2D getXY(int index)
Description copied from class:MultiVertexGeometryReturns XY coordinates of the given vertex of the Geometry.- Specified by:
getXYin classMultiVertexGeometry
-
getXY
public void getXY(int index, Point2D pt)- Specified by:
getXYin classMultiVertexGeometry
-
setXY
public void setXY(int index, Point2D pt)Description copied from class:MultiVertexGeometrySets XY coordinates of the given vertex of the Geometry. All other attributes are unchanged.- Specified by:
setXYin classMultiVertexGeometry
-
setXY
public void setXY(int index, double x, double y)
-
getXYZ
public Point3D getXYZ(int index)
Description copied from class:MultiVertexGeometryReturns XYZ coordinates of the given vertex of the Geometry. If the Geometry has no Z's, the default value for Z is returned (0).- Specified by:
getXYZin classMultiVertexGeometry
-
setXYZ
public void setXYZ(int index, Point3D pt)Description copied from class:MultiVertexGeometrySets 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.- Specified by:
setXYZin classMultiVertexGeometry
-
getAttributeAsDbl
public double getAttributeAsDbl(int semantics, int offset, int ordinate)Description copied from class:MultiVertexGeometryReturns value of the given vertex attribute as double.- Specified by:
getAttributeAsDblin classMultiVertexGeometry- Parameters:
semantics- The atribute semantics.offset- is the vertex index in the Geometry.ordinate- is the ordinate of a vertex attribute (for example, y has ordinate of 1, because it is second ordinate of POSITION) If attribute is not present, the default value is returned. See VertexDescription::GetDefaultValue() method.
-
getAttributeAsInt
public int getAttributeAsInt(int semantics, int offset, int ordinate)Description copied from class:MultiVertexGeometryReturns value of the given vertex attribute as int.- Specified by:
getAttributeAsIntin classMultiVertexGeometry- Parameters:
semantics- The atribute semantics.offset- is the vertex index in the Geometry.ordinate- is the ordinate of a vertex attribute (for example, y has ordinate of 1, because it is second ordinate of POSITION) If attribute is not present, the default value is returned. See VertexDescription::GetDefaultValue() method. Avoid using this method on non-integer atributes.
-
setAttribute
public void setAttribute(int semantics, int offset, int ordinate, double value)Description copied from class:MultiVertexGeometrySets the value of given attribute at given posisiotnsis.- Specified by:
setAttributein classMultiVertexGeometry- Parameters:
semantics- The atribute semantics.offset- is the vertex index in the Geometry.ordinate- is the ordinate of a vertex attribute (for example, y has ordinate of 1, because it is seond ordinate of POSITION)value- is the value to set. as well as the number of components of the attribute. If the attribute is not present in this Geometry, it is added.
-
setAttribute
public void setAttribute(int semantics, int offset, int ordinate, int value)Description copied from class:MultiVertexGeometrySame as above, but works with ints. Avoid using this method on non-integer atributes because some double attributes may have NaN default values (e.g. Ms)- Specified by:
setAttributein classMultiVertexGeometry
-
getAttributeStreamRef
public AttributeStreamBase getAttributeStreamRef(int semantics)
-
setAttributeStreamRef
public void setAttributeStreamRef(int semantics, AttributeStreamBase stream)Sets a reference to the given AttributeStream of the Geometry. Once the buffer has been obtained, the vertices of the Geometry can be manipulated directly. The AttributeStream parameters are not checked for the size.
If the attribute is missing, it will be added.
Note, that this method does not change the vertex count in the Geometry.
The stream can have more elements, than the Geometry point count, but only necessary part will be saved when exporting to a ESRI shape or other format. @param semantics Semantics of the attribute to assign the stream to. @param stream The input AttributeStream that will be assigned by reference. If one changes the stream later through the reference, one has to call NotifyStreamChanged. \exception Throws invalid_argument exception if the input stream type does not match that of the semantics persistence.
-
_assignVertexDescriptionImpl
protected void _assignVertexDescriptionImpl(VertexDescription newDescription)
- Overrides:
_assignVertexDescriptionImplin classMultiVertexGeometry
-
_updateEnvelope
protected void _updateEnvelope(Envelope2D env)
-
_updateEnvelope
protected void _updateEnvelope(Envelope3D env)
-
_updateLooseEnvelope
protected void _updateLooseEnvelope(Envelope2D env)
-
_updateLooseEnvelope
protected void _updateLooseEnvelope(Envelope3D env)
\internal Calculates loose envelope. Returns True if the calculation renders exact envelope.
-
queryEnvelope
public void queryEnvelope(Envelope env)
Description copied from class:GeometryReturns the axis aligned bounding box of the geometry.- Specified by:
queryEnvelopein classGeometry- Parameters:
env- The envelope to return the result in.
-
queryEnvelope2D
public void queryEnvelope2D(Envelope2D env)
Description copied from class:GeometryReturns tight bbox of the Geometry in X, Y plane.- Specified by:
queryEnvelope2Din classGeometry- Parameters:
env- The envelope to return the result in.
-
queryEnvelope3D
public void queryEnvelope3D(Envelope3D env)
Description copied from class:GeometryReturns tight bbox of the Geometry in 3D.- Specified by:
queryEnvelope3Din classGeometry- Parameters:
env- The envelope to return the result in.
-
queryLooseEnvelope2D
public void queryLooseEnvelope2D(Envelope2D env)
Description copied from class:GeometryReturns the conservative bbox of the Geometry in X, Y plane. This is a faster method than QueryEnvelope2D. However, the bbox could be larger than the tight box.- Overrides:
queryLooseEnvelope2Din classGeometry- Parameters:
env- The envelope to return the result in.
-
queryLooseEnvelope3D
public void queryLooseEnvelope3D(Envelope3D env)
Description copied from class:GeometryReturns tight conservative box of the Geometry in 3D. This is a faster method than the QueryEnvelope3D. However, the box could be larger than the tight box.- Overrides:
queryLooseEnvelope3Din classGeometry- Parameters:
env- The envelope to return the result in.
-
queryInterval
public Envelope1D queryInterval(int semantics, int ordinate)
Description copied from class:GeometryReturns the min and max attribute values at the ordinate of the Geometry.- Specified by:
queryIntervalin classGeometry- Parameters:
semantics- The semantics of the interval.ordinate- The ordinate of the interval.- Returns:
- The interval.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
setEnvelope
public void setEnvelope(Envelope env)
Sets the envelope of the Geometry. The Envelope description must match that of the Geometry.
-
copyTo
public void copyTo(Geometry dstGeom)
Description copied from class:GeometryCopies this geometry to another geometry of the same type. The result geometry is an exact copy.
-
_copyToUnsafe
void _copyToUnsafe(MultiVertexGeometryImpl dst)
-
_attributeStreamIsAllocated
public boolean _attributeStreamIsAllocated(int semantics)
-
_setEmptyImpl
void _setEmptyImpl()
-
notifyModified
public void notifyModified(int flags)
Notifies the Geometry of changes made to the vertices so that it could reset cached structures.
-
_updateAllDirtyIntervals
protected void _updateAllDirtyIntervals(boolean bExact)
- Parameters:
bExact- True, when the exact envelope need to be calculated and false for the loose one.
-
_updateXYImpl
public void _updateXYImpl(boolean bExact)
\internal Updates x, y intervals.
-
calculateEnvelope2D
void calculateEnvelope2D(Envelope2D env, boolean bExact)
-
_verifyAllStreamsImpl
protected void _verifyAllStreamsImpl()
\internal Verifies all streams (calls _VerifyStream for every attribute).
-
_resizeImpl
void _resizeImpl(int pointCount)
-
queryCoordinates
int queryCoordinates(Point2D[] dst, int dstSize, int beginIndex, int endIndex)
-
QueryCoordinates
int QueryCoordinates(Point3D[] dst, int dstSize, int beginIndex, int endIndex)
-
getIsSimple
public int getIsSimple(double tolerance)
-
setIsSimple
void setIsSimple(int isSimpleRes, double tolerance, boolean ogc_known)
-
_getSimpleTolerance
double _getSimpleTolerance()
-
_getAccelerators
public GeometryAccelerators _getAccelerators()
-
_clearAccelerators
void _clearAccelerators()
-
_interpolateTwoVertices
void _interpolateTwoVertices(int vertex1, int vertex2, double f, Point outPoint)
-
_getShortestDistance
double _getShortestDistance(int vertex1, int vertex2)
-
getPoint
public Point getPoint(int index)
Description copied from class:MultiVertexGeometryReturns given vertex of the Geometry.- Specified by:
getPointin classMultiVertexGeometry
-
setPoint
public void setPoint(int index, Point src)Description copied from class:MultiVertexGeometrySets the vertex at given index of the Geometry.- Specified by:
setPointin classMultiVertexGeometry- Parameters:
index- The index of the vertex being changed.src- The Point instance to set given vertex attributes from. The pointSrc can not be empty.
The method throws if the pointSrc is not of the Point type.
The attributes, that are present in the pointSrc and missing in this Geometry, will be added to the Geometry.
The vertex attributes missing in the pointSrc but present in the Geometry will be set to the default values (see VertexDescription::GetDefaultValue).
-
queryCoordinates
public void queryCoordinates(Point[] dst)
- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
queryCoordinates
public void queryCoordinates(Point2D[] dst)
Description copied from class:MultiVertexGeometryQueries XY coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
queryCoordinates
public void queryCoordinates(Point3D[] dst)
Description copied from class:MultiVertexGeometryQueries XYZ coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
replaceNaNs
public void replaceNaNs(int semantics, double value)Description copied from class:GeometryReplaces NaNs in the attribute with the given value. If the geometry is not empty, it adds the attribute if geometry does not have it yet, and replaces the values. If the geometry is empty, it adds the attribute and does not set any values.- Specified by:
replaceNaNsin classGeometry- Parameters:
semantics- The semantics for which to replace the NaNs.value- The value to replace NaNs with.
-
_buildRasterizedGeometryAccelerator
public abstract boolean _buildRasterizedGeometryAccelerator(double toleranceXY, Geometry.GeometryAccelerationDegree accelDegree)
-
_buildQuadTreeAccelerator
public abstract boolean _buildQuadTreeAccelerator(Geometry.GeometryAccelerationDegree d)
-
-