proc values_label_action {definition_method plane_type_field values_label extension start end interval definition_method values last_plane_type looking_north looking_west looking_down} {
if {[$last_plane_type getCurrentValue] != "" && [$plane_type_field getCurrentValue] != [$last_plane_type getCurrentValue]} {
if {[$definition_method getCurrentValue] != "Parallel"} {
set plane_type [$plane_type_field getCurrentValue]
if {$plane_type == "Northing"} {
$values_label setLabel "Northing range"
$extension setCurrentValue  "N"
} elseif {$plane_type == "Easting"} {
$values_label setLabel "Easting range"
$extension setCurrentValue  "E"
} elseif {$plane_type == "Elevation"} {
$values_label setLabel "Elevation range"
$extension setCurrentValue  "El"
} else {
$values_label setLabel "Plane range"
$extension setCurrentValue  "m"
$definition_method setCurrentValue "Specific values"
$values setCurrentValue 0.0
}
if {$plane_type != "Oblique"} {
set odb [GuidoExecServer QuickPlaneRange [subst {type = \"$plane_type\"}]]
$start setCurrentValue [GuidoGetParamBufferValue $odb start]
$end setCurrentValue [GuidoGetParamBufferValue $odb end]
$interval setCurrentValue [GuidoGetParamBufferValue $odb interval]
}
}
}
$last_plane_type setCurrentValue [$plane_type_field getCurrentValue]
}
proc getParallelValues {definition_method plane_type looking_north looking_west start end interval away towards extension save group} {
if {[$definition_method getCurrentValue] == "Parallel"} {
set odb [GuidoExecServer QuickPlaneParallelPlanes {}]
set status [GuidoGetParamBufferValue $odb status]
if {$status == 0} {
$plane_type setCurrentValue [GuidoGetParamBufferValue $odb plane_type]
$looking_north setCurrentValue [GuidoGetParamBufferValue $odb looking_north]
$looking_west setCurrentValue [GuidoGetParamBufferValue $odb looking_west]
$start setCurrentValue [GuidoGetParamBufferValue $odb start]
$end setCurrentValue [GuidoGetParamBufferValue $odb end]
$group setCurrentValue [GuidoGetParamBufferValue $odb group]
$interval setCurrentValue [GuidoGetParamBufferValue $odb interval]
$extension setCurrentValue [GuidoGetParamBufferValue $odb extension]
$save setCurrentValue true
interval_changed $interval $away $towards
}
}
}
proc interval_changed {interval away towards} {
set interval_val [expr abs([$interval getCurrentValue]) / 2.0]
$away setCurrentValue $interval_val
$towards setCurrentValue $interval_val
}
GuidoForm frmQuickPlanes {
-default_buttons
-label "Quick Planes"
-layout BoxLayout Y_AXIS
GuidoPanel orientation {
-layout BoxLayout Y_AXIS
-label "Orientation"
-border etched true
GuidoPanel orientation_panel {
-layout CentreLineLayout
GuidoComboBox plane_type {
-label "Orientation"
-width 12.4
-value_in Northing Easting Elevation Oblique
-alternative_values Northing Easting Elevation Oblique_Quick_Planes
-default Northing
-null false
-exclusive true
-tip QUICK_PLANES_TOOLTIP_1
}
GuidoLabel field_width_1a {
-label "Select the plane definition method"
-visible false
-height 0.1
}
GuidoLabel field_width_1b {
-label ""
-visible false
-height 0.1
-width 15
}
}
GuidoPanel overlay_panel {
-layout OverlayLayout
GuidoPanel overlay_panel_1 {
-layout CentreLineLayout
-dependency {"[ $plane_type getCurrentValue]" == "Northing"}
GuidoComboBox looking_north {
-label "View direction"
-width 12.4
-value_in "Looking north" "Looking south"
-default "Looking north"
-exclusive true
-null false
-tip QUICK_PLANES_TOOLTIP_2
}
GuidoLabel field_width_1c {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
GuidoPanel overlay_panel_2 {
-layout CentreLineLayout
-dependency {"[ $plane_type getCurrentValue]" == "Easting"}
GuidoComboBox looking_west {
-label "View direction"
-width 12.4
-value_in "Looking west" "Looking east"
-default "Looking west"
-exclusive true
-null false
-tip QUICK_PLANES_TOOLTIP_2
}
GuidoLabel field_width_1d {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
GuidoPanel overlay_panel_3 {
-layout CentreLineLayout
-dependency {"[ $plane_type getCurrentValue]" == "Elevation"}
GuidoComboBox looking_down {
-label "View direction"
-width 12.4
-value_in "Looking down"
-exclusive true
-null false
-default "Looking down"
-tip QUICK_PLANES_TOOLTIP_2
}
GuidoLabel field_width_1e {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
GuidoPanel overlay_panel_4 {
-layout CentreLineLayout
-dependency {"[ $plane_type getCurrentValue]" == "Oblique"}
GuidoComboBox oblique_definition_method {
-label "Define using"
-width 12.4
-value_in "Digitised endpoints"
-exclusive true
-null false
-default "Digitised endpoints"
}
GuidoLabel field_width_1f {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
}
}
GuidoPanel plane_positions {
-layout BoxLayout Y_AXIS
-label "Plane positions"
-border etched true
GuidoPanel method_panel {
-layout CentreLineLayout
GuidoComboBox definition_method {
-label "Select the plane definition method"
-width 12.4
-null false
-exclusive true
-default "Start, end and interval"
-tip "Select the plane definition method"
}
GuidoLabel field_width_1g {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
GuidoPanel overlay_panel_method {
-layout OverlayLayout
GuidoPanel overlay_panel_method_1 {
-layout CentreLineLayout
-dependency {"[ $definition_method getCurrentValue]" == "Start, end and interval" || "[ $definition_method getCurrentValue]" == "Parallel"}
GuidoField start {
-label "Start"
-width 13
-format double
-null false
-decimals 3
-tip "Select the plane start, end and interval"
}
GuidoField end {
-label "End"
-width 13
-format double
-null false
-decimals 3
-tip "Select the plane start, end and interval"
}
GuidoField interval {
-label "Interval between planes"
-width 13
-format double
-null false
-decimals 3
-tip "Select the plane start, end and interval"
}
GuidoLabel field_width_1h {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
GuidoPanel overlay_panel_method_2 {
-layout CentreLineLayout
-dependency {"[ $definition_method getCurrentValue]" == "Specific values"}
GuidoLabel values_label {
-label "Start"
}
GuidoField values {
-width 13
-format range
-null false
-decimals 3
-tip QUICK_PLANES_TOOLTIP_7
}
GuidoLabel field_width_1i {
-label "Select the plane definition method"
-visible false
-height 0.1
}
}
}
}
GuidoPanel section_thickness {
-layout CentreLineLayout
-label "Plane corridor"
-border etched true
GuidoField away {
-label "Away_Quick_Planes"
-width 13
-format double
-null false
-decimals 3
-default 25.0
-tip FRM_VERTICALPLANE_6
-low_bound 0.001
}
GuidoField towards {
-label "Towards_Quick_Planes"
-width 13
-format double
-null false
-decimals 3
-default 25.0
-tip FRM_VERTICALPLANE_7
-low_bound 0.001
}
GuidoLabel field_width_2 {
-label "Select the plane definition method"
-visible false
-height 0.1
}
GuidoLabel field_width_2b {
-label ""
-visible false
-height 0.1
-width 15
}
}
GuidoPanel plane_positions {
-layout CentreLineLayout
-label "2D"
-border etched true
GuidoCheckBox two_d {
-label "Snap to 2D plane view"
-selected_value true
-unselected_value false
-tip QUICK_PLANES_TOOLTIP_8
}
GuidoLabel field_width_3a {
-label "Select the plane definition method"
-visible false
-height 0.1
}
GuidoLabel field_width_3b {
-label ""
-visible false
-height 0.1
-width 15
}
}
GuidoPanel output {
-layout CentreLineLayout
-label "Output"
-border etched true
GuidoField extension {
-label "Plane name suffix"
-width 13
-default N
-tip QUICK_PLANES_TOOLTIP_9
-format plane_suffix
-max_length 16
-dependency {[$definition_method getCurrentValue] != "Parallel"}
}
GuidoCheckBox save {
-label "Save"
-selected_value true
-unselected_value false
-default true
-tip QUICK_PLANES_TOOLTIP_10
-dependency {[$definition_method getCurrentValue] != "Parallel"}
}
GuidoField group {
-label "Group name"
-width 13
-max_length 32
-dependency {"[ $save getCurrentValue]" == "true"}
-null false
-tip QUICK_PLANES_TOOLTIP_11
-format group
-dependency {[$definition_method getCurrentValue] != "Parallel"}
}
GuidoLabel field_width_4 {
-label "Select the plane definition method"
-visible false
-height 0.1
}
GuidoLabel field_width_4b {
-label ""
-visible false
-height 0.1
-width 15
}
GuidoField last_plane_type {
-default ""
-visible false
-input false
}
}
$plane_type setActionCallback valueChanged {[values_label_action $definition_method $plane_type $values_label $extension $start $end $interval $definition_method $values $last_plane_type $looking_north $looking_west $looking_down]}
$interval setActionCallback valueChanged {[interval_changed $interval $away $towards]}
$definition_method setActionCallback valueChanged {[getParallelValues $definition_method $plane_type $looking_north $looking_west $start $end $interval $away $towards $extension $save $group]}
$plane_type setDependency {[$definition_method getCurrentValue] != "Parallel"}
$looking_north setDependency {[$definition_method getCurrentValue] != "Parallel"}
$looking_west setDependency {[$definition_method getCurrentValue] != "Parallel"}
$looking_down setDependency {[$definition_method getCurrentValue] != "Parallel"}
$oblique_definition_method setDependency {[$definition_method getCurrentValue] != "Parallel"}
-action initial {[$last_plane_type setCurrentValue [$plane_type getCurrentValue]]}
}
