Skip to content

Commit

Permalink
refs #5667. Revert changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Aug 7, 2012
1 parent 7173de3 commit 2397d0d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
Expand Up @@ -365,8 +365,8 @@ void RectangularDetector::initialize(boost::shared_ptr<Object> shape,

m_xpixels = xpixels;
m_ypixels = ypixels;
m_xsize = std::abs(xpixels * xstep);
m_ysize = std::abs(ypixels * ystep);
m_xsize = xpixels * xstep;
m_ysize = ypixels * ystep;
m_xstart = xstart;
m_ystart = ystart;
m_xstep = xstep;
Expand Down
76 changes: 38 additions & 38 deletions Code/Mantid/Framework/Geometry/test/RectangularDetectorTest.h
Expand Up @@ -218,44 +218,44 @@ class RectangularDetectorTest : public CxxTest::TestSuite
delete parDet;
}

void test_sizex_with_negative_xstep()
{
RectangularDetector det;

const int xpixels = 10;
const double xstart = 1;
const double xstep = -0.1; // Step is negative
const int ypixels = 10;
const double ystart = 1;
const double ystep = 0.1;
const int idstart = 0;
const bool idfillbyfirst_y = true;
const int idstepbyrow = 10;
const int idstep=1;

det.initialize(ComponentCreationHelper::createCuboid(1), xpixels, xstart, xstep, ypixels, ystart, ystep, idstart, idfillbyfirst_y, idstepbyrow, idstep);
TS_ASSERT_EQUALS(std::abs(xpixels * xstep), det.xsize());

}

void test_sizey_with_negative_ystep()
{
RectangularDetector det;

const int xpixels = 10;
const double xstart = 1;
const double xstep = 0.1;
const int ypixels = 10;
const double ystart = 1;
const double ystep = -0.1; // Step is negative
const int idstart = 0;
const bool idfillbyfirst_y = true;
const int idstepbyrow = 10;
const int idstep=1;

det.initialize(ComponentCreationHelper::createCuboid(1), xpixels, xstart, xstep, ypixels, ystart, ystep, idstart, idfillbyfirst_y, idstepbyrow, idstep);
TS_ASSERT_EQUALS(std::abs(ypixels * ystep), det.ysize());
}
//void test_sizex_with_negative_xstep()
//{
// RectangularDetector det;

// const int xpixels = 10;
// const double xstart = 1;
// const double xstep = -0.1; // Step is negative
// const int ypixels = 10;
// const double ystart = 1;
// const double ystep = 0.1;
// const int idstart = 0;
// const bool idfillbyfirst_y = true;
// const int idstepbyrow = 10;
// const int idstep=1;

// det.initialize(ComponentCreationHelper::createCuboid(1), xpixels, xstart, xstep, ypixels, ystart, ystep, idstart, idfillbyfirst_y, idstepbyrow, idstep);
// TS_ASSERT_EQUALS(std::abs(xpixels * xstep), det.xsize());

//}

//void test_sizey_with_negative_ystep()
//{
// RectangularDetector det;

// const int xpixels = 10;
// const double xstart = 1;
// const double xstep = 0.1;
// const int ypixels = 10;
// const double ystart = 1;
// const double ystep = -0.1; // Step is negative
// const int idstart = 0;
// const bool idfillbyfirst_y = true;
// const int idstepbyrow = 10;
// const int idstep=1;

// det.initialize(ComponentCreationHelper::createCuboid(1), xpixels, xstart, xstep, ypixels, ystart, ystep, idstart, idfillbyfirst_y, idstepbyrow, idstep);
// TS_ASSERT_EQUALS(std::abs(ypixels * ystep), det.ysize());
//}

};

Expand Down

0 comments on commit 2397d0d

Please sign in to comment.