# Avizo-Script-Object V3.0 # NO DEPRECATION WARNING ############################################################## # Copy Transformation # # Copy transformation of reference to data. # # author: Amouda Joseph (ajoseph@fei.com) # (C) copyright 2015, FEI, SAS # ############################################################## # The Constructor is called when a scro is created or restarted "$this" proc constructor {} { "$this" newPortConnection reference HxSpatialData "$this" reference setLabel "Reference" "$this" newPortDoIt doit "$this" script hide } # The "compute" method is called whenever a port has changed "$this" proc compute {} { # Check if the button Apply was hit. Nothing is done if it was not. if { ![$this doit wasHit 0] } { return } # If no data is specified at Data port, the message "please connect a Spatial Data" is displayed set dataObject ["$this" data source] if { $dataObject == "" } { echo "Please connect a Spatial Data object to the Data port" return } # If no data is specified at Reference port, the message "please connect a Spatial Data" is displayed set referenceObject ["$this" reference source] if { $referenceObject == "" } { echo "Please connect a Spatial Data object to the Reference Transformation port" return } # Get the Reference's transformation set transformation [$referenceObject getTransform] # Apply the transformation to Data eval $dataObject setTransform $transformation "$this" recordInputUpdateInHistoryLog data }