Better conform Plot.h to VTK-m style

Principally, the indentation style was changed to 2 spaces and the
member variables of classes were changed to start with a capitol.
This commit is contained in:
Kenneth Moreland 2016-05-24 14:54:20 -06:00
parent 3456fc1455
commit fcbfacb4f0
3 changed files with 50 additions and 43 deletions

@ -30,39 +30,46 @@ namespace rendering {
class Plot
{
public:
//Plot(points, cells, field, colortable) {}
VTKM_CONT_EXPORT
Plot(const vtkm::cont::DynamicCellSet &cs,
const vtkm::cont::CoordinateSystem &c,
const vtkm::cont::Field &f,
const vtkm::rendering::ColorTable &ct) :
cellSet(cs), coords(c), scalarField(f), colorTable(ct)
{
f.GetBounds(scalarBounds,
VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
c.GetBounds(spatialBounds,
VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
}
//Plot(points, cells, field, colortable) {}
VTKM_CONT_EXPORT
Plot(const vtkm::cont::DynamicCellSet &cells,
const vtkm::cont::CoordinateSystem &coordinates,
const vtkm::cont::Field &scalarField,
const vtkm::rendering::ColorTable &colorTable)
: Cells(cells),
Coordinates(coordinates),
ScalarField(scalarField),
ColorTable(colorTable)
{
scalarField.GetBounds(this->ScalarBounds,
VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
coordinates.GetBounds(this->SpatialBounds,
VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
}
template<typename SceneRendererType, typename SurfaceType>
VTKM_CONT_EXPORT
void Render(SceneRendererType &sr,
SurfaceType &surface, //surface
vtkm::rendering::View &view)
{
sr.SetRenderSurface(&surface);
sr.SetActiveColorTable(colorTable);
sr.RenderCells(cellSet, coords, scalarField,
colorTable, view, scalarBounds);
}
vtkm::cont::DynamicCellSet cellSet;
vtkm::cont::CoordinateSystem coords;
vtkm::cont::Field scalarField;
vtkm::rendering::ColorTable colorTable;
template<typename SceneRendererType, typename SurfaceType>
VTKM_CONT_EXPORT
void Render(SceneRendererType &sceneRenderer,
SurfaceType &surface,
vtkm::rendering::View &view)
{
sceneRenderer.SetRenderSurface(&surface);
sceneRenderer.SetActiveColorTable(this->ColorTable);
sceneRenderer.RenderCells(this->Cells,
this->Coordinates,
this->ScalarField,
this->ColorTable,
view,
this->ScalarBounds);
}
vtkm::Float64 scalarBounds[2];
vtkm::Float64 spatialBounds[6];
vtkm::cont::DynamicCellSet Cells;
vtkm::cont::CoordinateSystem Coordinates;
vtkm::cont::Field ScalarField;
vtkm::rendering::ColorTable ColorTable;
vtkm::Float64 ScalarBounds[2];
vtkm::Float64 SpatialBounds[6];
};
}} //namespace vtkm::rendering

@ -53,12 +53,12 @@ public:
this->Plots[i].Render(sceneRenderer, surface, view);
// accumulate all Plots' spatial bounds into the scene spatial bounds
this->SpatialBounds[0] = vtkm::Min(this->SpatialBounds[0], this->Plots[i].spatialBounds[0]);
this->SpatialBounds[1] = vtkm::Max(this->SpatialBounds[1], this->Plots[i].spatialBounds[1]);
this->SpatialBounds[2] = vtkm::Min(this->SpatialBounds[2], this->Plots[i].spatialBounds[2]);
this->SpatialBounds[3] = vtkm::Max(this->SpatialBounds[3], this->Plots[i].spatialBounds[3]);
this->SpatialBounds[4] = vtkm::Min(this->SpatialBounds[4], this->Plots[i].spatialBounds[4]);
this->SpatialBounds[5] = vtkm::Max(this->SpatialBounds[5], this->Plots[i].spatialBounds[5]);
this->SpatialBounds[0] = vtkm::Min(this->SpatialBounds[0], this->Plots[i].SpatialBounds[0]);
this->SpatialBounds[1] = vtkm::Max(this->SpatialBounds[1], this->Plots[i].SpatialBounds[1]);
this->SpatialBounds[2] = vtkm::Min(this->SpatialBounds[2], this->Plots[i].SpatialBounds[2]);
this->SpatialBounds[3] = vtkm::Max(this->SpatialBounds[3], this->Plots[i].SpatialBounds[3]);
this->SpatialBounds[4] = vtkm::Min(this->SpatialBounds[4], this->Plots[i].SpatialBounds[4]);
this->SpatialBounds[5] = vtkm::Max(this->SpatialBounds[5], this->Plots[i].SpatialBounds[5]);
}
sceneRenderer.EndScene();
}

@ -139,10 +139,10 @@ public:
if (this->Scene.Plots.size() > 0)
{
//this->ColorBarAnnotation.SetAxisColor(eavlColor::white);
this->ColorBarAnnotation.SetRange(this->Scene.Plots[0].scalarBounds[0],
this->Scene.Plots[0].scalarBounds[1],
this->ColorBarAnnotation.SetRange(this->Scene.Plots[0].ScalarBounds[0],
this->Scene.Plots[0].ScalarBounds[1],
5);
this->ColorBarAnnotation.SetColorTable(this->Scene.Plots[0].colorTable);
this->ColorBarAnnotation.SetColorTable(this->Scene.Plots[0].ColorTable);
this->ColorBarAnnotation.Render(this->View, this->WorldAnnotator, this->Surface);
}
}
@ -299,10 +299,10 @@ public:
if (this->Scene.Plots.size() > 0)
{
//this->ColorBarAnnotation.SetAxisColor(eavlColor::white);
this->ColorBarAnnotation.SetRange(this->Scene.Plots[0].scalarBounds[0],
this->Scene.Plots[0].scalarBounds[1],
this->ColorBarAnnotation.SetRange(this->Scene.Plots[0].ScalarBounds[0],
this->Scene.Plots[0].ScalarBounds[1],
5);
this->ColorBarAnnotation.SetColorTable(this->Scene.Plots[0].colorTable);
this->ColorBarAnnotation.SetColorTable(this->Scene.Plots[0].ColorTable);
this->ColorBarAnnotation.Render(
this->View, this->WorldAnnotator, this->Surface);
}