Пример #1
0
si_t panel_default_mouse_release(struct panel* pnl , union message * msg)
{
/*	panel_event_in_which_widget(pnl, msg);*/
	si_t flag = 0;
	struct widget * wgt;

	struct rectangle area;

	struct object * tree, *node ;

	tree = OBJECT_POINTER(pnl);
	node = tree->rchild;
	while(node != NULL)
	{
		widget_absolute_area(WIDGET_POINTER(node), &area);
		if(point_in_area(&(msg->mouse.cursor_position), &area))
		{
			wgt = (struct widget*)node;
			wgt->callback(wgt, msg);
			flag = 1;
			break;
		}
		node = object_tree_iterator_decrement(tree,node);

	}
	if(flag == 0)
	{
		/* 
		 * panel doesn't have children.
		 * so ,do nothing
		 * */
	}
	return 1;
}
Пример #2
0
int main(int argc, char** argv){
	Quadtree remora_gis = Quadtree();

	remora_gis.insert(-84.110250f, 9.933845f, 0x1E1);
	remora_gis.insert(-84.108877f, 9.938325f, 0x2DF);
	remora_gis.insert(-84.098514f, 9.937848f, 0x2D4);
	remora_gis.insert(-84.098266f, 9.935712f, 0x2D2);
	remora_gis.insert(-84.099593f, 9.935712f, 0x2D6);
	remora_gis.insert(-84.099605f, 9.932733f, 0x2D2);


	remora_gis.insert(9.64f, 84.19f, 0x83);
	remora_gis.insert(39.10f, 18.99f, 0x47);

	

	vector<Data> test_points;
	/*
	
	get_coordinates();
	if ( abs(lat_1 - lat_0) > los || abs(lat_1 - lat_0) > los){
		lat_0 = lat_1;
		lon_0 = lon_1;
		test_points = remora_gis.nearest_points(lat[i], lon[i], los);
	}
	point_in_area(test_points, lat_0, lon_0);

	*/

	//-84.104447f, 9.935764f -- 1
	//-84.110101f, 9.936192f -- 0 evalúa a 1 por área más grande de lo necesario
	//-84.113754f, 9.937331f .. 0

	float lat[] = {9.935764f, 9.936192f, 9.937331f};
	float lon[] = {-84.104447f, -84.110101f, -84.113754f};
	float los = 0.005f;

	for(int i = 0; i < 3; i++){
		test_points = remora_gis.nearest_points(lat[i], lon[i], los);
		cout << "\nPuntos adyacentes para " << lon[i] << ", " << lat[i] << ": " << test_points.size() << "\n\n";
		point_in_area(test_points, lat[i], lon[i]);
	}


	return 0;
}