Skip to content

Commit

Permalink
Refs #6315. Merging current work onto more recent master.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Mar 21, 2013
2 parents 0120eda + 4dded9f commit 22dd38c
Show file tree
Hide file tree
Showing 75 changed files with 1,609 additions and 1,088 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
Available timestep values.
</Documentation>
</DoubleVectorProperty>
<StringVectorProperty
name="TimeLabelAnnotation"
information_only="1"
si_class="vtkSITimeLabelProperty">
</StringVectorProperty>
<IntVectorProperty
name="OutputHistoWorkspace"
command="SetOutputHistogramWS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <boost/functional/hash.hpp>
#include <sstream>


#include "MantidVatesAPI/Clipper.h"
#include <vtkPVClipDataSet.h>

Expand All @@ -59,7 +58,7 @@ class ClipperAdapter : public Mantid::VATES::Clipper

void SetInput(vtkDataSet* input)
{
m_clipper->SetInput(input);
m_clipper->SetInputData(input);
}

void SetClipFunction(vtkImplicitFunction* func)
Expand Down Expand Up @@ -186,11 +185,7 @@ void vtkMDEWRebinningCutter::updateAlgorithmProgress(double progress, const std:
progressMutex.unlock();
}


vtkCxxRevisionMacro(vtkMDEWRebinningCutter, "$Revision: 1.0 $")
;
vtkStandardNewMacro(vtkMDEWRebinningCutter)
;
vtkStandardNewMacro(vtkMDEWRebinningCutter);

using namespace Mantid::VATES;

Expand Down Expand Up @@ -257,10 +252,10 @@ int vtkMDEWRebinningCutter::RequestData(vtkInformation* vtkNotUsed(request), vtk
vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(outInfo->Get(
vtkDataObject::DATA_OBJECT()));

if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()))
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
{
// usually only one actual step requested
m_timestep = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())[0];
m_timestep = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
}

std::string scalarName = XMLDefinitions::signalName();
Expand Down Expand Up @@ -289,7 +284,7 @@ int vtkMDEWRebinningCutter::RequestData(vtkInformation* vtkNotUsed(request), vtk
delete p_1dMDFactory;

output->ShallowCopy(outData);

m_presenter->setAxisLabels(output);
}
return 1;
}
Expand Down Expand Up @@ -434,6 +429,8 @@ void vtkMDEWRebinningCutter::setTimeRange(vtkInformationVector* outputVector)
if(m_presenter->hasTDimensionAvailable())
{
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_LABEL_ANNOTATION(),
m_presenter->getTimeStepLabel().c_str());
std::vector<double> timeStepValues = m_presenter->getTimeStepValues();
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &timeStepValues[0],
static_cast<int> (timeStepValues.size()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class VTK_EXPORT vtkMDEWRebinningCutter : public vtkUnstructuredGridAlgorithm//,
{
public:
static vtkMDEWRebinningCutter *New();
vtkTypeRevisionMacro(vtkMDEWRebinningCutter,vtkUnstructuredGridAlgorithm);
vtkTypeMacro(vtkMDEWRebinningCutter, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);

/// Paraview Related Commands. See *.xml proxy/property file --------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@
number_of_elements="1"
default_values="1">
<BooleanDomain name="bool"/>
</IntVectorProperty>
<IntVectorProperty
name="In Original Coods"
command="SetInOriginalCoords"
number_of_elements="1"
default_values="0">
<BooleanDomain name="bool"/>
</IntVectorProperty>
<DoubleVectorProperty
name="InputMinThreshold"
Expand Down Expand Up @@ -130,6 +123,11 @@
number_of_elements="1"
default_values="--">
</StringVectorProperty>
<StringVectorProperty
name="TimeLabelAnnotation"
information_only="1"
si_class="vtkSITimeLabelProperty">
</StringVectorProperty>
</SourceProxy>
</ProxyGroup>
<!-- End RebinningTransformOperator -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ClipperAdapter : public Mantid::VATES::Clipper

void SetInput(vtkDataSet* input)
{
m_clipper->SetInput(input);
m_clipper->SetInputData(input);
}

void SetClipFunction(vtkImplicitFunction* func)
Expand Down Expand Up @@ -186,10 +186,7 @@ bool vtkRebinningTransformOperator::getOutputHistogramWS() const
return m_bOutputHistogramWS;
}

vtkCxxRevisionMacro(vtkRebinningTransformOperator, "$Revision: 1.0 $")
;
vtkStandardNewMacro(vtkRebinningTransformOperator)
;
vtkStandardNewMacro(vtkRebinningTransformOperator);

using namespace Mantid::VATES;

Expand Down Expand Up @@ -257,10 +254,10 @@ int vtkRebinningTransformOperator::RequestData(vtkInformation* vtkNotUsed(reques
vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(outInfo->Get(
vtkDataObject::DATA_OBJECT()));

if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()))
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
{
// usually only one actual step requested
m_timestep = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())[0];
m_timestep = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
}

