package require java
proc graphicalEllipsoid { formHandle } {
$formHandle hide
global sec_axis
global third_axis
global first_axis_rotation
global sec_axis_rotation
global third_axis_rotation
global rotationTypes
set visualiserForm [java::new com.surpac.gui.VisualiserForm 1]
$visualiserForm setSecAxis [$formHandle getField sec_axis]
$visualiserForm setThirdAxis [$formHandle getField third_axis]
$visualiserForm setFirstAxisRotation [$formHandle getField first_axis_rotation]
$visualiserForm setSectAxisRotation [$formHandle getField sec_axis_rotation]
$visualiserForm setThirdAxisRotation [$formHandle getField third_axis_rotation]
$visualiserForm setMajorSemi [$formHandle getField semimajfact]
$visualiserForm setMajorMinor [$formHandle getField minorfact]
$visualiserForm setMaxDistance [$formHandle getField majordist]
$visualiserForm setBearing [$formHandle getField majorbrg]
$visualiserForm setDip [$formHandle getField dip ]
$visualiserForm setPlunge [$formHandle getField tilt]
$visualiserForm setRotationConvention [$formHandle getField rotationTypes]
$visualiserForm interactFrame
if {[$visualiserForm getReturnStatus] == 1 } {
$formHandle setField semimajfact [$visualiserForm getMajorSemi]
$formHandle setField minorfact [$visualiserForm getMajorMinor]
$formHandle setField majordist [$visualiserForm getDist]
$formHandle setField majorbrg [$visualiserForm getBrg]
$formHandle setField tilt [$visualiserForm getPlunge]
$formHandle setField dip [$visualiserForm getDip]
$formHandle setField sec_axis [$visualiserForm getSecAxis]
$formHandle setField third_axis [$visualiserForm getThirdAxis]
$formHandle setField first_axis_rotation [$visualiserForm getFirstAxisRotation]
$formHandle setField sec_axis_rotation [$visualiserForm getSecAxisRotation]
$formHandle setField third_axis_rotation [$visualiserForm getThirdAxisRotation]
$formHandle setField rotationTypes [$visualiserForm getRotationConvention]
third_axis_change "[$third_axis getCurrentValue]"
}
$visualiserForm destroyFrame
$formHandle show
}
proc sec_axis_change {axis} {
global third_axis
global sec_axis
global rb3_x
global rb3_y
global rb3_z
if { [string compare $axis "X"] == 0} {
$rb3_x setInputAllowed false
$rb3_y setInputAllowed true
if { [string compare "[$third_axis getCurrentValue]" "X"] == 0} {
$third_axis setCurrentValue "Y"
}
} else {
$rb3_x setInputAllowed true
$rb3_y setInputAllowed false
if { [string compare "[$third_axis getCurrentValue]" "Y"] == 0} {
$third_axis setCurrentValue "X"
}
}
}
proc third_axis_change { axis} {
global plunge_pitch
global DipLB
if { [string compare $axis "Z"] != 0} {
$plunge_pitch setLabel "Plunge"
$DipLB setLabel "Dip"
} else {
$plunge_pitch setLabel "Dip"
$DipLB setLabel "Pitch"
}
}
proc rotationConvention {} {
global rotationTypes
global sec_axis
global third_axis
global first_axis_rotation
global sec_axis_rotation
global third_axis_rotation
global rb_z
global rb2_x
global rb2_y
global rb3_x
global rb3_y
global rb3_z
global first_rot_L
global first_rot_R
global sec_rot_L
global sec_rot_R
global third_rot_L
global third_rot_R
global tilt
global plunge_pitch
global DipLB
set rotConvet [$rotationTypes getCurrentValue]
set zposition [string first "Z" $rotConvet]
if {$zposition == -1} {
set rotConvet "Surpac ZXY LRL"
set zposition [string first "Z" $rotConvet]
$rb_z  setInputAllowed true
$rb2_x setInputAllowed true
$rb2_y setInputAllowed true
$rb3_y setInputAllowed true
$rb3_z setInputAllowed true
$first_rot_L setInputAllowed true
$first_rot_R setInputAllowed true
$sec_rot_L setInputAllowed true
$sec_rot_R setInputAllowed true
$third_rot_L setInputAllowed true
$third_rot_R setInputAllowed true
} else {
$rb_z  setInputAllowed false
$rb2_x setInputAllowed false
$rb2_y setInputAllowed false
$rb3_x setInputAllowed false
$rb3_y setInputAllowed false
$rb3_z setInputAllowed false
$first_rot_L setInputAllowed false
$first_rot_R setInputAllowed false
$sec_rot_L setInputAllowed false
$sec_rot_R setInputAllowed false
$third_rot_L setInputAllowed false
$third_rot_R setInputAllowed false
}
set num [expr $zposition + 1]
if {[string compare [string index $rotConvet $num] "X"] == 0} {
$sec_axis setCurrentValue "X"
} else {
$sec_axis setCurrentValue "Y"
}
set num [expr $num + 1]
if {[string compare [string index $rotConvet $num] "X"] == 0} {
$third_axis setCurrentValue "X"
$plunge_pitch setLabel "Plunge"
$DipLB setLabel "Dip"
} elseif {[string compare [string index $rotConvet $num] "Y"] == 0} {
$third_axis setCurrentValue "Y"
$plunge_pitch setLabel "Plunge"
$DipLB setLabel "Dip"
} else {
$third_axis setCurrentValue "Z"
$plunge_pitch setLabel "Dip"
$DipLB setLabel "Pitch"
}
set num [expr $num + 2]
if {[string compare [string index $rotConvet $num] "L"] == 0} {
$first_axis_rotation setCurrentValue "L"
} else {
$first_axis_rotation setCurrentValue "R"
}
set num [expr $num + 1]
if {[string compare [string index $rotConvet $num] "L"] == 0} {
$sec_axis_rotation setCurrentValue "L"
} else {
$sec_axis_rotation setCurrentValue "R"
}
set num [expr $num + 1]
if {[string compare [string index $rotConvet $num] "L"] == 0} {
$third_axis_rotation setCurrentValue "L"
} else {
$third_axis_rotation setCurrentValue "R"
}
}
GuidoForm frm20081 {
-default_buttons
-label "Nearest Neighbour Search Parameters"
-layout BoxLayout Y_AXIS
-tip "20081_TIP_001"
GuidoPanel frm20081_23 {
-layout CentreLineLayout
GuidoFiller frm20081_21 {
-height 1
}
GuidoFiller frm20081_22 {
-height 1
}
GuidoField majordist {
-display_length 10
-format double
-label "Maximum search radius"
-max_length 16
-null false
-tip "20081_TIP_003"
}
GuidoField vertdist {
-default 9999
-display_length 10
-format double
-label "Maximum vertical search distance"
-max_length 16
-null false
-tip "20081_TIP_004"
}
}
GuidoFiller frm20081_24 {
-height 1
}
GuidoPanel frm20081_25 {
-border etched true
-label "Search Ellipsoid Specifications"
-layout BoxLayout Y_AXIS
GuidoPanel frm20081_20_1 {
-layout BoxLayout X_AXIS
GuidoPanel frm20081_20 {
-border etched true
-label "Ellipsoid Orientation"
-layout CentreLineLayout
GuidoField majorbrg {
-default 0
-display_length 6
-format double
-label "Bearing"
-high_bound 360.000000
-low_bound 0.000000
-max_length 6
-null false
-tip GST_KRIG_HELP
}
GuidoLabel plunge_pitch {
-label "Plunge"
}
GuidoField tilt {
-default 0
-display_length 6
-format double
-high_bound 90.000000
-low_bound -90.000000
-max_length 6
-next_focus dip
-null false
-tip GST_KRIG_HELP
}
GuidoLabel DipLB {
-label "Dip"
}
GuidoField dip {
-default 0
-display_length 6
-format double
-high_bound 90.000000
-low_bound -90.000000
-max_length 6
-next_focus semimajfact
-null false
-tip GST_KRIG_HELP
}
}
GuidoPanel ANISOTROPY_panel {
-border etched true
-label "Anisotropy Ratios"
-layout CentreLineLayout
GuidoField semimajfact {
-default 1
-display_length 5
-format double
-label "major / semi-major"
-max_length 5
-next_focus minorfact
-null false
-tip GST_KRIG_HELP
}
GuidoField minorfact {
-default 1
-display_length 5
-format double
-label "major / minor"
-max_length 5
-null false
-tip GST_KRIG_HELP
}
GuidoFiller f0 {
-height 1
}
}
}
GuidoFiller f1 {
-height 1
}
GuidoPanel axisRotationtypes {
-layout BoxLayout Y_AXIS
GuidoPanel p0 {
-layout CentreLineLayout
GuidoComboBox rotationTypes {
-format none
-label "Rotation Convention"
-null false
-value_in  "Surpac ZXY LRL" "Geology ZYZ LLL" "DataMine ZXY LLL" "Gemcom 1 ZXZ RRR" "Gemcom 2 ZYZ RRR" "GSLIB ZXY LRR"  "MapTek ZXY LRL"  "Medsystems ZXY LRL" "Other"
-action valueChanged  {[rotationConvention ]}
-help    ROTATION_CONV_TIP
}
}
GuidoPanel axis {
-layout BoxLayout X_AXIS
GuidoPanel first_axis_with_rotation {
-border etched true
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel first_axis {
-layout BoxLayout X_AXIS
-tip "Bearing"
GuidoRadioButton rb_z {
-caption Z
-selected_value Z
-default true
-input false
-help ELLIP_1ST_AXIS_TIP
}
}
GuidoButtonGroupPanel first_axis_rotation {
-layout BoxLayout X_AXIS
GuidoRadioButton first_rot_L {
-caption "L"
-selected_value "L"
-default true
-input false
-help ELLIP_1ST_AXIS_LEFT_ROT_TOOLTIP
}
GuidoRadioButton first_rot_R {
-caption "R"
-selected_value "R"
-input false
-help ELLIP_1ST_AXIS_RIGHT_ROT_TOOLTIP
}
}
}
GuidoFiller spacer {
-width 0.05
}
GuidoPanel sec_axis_with_rotation {
-border etched true
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel sec_axis {
-layout BoxLayout X_AXIS
GuidoRadioButton rb2_x {
-caption "X"
-selected_value "X"
-default true
-action mouseClicked {[sec_axis_change "X"]}
-input false
-help ELLIP_2ND_X_AXIS_TIP
}
GuidoRadioButton rb2_y {
-caption Y
-selected_value "Y"
-action mouseClicked {[sec_axis_change "Y"]}
-input false
-help ELLIP_2ND_Y_AXIS_TIP
}
}
GuidoButtonGroupPanel sec_axis_rotation {
-layout BoxLayout X_AXIS
GuidoRadioButton sec_rot_L {
-caption "L"
-selected_value "L"
-input false
-help ELLIP_2ND_AXIS_LEFT_ROT_TOOLTIP
}
GuidoRadioButton sec_rot_R {
-caption "R"
-selected_value "R"
-default true
-input false
-help ELLIP_2ND_AXIS_RIGHT_ROT_TOOLTIP
}
}
}
GuidoFiller spacer {
-width 0.05
}
GuidoPanel third_axis_with_rotation {
-border etched true
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel third_axis {
-layout BoxLayout X_AXIS
GuidoRadioButton rb3_x {
-caption "X"
-selected_value "X"
-input false
-action mouseClicked {[third_axis_change "X"]}
-input false
-help ELLIP_3RD_X_AXIS_TIP
}
GuidoRadioButton rb3_y {
-caption "Y"
-selected_value "Y"
-default true
-action mouseClicked {[third_axis_change "Y"]}
-input false
-help ELLIP_3RD_Y_AXIS_TIP
}
GuidoRadioButton rb3_z {
-caption "Z"
-selected_value "Z"
-action mouseClicked {[third_axis_change "Z"]}
-input false
-help ELLIP_3RD_Z_AXIS_TIP
}
}
GuidoButtonGroupPanel third_axis_rotation {
-layout BoxLayout X_AXIS
GuidoRadioButton third_rot_L {
-caption "L"
-selected_value "L"
-default true
-input false
-help ELLIP_3RD_AXIS_LEFT_ROT_TOOLTIP
}
GuidoRadioButton third_rot_R {
-caption "R"
-selected_value "R"
-input false
-help ELLIP_3RD_AXIS_RIGHT_ROT_TOOLTIP
}
}
}
}
}
}
GuidoFiller frm20081_30 {
-height 0.5
}
GuidoPanel frm20081_33 {
-layout BoxLayout X_AXIS
GuidoPanel frm20081_33a {
-layout CentreLineLayout
GuidoCheckBox constrain {
-default false
-label "Constrain interpolation?"
-selected_value Y
-tip "20081_TIP_011"
-unselected_value N
}
GuidoFileBrowserField outfile {
-display_length 18
-file_mask reports|*.not
-format none
-label "REPORT_FILE_NAME"
-max_length 256
-next_focus constrain
-tip "REPORT_FILE_NAME_TIP"
-extension false
-file_access write
}
GuidoComboBox report_format {
-label "Format"
-display_length 16
-null false
-tip "The file format nominated here will be the output report format."
-value_in ".not - Surpac Note File" ".csv - Comma Separated (Spreadsheet)" ".htm - Hypertext Markup Language (Web)" ".html - Hypertext Markup Language (Web)" ".rtf - Rich Text Format (Microsoft Word)" ".pdf - Adobe Acrobat" ".ps - Postscript" ".log - Surpac log file"
}
}
}
GuidoFiller frm20081_31 {
-height 0.5
}
GuidoPanel evPanel {
-layout BoxLayout Y_AXIS
GuidoFiller ev1_1 {
-height 0.2
}
GuidoPanel evPanel2 {
-layout FlowLayout
GuidoButton visualiser {
-caption "Ellipsoid Visualiser"
-action valueChanged {[graphicalEllipsoid $frm20081]}
-tip "A Visual Representation of the Search Ellipsoid"
}
}
GuidoFiller ev1_2 {
-height 0.2
}
}
}
