Skip to content
Snippets Groups Projects
Commit 3dd6300e authored by Andrew Maclean's avatar Andrew Maclean
Browse files

Fixing warnings.

parent f59e635e
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ int main( int, char *[] )
//
// Create surface of implicit function
//
double range[2];
// double range[2];
// Sample quadric function
vtkSmartPointer<vtkQuadric> quadric =
......@@ -161,7 +161,7 @@ void CreatePlanes(vtkSmartPointer<vtkSampleFunction> &function,
int sliceIncr = (dims[2] - 1) / (numberOfPlanes + 1);
int slice = -4;
for (int i = 0; i< numberOfPlanes; ++i)
for (unsigned int i = 0; i< numberOfPlanes; ++i)
{
vtkSmartPointer<vtkExtractVOI> extract =
vtkSmartPointer<vtkExtractVOI>::New();
......@@ -201,7 +201,7 @@ void CreateContours(vtkSmartPointer<vtkSampleFunction> &function,
int sliceIncr = (dims[2] - 1) / (numberOfPlanes + 1);
int slice = -4;
for (int i = 0; i< numberOfPlanes; ++i)
for (unsigned int i = 0; i< numberOfPlanes; ++i)
{
vtkSmartPointer<vtkExtractVOI> extract =
vtkSmartPointer<vtkExtractVOI>::New();
......
......@@ -94,8 +94,9 @@ int main (int argc, char *argv[])
iren->SetRenderWindow(renWin);
std::vector<vtkSmartPointer<vtkRenderer>> renderers;
int gridSize = ((mcCases.size() + 3) / 4) * 4;
gridSize = mcCases.size() < 4 ? mcCases.size() : gridSize;
int gridSize = ((static_cast<int>(mcCases.size()) + 3) / 4) * 4;
gridSize = static_cast<int>(mcCases.size()) < 4 ?
static_cast<int>(mcCases.size()) : gridSize;
std::cout << "gridSize: " << gridSize << std::endl;
for (int i = 0; i < gridSize; ++i)
{
......@@ -344,14 +345,15 @@ int main (int argc, char *argv[])
}
// Setup viewports for the renderers
int rendererSize = 300;
unsigned int xGridDimensions = mcCases.size() < 4 ? mcCases.size() : 4;
unsigned int yGridDimensions = (mcCases.size() - 1) / 4 + 1;
int xGridDimensions = static_cast<int>(mcCases.size()) < 4 ?
static_cast<int>(mcCases.size()) : 4;
int yGridDimensions = (static_cast<int>(mcCases.size()) - 1) / 4 + 1;
std::cout << "x, y: " << xGridDimensions << " " << yGridDimensions << std::endl;
renWin->SetSize(
rendererSize * xGridDimensions, rendererSize * yGridDimensions);
for (int row = 0; row < static_cast<int>(yGridDimensions); row++)
for (int row = 0; row < yGridDimensions; row++)
{
for (int col = 0; col < static_cast<int>(xGridDimensions); col++)
for (int col = 0; col < xGridDimensions; col++)
{
int index = row * xGridDimensions + col;
......
......@@ -10,8 +10,8 @@ def main():
colors = vtk.vtkNamedColors()
# Set the background color. Match those in VTKTextbook.pdf.
bkg1 = map(lambda x: x / 256.0, [25, 51, 102])
colors.SetColor("BkgColor1", *bkg1)
bkg = map(lambda x: x / 256.0, [25, 51, 102])
colors.SetColor("BkgColor", *bkg)
# Read a vtk file
#
......@@ -52,7 +52,6 @@ def main():
# Match the window shape to the object.
# renWin.SetSize(500, int(500 * bounds[1] / bounds[3]))
renWin.SetSize(500, 500)
ren.SetBackground(colors.GetColor3d("BkgColor1"))
iren.Initialize()
......@@ -60,12 +59,12 @@ def main():
# Centered on Honolulu.
# Diamond Head is the crater lower left.
# Punchbowl is the crater in the centre.
ren.Render()
renWin.Render()
ren.SetBackground(colors.GetColor3d("BkgColor"))
ren.GetActiveCamera().Zoom(1.5)
ren.GetActiveCamera().Roll(-90)
ren.Render()
renWin.Render()
renWin.Render()
iren.Start()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment