-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #6541. First cut at axis labels.
This first pass gets things working for the NeXus reader.
- Loading branch information
Michael Reuter
committed
Feb 7, 2013
1 parent
2afe50c
commit 8fe88e7
Showing
5 changed files
with
62 additions
and
0 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
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
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
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 |
---|---|---|
@@ -1 +1,36 @@ | ||
#include "MantidVatesAPI/Common.h" | ||
#include "MantidGeometry/MDGeometry/IMDDimension.h" | ||
|
||
#include <vtkNew.h> | ||
#include <vtkFieldData.h> | ||
#include <vtkStringArray.h> | ||
|
||
//using namespace Mantid::Geometry; | ||
namespace Mantid | ||
{ | ||
namespace VATES | ||
{ | ||
std::string makeAxisTitle(Dimension_const_sptr dim) | ||
{ | ||
std::string title = dim->getName(); | ||
title += " ("; | ||
title += dim->getUnits(); | ||
title += ")"; | ||
return title; | ||
} | ||
|
||
void setAxisLabel(std::string metadataLabel, | ||
std::string labelString, | ||
vtkFieldData *fieldData) | ||
{ | ||
vtkNew<vtkStringArray> axisTitle; | ||
axisTitle->SetName(metadataLabel.c_str()); | ||
axisTitle->SetNumberOfComponents(1); | ||
axisTitle->SetNumberOfTuples(1); | ||
axisTitle->SetValue(0, labelString.c_str()); | ||
fieldData->AddArray(axisTitle.GetPointer()); | ||
} | ||
|
||
|
||
} // VATES | ||
} // Mantid |
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