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 interfacestatic interfaceNested classes/interfaces inherited from class Geometry
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type -
Field Summary
FieldsModifier and TypeFieldDescription(package private) GeometryAccelerators(package private) Envelopeprotected intprotected intprotected intprotected double(package private) AttributeStreamBase[]private static final longFields inherited from class Geometry
m_description, m_touchFlag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_assignVertexDescriptionImpl(VertexDescription newDescription) boolean_attributeStreamIsAllocated(int semantics) abstract booleanabstract 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) doubleprotected 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) voidprotected void_updateAllDirtyIntervals(boolean bExact) protected voidprotected voidprotected voidprotected void\internal Calculates loose envelope.void_updateXYImpl(boolean bExact) \internal Updates x, y intervals.protected voidprotected 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) voidcalculateEnvelope2D(Envelope2D env, boolean bExact) voidCopies this geometry to another geometry of the same type.booleandoublegetAttributeAsDbl(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.getAttributeStreamRef(int semantics) intgetIsSimple(double tolerance) getPoint(int index) Returns given vertex of the Geometry.voidgetPointByVal(int index, Point dst) Returns given vertex of the Geometry.intReturns the total vertex count in this Geometry.getXY(int index) Returns XY coordinates of the given vertex of the Geometry.voidgetXYZ(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) booleanvoidnotifyModified(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.voidReturns tight bbox of the Geometry in X, Y plane.voidReturns 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.voidReturns the conservative bbox of the Geometry in X, Y plane.voidReturns 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) voidSets 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) voidSets XY coordinates of the given vertex of the Geometry.voidSets XYZ coordinates of the given vertex of the Geometry.protected voidtoString()The output of this method can be only used for debugging.Methods inherited from class MultiVertexGeometry
getCoordinates2D, getCoordinates3D, getPointMethods inherited from class 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:
getPointCountin classMultiVertexGeometry- Returns:
- total vertex count in this Geometry.
-
isEmpty
-
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:MultiVertexGeometryReturns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.- Specified by:
getPointByValin classMultiVertexGeometry
-
setPointByVal
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
Description copied from class:MultiVertexGeometryReturns XY coordinates of the given vertex of the Geometry.- Specified by:
getXYin classMultiVertexGeometry
-
getXY
- Specified by:
getXYin classMultiVertexGeometry
-
setXY
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
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
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
-
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:
_assignVertexDescriptionImplin classMultiVertexGeometry
-
_updateEnvelope
-
_updateEnvelope
-
_updateLooseEnvelope
-
_updateLooseEnvelope
\internal Calculates loose envelope. Returns True if the calculation renders exact envelope. -
queryEnvelope
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
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
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
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
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
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
-
equals
-
setEnvelope
Sets the envelope of the Geometry. The Envelope description must match that of the Geometry. -
copyTo
-
_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:MultiVertexGeometryReturns given vertex of the Geometry.- Specified by:
getPointin classMultiVertexGeometry
-
setPoint
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
- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
queryCoordinates
Description copied from class:MultiVertexGeometryQueries XY coordinates as an array. The array must be larg enough (See GetPointCount()).- Specified by:
queryCoordinatesin classMultiVertexGeometry
-
queryCoordinates
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
-
toString
-