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 . setCoords ( bounding_box ) ; else m_data_extent . merge ( bounding_box ) ; } return success ; } int quad_handle ; if ( hint_index == - 1 ) quad_handle = m_root ; else quad_handle = get_quad_ ( hint_index ) ; int quad_height = getHeight ( quad_handle ) ; Envelope2D quad_extent = getExtent ( quad_handle ) ; int element_handle = insert_ ( element , bounding_box , quad_height , quad_extent , quad_handle , false , - 1 ) ; if ( element_handle != - 1 ) { if ( m_data_extent . isEmpty ( ) ) m_data_extent . setCoords ( bounding_box ) ; else m_data_extent . merge ( bounding_box ) ; } return element_handle ; }
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 The bounding_box of the Geometry to be inserted . \ param hint_index A handle used as a hint where to place the element . This can be a handle obtained from a previous insertion and is useful on data having strong locality such as segments of a Polygon .