std::string scalarName = XMLDefinitions::signalName();
Expand Down Expand Up @@ -288,7 +285,7 @@ int vtkRebinningTransformOperator::RequestData(vtkInformation* vtkNotUsed(reques
delete p_1dMDFactory;

output->ShallowCopy(outData);

m_presenter->setAxisLabels(output);
}
return 1;
}
Expand Down Expand Up @@ -384,15 +381,6 @@ void vtkRebinningTransformOperator::SetThresholdRangeStrategyIndex(std::string s
}
}

void vtkRebinningTransformOperator::SetInOriginalCoords(bool inOriginalCoords)
{
if(inOriginalCoords != m_bTransformVis)
{
m_bTransformVis = inOriginalCoords;
this->Modified();
}
}

const char* vtkRebinningTransformOperator::GetInputGeometryXML()
{
try
Expand Down Expand Up @@ -429,6 +417,8 @@ void vtkRebinningTransformOperator::setTimeRange(vtkInformationVector* outputVec
if(m_presenter->hasTDimensionAvailable())
{
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_LABEL_ANNOTATION(),
m_presenter->getTimeStepLabel().c_str());
std::vector<double> timeStepValues = m_presenter->getTimeStepValues();
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &timeStepValues[0],
static_cast<int> (timeStepValues.size()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class VTK_EXPORT vtkRebinningTransformOperator : public vtkUnstructuredGridAlgor
{
public:
static vtkRebinningTransformOperator *New();
vtkTypeRevisionMacro(vtkRebinningTransformOperator,vtkUnstructuredGridAlgorithm);
vtkTypeMacro(vtkRebinningTransformOperator, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);

/// Paraview Related Commands. See *.xml proxy/property file --------------------------------
Expand All @@ -76,7 +76,6 @@ class VTK_EXPORT vtkRebinningTransformOperator : public vtkUnstructuredGridAlgor
void SetOrigin(double originX, double originY, double originZ);
void SetForceOrthogonal(bool value);
void SetOutputHistogramWS(bool value);
void SetInOriginalCoords(bool inOriginalCoords);

const char* GetInputGeometryXML();
void SetThresholdRangeStrategyIndex(std::string selectedStrategyIndex);
Expand Down Expand Up @@ -170,8 +169,6 @@ class VTK_EXPORT vtkRebinningTransformOperator : public vtkUnstructuredGridAlgor
double m_lengthB3;
/// Do we force the basis vectors to be orthogonal?
bool m_ForceOrthogonal;
/// Flag indicating that visual results should be transformed into the original coordinate frame.
bool m_bTransformVis;
/// Flag indicating that a histogram workspace should be provided.
bool m_bOutputHistogramWS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ SERVER_MANAGER_SOURCES vtkScaleWorkspace.cxx
GUI_RESOURCE_FILES ScaleWorkspaceGUI.xml)
# Add to the 'VatesParaViewPlugins' group in VS
set_property( TARGET MantidParaViewScaleWorkspaceSMPlugin PROPERTY FOLDER "MantidVatesParaViewPlugins")

target_link_libraries( MantidParaViewScaleWorkspaceSMPlugin
${MANTID_SUBPROJECT_LIBS} )

# Put library into subfolder.
SET_TARGET_OUTPUT_DIRECTORY(MantidParaViewScaleWorkspaceSMPlugin ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PVPLUGINS_DIR}/${PVPLUGINS_SUBDIR})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#include "vtkScaleWorkspace.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkUnstructuredGrid.h"

vtkCxxRevisionMacro(vtkScaleWorkspace, "$Revision: 1.0 $");
#include "MantidVatesAPI/vtkDataSetToScaledDataSet.h"

#include <vtkInformation.h>
#include <vtkInformationVector.h>
#include <vtkNew.h>
#include <vtkObjectFactory.h>
#include <vtkUnstructuredGridAlgorithm.h>
#include <vtkUnstructuredGrid.h>

vtkStandardNewMacro(vtkScaleWorkspace);

using namespace Mantid::VATES;

vtkScaleWorkspace::vtkScaleWorkspace()
{
this->SetNumberOfInputPorts(1);
Expand All @@ -21,28 +26,15 @@ vtkScaleWorkspace::~vtkScaleWorkspace()

int vtkScaleWorkspace::RequestData(vtkInformation*, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
vtkInformation * inputInf = inputVector[0]->GetInformationObject(0);
vtkPointSet * inputDataSet = vtkPointSet::SafeDownCast(inputInf->Get(vtkDataObject::DATA_OBJECT()));
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkUnstructuredGrid *inputDataSet = vtkUnstructuredGrid::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));

vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkUnstructuredGrid *dataset = vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkUnstructuredGrid *outputDataSet = vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));

