Commit 873cda43 authored by Ken Martin's avatar Ken Martin
Browse files

some cleaning up

parent ee6fcb09
......@@ -5,7 +5,6 @@ source vtkInt.tcl
vtkSphereSource sphere;
sphere SetPhiResolution 12;
sphere SetThetaResolution 12;
sphere DebugOn;
vtkElevationFilter colorIt;
colorIt SetInput [sphere GetOutput];
......@@ -14,7 +13,6 @@ vtkElevationFilter colorIt;
vtkCastToConcrete cast;
cast SetInput [colorIt GetOutput];
cast DebugOn;
vtkPolyMapper mapper;
mapper SetInput [cast GetPolyDataOutput]
......@@ -25,14 +23,17 @@ vtkActor actor;
vtkRenderMaster rm;
set renWin [rm MakeRenderWindow];
set iren [$renWin MakeRenderWindowInteractor];
set renderer [$renWin MakeRenderer];
set ren1 [$renWin MakeRenderer];
$renderer AddActors actor;
$renderer SetBackground 1 1 1;
$renWin SetSize 450 450;
$ren1 AddActors actor;
$ren1 SetBackground 1 1 1;
$renWin SetSize 400 400;
[$ren1 GetActiveCamera] Zoom 1.4;
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren Initialize;
$renWin Render;
#$renWin SetFilename ColorSph.tcl.ppm;
#$renWin SaveImageAsPPM;
wm withdraw .
......@@ -20,7 +20,6 @@ vtkDelaunay3D del
del SetTolerance 0.01;
del SetAlpha 0.2;
del BoundingTriangulationOff;
del DebugOn;
vtkShrinkFilter shrink;
shrink SetInput [del GetOutput];
......
......@@ -15,11 +15,9 @@ set iren [$renWin MakeRenderWindowInteractor];
#
vtkMCubesReader reader;
reader SetFilename "../../data/pineRoot/pine_root.tri";
reader DebugOn;
vtkConnectivityFilter connect;
connect SetInput [reader GetOutput];
connect ExtractLargestRegion;
connect DebugOn;
vtkDataSetMapper isoMapper;
isoMapper SetInput [connect GetOutput];
isoMapper ScalarsVisibleOff;
......@@ -40,7 +38,7 @@ vtkActor outlineActor;
$ren1 AddActors outlineActor;
$ren1 AddActors isoActor;
$ren1 SetBackground 1 1 1;
$renWin SetSize 750 750;
$renWin SetSize 500 500;
eval $ren1 SetBackground $slate_grey;
# render the image
......@@ -57,5 +55,3 @@ $renWin Render;
# prevent the tk window from showing up then start the event loop
wm withdraw .
$iren Start;
......@@ -22,20 +22,17 @@ vtkVolume16Reader v16;
v16 SetImageRange 1 256;
v16 SetDataAspectRatio 0.3125 0.3125 0.390625;
v16 SetDataMask 0x7fff;
v16 DebugOn;
vtkSliceCubes mcubes;
mcubes SetReader v16;
mcubes SetValue 1750;
mcubes SetFilename "pine_root.tri"
mcubes SetLimitsFilename "pine_root.lim"
mcubes DebugOn;
mcubes Update;
vtkMCubesReader reader;
reader SetFilename "pine_root.tri"
reader SetLimitsFilename "pine_root.lim"
reader DebugOn;
vtkPolyMapper mapper;
mapper SetInput [reader GetOutput];
......@@ -48,7 +45,7 @@ vtkActor a;
#
$ren1 AddActors a;
$ren1 SetBackground 1 1 1;
$renWin SetSize 750 750;
$renWin SetSize 500 500;
eval $ren1 SetBackground $slate_grey;
# render the image
......
......@@ -18,8 +18,8 @@ v16 SetDataDimensions 128 128;
[v16 GetOutput] SetOrigin 0.0 0.0 0.0;
v16 SwapBytesOn;
v16 SetFilePrefix "../../data/headsq/half";
v16 SetImageRange 19 24;
#v16 SetImageRange 1 93;
#v16 SetImageRange 19 24;
v16 SetImageRange 1 93;
v16 SetDataAspectRatio 1.6 1.6 1.5;
v16 Update;
......
......@@ -39,10 +39,8 @@ vtkTexture texture;
vtkBYUReader byu;
byu SetGeometryFilename "../../data/motor.g"
byu SetPartNumber 1;
byu DebugOn;
vtkPolyNormals normals;
normals SetInput [byu GetOutput];
normals DebugOn;
vtkImplicitTextureCoords tex1;
tex1 SetInput [normals GetOutput];
tex1 SetRFunction planes;
......@@ -57,10 +55,8 @@ vtkActor byuActor;
vtkBYUReader byu2;
byu2 SetGeometryFilename "../../data/motor.g"
byu2 SetPartNumber 2;
byu2 DebugOn;
vtkPolyNormals normals2;
normals2 SetInput [byu2 GetOutput];
normals2 DebugOn;
vtkImplicitTextureCoords tex2;
tex2 SetInput [normals2 GetOutput];
tex2 SetRFunction planes;
......@@ -75,10 +71,8 @@ vtkActor byuActor2;
vtkBYUReader byu3;
byu3 SetGeometryFilename "../../data/motor.g"
byu3 SetPartNumber 3;
byu3 DebugOn;
vtkPolyNormals normals3;
normals3 SetInput [byu3 GetOutput];
normals3 DebugOn;
vtkImplicitTextureCoords tex3;
tex3 SetInput [normals3 GetOutput];
tex3 SetRFunction planes;
......@@ -93,10 +87,8 @@ vtkActor byuActor3;
vtkBYUReader byu4;
byu4 SetGeometryFilename "../../data/motor.g"
byu4 SetPartNumber 4;
byu4 DebugOn;
vtkPolyNormals normals4;
normals4 SetInput [byu4 GetOutput];
normals4 DebugOn;
vtkImplicitTextureCoords tex4;
tex4 SetInput [normals4 GetOutput];
tex4 SetRFunction planes;
......@@ -111,10 +103,8 @@ vtkActor byuActor4;
vtkBYUReader byu5;
byu5 SetGeometryFilename "../../data/motor.g"
byu5 SetPartNumber 5;
byu5 DebugOn;
vtkPolyNormals normals5;
normals5 SetInput [byu5 GetOutput];
normals5 DebugOn;
vtkImplicitTextureCoords tex5;
tex5 SetInput [normals5 GetOutput];
tex5 SetRFunction planes;
......@@ -134,7 +124,7 @@ $ren1 AddActors byuActor3;
$ren1 AddActors byuActor4;
$ren1 AddActors byuActor5;
$ren1 SetBackground 1 1 1;
$renWin SetSize 750 750;
$renWin SetSize 500 500;
vtkCamera camera;
camera SetFocalPoint 0.0286334 0.0362996 0.0379685;
......@@ -148,6 +138,8 @@ $ren1 SetActiveCamera camera;
# render the image
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren Initialize;
$renWin SetFilename "motor.tcl.ppm";
#$renWin SaveImageAsPPM;
# prevent the tk window from showing up then start the event loop
wm withdraw .
......
......@@ -15,7 +15,6 @@ set iren [$renWin MakeRenderWindowInteractor];
#
vtkMCubesReader reader;
reader SetFilename "../../data/pineRoot/pine_root.tri";
reader FlipNormalsOff;
vtkPolyMapper isoMapper;
isoMapper SetInput [reader GetOutput];
isoMapper ScalarsVisibleOff;
......
......@@ -5,7 +5,7 @@
#vtkCommand DebugOn;
# first find all the examples
set files [lsort [glob {*.tcl}]];
set files [lsort [glob {[p-z]*.tcl}]];
# remove support files that we know are not examples
if {[set pos [lsearch $files "vtkInt.tcl"]] != -1} {
......@@ -59,6 +59,9 @@ if {[set pos [lsearch $files "tkwin.tcl"]] != -1} {
if {[set pos [lsearch $files "sphereMap.tcl"]] != -1} {
set files [lreplace $files $pos $pos ]
}
if {[set pos [lsearch $files "motor.tcl"]] != -1} {
set files [lreplace $files $pos $pos ]
}
# now do the tests
......@@ -76,10 +79,19 @@ foreach afile $files {
imgDiff SetImage [pnm GetOutput];
imgDiff Update;
if {[imgDiff GetThresholdedError] == 0.0} {
# a test has to be off by at least ten pixels for us to care
if {[imgDiff GetThresholdedError] < 10.0} {
puts "Passed Test for $afile"
} else {
puts "Failed Test for $afile with an error of [imgDiff GetThresholdedError]"
# vtkPNMWriter pnmw;
# pnmw SetInput [imgDiff GetOutput];
# pnmw SetFilename "$afile.error.ppm";
# pnmw Write;
# vtkPNMWriter pnmw2;
# pnmw2 SetInput [renSrc GetOutput];
# pnmw2 SetFilename "$afile.test.ppm";
# pnmw2 Write;
}
vtkCommand DeleteAllObjects;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment