virtual void run()
   {
      // let all threads start at the same time
      startBarrier->block();
      ossim_uint32 idx = 0;
      for(idx = 0; idx < m_numberOfPointsToQuery; ++idx)
      {
         ossim_float32 t = static_cast<double>(rand())/static_cast<double>(RAND_MAX);
         ossim_float32 centerx = 10000.0*t; 
         ossim_float32 centery = 10000.0*t;

         ossimPolyArea2d polyArea1(ossimDrect(centerx-1000,centery-1000,centerx+2000,centery+2000));
         ossimPolyArea2d polyArea2(ossimDrect(centerx-500,centery-500,centerx+2000,centery+2000));

         ossimPolyArea2d temp1 = polyArea1&polyArea2;
         ossimPolyArea2d temp2 = polyArea1+polyArea2;

         ossimPolyArea2d temp3(polyArea1);
         ossimPolyArea2d temp4(polyArea2);

         temp3+=temp1;
         temp4&=temp3;

 //        ossimGpt gpt(m_minLat + yt*m_latDelta, m_minLon + xt*m_lonDelta);
      }
      // let all threads end at the same time
      endBarrier->block();
   }
Beispiel #2
0
double distsq(int x1, int y1, int x2, int y2, int x3, int y3) {
	double bc = sq(x1 - x2) + sq(y1 - y2);
	double ab = sq(x1 - x3) + sq(y1 - y3);
	double ac = sq(x2 - x3) + sq(y2 - y3);
	int x[3] = {x1, x2, x3}, y[3] = {y1, y2, y3};
	double p2 = polyArea2(x, y, 3);
	double ax = sq(p2) / bc;
	if(ab - ax > bc || ac - ax > bc) ax = min(ab, ac);
	return ax;
}