idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
26,200 | int deleteEdgeInternal_ ( int half_edge ) { int chain = getHalfEdgeChain ( half_edge ) ; int halfEdgeTwin = getHalfEdgeTwin ( half_edge ) ; int chainTwin = getHalfEdgeChain ( halfEdgeTwin ) ; assert ( chainTwin == chain ) ; assert ( half_edge == getHalfEdgeNext ( halfEdgeTwin ) || halfEdgeTwin == getHalfEdgeNext ( half... | Use with care . |
26,201 | void deleteEdgesBreakFaces_ ( AttributeStreamOfInt32 edgesToDelete ) { for ( int i = 0 , n = edgesToDelete . size ( ) ; i < n ; i ++ ) { int half_edge = edgesToDelete . get ( i ) ; int chain = getHalfEdgeChain ( half_edge ) ; int halfEdgeTwin = getHalfEdgeTwin ( half_edge ) ; int chainTwin = getHalfEdgeChain ( halfEdge... | parentage information still . |
26,202 | double getChainArea ( int chain ) { int chainIndex = getChainIndex_ ( chain ) ; double v = m_chainAreas . read ( chainIndex ) ; if ( NumberUtils . isNaN ( v ) ) { updateChainAreaAndPerimeter_ ( chain ) ; v = m_chainAreas . read ( chainIndex ) ; } return v ; } | + Inf is returned for the universe chain . |
26,203 | double getChainPerimeter ( int chain ) { int chainIndex = getChainIndex_ ( chain ) ; double v = m_chainPerimeters . read ( chainIndex ) ; if ( NumberUtils . isNaN ( v ) ) { updateChainAreaAndPerimeter_ ( chain ) ; v = m_chainPerimeters . read ( chainIndex ) ; } return v ; } | universe chain . |
26,204 | int getChainUserIndex ( int chain , int index ) { int i = getChainIndex_ ( chain ) ; AttributeStreamOfInt32 stream = m_chainIndices . get ( index ) ; if ( stream . size ( ) <= i ) return - 1 ; return stream . read ( i ) ; } | Returns a user index value for the chain . |
26,205 | void setChainUserIndex ( int chain , int index , int value ) { int i = getChainIndex_ ( chain ) ; AttributeStreamOfInt32 stream = m_chainIndices . get ( index ) ; if ( stream . size ( ) <= i ) stream . resize ( m_chainData . size ( ) , - 1 ) ; stream . write ( i , value ) ; } | Sets a user index value for the chain . |
26,206 | int createUserIndexForChains ( ) { if ( m_chainIndices == null ) { m_chainIndices = new ArrayList < AttributeStreamOfInt32 > ( 3 ) ; } AttributeStreamOfInt32 new_stream = new AttributeStreamOfInt32 ( m_chainData . capacity ( ) , - 1 ) ; for ( int i = 0 , n = m_chainIndices . size ( ) ; i < n ; i ++ ) { if ( m_chainIndi... | Creates a new user index for the chains . The index values are set to - 1 . |
26,207 | int getHalfEdgeConnector ( int clusterFrom , int clusterTo ) { int first_edge = getClusterHalfEdge ( clusterFrom ) ; if ( first_edge == - 1 ) return - 1 ; int edge = first_edge ; int firstEdgeTo = - 1 ; int eTo = - 1 ; do { if ( getHalfEdgeTo ( edge ) == clusterTo ) return edge ; if ( firstEdgeTo == - 1 ) { firstEdgeTo... | Could be a slow operation when valency of each cluster is high . |
26,208 | void reset ( Envelope2D extent , int height ) { m_quad_tree_nodes . deleteAll ( false ) ; m_element_nodes . deleteAll ( false ) ; m_data . clear ( ) ; m_free_data . clear ( false ) ; reset_ ( extent , height ) ; } | Resets the Quad_tree_impl to the given extent and height . \ param extent The extent of the Quad_tree_impl . \ param height The max height of the Quad_tree_impl . |
26,209 | int insert ( int element , Envelope2D bounding_box ) { if ( m_root == - 1 ) create_root_ ( ) ; if ( m_b_store_duplicates ) { int success = insert_duplicates_ ( element , bounding_box , 0 , m_extent , m_root , false , - 1 ) ; if ( success != - 1 ) { if ( m_data_extent . isEmpty ( ) ) m_data_extent . setCoords ( bounding... | Inserts the element and bounding_box into the Quad_tree_impl . Note that this will invalidate any active iterator on the Quad_tree_impl . Returns an Element_handle corresponding to the element and bounding_box . \ param element The element of the Geometry to be inserted . \ param bounding_box The bounding_box of the Ge... |
26,210 | int insert ( int element , Envelope2D bounding_box , int hint_index ) { if ( m_root == - 1 ) create_root_ ( ) ; if ( m_b_store_duplicates ) { int success = insert_duplicates_ ( element , bounding_box , 0 , m_extent , m_root , false , - 1 ) ; if ( success != - 1 ) { if ( m_data_extent . isEmpty ( ) ) m_data_extent . set... | Inserts the element and bounding_box into the Quad_tree_impl at the given quad_handle . Note that this will invalidate any active iterator on the Quad_tree_impl . Returns an Element_handle corresponding to the element and bounding_box . \ param element The element of the Geometry to be inserted . \ param bounding_box T... |
26,211 | void removeElement ( int element_handle ) { if ( m_b_store_duplicates ) throw new GeometryException ( "invalid call" ) ; int quad_handle = get_quad_ ( element_handle ) ; disconnect_element_handle_ ( element_handle ) ; free_element_and_box_node_ ( element_handle ) ; int q = quad_handle ; while ( q != - 1 ) { set_sub_tre... | Removes the element and bounding_box at the given element_handle . Note that this will invalidate any active iterator on the Quad_tree_impl . \ param element_handle The handle corresponding to the element and bounding_box to be removed . |
26,212 | Envelope2D getExtent ( int quad_handle ) { Envelope2D quad_extent = new Envelope2D ( ) ; quad_extent . setCoords ( m_extent ) ; if ( quad_handle == m_root ) return quad_extent ; AttributeStreamOfInt32 quadrants = new AttributeStreamOfInt32 ( 0 ) ; int q = quad_handle ; do { quadrants . add ( get_quadrant_ ( q ) ) ; q =... | Returns the extent of the quad at the given quad_handle . \ param quad_handle The handle corresponding to the quad . |
26,213 | int getIntersectionCount ( Envelope2D query , double tolerance , int max_count ) { if ( m_root == - 1 ) return 0 ; Envelope2D query_inflated = new Envelope2D ( ) ; query_inflated . setCoords ( query ) ; query_inflated . inflate ( tolerance , tolerance ) ; AttributeStreamOfInt32 quads_stack = new AttributeStreamOfInt32 ... | Returns the number of elements in the quad tree that intersect the qiven query . Some elements may be duplicated if the quad tree stores duplicates . \ param query The Envelope_2D used for the query . \ param tolerance The tolerance used for the intersection tests . \ param max_count If the intersection count becomes g... |
26,214 | static protected int isSimplePlanar ( Geometry geometry , SpatialReference spatialReference , boolean bForce , ProgressTracker progressTracker ) { assert ( false ) ; if ( geometry . isEmpty ( ) ) return 1 ; Geometry . Type gt = geometry . getType ( ) ; if ( gt == Geometry . Type . Point ) return 1 ; else if ( gt == Geo... | The code is executed in the 2D plane only . Attributes are ignored . MultiPoint - check for clustering . Polyline - check for clustering and cracking . Polygon - check for clustering cracking absence of self - intersections and correct ring ordering . |
26,215 | private int edgeAngleCompare_ ( Edge edge1 , Edge edge2 ) { if ( edge1 . equals ( edge2 ) ) return 0 ; Point2D v1 = edge1 . m_segment . _getTangent ( edge1 . getReversed ( ) ? 1.0 : 0.0 ) ; if ( edge1 . getReversed ( ) ) v1 . negate ( ) ; Point2D v2 = edge2 . m_segment . _getTangent ( edge2 . getReversed ( ) ? 1.0 : 0.... | compares angles between two edges |
26,216 | Envelope2D getEnvelope2D ( ) { Envelope2D env = new Envelope2D ( ) ; env . setEmpty ( ) ; VertexIterator vert_iter = queryVertexIterator ( ) ; Point2D pt = new Point2D ( ) ; boolean b_first = true ; for ( int ivertex = vert_iter . next ( ) ; ivertex != - 1 ; ivertex = vert_iter . next ( ) ) { getXY ( ivertex , pt ) ; i... | Returns envelope of all coordinates . |
26,217 | int addGeometry ( Geometry geometry ) { Geometry . Type gt = geometry . getType ( ) ; if ( Geometry . isMultiPath ( gt . value ( ) ) ) return addMultiPath_ ( ( MultiPath ) geometry ) ; if ( gt == Geometry . Type . MultiPoint ) return addMultiPoint_ ( ( MultiPoint ) geometry ) ; throw GeometryException . GeometryInterna... | Adds a Geometry to the Edit_shape |
26,218 | void appendGeometry ( int dstGeometry , Geometry srcGeometry ) { Geometry . Type gt = srcGeometry . getType ( ) ; if ( Geometry . isMultiPath ( gt . value ( ) ) ) { appendMultiPath_ ( dstGeometry , ( MultiPath ) srcGeometry ) ; return ; } else if ( gt . value ( ) == Geometry . GeometryType . MultiPoint ) { appendMultiP... | Append a Geometry to the given geometry of the Edit_shape |
26,219 | int addPathFromMultiPath ( MultiPath multi_path , int ipath , boolean as_polygon ) { int newgeom = createGeometry ( as_polygon ? Geometry . Type . Polygon : Geometry . Type . Polyline , multi_path . getDescription ( ) ) ; MultiPathImpl mp_impl = ( MultiPathImpl ) multi_path . _getImpl ( ) ; if ( multi_path . getPathSiz... | Adds a path |
26,220 | int removeGeometry ( int geometry ) { for ( int path = getFirstPath ( geometry ) ; path != - 1 ; path = removePath ( path ) ) { } int prev = getPrevGeometry ( geometry ) ; int next = getNextGeometry ( geometry ) ; if ( prev != - 1 ) setNextGeometry_ ( prev , next ) ; else { m_first_geometry = next ; } if ( next != - 1 ... | Deletes existing geometry from the edit shape and returns the next one . |
26,221 | int createGeometry ( Geometry . Type geometry_type , VertexDescription description ) { int newgeom = newGeometry_ ( geometry_type . value ( ) ) ; if ( m_vertices == null ) { m_vertices_mp = new MultiPoint ( description ) ; m_vertices = ( MultiPointImpl ) m_vertices_mp . _getImpl ( ) ; } else m_vertices_mp . mergeVertex... | create a new empty geometry of the given type and attribute set . |
26,222 | void setGeometryUserIndex ( int geom , int index , int value ) { AttributeStreamOfInt32 stream = m_geometry_indices . get ( index ) ; int pindex = getGeometryIndex_ ( geom ) ; if ( pindex >= stream . size ( ) ) stream . resize ( Math . max ( ( int ) ( pindex * 1.25 ) , ( int ) 16 ) , - 1 ) ; stream . write ( pindex , v... | Sets value to the given user index on a geometry . |
26,223 | int getGeometryUserIndex ( int geom , int index ) { int pindex = getGeometryIndex_ ( geom ) ; AttributeStreamOfInt32 stream = m_geometry_indices . get ( index ) ; if ( pindex < stream . size ( ) ) return stream . read ( pindex ) ; else return - 1 ; } | Returns the value of the given user index of a geometry |
26,224 | int createGeometryUserIndex ( ) { if ( m_geometry_indices == null ) m_geometry_indices = new ArrayList < AttributeStreamOfInt32 > ( 4 ) ; for ( int i = 0 ; i < m_geometry_indices . size ( ) ; i ++ ) { if ( m_geometry_indices . get ( i ) == null ) { m_geometry_indices . set ( i , ( AttributeStreamOfInt32 ) AttributeStre... | stores - 1 for that geometry . |
26,225 | boolean hasDegenerateSegments ( double tolerance ) { for ( int geometry = getFirstGeometry ( ) ; geometry != - 1 ; geometry = getNextGeometry ( geometry ) ) { if ( ! Geometry . isMultiPath ( getGeometryType ( geometry ) ) ) continue ; boolean b_polygon = getGeometryType ( geometry ) == Geometry . GeometryType . Polygon... | Checks if there are degenerate segments in any of multipath geometries |
26,226 | int splitSegment ( int origin_vertex , double [ ] split_scalars , int split_count ) { int actual_splits = 0 ; int next_vertex = getNextVertex ( origin_vertex ) ; if ( next_vertex == - 1 ) throw GeometryException . GeometryInternalError ( ) ; int vindex = getVertexIndex ( origin_vertex ) ; int vindex_next = getVertexInd... | happend ) . |
26,227 | int createUserIndex ( ) { if ( m_indices == null ) m_indices = new ArrayList < AttributeStreamOfInt32 > ( 0 ) ; for ( int i = 0 ; i < m_indices . size ( ) ; i ++ ) { if ( m_indices . get ( i ) == null ) { m_indices . set ( i , ( AttributeStreamOfInt32 ) AttributeStreamBase . createIndexStream ( 0 , - 1 ) ) ; return i ;... | store an integer user value on the vertex . |
26,228 | Segment getSegment ( int vertex ) { if ( m_segments != null ) { int vindex = getVertexIndex ( vertex ) ; return m_segments . get ( vindex ) ; } return null ; } | if it is a Line . |
26,229 | boolean queryLineConnector ( int vertex , Line line ) { int next = getNextVertex ( vertex ) ; if ( next == - 1 ) return false ; if ( ! m_b_has_attributes ) { Point2D pt = new Point2D ( ) ; getXY ( vertex , pt ) ; line . setStartXY ( pt ) ; getXY ( next , pt ) ; line . setEndXY ( pt ) ; } else { Point pt = new Point ( )... | Can be used together with get_segment . |
26,230 | int insertPath ( int geometry , int before_path ) { int prev = - 1 ; if ( before_path != - 1 ) { if ( geometry != getGeometryFromPath ( before_path ) ) throw GeometryException . GeometryInternalError ( ) ; prev = getPrevPath ( before_path ) ; } else prev = getLastPath ( geometry ) ; int newpath = newPath_ ( geometry ) ... | path at the end . |
26,231 | int removePath ( int path ) { int prev = getPrevPath ( path ) ; int next = getNextPath ( path ) ; int geometry = getGeometryFromPath ( path ) ; if ( prev != - 1 ) setNextPath_ ( prev , next ) ; else { setFirstPath_ ( geometry , next ) ; } if ( next != - 1 ) setPrevPath_ ( next , prev ) ; else { setLastPath_ ( geometry ... | Removes a path gets rid of all its vertices and returns the next one |
26,232 | void clearPath ( int path ) { int first_vertex = getFirstVertex ( path ) ; if ( first_vertex != - 1 ) { int vertex = first_vertex ; for ( int i = 0 , n = getPathSize ( path ) ; i < n ; i ++ ) { int v = vertex ; vertex = getNextVertex ( vertex ) ; freeVertex_ ( v ) ; } int geometry = getGeometryFromPath ( path ) ; setGe... | Clears all vertices from the path |
26,233 | double getRingArea ( int path ) { if ( isRingAreaValid_ ( path ) ) return m_path_areas . get ( getPathIndex_ ( path ) ) ; Line line = new Line ( ) ; int vertex = getFirstVertex ( path ) ; if ( vertex == - 1 ) return 0 ; Point2D pt0 = new Point2D ( ) ; getXY ( vertex , pt0 ) ; double area = 0 ; for ( int i = 0 , n = get... | Returns the ring area |
26,234 | void setPathUserIndex ( int path , int index , int value ) { AttributeStreamOfInt32 stream = m_pathindices . get ( index ) ; int pindex = getPathIndex_ ( path ) ; if ( stream . size ( ) < m_path_areas . size ( ) ) stream . resize ( m_path_areas . size ( ) , - 1 ) ; stream . write ( pindex , value ) ; } | Sets value to the given user index on a path . |
26,235 | int getPathUserIndex ( int path , int index ) { int pindex = getPathIndex_ ( path ) ; AttributeStreamOfInt32 stream = m_pathindices . get ( index ) ; if ( pindex < stream . size ( ) ) return stream . read ( pindex ) ; else return - 1 ; } | Returns the value of the given user index of a path |
26,236 | int createPathUserIndex ( ) { if ( m_pathindices == null ) m_pathindices = new ArrayList < AttributeStreamOfInt32 > ( 0 ) ; for ( int i = 0 ; i < m_pathindices . size ( ) ; i ++ ) { if ( m_pathindices . get ( i ) == null ) { m_pathindices . set ( i , ( AttributeStreamOfInt32 ) ( AttributeStreamBase . createIndexStream ... | index allows to store an integer user value on the path . |
26,237 | void movePath ( int geom , int before_path , int path_to_move ) { if ( path_to_move == - 1 ) throw new IllegalArgumentException ( ) ; if ( before_path == path_to_move ) return ; int next = getNextPath ( path_to_move ) ; int prev = getPrevPath ( path_to_move ) ; int geom_src = getGeometryFromPath ( path_to_move ) ; if (... | before_path can be - 1 then the path is moved to the end of the dst_geom . |
26,238 | int addVertex ( int path , int vertex ) { m_vertices . getPointByVal ( getVertexIndex ( vertex ) , getHelperPoint_ ( ) ) ; return insertVertex_ ( path , - 1 , getHelperPoint_ ( ) ) ; } | Returns new vertex handle . |
26,239 | int removeVertex ( int vertex , boolean b_left_segment ) { int path = getPathFromVertex ( vertex ) ; int prev = getPrevVertex ( vertex ) ; int next = getNextVertex ( vertex ) ; if ( prev != - 1 ) setNextVertex_ ( prev , next ) ; int path_size = getPathSize ( path ) ; if ( vertex == getFirstVertex ( path ) ) { setFirstV... | reconnect . Returns next vertex after erased one . |
26,240 | void applyTransformation ( Transformation2D transform ) { m_vertices_mp . applyTransformation ( transform ) ; if ( m_segments != null ) { for ( int i = 0 , n = m_segments . size ( ) ; i < n ; i ++ ) { if ( m_segments . get ( i ) != null ) { m_segments . get ( i ) . applyTransformation ( transform ) ; } } } } | Applies affine transformation |
26,241 | public int insert ( int element , Envelope2D boundingBox , int hintIndex ) { return m_impl . insert ( element , boundingBox , hintIndex ) ; } | Inserts the element and bounding_box into the QuadTree at the given quad_handle . Note that a copy will me made of the input bounding_box . Note that this will invalidate any active iterator on the QuadTree . Returns an Element_handle corresponding to the element and bounding_box . \ param element The element of the Ge... |
26,242 | public int getIntersectionCount ( Envelope2D query , double tolerance , int maxCount ) { return m_impl . getIntersectionCount ( query , tolerance , maxCount ) ; } | Returns the number of elements in the quad tree that intersect the qiven query . Some elements may be duplicated if the quad tree stores duplicates . \ param query The Envelope2D used for the query . \ param tolerance The tolerance used for the intersection tests . \ param max_count If the intersection count becomes gr... |
26,243 | public QuadTreeIterator getIterator ( Geometry query , double tolerance ) { QuadTreeImpl . QuadTreeIteratorImpl iterator = m_impl . getIterator ( query , tolerance ) ; return new QuadTreeIterator ( iterator , false ) ; } | Gets an iterator on the QuadTree . The query will be the Envelope2D that bounds the input Geometry . To reuse the existing iterator on the same QuadTree but with a new query use the reset_iterator function on the QuadTree_iterator . \ param query The Geometry used for the query . If the Geometry is a Line segment then ... |
26,244 | public QuadTreeIterator getIterator ( ) { QuadTreeImpl . QuadTreeIteratorImpl iterator = m_impl . getIterator ( ) ; return new QuadTreeIterator ( iterator , false ) ; } | Gets an iterator on the QuadTree . |
26,245 | public QuadTreeIterator getIterator ( Geometry query , double tolerance , boolean bSorted ) { if ( ! bSorted ) { QuadTreeImpl . QuadTreeIteratorImpl iterator = m_impl . getIterator ( query , tolerance ) ; return new QuadTreeIterator ( iterator , false ) ; } else { QuadTreeImpl . QuadTreeSortedIteratorImpl iterator = m_... | Gets an iterator on the QuadTree . The query will be the Envelope2D that bounds the input Geometry . To reuse the existing iterator on the same QuadTree but with a new query use the reset_iterator function on the QuadTree_iterator . \ param query The Geometry used for the query . If the Geometry is a Line segment then ... |
26,246 | public QuadTreeIterator getIterator ( boolean bSorted ) { if ( ! bSorted ) { QuadTreeImpl . QuadTreeIteratorImpl iterator = m_impl . getIterator ( ) ; return new QuadTreeIterator ( iterator , false ) ; } else { QuadTreeImpl . QuadTreeSortedIteratorImpl iterator = m_impl . getSortedIterator ( ) ; return new QuadTreeIter... | Gets an iterator on the QuadTree . \ param bSorted Put true to iterate the quad tree in the order of the Element_types . |
26,247 | public Point2D getCoord2D ( double t ) { Point2D pt = new Point2D ( ) ; getCoord2D ( t , pt ) ; return pt ; } | Returns the coordinate of the point on this segment for the given parameter value . |
26,248 | public void startPath ( double x , double y ) { Point2D endPoint = new Point2D ( ) ; endPoint . x = x ; endPoint . y = y ; startPath ( endPoint ) ; } | Starts a new Path at the Point . |
26,249 | public void bezierTo ( Point2D controlPoint1 , Point2D controlPoint2 , Point2D endPoint ) { _beforeNewSegment ( 1 ) ; setXY ( m_pointCount - 1 , endPoint ) ; double z ; _initSegmentData ( 6 ) ; m_pathFlags . setBits ( m_pathFlags . size ( ) - 1 , ( byte ) PathFlags . enumHasNonlinearSegments ) ; m_segmentParamIndex . w... | adds a Cubic Bezier Segment to the current Path . The Bezier Segment connects the current last Point and the given endPoint . |
26,250 | public void openAllPathsAndDuplicateStartVertex ( ) { _touch ( ) ; if ( m_bPolygon ) throw GeometryException . GeometryInternalError ( ) ; if ( m_pathFlags == null ) throw GeometryException . GeometryInternalError ( ) ; _verifyAllStreams ( ) ; int closedPathCount = 0 ; int pathCount = getPathCount ( ) ; for ( int i = 0... | Major Changes on 16th of January |
26,251 | public void closeAllPaths ( ) { _touch ( ) ; if ( m_bPolygon || isEmptyImpl ( ) ) return ; m_bPathStarted = false ; for ( int ipath = 0 , npart = m_paths . size ( ) - 1 ; ipath < npart ; ipath ++ ) { if ( isClosedPath ( ipath ) ) continue ; byte pf = m_pathFlags . read ( ipath ) ; m_pathFlags . write ( ipath , ( byte )... | Closes all open curves by adding an implicit line segment from the end point to the start point . |
26,252 | public void closePathWithBezier ( Point2D controlPoint1 , Point2D controlPoint2 ) { _touch ( ) ; if ( isEmptyImpl ( ) ) throw new GeometryException ( "Invalid call. This operation cannot be performed on an empty geometry." ) ; m_bPathStarted = false ; int pathIndex = m_paths . size ( ) - 2 ; byte pf = m_pathFlags . rea... | Closes last path of the MultiPathImpl with the Bezier Segment . |
26,253 | GeometryCursor prepareVector_ ( VertexDescription descr , int dimensionMask , Geometry [ ] res_vec ) { int inext = 0 ; if ( ( dimensionMask & 1 ) != 0 ) { if ( res_vec [ 0 ] == null ) res_vec [ 0 ] = new MultiPoint ( descr ) ; inext ++ ; } else { for ( int i = 0 ; i < res_vec . length - 1 ; i ++ ) res_vec [ i ] = res_v... | as indicated with the dimensionMask |
26,254 | SimpleEdge tryGetCachedEdge_ ( int value ) { SimpleEdge se = m_simple_edges_cache . get ( ( value & NumberUtils . intMax ( ) ) % m_simple_edges_cache . size ( ) ) ; if ( se != null ) { if ( se . m_value == value ) return se ; else { } } return null ; } | Returns a cached edge for the given value . May return NULL . |
26,255 | void tryDeleteCachedEdge_ ( int value ) { int ind = ( value & NumberUtils . intMax ( ) ) % m_simple_edges_cache . size ( ) ; SimpleEdge se = m_simple_edges_cache . get ( ind ) ; if ( se != null && se . m_value == value ) { m_simple_edges_recycle . add ( se ) ; m_simple_edges_cache . set ( ind , null ) ; } else { } } | Removes cached edge from the cache for the given value . |
26,256 | SimpleEdge tryCreateCachedEdge_ ( int value ) { int ind = ( value & NumberUtils . intMax ( ) ) % m_simple_edges_cache . size ( ) ; SimpleEdge se = m_simple_edges_cache . get ( ind ) ; if ( se == null ) { if ( m_simple_edges_recycle . isEmpty ( ) ) { m_simple_edges_buffer . add ( new SimpleEdge ( ) ) ; se = m_simple_edg... | Creates a cached edge . May fail and return NULL . |
26,257 | int compareTwoSegments_ ( Segment seg_1 , Segment seg_2 ) { int res = seg_1 . _isIntersecting ( seg_2 , m_tolerance , true ) ; if ( res != 0 ) { if ( res == 2 ) return errorCoincident ( ) ; else return errorCracking ( ) ; } Point2D start_1 = seg_1 . getStartXY ( ) ; Point2D end1 = seg_1 . getEndXY ( ) ; Point2D start2 ... | is set . |
26,258 | void setSweepY ( double y , double x ) { m_sweep_y = y ; m_sweep_x = x ; m_prev_1 = - 1 ; m_prev_2 = - 1 ; m_vertex_1 = - 1 ; m_vertex_2 = - 1 ; } | Sets new sweep line position . |
26,259 | public void setFromPoints ( Point2D [ ] points ) { if ( points == null || points . length == 0 ) { setEmpty ( ) ; return ; } Point2D pt = points [ 0 ] ; setCoords ( pt . x , pt . y ) ; for ( int i = 1 ; i < points . length ; i ++ ) { Point2D pt2d = points [ i ] ; mergeNE ( pt2d . x , pt2d . y ) ; } } | Sets the envelope from the array of points . The envelope will be set to empty if the array is null . |
26,260 | public void mergeNE ( double x , double y ) { if ( xmin > x ) xmin = x ; else if ( xmax < x ) xmax = x ; if ( ymin > y ) ymin = y ; else if ( ymax < y ) ymax = y ; } | Merges a point with this envelope without checking if the envelope is empty . Use with care . |
26,261 | public boolean isIntersectingNE ( Envelope2D other ) { return ( ( xmin <= other . xmin ) ? xmax >= other . xmin : other . xmax >= xmin ) && ( ( ymin <= other . ymin ) ? ymax >= other . ymin : other . ymax >= ymin ) ; } | Checks if this envelope intersects the other assuming neither one is empty . |
26,262 | public Point2D queryCorner ( int index ) { switch ( index ) { case 0 : return Point2D . construct ( xmin , ymin ) ; case 1 : return Point2D . construct ( xmin , ymax ) ; case 2 : return Point2D . construct ( xmax , ymax ) ; case 3 : return Point2D . construct ( xmax , ymin ) ; default : throw new IndexOutOfBoundsExcept... | Queries a corner of the envelope . |
26,263 | public void queryCorners ( Point2D [ ] corners ) { if ( ( corners == null ) || ( corners . length < 4 ) ) throw new IllegalArgumentException ( ) ; if ( corners [ 0 ] != null ) corners [ 0 ] . setCoords ( xmin , ymin ) ; else corners [ 0 ] = new Point2D ( xmin , ymin ) ; if ( corners [ 1 ] != null ) corners [ 1 ] . setC... | Queries corners into a given array . The array length must be at least 4 . Starts from the lower left corner and goes clockwise . |
26,264 | public void move ( double dx , double dy ) { if ( isEmpty ( ) ) return ; xmin += dx ; ymin += dy ; xmax += dx ; ymax += dy ; } | Moves the Envelope by given distance . |
26,265 | double _boundaryDistance ( Point2D pt ) { if ( isEmpty ( ) ) return NumberUtils . NaN ( ) ; if ( pt . x == xmin ) return pt . y - ymin ; double height = ymax - ymin ; double width = xmax - xmin ; if ( pt . y == ymax ) return height + pt . x - xmin ; if ( pt . x == xmax ) return height + width + ymax - pt . y ; if ( pt ... | function ) . |
26,266 | int _envelopeSide ( Point2D pt ) { if ( isEmpty ( ) ) return - 1 ; double boundaryDist = _boundaryDistance ( pt ) ; double height = ymax - ymin ; double width = xmax - xmin ; if ( boundaryDist < height ) return 0 ; if ( ( boundaryDist -= height ) < width ) return 1 ; return boundaryDist - width < height ? 2 : 3 ; } | returns 0 .. 3 depending on which side pt lies . |
26,267 | int clipLine ( Point2D p0 , Point2D p1 , int lineExtension , double [ ] segParams , double [ ] boundaryDistances ) { if ( boundaryDistances != null ) { boundaryDistances [ 0 ] = - 1.0 ; boundaryDistances [ 1 ] = - 1.0 ; } double [ ] tOld = new double [ 2 ] ; int modified = 0 ; Point2D delta = new Point2D ( p1 . x - p0 ... | 4 - the segment is complitely inside of the clipping window |
26,268 | public double sqrMaxDistance ( Envelope2D other ) { if ( isEmpty ( ) || other . isEmpty ( ) ) return NumberUtils . TheNaN ; double dist = 0 ; Point2D [ ] points = new Point2D [ 4 ] ; queryCorners ( points ) ; Point2D [ ] points_o = new Point2D [ 4 ] ; other . queryCorners ( points_o ) ; for ( int i = 0 ; i < 4 ; i ++ )... | Returns squared max distance between two bounding boxes . This is furthest distance between points on the two envelopes . |
26,269 | public double sqrDistance ( Point2D pt2D ) { double dx = 0 ; double dy = 0 ; double nn ; nn = xmin - pt2D . x ; if ( nn > dx ) dx = nn ; nn = ymin - pt2D . y ; if ( nn > dy ) dy = nn ; nn = pt2D . x - xmax ; if ( nn > dx ) dx = nn ; nn = pt2D . y - ymax ; if ( nn > dy ) dy = nn ; return dx * dx + dy * dy ; } | Calculates minimum squared distance from this envelope to the point . Returns 0 for empty envelopes . |
26,270 | public void setEnvelope ( Envelope env ) { if ( ! m_description . equals ( env . getDescription ( ) ) ) throw new IllegalArgumentException ( ) ; m_envelope = ( Envelope ) env . createInstance ( ) ; env . copyTo ( m_envelope ) ; _setDirtyFlag ( DirtyFlags . DirtyIntervals , false ) ; } | Sets the envelope of the Geometry . The Envelope description must match that of the Geometry . |
26,271 | void _copyToUnsafe ( MultiVertexGeometryImpl dst ) { _verifyAllStreams ( ) ; dst . m_description = m_description ; dst . m_vertexAttributes = null ; int nattrib = m_description . getAttributeCount ( ) ; AttributeStreamBase [ ] cloneAttributes = null ; if ( m_vertexAttributes != null ) { cloneAttributes = new AttributeS... | Does not check geometry type . Used to copy Polygon to Polyline |
26,272 | public void notifyModified ( int flags ) { if ( flags == DirtyFlags . DirtyAll ) { m_reservedPointCount = - 1 ; _notifyModifiedAllImpl ( ) ; } m_flagsMask |= flags ; _clearAccelerators ( ) ; _touch ( ) ; } | Notifies the Geometry of changes made to the vertices so that it could reset cached structures . |
26,273 | public void _updateXYImpl ( boolean bExact ) { m_envelope . setEmpty ( ) ; AttributeStreamOfDbl stream = ( AttributeStreamOfDbl ) m_vertexAttributes [ 0 ] ; Point2D pt = new Point2D ( ) ; for ( int i = 0 ; i < m_pointCount ; i ++ ) { stream . read ( 2 * i , pt ) ; m_envelope . merge ( pt ) ; } } | \ internal Updates x y intervals . |
26,274 | public int getIsSimple ( double tolerance ) { if ( ! _hasDirtyFlag ( DirtyFlags . DirtyIsKnownSimple ) ) { if ( ! _hasDirtyFlag ( DirtyFlags . IsWeakSimple ) ) { return 0 ; } if ( m_simpleTolerance >= tolerance ) { if ( ! _hasDirtyFlag ( DirtyFlags . DirtyOGCFlags ) ) return 2 ; return 1 ; } return - 1 ; } return - 1 ;... | and valid ring ordering ) |
26,275 | static boolean needsCracking ( boolean allowCoincident , EditShape shape , double tolerance , NonSimpleResult result , ProgressTracker progress_tracker ) { if ( ! canBeCracked ( shape ) ) return false ; Cracker cracker = new Cracker ( progress_tracker ) ; cracker . m_shape = shape ; cracker . m_tolerance = tolerance ; ... | Used for IsSimple . |
26,276 | public boolean isSimpleRelaxed ( ) { OperatorSimplify op = ( OperatorSimplify ) OperatorFactoryLocal . getInstance ( ) . getOperator ( Operator . Type . Simplify ) ; return op . isSimpleAsFeature ( getEsriGeometry ( ) , esriSR , true , null , null ) ; } | Extension method - checks if geometry is simple for Geodatabase . |
26,277 | public OGCGeometry makeSimpleRelaxed ( boolean forceProcessing ) { OperatorSimplify op = ( OperatorSimplify ) OperatorFactoryLocal . getInstance ( ) . getOperator ( Operator . Type . Simplify ) ; return OGCGeometry . createFromEsriGeometry ( op . execute ( getEsriGeometry ( ) , esriSR , forceProcessing , null ) , esriS... | Makes a simple geometry for Geodatabase . |
26,278 | private OGCGeometry simplifyBunch_ ( GeometryCursor gc ) { MultiPoint dstMultiPoint = null ; ArrayList < Geometry > dstPolylines = new ArrayList < Geometry > ( ) ; ArrayList < Geometry > dstPolygons = new ArrayList < Geometry > ( ) ; for ( com . esri . core . geometry . Geometry g = gc . next ( ) ; g != null ; g = gc .... | it produces a single OGCGeometry . |
26,279 | public static OGCGeometry createFromEsriCursor ( GeometryCursor gc , SpatialReference sr ) { return createFromEsriCursor ( gc , sr , false ) ; } | Create an OGCGeometry instance from the GeometryCursor . |
26,280 | boolean sweepVertical ( EditShape shape , double tolerance ) { setEditShape_ ( shape ) ; m_b_cracked = false ; m_tolerance = tolerance ; m_tolerance_sqr = tolerance * tolerance ; m_complications = false ; boolean bresult = sweepImpl_ ( ) ; if ( ! m_complications ) { int filtered = shape . filterClosePoints ( tolerance ... | Does one pass sweep vertically |
26,281 | int newEdge_ ( int origin_vertex ) { int edge = m_edges . newElement ( ) ; int edgeVertices = m_edge_vertices . createList ( ) ; setEdgeOriginVertices_ ( edge , edgeVertices ) ; if ( origin_vertex != - 1 ) m_edge_vertices . addElement ( edgeVertices , origin_vertex ) ; return edge ; } | Creates a new unattached edge with the given origin . |
26,282 | void mergeClusters_ ( int cluster_1 , int cluster2 ) { int eventQnode = getClusterEventQNode ( cluster2 ) ; if ( eventQnode != - 1 ) { m_event_q . deleteNode ( eventQnode , - 1 ) ; setClusterEventQNode_ ( cluster2 , - 1 ) ; } int firstEdge1 = getClusterFirstEdge ( cluster_1 ) ; int firstEdge2 = getClusterFirstEdge ( cl... | Merges two coincident clusters into one . The cluster2 becomes invalid . |
26,283 | void mergeEdges_ ( int edge1 , int edge2 ) { int cluster_1 = getEdgeCluster ( edge1 , 0 ) ; int cluster2 = getEdgeCluster ( edge1 , 1 ) ; int cluster21 = getEdgeCluster ( edge2 , 0 ) ; int cluster22 = getEdgeCluster ( edge2 , 1 ) ; int originVertices1 = getEdgeOriginVertices ( edge1 ) ; int originVertices2 = getEdgeOri... | Merges two coincident edges into one . The edge2 becomes invalid . |
26,284 | void disconnectEdge_ ( int edge ) { int cluster_1 = getEdgeCluster ( edge , 0 ) ; int cluster2 = getEdgeCluster ( edge , 1 ) ; disconnectEdgeFromCluster_ ( edge , cluster_1 ) ; disconnectEdgeFromCluster_ ( edge , cluster2 ) ; } | Disconnects the edge from its clusters . |
26,285 | void disconnectEdgeFromCluster_ ( int edge , int cluster ) { int next = getNextEdge ( edge , cluster ) ; assert ( getPrevEdge ( next , cluster ) == edge ) ; int prev = getPrevEdge ( edge , cluster ) ; assert ( getNextEdge ( prev , cluster ) == edge ) ; int first_edge = getClusterFirstEdge ( cluster ) ; if ( next != edg... | Disconnects the edge from a cluster it is connected to . |
26,286 | void fillEventQueue ( ) { AttributeStreamOfInt32 event_q = new AttributeStreamOfInt32 ( 0 ) ; event_q . reserve ( m_shape . getTotalPointCount ( ) ) ; EditShape . VertexIterator iter = m_shape . queryVertexIterator ( ) ; for ( int vert = iter . next ( ) ; vert != - 1 ; vert = iter . next ( ) ) { if ( m_shape . getUserI... | Fills the event queue and merges coincident clusters . |
26,287 | void getAffectedEdges ( int cluster , AttributeStreamOfInt32 edges ) { int first_edge = getClusterFirstEdge ( cluster ) ; if ( first_edge == - 1 ) return ; int edge = first_edge ; do { int sweepNode = getEdgeSweepNode ( edge ) ; if ( StridedIndexTypeCollection . isValidElement ( sweepNode ) ) { edges . add ( edge ) ; }... | change of cluster coordinate . |
26,288 | void updateClusterXY ( int cluster , Point2D pt ) { int vertexList = getClusterVertices ( cluster ) ; for ( int vh = m_cluster_vertices . getFirst ( vertexList ) ; vh != - 1 ; vh = m_cluster_vertices . getNext ( vh ) ) { int vertex = m_cluster_vertices . getElement ( vh ) ; m_shape . setXY ( vertex , pt ) ; } } | Updates all vertices of the cluster to new coordinate |
26,289 | void getClusterXY ( int cluster , Point2D ptOut ) { int vindex = getClusterVertexIndex ( cluster ) ; m_shape . getXYWithIndex ( vindex , ptOut ) ; } | Returns a cluster s xy . |
26,290 | static boolean executeNonReciprocal ( EditShape shape , double tolerance ) { Clusterer clusterer = new Clusterer ( ) ; clusterer . m_shape = shape ; clusterer . m_tolerance = tolerance ; clusterer . m_sqr_tolerance = tolerance * tolerance ; clusterer . m_cell_size = 2 * tolerance ; clusterer . m_inv_cell_size = 1.0 / c... | the tolerance in the first - found - first - clustered order ) |
26,291 | static boolean isClusterCandidate_ ( double x_1 , double y1 , double x2 , double y2 , double sqr_tolerance ) { double dx = x_1 - x2 ; double dy = y1 - y2 ; return dx * dx + dy * dy <= sqr_tolerance ; } | makes sure Simplified shape is more robust to transformations . |
26,292 | static boolean mergeVertices ( Point pt_1 , Point pt_2 , double w_1 , int rank_1 , double w_2 , int rank_2 , Point pt_res , double [ ] w_res , int [ ] rank_res ) { assert ( ! pt_1 . isEmpty ( ) && ! pt_2 . isEmpty ( ) ) ; boolean res = pt_1 . equals ( pt_2 ) ; if ( rank_1 > rank_2 ) { pt_res = pt_1 ; if ( w_res != null... | return true if the coordinates has changed . |
26,293 | static Geometry pointMinusPolygon_ ( Point point , Polygon polygon , double tolerance , ProgressTracker progress_tracker ) { PolygonUtils . PiPResult result = PolygonUtils . isPointInPolygon2D ( polygon , point , tolerance ) ; if ( result == PolygonUtils . PiPResult . PiPOutside ) return point ; return point . createIn... | these are special implementations all others delegate to the topo - graph . |
26,294 | void dissolveCommonEdges_ ( ) { int visitedEdges = m_topo_graph . createUserIndexForHalfEdges ( ) ; AttributeStreamOfInt32 edgesToDelete = new AttributeStreamOfInt32 ( 0 ) ; for ( int cluster = m_topo_graph . getFirstCluster ( ) ; cluster != - 1 ; cluster = m_topo_graph . getNextCluster ( cluster ) ) { int firstHalfEdg... | dissolved faces . Only face parentage will be uasable . |
26,295 | public static JsonReader createFromStringNNT ( String str ) { try { JsonFactory factory = new JsonFactory ( ) ; JsonParser jsonParser = factory . createParser ( str ) ; return new JsonParserReader ( jsonParser ) ; } catch ( Exception ex ) { throw new JsonGeometryException ( ex . getMessage ( ) ) ; } } | Creates a JsonReader for the string . The nextToken is not called by this method . |
26,296 | public static void deaccelerateGeometry ( Geometry geometry ) { Geometry . Type gt = geometry . getType ( ) ; if ( Geometry . isMultiVertex ( gt . value ( ) ) ) { GeometryAccelerators accel = ( ( MultiVertexGeometryImpl ) geometry . _getImpl ( ) ) . _getAccelerators ( ) ; if ( accel != null ) { accel . _setRasterizedGe... | Removes accelerators from given geometry . |
26,297 | private static boolean relate ( Point point_a , Envelope envelope_b , SpatialReference sr , int relation , ProgressTracker progress_tracker ) { if ( point_a . isEmpty ( ) || envelope_b . isEmpty ( ) ) { if ( relation == Relation . disjoint ) return true ; return false ; } Point2D pt_a = point_a . getXY ( ) ; Envelope2D... | interior and exterior of point_a vs envelope_b for the given relation . |
26,298 | private static boolean relate ( Point point_a , Point point_b , SpatialReference sr , int relation , ProgressTracker progress_tracker ) { if ( point_a . isEmpty ( ) || point_b . isEmpty ( ) ) { if ( relation == Relation . disjoint ) return true ; return false ; } Point2D pt_a = point_a . getXY ( ) ; Point2D pt_b = poin... | interior and exterior of point_a vs point_b for the given relation . |
26,299 | private static boolean polygonEqualsPolygon_ ( Polygon polygon_a , Polygon polygon_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; polygon_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeEqualsEnvelop... | Returns true if polygon_a equals polygon_b . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.