catch {load vtktcl} # get the interactor ui source vtkInt.tcl source colors.tcl vtkRenderer ren1 vtkRenderWindow renWin renWin AddRenderer ren1 vtkRenderWindowInteractor iren iren SetRenderWindow renWin # read data # vtkStructuredGridReader reader reader SetFileName "office.vtk" reader Update;#force a read to occur reader SetScalarsName "c19" vtkStructuredGridReader reader2 reader2 SetFileName "office.vtk" reader2 Update; reader2 SetScalarsName "p1" set length [[reader GetOutput] GetLength] set maxVelocity [[[[reader GetOutput] GetPointData] GetVectors] GetMaxNorm] set maxTime [expr 35.0 * $length / $maxVelocity] vtkStructuredGridGeometryFilter table1 table1 SetInput [reader GetOutput] table1 SetExtent 11 15 7 9 8 8 vtkPolyDataMapper mapTable1 mapTable1 SetInput [table1 GetOutput] mapTable1 ScalarVisibilityOn vtkActor table1Actor table1Actor SetMapper mapTable1 [table1Actor GetProperty] SetColor .59 .427 .392 vtkStructuredGridGeometryFilter table2 table2 SetInput [reader GetOutput] table2 SetExtent 11 15 10 12 8 8 vtkPolyDataMapper mapTable2 mapTable2 SetInput [table2 GetOutput] mapTable2 ScalarVisibilityOn vtkActor table2Actor table2Actor SetMapper mapTable2 [table2Actor GetProperty] SetColor .59 .427 .392 vtkStructuredGridGeometryFilter FilingCabinet1 FilingCabinet1 SetInput [reader GetOutput] FilingCabinet1 SetExtent 15 15 7 9 0 8 vtkPolyDataMapper mapFilingCabinet1 mapFilingCabinet1 SetInput [FilingCabinet1 GetOutput] mapFilingCabinet1 ScalarVisibilityOn vtkActor FilingCabinet1Actor FilingCabinet1Actor SetMapper mapFilingCabinet1 [FilingCabinet1Actor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter FilingCabinet2 FilingCabinet2 SetInput [reader GetOutput] FilingCabinet2 SetExtent 15 15 10 12 0 8 vtkPolyDataMapper mapFilingCabinet2 mapFilingCabinet2 SetInput [FilingCabinet2 GetOutput] mapFilingCabinet2 ScalarVisibilityOn vtkActor FilingCabinet2Actor FilingCabinet2Actor SetMapper mapFilingCabinet2 [FilingCabinet2Actor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf1Top bookshelf1Top SetInput [reader GetOutput] bookshelf1Top SetExtent 13 13 0 4 0 11 vtkPolyDataMapper mapBookshelf1Top mapBookshelf1Top SetInput [bookshelf1Top GetOutput] mapBookshelf1Top ScalarVisibilityOn vtkActor bookshelf1TopActor bookshelf1TopActor SetMapper mapBookshelf1Top [bookshelf1TopActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf1Bottom bookshelf1Bottom SetInput [reader GetOutput] bookshelf1Bottom SetExtent 20 20 0 4 0 11 vtkPolyDataMapper mapBookshelf1Bottom mapBookshelf1Bottom SetInput [bookshelf1Bottom GetOutput] mapBookshelf1Bottom ScalarVisibilityOn vtkActor bookshelf1BottomActor bookshelf1BottomActor SetMapper mapBookshelf1Bottom [bookshelf1BottomActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf1Front bookshelf1Front SetInput [reader GetOutput] bookshelf1Front SetExtent 13 20 0 0 0 11 vtkPolyDataMapper mapBookshelf1Front mapBookshelf1Front SetInput [bookshelf1Front GetOutput] mapBookshelf1Front ScalarVisibilityOn vtkActor bookshelf1FrontActor bookshelf1FrontActor SetMapper mapBookshelf1Front [bookshelf1FrontActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf1Back bookshelf1Back SetInput [reader GetOutput] bookshelf1Back SetExtent 13 20 4 4 0 11 vtkPolyDataMapper mapBookshelf1Back mapBookshelf1Back SetInput [bookshelf1Back GetOutput] mapBookshelf1Back ScalarVisibilityOn vtkActor bookshelf1BackActor bookshelf1BackActor SetMapper mapBookshelf1Back [bookshelf1BackActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf1LHS bookshelf1LHS SetInput [reader GetOutput] bookshelf1LHS SetExtent 13 20 0 4 0 0 vtkPolyDataMapper mapBookshelf1LHS mapBookshelf1LHS SetInput [bookshelf1LHS GetOutput] mapBookshelf1LHS ScalarVisibilityOn vtkActor bookshelf1LHSActor bookshelf1LHSActor SetMapper mapBookshelf1LHS [bookshelf1LHSActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf1RHS bookshelf1RHS SetInput [reader GetOutput] bookshelf1RHS SetExtent 13 20 0 4 11 11 vtkPolyDataMapper mapBookshelf1RHS mapBookshelf1RHS SetInput [bookshelf1RHS GetOutput] mapBookshelf1RHS ScalarVisibilityOn vtkActor bookshelf1RHSActor bookshelf1RHSActor SetMapper mapBookshelf1RHS [bookshelf1RHSActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf2Top bookshelf2Top SetInput [reader GetOutput] bookshelf2Top SetExtent 13 13 15 19 0 11 # begin_of_the_skype_highlighting 13 13 15 19 0 11 # end_of_the_skype_highlighting vtkPolyDataMapper mapBookshelf2Top mapBookshelf2Top SetInput [bookshelf2Top GetOutput] mapBookshelf2Top ScalarVisibilityOn vtkActor bookshelf2TopActor bookshelf2TopActor SetMapper mapBookshelf2Top [bookshelf2TopActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf2Bottom bookshelf2Bottom SetInput [reader GetOutput] bookshelf2Bottom SetExtent 20 20 15 19 0 11 vtkPolyDataMapper mapBookshelf2Bottom mapBookshelf2Bottom SetInput [bookshelf2Bottom GetOutput] mapBookshelf2Bottom ScalarVisibilityOn vtkActor bookshelf2BottomActor bookshelf2BottomActor SetMapper mapBookshelf2Bottom [bookshelf2BottomActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf2Front bookshelf2Front SetInput [reader GetOutput] bookshelf2Front SetExtent 13 20 15 15 0 11 # begin_of_the_skype_highlighting 13 20 15 15 0 11 end_of_the_skype_highlighting vtkPolyDataMapper mapBookshelf2Front mapBookshelf2Front SetInput [bookshelf2Front GetOutput] mapBookshelf2Front ScalarVisibilityOn vtkActor bookshelf2FrontActor bookshelf2FrontActor SetMapper mapBookshelf2Front [bookshelf2FrontActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf2Back bookshelf2Back SetInput [reader GetOutput] bookshelf2Back SetExtent 13 20 19 19 0 11 # begin_of_the_skype_highlighting 13 20 19 19 0 11 end_of_the_skype_highlighting vtkPolyDataMapper mapBookshelf2Back mapBookshelf2Back SetInput [bookshelf2Back GetOutput] mapBookshelf2Back ScalarVisibilityOn vtkActor bookshelf2BackActor bookshelf2BackActor SetMapper mapBookshelf2Back [bookshelf2BackActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf2LHS bookshelf2LHS SetInput [reader GetOutput] bookshelf2LHS SetExtent 13 20 15 19 0 0 vtkPolyDataMapper mapBookshelf2LHS mapBookshelf2LHS SetInput [bookshelf2LHS GetOutput] mapBookshelf2LHS ScalarVisibilityOn vtkActor bookshelf2LHSActor bookshelf2LHSActor SetMapper mapBookshelf2LHS [bookshelf2LHSActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter bookshelf2RHS bookshelf2RHS SetInput [reader GetOutput] bookshelf2RHS SetExtent 13 20 15 19 11 11 vtkPolyDataMapper mapBookshelf2RHS mapBookshelf2RHS SetInput [bookshelf2RHS GetOutput] mapBookshelf2RHS ScalarVisibilityOn vtkActor bookshelf2RHSActor bookshelf2RHSActor SetMapper mapBookshelf2RHS [bookshelf2RHSActor GetProperty] SetColor .8 .8 .6 vtkStructuredGridGeometryFilter window window SetInput [reader GetOutput] window SetExtent 20 20 6 13 10 13 vtkPolyDataMapper mapWindow mapWindow SetInput [window GetOutput] mapWindow ScalarVisibilityOn vtkActor windowActor windowActor SetMapper mapWindow [windowActor GetProperty] SetColor .3 .3 .5 vtkStructuredGridGeometryFilter outlet outlet SetInput [reader GetOutput] outlet SetExtent 0 0 9 10 14 16 vtkPolyDataMapper mapOutlet mapOutlet SetInput [outlet GetOutput] mapOutlet ScalarVisibilityOn vtkActor outletActor outletActor SetMapper mapOutlet [outletActor GetProperty] SetColor 0 0 0 vtkStructuredGridGeometryFilter inlet inlet SetInput [reader GetOutput] inlet SetExtent 0 0 9 10 0 6 vtkPolyDataMapper mapInlet mapInlet SetInput [inlet GetOutput] mapInlet ScalarVisibilityOn vtkActor inletActor inletActor SetMapper mapInlet [inletActor GetProperty] SetColor 0 0 0 vtkStructuredGridOutlineFilter outline outline SetInput [reader GetOutput] vtkPolyDataMapper mapOutline mapOutline SetInput [outline GetOutput] vtkActor outlineActor outlineActor SetMapper mapOutline [outlineActor GetProperty] SetColor 0 0 0 # Create source for streamtubes vtkPointSource seeds seeds SetRadius 0.075 eval seeds SetCenter 0.1 2.7 0.5 seeds SetNumberOfPoints 25 vtkStreamLine streamers streamers SetInput [reader GetOutput] streamers SetSource [seeds GetOutput] streamers SetMaximumPropagationTime 1500 streamers SetStepLength 0.1 streamers Update ############# # isocontur # ############# vtkContourFilter iso iso SetInput [reader GetOutput] iso ComputeNormalsOn iso SetValue 0 25 iso GenerateValues 5 25 35 vtkPolyDataMapper isoMapper isoMapper SetInput [iso GetOutput] isoMapper ScalarVisibilityOn vtkProperty isoProp isoProp SetOpacity 0.15 vtkActor isoActor isoActor SetMapper isoMapper isoActor SetProperty isoProp ################################### # distributia aerului in incapere # ################################### vtkArrowSource arrow arrow SetTipResolution 6 arrow SetTipRadius 0.1 arrow SetTipLength 0.35 arrow SetShaftResolution 6 arrow SetShaftRadius 0.05 vtkMaskPoints gFilter gFilter SetInput [reader GetOutput] gFilter SetRandomMode 1 gFilter SetMaximumNumberOfPoints 1000 vtkGlyph3D glyph glyph SetInput [gFilter GetOutput] glyph SetSource [arrow GetOutput] glyph SetVectorModeToUseVector glyph SetColorModeToColorByScalar glyph SetScaleMode 1 glyph OrientOn glyph SetScaleFactor 2 vtkPolyDataMapper glyphMapper glyphMapper SetInput [glyph GetOutput] glyphMapper ScalarVisibilityOn eval glyphMapper SetScalarRange [[reader GetOutput] GetScalarRange] vtkActor airActor airActor SetMapper glyphMapper ########## # cutter # ########## vtkPlane plane plane SetOrigin 2.5 2.5 0.2 plane SetNormal 0.7 -0.1 -0.7 vtkCutter planeCut planeCut SetInput [reader2 GetOutput] planeCut SetCutFunction plane vtkPolyDataMapper cutMapper cutMapper SetInput [planeCut GetOutput] eval cutMapper SetScalarRange [[[[reader2 GetOutput] GetPointData] GetScalars] GetRange] vtkActor cutActor cutActor SetMapper cutMapper ########### # clipper # ########### vtkPlane clipPlane clipPlane SetOrigin 1.5 2.5 0.2 clipPlane SetNormal 0.7 -0.1 -0.7 vtkClipPolyData clipper clipper SetInput [iso GetOutput] clipper SetClipFunction clipPlane clipper GenerateClipScalarsOn clipper SetValue 0.0 vtkPolyDataMapper clipMapper clipMapper SetInput [clipper GetOutput] clipMapper ScalarVisibilityOff vtkProperty backProp eval backProp SetDiffuseColor $coral vtkActor clipActor clipActor SetMapper clipMapper eval [clipActor GetProperty] SetColor $peacock clipActor SetBackfaceProperty backProp ############################### # multiple tubes for air flow # ############################### vtkPointSource tubeSeeds tubeSeeds SetRadius 0.15 eval tubeSeeds SetCenter 0.1 2.1 0.5 tubeSeeds SetNumberOfPoints 6 vtkRungeKutta4 integ vtkStreamTracer streamer streamer SetInput [reader GetOutput] streamer SetSource [tubeSeeds GetOutput] streamer SetMaximumPropagation 500 streamer SetInitialIntegrationStep 0.05 streamer SetIntegrationDirectionToBoth streamer SetIntegrator integ vtkTubeFilter streamTube streamTube SetInput [streamer GetOutput] streamTube SetInputArrayToProcess 1 0 0 vtkDataObject::FIELD_ASSOCIATION_POINTS vectors streamTube SetRadius 0.02 streamTube SetNumberOfSides 12 streamTube SetVaryRadiusToVaryRadiusByVector vtkPolyDataMapper mapStreamTube mapStreamTube SetInput [streamTube GetOutput] eval mapStreamTube SetScalarRange \ [[[[reader GetOutput] GetPointData] GetScalars] GetRange] vtkActor streamTubeActor streamTubeActor SetMapper mapStreamTube [streamTubeActor GetProperty] BackfaceCullingOn ########################################## vtkPolyDataMapper mapStreamers mapStreamers SetInput [streamers GetOutput] eval mapStreamers SetScalarRange [[[[reader GetOutput] GetPointData] GetScalars] GetRange] vtkActor streamersActor streamersActor SetMapper mapStreamers ren1 AddActor table1Actor ren1 AddActor table2Actor ren1 AddActor FilingCabinet1Actor ren1 AddActor FilingCabinet2Actor ren1 AddActor bookshelf1TopActor ren1 AddActor bookshelf1BottomActor ren1 AddActor bookshelf1FrontActor ren1 AddActor bookshelf1BackActor ren1 AddActor bookshelf1LHSActor ren1 AddActor bookshelf1RHSActor ren1 AddActor bookshelf2TopActor ren1 AddActor bookshelf2BottomActor ren1 AddActor bookshelf2FrontActor ren1 AddActor bookshelf2BackActor ren1 AddActor bookshelf2LHSActor ren1 AddActor bookshelf2RHSActor ren1 AddActor windowActor ren1 AddActor outletActor ren1 AddActor inletActor ren1 AddActor outlineActor ren1 AddActor streamersActor ren1 AddActor streamTubeActor ren1 AddActor isoActor ren1 AddActor airActor ren1 AddActor cutActor ren1 AddActor clipActor eval ren1 SetBackground $slate_grey vtkCamera aCamera aCamera SetClippingRange 0.726079 36.3039 aCamera SetFocalPoint 2.43584 2.15046 1.11104 aCamera SetPosition -4.76183 -10.4426 3.17203 aCamera ComputeViewPlaneNormal aCamera SetViewUp 0.0511273 0.132773 0.989827 aCamera SetViewAngle 18.604 aCamera Zoom 1.2 ren1 SetActiveCamera aCamera renWin SetSize 500 300 # iren SetUserMethod {wm deiconify .vtkInteract} iren Initialize #renWin SetFileName "office.tcl.ppm" #renWin SaveImageAsPPM # interact with data wm withdraw .