Esempio n. 1
0
Int main()
{
  DRange<2> range;
  range.setMin(DPosition<2>(2.0, 3.0));
  range.setMax(DPosition<2>(1.0, 5.0));

  for (UInt i = 0; i < DRange<2>::DIMENSION; ++i)
  {
    std::cout << "min " << i << ": " << range.minPosition()[i] << std::endl;
    std::cout << "max " << i << ": " << range.maxPosition()[i] << std::endl;
  }

  return 0;
} //end of main
Esempio n. 2
0
TEST_REAL_SIMILAR(r2.maxPosition()[0],3.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[1],4.0f);
END_SECTION

START_SECTION(DRange(const Base& range))
Internal::DIntervalBase<2> ib(r);
DRange<2> r2(ib);
TEST_REAL_SIMILAR(r2.minPosition()[0],-1.0f);
TEST_REAL_SIMILAR(r2.minPosition()[1],-2.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[0],3.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[1],4.0f);
END_SECTION

START_SECTION(DRange& operator=(const Base& rhs))
Internal::DIntervalBase<2> ib(r);
DRange<2> r2;
r2 = ib;
TEST_REAL_SIMILAR(r2.minPosition()[0],-1.0f);
TEST_REAL_SIMILAR(r2.minPosition()[1],-2.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[0],3.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[1],4.0f);
END_SECTION

START_SECTION(DRange& operator=(const DRange& rhs))
DRange<2> r2;
r2 = r;
TEST_REAL_SIMILAR(r2.minPosition()[0],-1.0f);
TEST_REAL_SIMILAR(r2.minPosition()[1],-2.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[0],3.0f);
TEST_REAL_SIMILAR(r2.maxPosition()[1],4.0f);
END_SECTION