Skip to content

Commit

Permalink
Remove dependency on MDAlgorithms from MDEventInserter
Browse files Browse the repository at this point in the history
Refs #11497
  • Loading branch information
martyngigg committed Apr 8, 2015
1 parent d3b8438 commit 866afbc
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Code/Mantid/Framework/DataObjects/test/MDEventInserterTest.h
@@ -1,20 +1,21 @@
#ifndef MANTID_DATAOBJECTS_MDEVENTINSERTERTEST_H_
#define MANTID_DATAOBJECTS_MDEVENTINSERTERTEST_H_

#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include "MantidKernel/System.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidAPI/IAlgorithm.h"
#include "MantidDataObjects/MDEventWorkspace.h"
#include "MantidDataObjects/MDEvent.h"
#include <iostream>
#include <iomanip>

#include "MantidDataObjects/MDEventFactory.h"
#include "MantidDataObjects/MDEventInserter.h"
#include "MantidGeometry/MDGeometry/MDHistoDimension.h"

#include <boost/shared_ptr.hpp>

#include <cxxtest/TestSuite.h>


using namespace Mantid;
Expand All @@ -29,19 +30,18 @@ class MDEventInserterTest : public CxxTest::TestSuite
/// Test helper method. Creates an empty 2D MDEventWorkspace, with the specified event type.
IMDEventWorkspace_sptr createInputWorkspace(const std::string& eventType)
{
IAlgorithm_sptr createAlg = AlgorithmManager::Instance().createUnmanaged("CreateMDWorkspace");
createAlg->initialize();
createAlg->setChild(true);
createAlg->setProperty("Dimensions", 2);
createAlg->setPropertyValue("Extents", "-10,10,-10,10");
createAlg->setPropertyValue("Names", "A, B");
createAlg->setPropertyValue("Units", "m, m");
createAlg->setPropertyValue("EventType", eventType);
createAlg->setPropertyValue("OutputWorkspace", "out_ws");
createAlg->execute();
Workspace_sptr temp = createAlg->getProperty("OutputWorkspace");
IMDEventWorkspace_sptr outWS = boost::dynamic_pointer_cast<IMDEventWorkspace>(temp);
return outWS;
using Mantid::Geometry::MDHistoDimension;

IMDEventWorkspace_sptr ws =
MDEventFactory::CreateMDWorkspace(2, eventType);
coord_t min(-10.0f), max(10.0f);
ws->addDimension(boost::make_shared<MDHistoDimension>("A", "A", "m", min, max, 1));
ws->addDimension(boost::make_shared<MDHistoDimension>("B", "B", "m", min, max, 1));
ws->initialize();
// Split to level 1
ws->splitBox();
ws->setMinRecursionDepth(0);
return ws;
}

public:
Expand Down

0 comments on commit 866afbc

Please sign in to comment.