forked from mantidproject/mantid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #37 Created framework for LoadNexusGeometry algorithm
- Loading branch information
1 parent
165457d
commit f2df524
Showing
4 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Framework/DataHandling/inc/MantidDataHandling/LoadNexusGeometry.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef LOAD_NEXUS_GEOMETRY_H_ | ||
#define LOAD_NEXUS_GEOMETRY_H_ | ||
|
||
#include "MantidAPI/Algorithm.h" | ||
#include "MantidAPI/IFileLoader.h" | ||
|
||
namespace Mantid{ | ||
namespace DataHandling{ | ||
|
||
class DLLExport LoadNexusGeometry | ||
: public API::IFileLoader<Kernel::NexusDescriptor> { | ||
public: | ||
/// Default constructor | ||
LoadNexusGeometry(); | ||
/// Algorithm's name for identification overriding a virtual method | ||
const std::string name() const override { return "LoadNexusGeometry"; } | ||
/// Algorithm's version for identification overriding a virtual method | ||
int version() const override { return 1; } | ||
/// Algorithm's category for identification overriding a virtual method | ||
const std::string category() const override { return "DataHandling\\Nexus"; } | ||
/// Summary of algorithms purpose | ||
const std::string summary() const override { | ||
return "Loads Instrument Geometry from a NeXus file."; | ||
|
||
} | ||
|
||
/// Returns a confidence value that this algorithm can load a file | ||
int confidence(Kernel::NexusDescriptor &descriptor) const override; | ||
|
||
private: | ||
/// Overwrites Algorithm method. | ||
void init() override; | ||
/// Overwrites Algorithm method | ||
void exec() override; | ||
|
||
}; | ||
|
||
|
||
} | ||
} | ||
|
||
|
||
#endif // LOAD_NEXUS_GEOMETRY_H_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//----------------------------------------- | ||
// Includes | ||
//----------------------------------------- | ||
#include "MantidDataHandling/LoadNexusGeometry.h" | ||
|
||
#include "MantidAPI/RegisterFileLoader.h" | ||
|
||
namespace Mantid { | ||
namespace DataHandling{ | ||
|
||
//Register the algorithm into the algorithm factory | ||
DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNexusGeometry) | ||
|
||
//Empty Default Constructor | ||
LoadNexusGeometry::LoadNexusGeometry(){} | ||
|
||
void LoadNexusGeometry::init(){} | ||
void LoadNexusGeometry::exec(){} | ||
|
||
int LoadNexusGeometry::confidence (Kernel::NexusDescriptor &descriptor) const{return 0;} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef LOAD_NEXUS_GEOMETRY_TEST_H_ | ||
#define LOAD_NEXUS_GEOMETRY_TEST_H_ | ||
|
||
#include "MantidDataHandling/LoadNexusGeometry.h" | ||
|
||
#include <cxxtest/TestSuite.h> | ||
|
||
using namespace Mantid::DataHandling; | ||
|
||
class LoadNexusGeometryTest : public CxxTest::TestSuite | ||
{ | ||
public: | ||
void testExecLoadNexusGeometry() | ||
{ | ||
LoadNexusGeometry ld; | ||
TS_ASSERT_THROWS_NOTHING(ld.initialize ()); | ||
TS_ASSERT_THROWS_NOTHING(ld.execute ()) | ||
TS_ASSERT(ld.isExecuted ()) | ||
} | ||
}; | ||
|
||
#endif // LOAD_NEXUS_GEOMETRY_TEST_H_ |