vtkPoints* points = inputDataSet->GetPoints();
double* point;
vtkPoints* newPoints = vtkPoints::New();
newPoints->Allocate(points->GetNumberOfPoints());
for(int i = 0; i < points->GetNumberOfPoints(); i++)
{
point = points->GetPoint(i);
point[0] *= m_xScaling;
point[1] *= m_yScaling;
point[2] *= m_zScaling;
newPoints->InsertNextPoint(point);
}
//Shallow copy the input.
dataset->ShallowCopy(inputDataSet);
//Give the output dataset the scaled set of points.
dataset->SetPoints(newPoints);
vtkDataSetToScaledDataSet scaler(inputDataSet, outputDataSet);
scaler.initialize(m_xScaling, m_yScaling, m_zScaling);
scaler.execute();
return 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class VTK_EXPORT vtkScaleWorkspace : public vtkUnstructuredGridAlgorithm
{
public:
static vtkScaleWorkspace *New();
vtkTypeRevisionMacro(vtkScaleWorkspace,vtkUnstructuredGridAlgorithm);
vtkTypeMacro(vtkScaleWorkspace, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
void SetXScaling(double xScaling);
void SetYScaling(double yScaling);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using namespace Mantid::API;
using namespace Mantid::VATES;

vtkCxxRevisionMacro(vtkSplatterPlot, "$Revision: 1.0 $");
vtkStandardNewMacro(vtkSplatterPlot);

vtkSplatterPlot::vtkSplatterPlot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class VTK_EXPORT vtkSplatterPlot : public vtkUnstructuredGridAlgorithm
{
public:
static vtkSplatterPlot *New();
vtkTypeRevisionMacro(vtkSplatterPlot,vtkUnstructuredGridAlgorithm);
vtkTypeMacro(vtkSplatterPlot, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
void SetNumberOfPoints(int nPoints);
void updateAlgorithmProgress(double progress, const std::string& message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "MantidVatesAPI/FilteringUpdateProgressAction.h"
#include "MantidVatesAPI/MDLoadingViewAdapter.h"

vtkCxxRevisionMacro(vtkEventNexusReader, "$Revision: 1.0 $");
vtkStandardNewMacro(vtkEventNexusReader);

using namespace Mantid::VATES;
Expand Down Expand Up @@ -110,10 +109,10 @@ int vtkEventNexusReader::RequestData(vtkInformation * vtkNotUsed(request), vtkIn
//get the info objects
vtkInformation *outInfo = outputVector->GetInformationObject(0);

if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()))
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
{
// usually only one actual step requested
m_time =outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())[0];
m_time =outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
}

FilterUpdateProgressAction<vtkEventNexusReader> loadingProgressUpdate(this, "Loading...");
Expand All @@ -134,7 +133,7 @@ int vtkEventNexusReader::RequestData(vtkInformation * vtkNotUsed(request), vtkIn
vtkBox* box = vtkBox::New();
box->SetBounds(product->GetBounds());
vtkPVClipDataSet* clipper = vtkPVClipDataSet::New();
clipper->SetInput(product);
clipper->SetInputData(product);
clipper->SetClipFunction(box);
clipper->SetInsideOut(true);
clipper->Update();
Expand Down Expand Up @@ -200,6 +199,8 @@ void vtkEventNexusReader::setTimeRange(vtkInformationVector* outputVector)
if(m_presenter->hasTDimensionAvailable())
{
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_LABEL_ANNOTATION(),
m_presenter->getTimeStepLabel().c_str());
std::vector<double> timeStepValues = m_presenter->getTimeStepValues();
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &timeStepValues[0],
static_cast<int> (timeStepValues.size()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class VTK_EXPORT vtkEventNexusReader : public vtkUnstructuredGridAlgorithm
//----------------------------------------------

static vtkEventNexusReader *New();
vtkTypeRevisionMacro(vtkEventNexusReader,vtkUnstructuredGridAlgorithm);
vtkTypeMacro(vtkEventNexusReader, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
Available timestep values.
</Documentation>
</DoubleVectorProperty>
<StringVectorProperty
name="TimeLabelAnnotation"
information_only="1"
si_class="vtkSITimeLabelProperty">
</StringVectorProperty>
</SourceProxy>
</ProxyGroup>
<!-- End MDEWNexusReader -->
</ServerManagerConfiguration>
</ServerManagerConfiguration>

0 comments on commit 22dd38c

Please sign in to comment.