Skip to content

Commit

Permalink
Refs #4504, Refs #4511: code demonstrating the bug in #4511
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Jan 13, 2012
1 parent b782357 commit c174d18
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ int main( int argc, char ** argv )
{
QApplication app(argc, argv);
app.setApplicationName("SliceViewerWindow demo");
IMDWorkspace_sptr mdew = makeDemoData();
IMDWorkspace_sptr mdew = makeDemoData(true);

SliceViewerWindow * mainWin = new SliceViewerWindow("mdew");
SliceViewerWindow * mainWin = new SliceViewerWindow("binned_al");
//mainWin->getSlicer()->getLineOverlay()->setSnap(0.5);
// mainWin->getSlicer()->getLineOverlay()->setSnapLength(0.1);
mainWin->move(100, 100);
mainWin->resize(700, 700);
mainWin->getSlicer()->setXYDim(0,1);
mainWin->show();

app.exec();
Expand Down
21 changes: 16 additions & 5 deletions Code/Mantid/MantidQt/SliceViewer/src/main_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ IMDWorkspace_sptr makeDemoData(bool binned = false)
"SplitThreshold", "100",
"MaxRecursionDepth", "20",
"OutputWorkspace", "mdew");
addPeak(15000,0,0,0, 1);
addPeak(15000,0,0,0, 3);
addPeak(5000,0,0,0, 0.3);
addPeak(5000,0,0,0, 0.2);
addPeak(5000,0,0,0, 0.1);
addPeak(5000,1,0,0, 0.3);
addPeak(5000,2,0,0, 0.3);
addPeak(5000,2,1,0, 0.3);
// addPeak(12000,0,0,0, 0.03);
IMDEventWorkspace_sptr mdew = boost::dynamic_pointer_cast<IMDEventWorkspace>( AnalysisDataService::Instance().retrieve("mdew") );
mdew->splitAllIfNeeded(NULL);
Expand All @@ -111,11 +114,19 @@ IMDWorkspace_sptr makeDemoData(bool binned = false)
"InputWorkspace", "mdew",
"OutputWorkspace", "binned",
"AxisAligned", "0",
"BasisVectorX", "rx, m, 1.0, 0.0, 0.0, 20.0, 100",
"BasisVectorY", "ry, m, 0.0, 1.0, 0.0, 20.0, 100",
"BasisVectorZ", "ry, m, 0.0, 0.0, 1.0, 20.0, 100",
"BasisVectorX", "rx, m, 1.0, 0.0, 0.0, 10.0, 100",
"BasisVectorY", "ry, m, 0.0, 1.0, 0.0, 10.0, 100",
"BasisVectorZ", "ry, m, 0.0, 0.0, 1.0, 10.0, 100",
"ForceOrthogonal", "1",
"Origin", "-10, -10, -10");
"Origin", "-5, -5, -5");

FrameworkManager::Instance().exec("BinMD", 12,
"InputWorkspace", "mdew",
"OutputWorkspace", "binned_al",
"AxisAligned", "1",
"AlignedDimX", "k, -5, 5, 100",
"AlignedDimY", "l, -5, 5, 100",
"AlignedDimZ", "h, -5, 5, 100");

return boost::dynamic_pointer_cast<IMDWorkspace>( AnalysisDataService::Instance().retrieve("binned") );
}
Expand Down

0 comments on commit c174d18

Please sign in to comment.