Class 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.
    • Field Detail

      • 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 Detail

      • MultiVertexGeometryImpl

        public MultiVertexGeometryImpl()
    • 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:
        getPointCount in class MultiVertexGeometry
        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.
        Specified by:
        isEmpty in class Geometry
        Returns:
        boolean Returns TRUE if this geometry is empty.
      • 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: MultiVertexGeometry
        Returns given vertex of the Geometry. The outPoint will have same VertexDescription as this Geometry.
        Specified by:
        getPointByVal in class MultiVertexGeometry
      • setPointByVal

        public void setPointByVal​(int index,
                                  Point src)
        Description copied from class: MultiVertexGeometry
        Sets the vertex at given index of the Geometry.
        Specified by:
        setPointByVal in class MultiVertexGeometry
        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).
      • setXY

        public void setXY​(int index,
                          Point2D pt)
        Description copied from class: MultiVertexGeometry
        Sets XY coordinates of the given vertex of the Geometry. All other attributes are unchanged.
        Specified by:
        setXY in class MultiVertexGeometry
      • setXY

        public void setXY​(int index,
                          double x,
                          double y)
      • getXYZ

        public Point3D getXYZ​(int index)
        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 class MultiVertexGeometry
      • setXYZ

        public void setXYZ​(int index,
                           Point3D pt)
        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 class MultiVertexGeometry
      • 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 class MultiVertexGeometry
        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 class MultiVertexGeometry
        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 class MultiVertexGeometry
        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 class MultiVertexGeometry
      • 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.
      • _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: Geometry
        Returns the axis aligned bounding box of the geometry.
        Specified by:
        queryEnvelope in class Geometry
        Parameters:
        env - The envelope to return the result in.
      • queryEnvelope2D

        public void queryEnvelope2D​(Envelope2D env)
        Description copied from class: Geometry
        Returns tight bbox of the Geometry in X, Y plane.
        Specified by:
        queryEnvelope2D in class Geometry
        Parameters:
        env - The envelope to return the result in.
      • queryEnvelope3D

        public void queryEnvelope3D​(Envelope3D env)
        Description copied from class: Geometry
        Returns tight bbox of the Geometry in 3D.
        Specified by:
        queryEnvelope3D in class Geometry
        Parameters:
        env - The envelope to return the result in.
      • queryLooseEnvelope2D

        public void queryLooseEnvelope2D​(Envelope2D env)
        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 class Geometry
        Parameters:
        env - The envelope to return the result in.
      • queryLooseEnvelope3D

        public void queryLooseEnvelope3D​(Envelope3D env)
        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 class Geometry
        Parameters:
        env - The envelope to return the result in.
      • queryInterval

        public Envelope1D queryInterval​(int semantics,
                                        int ordinate)
        Description copied from class: Geometry
        Returns the min and max attribute values at the ordinate of the Geometry.
        Specified by:
        queryInterval in class Geometry
        Parameters:
        semantics - The semantics of the interval.
        ordinate - The ordinate of the interval.
        Returns:
        The interval.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.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: Geometry
        Copies this geometry to another geometry of the same type. The result geometry is an exact copy.
        Specified by:
        copyTo in class Geometry
        Parameters:
        dstGeom - The geometry instance to copy to.
      • _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()
      • _clearAccelerators

        void _clearAccelerators()
      • _interpolateTwoVertices

        void _interpolateTwoVertices​(int vertex1,
                                     int vertex2,
                                     double f,
                                     Point outPoint)
      • _getShortestDistance

        double _getShortestDistance​(int vertex1,
                                    int vertex2)
      • setPoint

        public void setPoint​(int index,
                             Point src)
        Description copied from class: MultiVertexGeometry
        Sets the vertex at given index of the Geometry.
        Specified by:
        setPoint in class MultiVertexGeometry
        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).
      • 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 class Geometry
        Parameters:
        semantics - The semantics for which to replace the NaNs.
        value - The value to replace NaNs with.
      • toString

        public java.lang.String toString()
        Description copied from class: Geometry
        The output of this method can be only used for debugging. It is subject to change without notice.
        Overrides:
        toString in class Geometry