Skip to content

Commit

Permalink
refs #7200 initial modifications to MDEvent Factory to accept new
Browse files Browse the repository at this point in the history
 templates from MDFlatBoxTree class
  • Loading branch information
abuts committed May 28, 2013
1 parent 2de4057 commit d6490bd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
20 changes: 20 additions & 0 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDEventFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "MantidMDEvents/MDLeanEvent.h"
#include "MantidMDEvents/MDEventFactory.h"
#include "MantidMDEvents/MDEventWorkspace.h"
#include "MantidGeometry/MDGeometry/MDDimensionExtents.h"
#include "MantidMDEvents/MDWSDescription.h"
#include <boost/shared_ptr.hpp>


Expand All @@ -25,10 +27,27 @@ namespace MDEvents
*/
class DLLExport MDEventFactory
{
// definition which states how many dimensions to generate.
enum {MAX_MD_DIMENSIONS_NUM = 9};
public:
MDEventFactory() {}
~MDEventFactory() {}
static API::IMDEventWorkspace_sptr CreateMDWorkspace(size_t nd, const std::string & eventType="MDLeanEvent");

static API::IMDNode * createBox(size_t nDimensions, API::BoxController_sptr & splitter, const std::vector<Mantid::Geometry::MDDimensionExtents<coord_t> > & extentsVector,
const uint32_t depth=0,const size_t nBoxEvents=UNDEF_SIZET,const size_t boxID=UNDEF_SIZET, const std::string & eventType="MDLeanEvent");
static API::IMDNode * createGridBox(size_t nd, API::BoxController_sptr & splitter, const std::vector<Mantid::Geometry::MDDimensionExtents<coord_t> > & extentsVector,
const uint32_t depth=0,const size_t nBoxEvents=UNDEF_SIZET,const size_t boxID=UNDEF_SIZET, const std::string & eventType="MDLeanEvent");
private:
typedef API::IMDNode *(MDEventFactory::*fpCreateBox)(size_t nDim,API::BoxController_sptr & ,const std::vector<Mantid::Geometry::MDDimensionExtents<coord_t> > & ,
const uint32_t,const size_t ,const size_t, const std::string &);
// vector of function pointers to the functions which create MDBox or MDGridBox;
static std::vector<fpCreateBox> boxCreatorFP;

// typedef for the class function pointer to the function, which creates MD Workspaces
typedef API::IMDEventWorkspace *(MDEventFactory::*fpCreateMDWS)(size_t nd,const std::string & eventType);
// vector of function pointers to the funcions
static std::vector<fpCreateMDWS> wsCreatorFP;
};

//### BEGIN AUTO-GENERATED CODE #################################################################
Expand Down Expand Up @@ -416,5 +435,6 @@ namespace MDEvents






7 changes: 3 additions & 4 deletions Code/Mantid/Framework/MDEvents/src/MDEventFactory.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Auto-generated by 'generate_mdevent_declarations.py'
* on 2011-09-26 14:20:48.019611
/* Auto-generated by 'D:\Data\Mantid_GIT\Code\Mantid\Framework\MDEvents\src\generate_mdevent_declarations.py'
* on 2013-05-28 12:45:23.952000
*
* DO NOT EDIT!
*/
Expand All @@ -17,7 +17,6 @@
#include "MantidMDEvents/MDBoxIterator.h"
#include "MantidMDEvents/MDEvent.h"
#include "MantidMDEvents/MDLeanEvent.h"
//#include "MantidMDEvents/MDBoxToChange.h"

// We need to include the .cpp files so that the declarations are picked up correctly. Weird, I know.
// See http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13
Expand Down Expand Up @@ -252,4 +251,4 @@ API::IMDEventWorkspace_sptr MDEventFactory::CreateMDWorkspace(size_t nd, const s
} // namespace Mantid
} // namespace MDEvents

/* THIS FILE WAS AUTO-GENERATED BY generate_mdevent_declarations.py - DO NOT EDIT! */
/* THIS FILE WAS AUTO-GENERATED BY D:\Data\Mantid_GIT\Code\Mantid\Framework\MDEvents\src\generate_mdevent_declarations.py - DO NOT EDIT! */

0 comments on commit d6490bd

Please sign in to comment.