Definition at line 417 of file VideoMinimap.h. References Blank(), Impala::Visualization::MapCoordPos::count, Impala::Visualization::MapFunction::GetHeight(), Impala::Visualization::MapFunction::GetNrShots(), Impala::Visualization::MapFunction::GetWidth(), ILOG_DEBUG, InitOGLIMAGE(), mCoordMap, mMapFunction, mOglIm, OglGui::OglWindow::mOglWnd, mParentWindow, mPreviewWindow, mThreadSet, mView, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::SetValue(), Impala::Visualization::MapFunction::ShotToXY(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::Val(), Impala::Visualization::MapCoordPos::x, and Impala::Visualization::MapCoordPos::y. 00418 { 00419 // init shot to minimap table: 00420 ILOG_DEBUG("initializing map..."); 00421 00422 mMapFunction = map; 00423 00424 int width = map->GetWidth(); 00425 int height = map->GetHeight(); 00426 00427 //int counts[width][height]; 00428 Core::Array::Array2dScalarInt32* counts = 00429 Core::Array::ArrayCreate<Core::Array::Array2dScalarInt32>(width, height, 0, 0); 00430 00431 int x, y; 00432 00433 // clear counters: 00434 for (x=0;x<width;x++) 00435 for (y=0;y<height;y++) 00436 //counts[x][y] = 0; 00437 counts->SetValue(0, x, y); 00438 00439 // map shot -> x,y and count nr of shots per x,y pos 00440 for (int i = 0; i < map->GetNrShots(); i++) 00441 { 00442 map->ShotToXY(i, &x, &y); 00443 //counts[x][y] = counts[x][y] + 1; 00444 counts->SetValue(counts->Val(x, y) + 1, x, y); 00445 MapCoordPos p; 00446 p.x = x; 00447 p.y = y; 00448 p.count = 0; 00449 mCoordMap[i] = p; 00450 } 00451 00452 // update map so that every shot knows how many other shots share x,y 00453 for (int i = 0; i < map->GetNrShots(); i++) 00454 { 00455 //mCoordMap[i].count = counts[mCoordMap[i].x][mCoordMap[i].y]; 00456 mCoordMap[i].count = counts->Val(mCoordMap[i].x, mCoordMap[i].y); 00457 } 00458 ILOG_DEBUG("map initialized."); 00459 00460 00461 // init visualization: 00462 InitOGLIMAGE(width, height); 00463 00464 mView = viewSys.View2D(mOglWnd, mOglIm, 0, 0, screenwidth, screenheight); 00465 viewSys.SetTags(mView, visibleTag); 00466 00467 mParentWindow = parent; 00468 mPreviewWindow = 0; 00469 mThreadSet = 0; 00470 00471 Blank(); 00472 }
Here is the call graph for this function:
|