Skip to content

Commit

Permalink
Refs #6315. Fix to make unit tests happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Apr 26, 2013
1 parent 51dfeaf commit 9e24c06
Showing 1 changed file with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "MantidVatesAPI/vtkDataSetToNonOrthogonalDataSet.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidGeometry/Crystal/UnitCell.h"
#include "MantidGeometry/Crystal/OrientedLattice.h"
Expand Down Expand Up @@ -82,18 +83,33 @@ void vtkDataSetToNonOrthogonalDataSet::execute()
ADSWorkspaceProvider<API::IMDWorkspace> workspaceProvider;
API::Workspace_sptr ws = workspaceProvider.fetchWorkspace(m_wsName);
std::string wsType = ws->id();

Geometry::OrientedLattice oLatt;
std::vector<double> wMatArr;
Kernel::Matrix<coord_t> affMat;

// Have to cast since inherited class doesn't provide access to all info
if (boost::algorithm::find_first(wsType, "MDHistoWorkspace"))
{
API::IMDHistoWorkspace_const_sptr infoWs = boost::dynamic_pointer_cast<const API::IMDHistoWorkspace>(ws);
m_numDims = infoWs->getNumDims();
Geometry::OrientedLattice oLatt = infoWs->getExperimentInfo(0)->sample().getOrientedLattice();
std::vector<double> wMatArr = infoWs->getExperimentInfo(0)->run().getPropertyValueAsType<std::vector<double > >("W_MATRIX");
Kernel::DblMatrix wTrans(wMatArr);
oLatt = infoWs->getExperimentInfo(0)->sample().getOrientedLattice();
wMatArr = infoWs->getExperimentInfo(0)->run().getPropertyValueAsType<std::vector<double > >("W_MATRIX");
API::CoordTransform *transform = infoWs->getTransformToOriginal();
affMat = transform->makeAffineMatrix();
}
// This is only here to make the unit test run.
if (boost::algorithm::find_first(wsType, "MDEventWorkspace"))
{
API::IMDEventWorkspace_const_sptr infoWs = boost::dynamic_pointer_cast<const API::IMDEventWorkspace>(ws);
m_numDims = infoWs->getNumDims();
oLatt = infoWs->getExperimentInfo(0)->sample().getOrientedLattice();
wMatArr = infoWs->getExperimentInfo(0)->run().getPropertyValueAsType<std::vector<double > >("W_MATRIX");
API::CoordTransform *transform = infoWs->getTransformToOriginal();
Kernel::Matrix<coord_t> affMat = transform->makeAffineMatrix();
this->createSkewInformation(oLatt, wTrans, affMat);
affMat = transform->makeAffineMatrix();
}
Kernel::DblMatrix wTrans(wMatArr);
this->createSkewInformation(oLatt, wTrans, affMat);
}

// Get the original points
Expand Down

0 comments on commit 9e24c06

Please sign in to comment.