Changeset 3986


Ignore:
Timestamp:
Oct 3, 2013 12:03:17 PM (11 years ago)
Author:
gah
Message:

add RAPPTURE_PATH variable to use and env scripts.

Location:
trunk/gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/rappture-csh.env.in

    r3177 r3986  
    105105  setenv R_LIBS "${libdir}/R"
    106106endif
     107
     108setenv RAPPTURE_PATH "${exec_prefix}"
  • trunk/gui/apps/rappture.env.in

    r3330 r3986  
    6060
    6161export R_LIBS
     62
     63RAPPTURE_PATH=${exec_prefix}
     64
     65export RAPPTURE_PATH
  • trunk/gui/apps/rappture.use.in

    r3330 r3986  
    3535prepend R_LIBS ${libdir}/R
    3636
     37setenv RAPPTURE_PATH ${exec_prefix}
     38
    3739tags DEVEL
  • trunk/gui/scripts/vtkvolumeviewer.tcl

    r3984 r3986  
    6464    public method updateTransferFunctions {}
    6565
    66     private method SetOrientation { side }
    67     private method HideAllMarkers {}
    68     private method GetColormap { cname color }
    69     private method ResetColormap { cname color }
    70     private method InitComponentSettings { cname }
    71     private method SwitchComponent { cname }
    72     private method GetDatasetsWithComponent { cname }
     66    private method BuildVolumeComponents {}
    7367    private method ComputeAlphamap { cname }
    7468    private method ComputeTransferFunction { cname }
    75     private method SetInitialTransferFunction { dataobj cname }
    76     private method SendTransferFunctions {}
     69    private method GetColormap { cname color }
     70    private method GetDatasetsWithComponent { cname }
     71    private method HideAllMarkers {}
     72    private method InitComponentSettings { cname }
    7773    private method ParseLevelsOption { cname levels }
    7874    private method ParseMarkersOption { cname markers }
    79     private method BuildVolumeComponents {}
     75    private method ResetColormap { cname color }
     76    private method SendTransferFunctions {}
     77    private method SetInitialTransferFunction { dataobj cname }
     78    private method SetOrientation { side }
     79    private method SwitchComponent { cname }
    8080
    8181    private variable _current "";       # Currently selected component
     
    110110    private method BuildAxisTab {}
    111111    private method BuildCameraTab {}
    112     private method BuildColormap { name colors }
    113112    private method BuildCutplaneTab {}
    114113    private method BuildDownloadPopup { widget command }
     
    129128    private method PanCamera {}
    130129    private method RequestLegend {}
    131     private method SetColormap { dataobj comp }
    132     private method ChangeColormap { dataobj comp color }
    133130    private method SetLegendTip { x y }
    134131    private method SetObjectStyle { dataobj comp }
     
    249246        cutplaneLighting        1
    250247        cutplaneOpacity         100
     248        cutplanePositionX       50
     249        cutplanePositionY       50
     250        cutplanePositionZ       50
    251251        cutplaneVisible         0
    252252        cutplaneVisibleX        1
     
    254254        cutplaneVisibleZ        1
    255255        cutplaneWireframe       0
    256         cutplaneXPosition       50
    257         cutplaneYPosition       50
    258         cutplaneZPosition       50
    259256        legendVisible           1
    260257        volumeAmbient           40
     
    13691366        "volumeVisible" {
    13701367            set bool $_settings(volumeVisible)
    1371             foreach dataset [CurrentDatasets -visible] {
    1372                 SendCmd "volume visible $bool $dataset"
     1368            set _settings($cname-volumeVisible)
     1369            foreach tag [GetDatasetsWithComponent $_current] {
     1370                SendCmd "volume visible $bool $tag"
    13731371            }
    13741372            if { $bool } {
     
    13841382            set mode [$itk_component(blendmode) translate $val]
    13851383            set _settings(volumeBlendMode) $mode
    1386             foreach dataset [CurrentDatasets -visible] {
    1387                 SendCmd "volume blendmode $mode $dataset"
     1384            set _settings($cname-volumeBlendMode) $mode
     1385            foreach tag [GetDatasetsWithComponent $_current] {
     1386                SendCmd "volume blendmode $mode $tag"
    13881387            }
    13891388        }
    13901389        "volumeAmbient" {
    13911390            set val $_settings(volumeAmbient)
     1391            set _settings($cname-volumnAmbient) $val
    13921392            set ambient [expr {0.01*$val}]
    1393             foreach dataset [CurrentDatasets -visible] {
    1394                 SendCmd "volume shading ambient $ambient $dataset"
     1393            foreach tag [GetDatasetsWithComponent $_current] {
     1394                SendCmd "volume shading ambient $ambient $tag"
    13951395            }
    13961396        }
    13971397        "volumeDiffuse" {
    13981398            set val $_settings(volumeDiffuse)
     1399            set _settings($cname-volumeDiffuse) $val
    13991400            set diffuse [expr {0.01*$val}]
    1400             foreach dataset [CurrentDatasets -visible] {
    1401                 SendCmd "volume shading diffuse $diffuse $dataset"
     1401            foreach tag [GetDatasetsWithComponent $_current] {
     1402                SendCmd "volume shading diffuse $diffuse $tag"
    14021403            }
    14031404        }
    14041405        "volumeSpecularLevel" - "volumeSpecularExponent" {
    14051406            set val $_settings(volumeSpecularLevel)
    1406             set specularLevel [expr {0.01*$val}]
    1407             set specularExponent $_settings(volumeSpecularExponent)
    1408             foreach dataset [CurrentDatasets -visible] {
    1409                 SendCmd "volume shading specular $specularLevel $specularExponent $dataset"
     1407            set _settings($cname-volumnSpecularLevel) $val
     1408            set level [expr {0.01*$val}]
     1409            set exp $_settings(volumeSpecularExponent)
     1410            foreach tag [GetDatasetsWithComponent $_current] {
     1411                SendCmd "volume shading specular $level $exp $tag"
    14101412            }
    14111413        }
    14121414        "volumeLighting" {
    14131415            set bool $_settings(volumeLighting)
    1414             foreach dataset [CurrentDatasets -visible] {
    1415                 SendCmd "volume lighting $bool $dataset"
     1416            set _settings($cname-volumeLighting) $bool
     1417            foreach tag [GetDatasetsWithComponent $_current] {
     1418                SendCmd "volume lighting $bool $tag"
    14161419            }
    14171420        }
    14181421        "volumeOpacity" {
    14191422            set val $_settings(volumeOpacity)
     1423            set _settings($cname-volumeOpacity) $val
    14201424            set val [expr {0.01*$val}]
    1421             foreach dataset [CurrentDatasets -visible] {
    1422                 SendCmd "volume opacity $val $dataset"
     1425            foreach tag [GetDatasetsWithComponent $_current] {
     1426                SendCmd "volume opacity $val $tag"
    14231427            }
    14241428        }
    14251429        "volumeQuality" {
    14261430            set val $_settings(volumeQuality)
     1431            set _settings($cname-volumeQuality) $val
    14271432            set val [expr {0.01*$val}]
    1428             foreach dataset [CurrentDatasets -visible] {
    1429                 SendCmd "volume quality $val $dataset"
     1433            foreach tag [GetDatasetsWithComponent $_current] {
     1434                SendCmd "volume quality $val $tag"
    14301435            }
    14311436        }
     
    15691574        }
    15701575    }
    1571 }
    1572 
    1573 #
    1574 # ChangeColormap --
    1575 #
    1576 itcl::body Rappture::VtkVolumeViewer::ChangeColormap {dataobj comp color} {
    1577     set tag $dataobj-$comp
    1578     if { ![info exist _style($tag)] } {
    1579         error "no initial colormap"
    1580     }
    1581     array set style $_style($tag)
    1582     set style(-color) $color
    1583     set _style($tag) [array get style]
    1584     SetColormap $dataobj $comp
    1585 }
    1586 
    1587 #
    1588 # SetColormap --
    1589 #
    1590 itcl::body Rappture::VtkVolumeViewer::SetColormap { dataobj comp } {
    1591     array set style {
    1592         -color BCGYR
    1593         -levels 6
    1594         -opacity 1.0
    1595     }
    1596     set tag $dataobj-$comp
    1597     if { ![info exists _initialStyle($tag)] } {
    1598         # Save the initial component style.
    1599         set _initialStyle($tag) [$dataobj style $comp]
    1600     }
    1601 
    1602     # Override defaults with initial style defined in xml.
    1603     array set style $_initialStyle($tag)
    1604 
    1605     if { ![info exists _style($tag)] } {
    1606         set _style($tag) [array get style]
    1607     }
    1608     # Override initial style with current style.
    1609     array set style $_style($tag)
    1610 
    1611     set name "$style(-color):$style(-levels):$style(-opacity)"
    1612     if { ![info exists _colormaps($name)] } {
    1613         BuildColormap $name [array get style]
    1614         set _colormaps($name) 1
    1615     }
    1616     if { ![info exists _dataset2style($tag)] ||
    1617          $_dataset2style($tag) != $name } {
    1618         SendCmd "volume colormap $name $tag"
    1619         SendCmd "cutplane colormap $name-opaque $tag"
    1620         set _dataset2style($tag) $name
    1621     }
    1622 }
    1623 
    1624 #
    1625 # BuildColormap --
    1626 #
    1627 itcl::body Rappture::VtkVolumeViewer::BuildColormap { name styles } {
    1628     array set style $styles
    1629     set cmap [ColorsToColormap $style(-color)]
    1630     if { [llength $cmap] == 0 } {
    1631         set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
    1632     }
    1633     if { ![info exists _settings(volumeOpacity)] } {
    1634         set _settings(volumeOpacity) $style(-opacity)
    1635     }
    1636     set max $_settings(volumeOpacity)
    1637 
    1638     set opaqueWmap "0.0 1.0 1.0 1.0"
    1639     #set wmap "0.0 0.0 0.1 0.0 0.2 0.8 0.98 0.8 0.99 0.0 1.0 0.0"
    1640     # Approximate cubic opacity curve
    1641     set wmap "0.0 0.0 0.1 0.001 0.2 0.008 0.3 0.027 0.4 0.064 0.5 0.125 0.6 0.216 0.7 0.343 0.8 0.512 0.9 0.729 1.0 1.0"
    1642     SendCmd "colormap add $name { $cmap } { $wmap }"
    1643     SendCmd "colormap add $name-opaque { $cmap } { $opaqueWmap }"
    16441576}
    16451577
Note: See TracChangeset for help on using the changeset viewer.