proc getExtents {method plane_type plane_group plane_name left_easting left_northing left_elevation right_easting right_northing right_elevation} {
if {[$method getCurrentValue] == "Current block model"} {
set dataBuffer [GuidoExecServer GetBlockModelRange {}]
if {[GuidoGetParamBufferValue $dataBuffer status] == 0} {
$left_easting setCurrentValue [GuidoGetParamBufferValue $dataBuffer xmin]
$left_northing setCurrentValue [GuidoGetParamBufferValue $dataBuffer ymin]
$left_elevation setCurrentValue [GuidoGetParamBufferValue $dataBuffer zmin]
$right_easting setCurrentValue [GuidoGetParamBufferValue $dataBuffer xmax]
$right_northing setCurrentValue [GuidoGetParamBufferValue $dataBuffer ymax]
$right_elevation setCurrentValue [GuidoGetParamBufferValue $dataBuffer zmax]
}
} elseif {[$method getCurrentValue] == "Current vertical plane"} {
if {"[$plane_type getCurrentValue]" == "Vertical"} {
set dataBuffer [GuidoExecServer GetVerticalPlane [subst {group = "[$plane_group getCurrentValue]" name = "[$plane_name getCurrentValue]"}]]
if {[GuidoGetParamBufferValue $dataBuffer status] == 0} {
$left_easting setCurrentValue [GuidoGetParamBufferValue $dataBuffer left_easting]
$left_northing setCurrentValue [GuidoGetParamBufferValue $dataBuffer left_northing]
$left_elevation setCurrentValue [GuidoGetParamBufferValue $dataBuffer left_elevation]
$right_easting setCurrentValue [GuidoGetParamBufferValue $dataBuffer right_easting]
$right_northing setCurrentValue [GuidoGetParamBufferValue $dataBuffer right_northing]
$right_elevation setCurrentValue [GuidoGetParamBufferValue $dataBuffer right_elevation]
}
}
} elseif {[$method getCurrentValue] == "Open data"} {
set dataBuffer [GuidoExecServer GraphicsExtents {}]
if {[GuidoGetParamBufferValue $dataBuffer status] == 0} {
$left_easting setCurrentValue [GuidoGetParamBufferValue $dataBuffer left_easting]
$left_northing setCurrentValue [GuidoGetParamBufferValue $dataBuffer left_northing]
$left_elevation setCurrentValue [GuidoGetParamBufferValue $dataBuffer left_elevation]
$right_easting setCurrentValue [GuidoGetParamBufferValue $dataBuffer right_easting]
$right_northing setCurrentValue [GuidoGetParamBufferValue $dataBuffer right_northing]
$right_elevation setCurrentValue [GuidoGetParamBufferValue $dataBuffer right_elevation]
}
}
}
proc removeDisabledItems {method plane_type} {
set dataBuffer [GuidoExecServer GetBlockModelRange {}]
if {[GuidoGetParamBufferValue $dataBuffer status] != 0} {
$method removeItemAt 3
}
if {"[$plane_type getCurrentValue]" != "Vertical"} {
$method removeItemAt 2
}
set dataBuffer [GuidoExecServer GraphicsExtents {}]
if {[GuidoGetParamBufferValue $dataBuffer status] == 0} {
if {[GuidoGetParamBufferValue $dataBuffer left_easting] == 0.0 &&
[GuidoGetParamBufferValue $dataBuffer left_northing] == 0.0 &&
[GuidoGetParamBufferValue $dataBuffer left_elevation] == 0.0 &&
[GuidoGetParamBufferValue $dataBuffer right_easting] == 0.0 &&
[GuidoGetParamBufferValue $dataBuffer right_northing] == 0.0 &&
[GuidoGetParamBufferValue $dataBuffer right_elevation] == 0.0} {
$method removeItemAt 0
}
}
}
GuidoForm frmworkArea {
-default_buttons
-label "3D Work Area"
-tip "FRM_WORKAREA_1"
-layout BoxLayout Y_AXIS
GuidoTabbedPane tabbed_pane {
GuidoPanel size {
-layout BorderLayout
-label "Extents"
GuidoPanel sizeBorder {
-layout CentreLineLayout
-border etched true
GuidoComboBox method {
-display_length 14
-label "PLANES_LABEL_CALCULATE_SIZE_BASED_ON"
-value_in "Open data" "Limits defined below" "Current vertical plane" "Current block model"
-null false
-exclusive true
-default "Open data"
-tip "FRM_WORKAREA_2"
}
GuidoFiller f1 {
-height 0.5
}
GuidoFiller f2 {
-height 0.5
}
GuidoLabel left_northing_label {
-label "PLANES_LABEL_LOWER_LEFT_NORTHING"
}
GuidoField left_northing {
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-dependency {[$method getCurrentValue] == "Limits defined below"}
-tip "The minimum Northing value for the work area."
}
GuidoLabel left_easting_label {
-label "PLANES_LABEL_EASTING"
}
GuidoField left_easting {
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-dependency {[$method getCurrentValue] == "Limits defined below"}
-tip "The minimum Easting value for the work area."
}
GuidoLabel left_elevation_label {
-label "PLANES_LABEL_ELEVATION"
}
GuidoField left_elevation {
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-dependency {[$method getCurrentValue] == "Limits defined below"}
-tip "The minimum Elevation value for the work area."
}
GuidoFiller f3 {
-height 0.5
}
GuidoFiller f4 {
-height 0.5
}
GuidoLabel right_northing_label {
-label "PLANES_LABEL_UPPER_RIGHT_NORTHING"
}
GuidoField right_northing {
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-dependency {[$method getCurrentValue] == "Limits defined below"}
-tip "The maximum Northing value for the work area."
}
GuidoLabel right_easting_label {
-label "PLANES_LABEL_EASTING"
}
GuidoField right_easting {
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-dependency {[$method getCurrentValue] == "Limits defined below"}
-tip "The maximum Easting value for the work area."
}
GuidoLabel right_elevation_label {
-label "PLANES_LABEL_ELEVATION"
}
GuidoField right_elevation {
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-dependency {[$method getCurrentValue] == "Limits defined below"}
-tip "The maximum Elevation value for the work area."
}
GuidoLabel f5 {
-label "PLANES_LABEL_SPACING_ALONG_ELEVATION_Z_AXIS"
-visible false
}
GuidoFiller f6 {
-height 0.5
}
}
}
GuidoPanel format {
-layout BorderLayout
-label "Formatting"
GuidoPanel formatBorder {
-layout CentreLineLayout
-border etched true
GuidoComboBox decorations {
-display_length 14
-label "PLANES_LABEL_SHOW_3D_WORK_AREA_WITH"
-value_in "Axis highlighting and text labels" "Axis highlighting" "Text labels"
-null false
-exclusive true
-default "Axis highlighting and text labels"
-tip "FRM_WORKAREA_3"
}
GuidoFiller f7 {
-height 0.5
}
GuidoFiller f8 {
-height 0.5
}
GuidoField northing_spacing {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_SPACING_ALONG_NORTHING_Y_AXIS"
-max_length 16
-null false
-tip "FRM_WORKAREA_4"
}
GuidoField easting_spacing {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_SPACING_ALONG_EASTING_X_AXIS"
-max_length 16
-null false
-tip "FRM_WORKAREA_5"
}
GuidoField elevation_spacing {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_SPACING_ALONG_ELEVATION_Z_AXIS"
-max_length 16
-null false
-tip "FRM_WORKAREA_6"
}
GuidoFiller f9 {
-height 0.5
}
GuidoFiller f10 {
-height 0.5
}
GuidoField text_height {
-display_length 6
-format integer
-label "PLANES_LABEL_TEXT_HEIGHT_IN_PIXELS"
-max_length 16
-null false
-default 10
-low_bound 1
-tip "The height of axis labels in pixels."
}
}
}
}
GuidoPanel hidden {
-width 0
-height 0
GuidoLabel plane_type {
-no_mlt
-status_item "plane type"
-visible false
-height 0.1
-width 0.1
}
GuidoLabel plane_group {
-no_mlt
-status_item "plane group"
-visible false
-height 0.1
-width 0.1
}
GuidoLabel plane_name {
-no_mlt
-status_item "plane name"
-visible false
-height 0.1
-width 0.1
}
}
$method setActionCallback valueChanged {[getExtents $method $plane_type $plane_group $plane_name $left_easting $left_northing $left_elevation $right_easting $right_northing $right_elevation]}
$method setActionCallback initial {[removeDisabledItems $method $plane_type]}
$method setActionCallback initial {[getExtents $method $plane_type $plane_group $plane_name $left_easting $left_northing $left_elevation $right_easting $right_northing $right_elevation]}
}
