Commit e2812ef5 authored by Ken Martin's avatar Ken Martin
Browse files

added load vtktcl and removed semicolons

parent 9ceea046
catch {load vtktcl}
# Example demonstrates use of vtkCastToConcrete
#
source vtkInt.tcl
vtkSphereSource sphere;
sphere SetPhiResolution 12;
sphere SetThetaResolution 12;
vtkSphereSource sphere
sphere SetPhiResolution 12
sphere SetThetaResolution 12
vtkElevationFilter colorIt;
colorIt SetInput [sphere GetOutput];
colorIt SetLowPoint 0 0 -1;
colorIt SetHighPoint 0 0 1;
vtkElevationFilter colorIt
colorIt SetInput [sphere GetOutput]
colorIt SetLowPoint 0 0 -1
colorIt SetHighPoint 0 0 1
vtkCastToConcrete cast;
cast SetInput [colorIt GetOutput];
vtkCastToConcrete cast
cast SetInput [colorIt GetOutput]
vtkPolyMapper mapper;
vtkPolyMapper mapper
mapper SetInput [cast GetPolyDataOutput]
vtkActor actor;
actor SetMapper mapper;
vtkActor actor
actor SetMapper mapper
vtkRenderMaster rm;
set renWin [rm MakeRenderWindow];
set iren [$renWin MakeRenderWindowInteractor];
set ren1 [$renWin MakeRenderer];
vtkRenderMaster rm
set renWin [rm MakeRenderWindow]
set iren [$renWin MakeRenderWindowInteractor]
set ren1 [$renWin MakeRenderer]
$ren1 AddActors actor;
$ren1 SetBackground 1 1 1;
$renWin SetSize 400 400;
[$ren1 GetActiveCamera] Zoom 1.4;
$ren1 AddActors actor
$ren1 SetBackground 1 1 1
$renWin SetSize 400 400
[$ren1 GetActiveCamera] Zoom 1.4
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren Initialize;
$iren SetUserMethod {wm deiconify .vtkInteract}
$iren Initialize
#$renWin SetFileName ColorSph.tcl.ppm;
#$renWin SaveImageAsPPM;
#$renWin SetFileName ColorSph.tcl.ppm
#$renWin SaveImageAsPPM
wm withdraw .
catch {load vtktcl}
# user interface command widget
source vtkInt.tcl
# create a rendering window and renderer
vtkRenderMaster rm;
set renWin [rm MakeRenderWindow];
set ren1 [$renWin MakeRenderer];
set iren [$renWin MakeRenderWindowInteractor];
vtkRenderMaster rm
set renWin [rm MakeRenderWindow]
set ren1 [$renWin MakeRenderer]
set iren [$renWin MakeRenderWindowInteractor]
# create an actor and give it cone geometry
vtkConeSource cone;
cone SetResolution 8;
vtkPolyMapper coneMapper;
coneMapper SetInput [cone GetOutput];
vtkActor coneActor;
coneActor SetMapper coneMapper;
vtkConeSource cone
cone SetResolution 8
vtkPolyMapper coneMapper
coneMapper SetInput [cone GetOutput]
vtkActor coneActor
coneActor SetMapper coneMapper
# assign our actor to the renderer
$ren1 AddActors coneActor;
$ren1 AddActors coneActor
# enable user interface interactor
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren Initialize;
$iren SetUserMethod {wm deiconify .vtkInteract}
$iren Initialize
#$renWin SetFileName Cone.tcl.ppm;
#$renWin SaveImageAsPPM;
#$renWin SetFileName Cone.tcl.ppm
#$renWin SaveImageAsPPM
# prevent the tk window from showing up then start the event loop
wm withdraw .
......
catch {load vtktcl}
# this is a tcl version of the Mace example
# include get the vtk interactor ui
source vtkInt.tcl
# Create the render master
#
vtkRenderMaster rm;
vtkRenderMaster rm
# Now create the RenderWindow, Renderer and both Actors
#
set renWin [rm MakeRenderWindow];
set ren1 [$renWin MakeRenderer];
set iren [$renWin MakeRenderWindowInteractor];
vtkCylinderSource cone;
#vtkDiskSource cone;
#cone SetInnerRadius 1.0;
#cone SetOuterRadius 1.0;
vtkPolyMapper coneMapper;
coneMapper SetInput [cone GetOutput];
vtkActor coneActor;
coneActor SetMapper coneMapper;
set renWin [rm MakeRenderWindow]
set ren1 [$renWin MakeRenderer]
set iren [$renWin MakeRenderWindowInteractor]
vtkCylinderSource cone
#vtkDiskSource cone
#cone SetInnerRadius 1.0
#cone SetOuterRadius 1.0
vtkPolyMapper coneMapper
coneMapper SetInput [cone GetOutput]
vtkActor coneActor
coneActor SetMapper coneMapper
# Add the actors to the renderer, set the background and size
#
$ren1 AddActors coneActor;
$ren1 SetBackground 0.1 0.2 0.4;
$renWin SetSize 450 450;
$ren1 AddActors coneActor
$ren1 SetBackground 0.1 0.2 0.4
$renWin SetSize 450 450
# Get handles to some useful objects
#
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren Initialize;
$renWin Render;
$iren SetUserMethod {wm deiconify .vtkInteract}
$iren Initialize
$renWin Render
#$renWin SetFileName Cylinder.tcl.ppm;
#$renWin SaveImageAsPPM;
#$renWin SetFileName Cylinder.tcl.ppm
#$renWin SaveImageAsPPM
set coneProp [coneActor GetProperty];
set coneProp [coneActor GetProperty]
# prevent the tk window from showing up then start the event loop
wm withdraw .
......
catch {load vtktcl}
# Create a fancy image of a 2D Delaunay triangulation. Points are randomly
# generated.
......@@ -9,85 +10,85 @@ source colors.tcl
# create some points
#
vtkMath math;
vtkFloatPoints points;
vtkMath math
vtkFloatPoints points
for {set i 0} {$i<50} {incr i 1} {
eval points InsertPoint $i [math Random 0 1] [math Random 0 1] 0.0;
eval points InsertPoint $i [math Random 0 1] [math Random 0 1] 0.0
}
vtkPolyData profile;
profile SetPoints points;
vtkPolyData profile
profile SetPoints points
# triangulate them
#
vtkDelaunay2D del
del SetInput profile;
del SetTolerance 0.001;
vtkPolyMapper mapMesh;
mapMesh SetInput [del GetOutput];
del SetInput profile
del SetTolerance 0.001
vtkPolyMapper mapMesh
mapMesh SetInput [del GetOutput]
vtkActor meshActor
meshActor SetMapper mapMesh;
meshActor SetMapper mapMesh
eval [meshActor GetProperty] SetColor .1 .2 .4
vtkExtractEdges extract;
extract SetInput [del GetOutput];
vtkTubeFilter tubes;
tubes SetInput [extract GetOutput];
tubes SetRadius 0.01;
tubes SetNumberOfSides 6;
vtkPolyMapper mapEdges;
mapEdges SetInput [tubes GetOutput];
vtkExtractEdges extract
extract SetInput [del GetOutput]
vtkTubeFilter tubes
tubes SetInput [extract GetOutput]
tubes SetRadius 0.01
tubes SetNumberOfSides 6
vtkPolyMapper mapEdges
mapEdges SetInput [tubes GetOutput]
vtkActor edgeActor
edgeActor SetMapper mapEdges;
eval [edgeActor GetProperty] SetColor $peacock;
[edgeActor GetProperty] SetSpecularColor 1 1 1;
[edgeActor GetProperty] SetSpecular 0.3;
[edgeActor GetProperty] SetSpecularPower 20;
[edgeActor GetProperty] SetAmbient 0.2;
[edgeActor GetProperty] SetDiffuse 0.8;
edgeActor SetMapper mapEdges
eval [edgeActor GetProperty] SetColor $peacock
[edgeActor GetProperty] SetSpecularColor 1 1 1
[edgeActor GetProperty] SetSpecular 0.3
[edgeActor GetProperty] SetSpecularPower 20
[edgeActor GetProperty] SetAmbient 0.2
[edgeActor GetProperty] SetDiffuse 0.8
vtkSphereSource ball;
ball SetRadius 0.025;
ball SetThetaResolution 12;
ball SetPhiResolution 12;
vtkGlyph3D balls;
balls SetInput [del GetOutput];
balls SetSource [ball GetOutput];
vtkPolyMapper mapBalls;
mapBalls SetInput [balls GetOutput];
vtkSphereSource ball
ball SetRadius 0.025
ball SetThetaResolution 12
ball SetPhiResolution 12
vtkGlyph3D balls
balls SetInput [del GetOutput]
balls SetSource [ball GetOutput]
vtkPolyMapper mapBalls
mapBalls SetInput [balls GetOutput]
vtkActor ballActor
ballActor SetMapper mapBalls;
eval [ballActor GetProperty] SetColor $hot_pink;
[ballActor GetProperty] SetSpecularColor 1 1 1;
[ballActor GetProperty] SetSpecular 0.3;
[ballActor GetProperty] SetSpecularPower 20;
[ballActor GetProperty] SetAmbient 0.2;
[ballActor GetProperty] SetDiffuse 0.8;
ballActor SetMapper mapBalls
eval [ballActor GetProperty] SetColor $hot_pink
[ballActor GetProperty] SetSpecularColor 1 1 1
[ballActor GetProperty] SetSpecular 0.3
[ballActor GetProperty] SetSpecularPower 20
[ballActor GetProperty] SetAmbient 0.2
[ballActor GetProperty] SetDiffuse 0.8
# Create graphics objects
vtkRenderMaster rm;
vtkRenderMaster rm
# Now create the rendering window, renderer, and interactive renderer
set renWin [rm MakeRenderWindow];
set ren1 [$renWin MakeRenderer];
set iren [$renWin MakeRenderWindowInteractor];
set renWin [rm MakeRenderWindow]
set ren1 [$renWin MakeRenderer]
set iren [$renWin MakeRenderWindowInteractor]
# Add the actors to the renderer, set the background and size
$ren1 AddActors ballActor;
#$ren1 AddActors meshActor;
$ren1 AddActors edgeActor;
$ren1 SetBackground 1 1 1;
$renWin SetSize 150 150;
#$renWin SetSize 500 500;
$ren1 AddActors ballActor
#$ren1 AddActors meshActor
$ren1 AddActors edgeActor
$ren1 SetBackground 1 1 1
$renWin SetSize 150 150
#$renWin SetSize 500 500
# render the image
#
$iren SetUserMethod {wm deiconify .vtkInteract};
[$ren1 GetActiveCamera] Zoom 1.5;
$iren Initialize;
$iren SetUserMethod {wm deiconify .vtkInteract}
[$ren1 GetActiveCamera] Zoom 1.5
$iren Initialize
$renWin SetFileName "DelMesh.ppm";
#$renWin SaveImageAsPPM;
$renWin SetFileName "DelMesh.ppm"
#$renWin SaveImageAsPPM
# prevent the tk window from showing up then start the event loop
wm withdraw .
......
catch {load vtktcl}
# get the interactor ui
source vtkInt.tcl
# First create the render master
vtkRenderMaster rm;
vtkRenderMaster rm
# Now create the RenderWindow, Renderer and both Actors
#
set renWin [rm MakeRenderWindow];
set ren1 [$renWin MakeRenderer];
set iren [$renWin MakeRenderWindowInteractor];
set renWin [rm MakeRenderWindow]
set ren1 [$renWin MakeRenderer]
set iren [$renWin MakeRenderWindowInteractor]
# create some points
#
vtkMath math;
vtkFloatPoints points;
vtkMath math
vtkFloatPoints points
for {set i 0} {$i<1000} {incr i 1} {
eval points InsertPoint $i [math Random 0 1] [math Random 0 1] 0.0;
eval points InsertPoint $i [math Random 0 1] [math Random 0 1] 0.0
}
vtkPolyData profile;
profile SetPoints points;
vtkPolyData profile
profile SetPoints points
# triangulate them
#
vtkDelaunay2D del
del SetInput profile;
del BoundingTriangulationOn;
del SetTolerance 0.001;
del SetAlpha 0.0;
del Update;
del SetInput profile
del BoundingTriangulationOn
del SetTolerance 0.001
del SetAlpha 0.0
del Update
vtkShrinkPolyData shrink;
shrink SetInput [del GetOutput];
vtkShrinkPolyData shrink
shrink SetInput [del GetOutput]
vtkPolyMapper map;
map SetInput [shrink GetOutput];
vtkPolyMapper map
map SetInput [shrink GetOutput]
vtkActor triangulation;
triangulation SetMapper map;
[triangulation GetProperty] SetColor 1 0 0;
vtkActor triangulation
triangulation SetMapper map
[triangulation GetProperty] SetColor 1 0 0
# Add the actors to the renderer, set the background and size
#
$ren1 AddActors triangulation;
$ren1 SetBackground 1 1 1;
$renWin SetSize 500 500;
$renWin Render;
$ren1 AddActors triangulation
$ren1 SetBackground 1 1 1
$renWin SetSize 500 500
$renWin Render
set cam1 [$ren1 GetActiveCamera];
$cam1 Zoom 1.5;
set cam1 [$ren1 GetActiveCamera]
$cam1 Zoom 1.5
# render the image
#
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren SetUserMethod {wm deiconify .vtkInteract}
$renWin Render;
$renWin Render
#$renWin SetFileName Delaunay2D.tcl.ppm;
#$renWin SaveImageAsPPM;
#$renWin SetFileName Delaunay2D.tcl.ppm
#$renWin SaveImageAsPPM
# prevent the tk window from showing up then start the event loop
wm withdraw .
......
catch {load vtktcl}
# get the interactor ui
source vtkInt.tcl
# create some random points in the unit cube centered at (.5,.5,.5)
#
vtkMath math;
vtkFloatPoints points;
vtkMath math
vtkFloatPoints points
for {set i 0} {$i<25} {incr i 1} {
eval points InsertPoint $i [math Random 0 1] [math Random 0 1] [math Random 0 1];
eval points InsertPoint $i [math Random 0 1] [math Random 0 1] [math Random 0 1]
}
vtkPolyData profile;
profile SetPoints points;
vtkPolyData profile
profile SetPoints points
# triangulate them
#
vtkDelaunay3D del
del SetInput profile;
del BoundingTriangulationOn;
del SetTolerance 0.01;
del SetAlpha 0.2;
del BoundingTriangulationOff;
del SetInput profile
del BoundingTriangulationOn
del SetTolerance 0.01
del SetAlpha 0.2
del BoundingTriangulationOff
vtkShrinkFilter shrink;
shrink SetInput [del GetOutput];
shrink SetShrinkFactor 0.9;
vtkShrinkFilter shrink
shrink SetInput [del GetOutput]
shrink SetShrinkFactor 0.9
vtkDataSetMapper map;
map SetInput [shrink GetOutput];
vtkDataSetMapper map
map SetInput [shrink GetOutput]
vtkActor triangulation;
triangulation SetMapper map;
[triangulation GetProperty] SetColor 1 0 0;
vtkActor triangulation
triangulation SetMapper map
[triangulation GetProperty] SetColor 1 0 0
# First create the render master
vtkRenderMaster rm;
vtkRenderMaster rm
# Create graphics stuff
#
set renWin [rm MakeRenderWindow];
set ren1 [$renWin MakeRenderer];
set iren [$renWin MakeRenderWindowInteractor];
set renWin [rm MakeRenderWindow]
set ren1 [$renWin MakeRenderer]
set iren [$renWin MakeRenderWindowInteractor]
# Add the actors to the renderer, set the background and size
#
$ren1 AddActors triangulation;
$ren1 SetBackground 1 1 1;
$renWin SetSize 500 500;
$renWin Render;
$ren1 AddActors triangulation
$ren1 SetBackground 1 1 1
$renWin SetSize 500 500
$renWin Render
set cam1 [$ren1 GetActiveCamera];
$cam1 Zoom 1.5;
set cam1 [$ren1 GetActiveCamera]
$cam1 Zoom 1.5
# render the image
#
$iren SetUserMethod {wm deiconify .vtkInteract};
$iren SetUserMethod {wm deiconify .vtkInteract}
$renWin Render;
#$renWin SetFileName Delaunay3D.tcl.ppm;
#$renWin SaveImageAsPPM;
$renWin Render
#$renWin SetFileName Delaunay3D.tcl.ppm
#$renWin SaveImageAsPPM
# prevent the tk window from showing up then start the event loop
wm withdraw .
......
catch {load vtktcl}
# generate four hyperstreamlines
# get the supporting scripts
......@@ -5,164 +6,164 @@ source vtkInt.tcl
source vtkInclude.tcl
# create tensor ellipsoids
vtkRenderMaster rm;
vtkRenderMaster rm
# Now create the RenderWindow, Renderer and interactive renderer
#
set renWin [rm MakeRenderWindow];
set ren1 [$renWin MakeRenderer];
set iren [$renWin MakeRenderWindowInteractor];
set renWin [rm MakeRenderWindow]
set ren1 [$renWin MakeRenderer]
set iren [$renWin MakeRenderWindowInteractor]
#
# Create tensor ellipsoids
#
# generate tensors
vtkPointLoad ptLoad;
ptLoad SetLoadValue 100.0;
ptLoad SetSampleDimensions 30 30 30;
ptLoad ComputeEffectiveStressOn;
ptLoad SetModelBounds -10 10 -10 10 -10 10;
vtkPointLoad ptLoad
ptLoad SetLoadValue 100.0
ptLoad SetSampleDimensions 30 30 30
ptLoad ComputeEffectiveStressOn
ptLoad SetModelBounds -10 10 -10 10 -10 10
# Generate hyperstreamlines
vtkHyperStreamline s1;
s1 SetInput [ptLoad GetOutput];
s1 SetStartPosition 9 9 -9;
s1 IntegrateMinorEigenvector;
s1 SetMaximumPropagationDistance 18.0;
s1 SetIntegrationStepLength 0.1;
s1 SetStepLength 0.01;
s1 SetRadius 0.25;
s1 SetNumberOfSides 18;
s1 SetIntegrationDirection $VTK_INTEGRATE_BOTH_DIRECTIONS;
s1 Update;
vtkHyperStreamline s1
s1 SetInput [ptLoad GetOutput]
s1 SetStartPosition 9 9 -9
s1 IntegrateMinorEigenvector
s1 SetMaximumPropagationDistance 18.0
s1 SetIntegrationStepLength 0.1
s1 SetStepLength 0.01
s1 SetRadius 0.25
s1 SetNumberOfSides 18
s1 SetIntegrationDirection $VTK_INTEGRATE_BOTH_DIRECTIONS
s1 Update
# Map hyperstreamlines
vtkLogLookupTable lut;
lut SetHueRange .6667 0.0;
vtkPolyMapper s1Mapper;
s1Mapper SetInput [s1 GetOutput];
s1Mapper SetLookupTable lut;
vtkLogLookupTable lut
lut SetHueRange .6667 0.0
vtkPolyMapper s1Mapper
s1Mapper SetInput [s1 GetOutput]
s1Mapper SetLookupTable lut
ptLoad Update;#force update for scalar range
eval s1Mapper SetScalarRange [[ptLoad GetOutput] GetScalarRange];
vtkActor s1Actor;
s1Actor SetMapper s1Mapper;
eval s1Mapper SetScalarRange [[ptLoad GetOutput] GetScalarRange]
vtkActor s1Actor
s1Actor SetMapper s1Mapper
vtkHyperStreamline s2;
s2 SetInput [ptLoad GetOutput];
s2 SetStartPosition -9 -9 -9;
s2 IntegrateMinorEigenvector;
s2 SetMaximumPropagationDistance 18.0;
s2 SetIntegrationStepLength 0.1;
s2 SetStepLength 0.01;
s2 SetRadius 0.25;
s2 SetNumberOfSides 18;
s2 SetIntegrationDirection $VTK_INTEGRATE_BOTH_DIRECTIONS;
s2 Update;
vtkPolyMapper s2Mapper;
s2Mapper SetInput [s2 GetOutput];
s2Mapper SetLookupTable lut;
vtkHyperStreamline s2
s2 SetInput [ptLoad GetOutput]
s2 SetStartPosition -9 -9 -9
s2 IntegrateMinorEigenvector
s2 SetMaximumPropagationDistance 18.0
s2 SetIntegrationStepLength 0.1
s2 SetStepLength 0.01
s2 SetRadius 0.25
s2 SetNumberOfSides 18
s2 SetIntegrationDirection $VTK_INTEGRATE_BOTH_DIRECTIONS
s2 Update
vtkPolyMapper s2Mapper
s2Mapper SetInput [s2 GetOutput]
s2Mapper SetLookupTable lut
ptLoad Update;#force update for scalar range
eval s2Mapper SetScalarRange [[ptLoad GetOutput] GetScalarRange];
vtkActor s2Actor;
s2Actor SetMapper s2Mapper;
eval s2Mapper SetScalarRange [[ptLoad GetOutput] GetScalarRange]
vtkActor s2Actor
s2Actor SetMapper s2Mapper
vtkHyperStreamline s3;
s3 SetInput [ptLoad GetOutput];
s3 SetStartPosition 9 -9 -9;
s3 IntegrateMinorEigenvector;
s3 SetMaximumPropagationDistance 18.0;