Package com.esri.core.geometry
Class VertexDescription
- java.lang.Object
-
- com.esri.core.geometry.VertexDescription
-
public final class VertexDescription extends java.lang.ObjectDescribes the vertex format of a Geometry. Geometry objects store vertices. The vertex is a multi attribute entity. It has mandatory X, Y coordinates. In addition it may have Z, M, ID, and other user specified attributes. Geometries point to VertexDescription instances. If the two Geometries have same set of attributes, they point to the same VertexDescription instance.
To create a new VertexDescription use the VertexDescriptionDesigner class.
The VertexDescription allows to add new attribute types easily (see ID2).
The attributes are stored sorted by Semantics value.
Note: You could also think of the VertexDescription as a schema of a database table. You may look the vertices of a Geometry as if they are stored in a database table, and the VertexDescription defines the fields of the table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceVertexDescription.InterpolationSpecifies how the attribute is interpolated along the segments.(package private) static interfaceVertexDescription.PersistenceSpecifies the type of the attribute.static interfaceVertexDescription.SemanticsDescribes the attribute and, in case of predefined attributes, provides a hint of the attribute use.
-
Field Summary
Fields Modifier and Type Field Description (package private) static int[]_components(package private) static double[]_defaultValues(package private) static int[]_interpolation(package private) static int[]_persistence(package private) static int[]_persistencesizeprivate intm_attributeCountprivate double[]m_defaultPointAttributesprivate intm_hashprivate int[]m_indexToSemanticsprivate int[]m_pointAttributeOffsets(package private) intm_semanticsBitArrayprivate int[]m_semanticsToIndexMapprivate intm_totalComponentCount
-
Constructor Summary
Constructors Constructor Description VertexDescription(int bitMask)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) double[]_getDefaultPointAttributes()Returns a packed array of double representation of all ordinates of attributes of a point, i.e.: X, Y, Z, ID, TEXTURE2D.u, TEXTURE2D.v(package private) double_getDefaultPointAttributeValue(int attributeIndex, int ordinate)(package private) int_getPointAttributeOffset(int attributeIndex)Returns an offset to the first ordinate of the given attribute.(package private) int_getPointAttributeOffsetFromSemantics(int semantics)(package private) int_getSemanticsImpl(int attributeIndex)booleanequals(java.lang.Object _other)intgetAttributeCount()Returns the attribute count of this description.intgetAttributeIndex(int semantics)Returns the index the given attribute in the vertex description.static intgetComponentCount(int semantics)Returns the number of the components of the given semantics.static doublegetDefaultValue(int semantics)Returns default value for each ordinate of the vertex attribute with given semantics.(package private) static intgetInterpolation(int semantics)Returns the interpolation type for the attribute.(package private) static intgetPersistence(int semantics)Returns the persistence type for the attribute.(package private) static intgetPersistenceSize(int persistence)Returns the size of the persistence type in bytes.(package private) static intgetPersistenceSizeSemantics(int semantics)Returns the size of the semantics in bytes.(package private) intgetPointAttributeOffset_(int attributeIndex)intgetSemantics(int attributeIndex)Returns the semantics of the given attribute.intgetTotalComponentCount()Returns the total component count.booleanhasAttribute(int semantics)Returns True if the attribute with the given name and given set exists.booleanhasAttributesFrom(VertexDescription src)Returns True if this vertex description includes all attributes from the src.inthashCode()booleanhasID()Returns True, if the vertex has ID attribute.booleanhasM()Returns True, if the vertex has M attribute.booleanhasZ()Returns True, if the vertex has Z attribute.static booleanisDefaultValue(int semantics, double v)Checks if the given value is the default one.(package private) static booleanisIntegerPersistence(int persistence)(package private) static booleanisIntegerSemantics(int semantics)
-
-
-
Field Detail
-
m_attributeCount
private int m_attributeCount
-
m_semanticsBitArray
int m_semanticsBitArray
-
m_totalComponentCount
private int m_totalComponentCount
-
m_hash
private int m_hash
-
m_semanticsToIndexMap
private int[] m_semanticsToIndexMap
-
m_indexToSemantics
private int[] m_indexToSemantics
-
m_pointAttributeOffsets
private int[] m_pointAttributeOffsets
-
m_defaultPointAttributes
private double[] m_defaultPointAttributes
-
_defaultValues
static final double[] _defaultValues
-
_interpolation
static final int[] _interpolation
-
_persistence
static final int[] _persistence
-
_persistencesize
static final int[] _persistencesize
-
_components
static final int[] _components
-
-
Method Detail
-
getAttributeCount
public final int getAttributeCount()
Returns the attribute count of this description. The value is always greater or equal to 1. The first attribute is always a POSITION.
-
getSemantics
public final int getSemantics(int attributeIndex)
Returns the semantics of the given attribute.- Parameters:
attributeIndex- The index of the attribute in the description. Max value is getAttributeCount() - 1.
-
getAttributeIndex
public final int getAttributeIndex(int semantics)
Returns the index the given attribute in the vertex description.- Parameters:
semantics-- Returns:
- Returns the attribute index or -1 of the attribute does not exist
-
getInterpolation
static int getInterpolation(int semantics)
Returns the interpolation type for the attribute.- Parameters:
semantics- The semantics of the attribute.
-
getPersistence
static int getPersistence(int semantics)
Returns the persistence type for the attribute.- Parameters:
semantics- The semantics of the attribute.
-
getPersistenceSize
static int getPersistenceSize(int persistence)
Returns the size of the persistence type in bytes.- Parameters:
persistence- The persistence type to query.
-
getPersistenceSizeSemantics
static int getPersistenceSizeSemantics(int semantics)
Returns the size of the semantics in bytes.
-
getComponentCount
public static int getComponentCount(int semantics)
Returns the number of the components of the given semantics. For example, it returns 2 for the POSITION.- Parameters:
semantics- The semantics of the attribute.
-
hasAttribute
public boolean hasAttribute(int semantics)
Returns True if the attribute with the given name and given set exists.- Parameters:
semantics- The semantics of the attribute.
-
hasAttributesFrom
public final boolean hasAttributesFrom(VertexDescription src)
Returns True if this vertex description includes all attributes from the src.- Parameters:
src- The Vertex_description to compare with.- Returns:
- The function returns false, only when this description does not have some of the attribute that src has.
-
hasZ
public final boolean hasZ()
Returns True, if the vertex has Z attribute.
-
hasM
public final boolean hasM()
Returns True, if the vertex has M attribute.
-
hasID
public final boolean hasID()
Returns True, if the vertex has ID attribute.
-
getDefaultValue
public static double getDefaultValue(int semantics)
Returns default value for each ordinate of the vertex attribute with given semantics.
-
getPointAttributeOffset_
int getPointAttributeOffset_(int attributeIndex)
-
getTotalComponentCount
public int getTotalComponentCount()
Returns the total component count.
-
isDefaultValue
public static boolean isDefaultValue(int semantics, double v)Checks if the given value is the default one. The simple equality test with GetDefaultValue does not work due to the use of NaNs as default value for some parameters.
-
isIntegerPersistence
static boolean isIntegerPersistence(int persistence)
-
isIntegerSemantics
static boolean isIntegerSemantics(int semantics)
-
equals
public boolean equals(java.lang.Object _other)
- Overrides:
equalsin classjava.lang.Object
-
_getDefaultPointAttributes
double[] _getDefaultPointAttributes()
Returns a packed array of double representation of all ordinates of attributes of a point, i.e.: X, Y, Z, ID, TEXTURE2D.u, TEXTURE2D.v
-
_getDefaultPointAttributeValue
double _getDefaultPointAttributeValue(int attributeIndex, int ordinate)
-
_getPointAttributeOffset
int _getPointAttributeOffset(int attributeIndex)
Returns an offset to the first ordinate of the given attribute. This method is used for the cases when one wants to have a packed array of ordinates of all attributes, i.e.: X, Y, Z, ID, TEXTURE2D.u, TEXTURE2D.v
-
_getPointAttributeOffsetFromSemantics
int _getPointAttributeOffsetFromSemantics(int semantics)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
_getSemanticsImpl
int _getSemanticsImpl(int attributeIndex)
-
-