void sweep(elementptr head, nodeptr root){ while(head != NULL){ #ifdef DEMO draw_LineScanning(head->p1.y); cv::waitKey(0); #endif if(head->p1.y < head->p2.y) insert_point(head->p1); else if(head->p1.y > head->p2.y) delete_point(head->p2); else{ if(head->p1.x < head->p2.x) treeInterval(root, head->p1.x, head->p2.x, head->p1.y); else treeInterval(root, head->p2.x, head->p1.x, head->p1.y); } head = head->next; } }
//@@@@@@@@@@@@@@@@@@@@@@ MAIN @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ void Main(void) { int i=0,j=0; GUI_Init(); GUI_SetBkColor(GUI_GREEN); GUI_Clear(); GUI_SetColor(GUI_BLACK); point.x_point=20;point.y_point=20; draw_net(); draw_point(); draw_curcolor(270,50,1); while(1) { store_x=point.x_point; store_y=point.y_point; //Button(); key_s3c(); change_point(); draw_point(); if( (store_x!=point.x_point)||(store_y!=point.y_point) ) delete_point(); draw_map(); change_color(); draw_curcolor(270,50,point.color); change_color(); GUI_Delay(3000); } }