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:
Serializable
- Direct Known Subclasses:
MultiPathImpl
,MultiPointImpl
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 ClassesModifier and TypeClassDescriptionstatic interface
static interface
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) GeometryAccelerators
(package private) Envelope
protected int
protected int
protected int
protected double
(package private) AttributeStreamBase[]
private static final long
Fields inherited from class com.esri.core.geometry.Geometry
m_description, m_touchFlag
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_assignVertexDescriptionImpl
(VertexDescription newDescription) boolean
_attributeStreamIsAllocated
(int semantics) abstract boolean
abstract boolean
_buildRasterizedGeometryAccelerator
(double toleranceXY, Geometry.GeometryAccelerationDegree accelDegree) (package private) void
(package private) abstract void
\internal CHildren implement this method to copy additional information(package private) void
(package private) double
_getShortestDistance
(int vertex1, int vertex2) (package private) double
protected boolean
_hasDirtyFlag
(int flag) (package private) void
_interpolateTwoVertices
(int vertex1, int vertex2, double f, Point outPoint) protected abstract void
(package private) void
_resizeImpl
(int pointCount) protected void
_setDirtyFlag
(int flag, boolean bYesNo) (package private) void
protected void
_updateAllDirtyIntervals
(boolean bExact) protected void
protected void
protected void
protected void
\internal Calculates loose envelope.void
_updateXYImpl
(boolean bExact) \internal Updates x, y intervals.protected void
protected void
\internal Verifies all streams (calls _VerifyStream for every attribute).protected abstract void
\internal Called inside of the VerifyAllStreams to get a child class a chance to do additional verify.(package private) void
calculateEnvelope2D
(Envelope2D env, boolean bExact) void
Copies this geometry to another geometry of the same type.boolean
double
getAttributeAsDbl
(int semantics, int offset, int ordinate) Returns value of the given vertex attribute as double.int
getAttributeAsInt
(int semantics, int offset, int ordinate) Returns value of the given vertex attribute as int.getAttributeStreamRef
(int semantics) int
getIsSimple
(double tolerance) getPoint
(int index) Returns given vertex of the Geometry.void
getPointByVal
(int index, Point dst) Returns given vertex of the Geometry.int
Returns the total vertex count in this Geometry.getXY
(int index) Returns XY coordinates of the given vertex of the Geometry.void
getXYZ
(int index) Returns XYZ coordinates of the given vertex of the Geometry.int
hashCode()
boolean
isEmpty()
IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.(package private) boolean
void
notifyModified
(int flags) Notifies the Geometry of changes made to the vertices so that it could reset cached structures.void
queryCoordinates
(Point[] dst) void
queryCoordinates
(Point2D[] dst) Queries XY coordinates as an array.(package private) int
queryCoordinates
(Point2D[] dst, int dstSize, int beginIndex, int endIndex) void
queryCoordinates
(Point3D[] dst) Queries XYZ coordinates as an array.(package private) int
QueryCoordinates
(Point3D[] dst, int dstSize, int beginIndex, int endIndex) void
queryEnvelope
(Envelope env) Returns the axis aligned bounding box of the geometry.void
Returns tight bbox of the Geometry in X, Y plane.void
Returns tight bbox of the Geometry in 3D.queryInterval
(int semantics, int ordinate) Returns the min and max attribute values at the ordinate of the Geometry.void
Returns the conservative bbox of the Geometry in X, Y plane.void
Returns tight conservative box of the Geometry in 3D.void
replaceNaNs
(int semantics, double value) Replaces NaNs in the attribute with the given value.void
setAttribute
(int semantics, int offset, int ordinate, double value) Sets the value of given attribute at given posisiotnsis.void
setAttribute
(int semantics, int offset, int ordinate, int value) Same as above, but works with ints.void
setAttributeStreamRef
(int semantics, AttributeStreamBase stream) Sets a reference to the given AttributeStream of the Geometry.void
setEnvelope
(Envelope env) Sets the envelope of the Geometry.(package private) void
setIsSimple
(int isSimpleRes, double tolerance, boolean ogc_known) void
Sets the vertex at given index of the Geometry.void
setPointByVal
(int index, Point src) Sets the vertex at given index of the Geometry.void
setXY
(int index, double x, double y) void
Sets XY coordinates of the given vertex of the Geometry.void
Sets XYZ coordinates of the given vertex of the Geometry.protected void
toString()
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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
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
-
-
Constructor Details
-
MultiVertexGeometryImpl
public MultiVertexGeometryImpl()
-
-
Method Details
-
_copyToImpl
\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:
getPointCount
in classMultiVertexGeometry
- Returns:
- total vertex count in this Geometry.
-
isEmpty
public boolean isEmpty()Description copied from class:Geometry
IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state. -
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
Description copied from class:MultiVertexGeometry
Returns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.- Specified by:
getPointByVal
in classMultiVertexGeometry
-
setPointByVal
Description copied from class:MultiVertexGeometry
Sets the vertex at given index of the Geometry.- Specified by:
setPointByVal
in 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
Description copied from class:MultiVertexGeometry
Returns XY coordinates of the given vertex of the Geometry.- Specified by:
getXY
in classMultiVertexGeometry
-
getXY
- Specified by:
getXY
in classMultiVertexGeometry
-
setXY
Description copied from class:MultiVertexGeometry
Sets XY coordinates of the given vertex of the Geometry. All other attributes are unchanged.- Specified by:
setXY
in classMultiVertexGeometry
-
setXY
public void setXY(int index, double x, double y) -
getXYZ
Description copied from class:MultiVertexGeometry
Returns 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:
getXYZ
in classMultiVertexGeometry
-
setXYZ
Description copied from class:MultiVertexGeometry
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.- Specified by:
setXYZ
in classMultiVertexGeometry
-
getAttributeAsDbl
public double getAttributeAsDbl(int semantics, int offset, int ordinate) Description copied from class:MultiVertexGeometry
Returns value of the given vertex attribute as double.- Specified by:
getAttributeAsDbl
in 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:MultiVertexGeometry
Returns value of the given vertex attribute as int.- Specified by:
getAttributeAsInt
in 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:MultiVertexGeometry
Sets the value of given attribute at given posisiotnsis.- Specified by:
setAttribute
in 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:MultiVertexGeometry
Same 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:
setAttribute
in classMultiVertexGeometry
-
getAttributeStreamRef
-
setAttributeStreamRef
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
- Overrides:
_assignVertexDescriptionImpl
in classMultiVertexGeometry
-
_updateEnvelope
-
_updateEnvelope
-
_updateLooseEnvelope
-
_updateLooseEnvelope
\internal Calculates loose envelope. Returns True if the calculation renders exact envelope. -
queryEnvelope
Description copied from class:Geometry
Returns the axis aligned bounding box of the geometry.- Specified by:
queryEnvelope
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryEnvelope2D
Description copied from class:Geometry
Returns tight bbox of the Geometry in X, Y plane.- Specified by:
queryEnvelope2D
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryEnvelope3D
Description copied from class:Geometry
Returns tight bbox of the Geometry in 3D.- Specified by:
queryEnvelope3D
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryLooseEnvelope2D
Description copied from class:Geometry
Returns 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:
queryLooseEnvelope2D
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryLooseEnvelope3D
Description copied from class:Geometry
Returns 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:
queryLooseEnvelope3D
in classGeometry
- Parameters:
env
- The envelope to return the result in.
-
queryInterval
Description copied from class:Geometry
Returns the min and max attribute values at the ordinate of the Geometry.- Specified by:
queryInterval
in classGeometry
- Parameters:
semantics
- The semantics of the interval.ordinate
- The ordinate of the interval.- Returns:
- The interval.
-
hashCode
public int hashCode() -
equals
-
setEnvelope
Sets the envelope of the Geometry. The Envelope description must match that of the Geometry. -
copyTo
Description copied from class:Geometry
Copies this geometry to another geometry of the same type. The result geometry is an exact copy. -
_copyToUnsafe
-
_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
-
_verifyAllStreamsImpl
protected void _verifyAllStreamsImpl()\internal Verifies all streams (calls _VerifyStream for every attribute). -
_resizeImpl
void _resizeImpl(int pointCount) -
queryCoordinates
-
QueryCoordinates
-
getIsSimple
public int getIsSimple(double tolerance) -
setIsSimple
void setIsSimple(int isSimpleRes, double tolerance, boolean ogc_known) -
_getSimpleTolerance
double _getSimpleTolerance() -
_getAccelerators
-
_clearAccelerators
void _clearAccelerators() -
_interpolateTwoVertices
-
_getShortestDistance
double _getShortestDistance(int vertex1, int vertex2) -
getPoint
Description copied from class:MultiVertexGeometry
Returns given vertex of the Geometry.- Specified by:
getPoint
in classMultiVertexGeometry
-
setPoint
Description copied from class:MultiVertexGeometry
Sets the vertex at given index of the Geometry.- Specified by:
setPoint
in 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
- Specified by:
queryCoordinates
in classMultiVertexGeometry
-
queryCoordinates
Description copied from class:MultiVertexGeometry
Queries XY coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinates
in classMultiVertexGeometry
-
queryCoordinates
Description copied from class:MultiVertexGeometry
Queries XYZ coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinates
in classMultiVertexGeometry
-
replaceNaNs
public void replaceNaNs(int semantics, double value) Description copied from class:Geometry
Replaces 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:
replaceNaNs
in 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
-
toString
Description copied from class:Geometry
The output of this method can be only used for debugging. It is subject to change without notice.
-