set newNodes 0
set nested false
set initialValues false
set containerName "Incline sections"
set getFunction "GetInclinedPlane"
set setFunction "SetInclinedPlane"
set removeFunction "RemoveInclinedPlane"
set iconFile "icons/16/menu_create_inclined_planes.png"
set iconFileZ "icons/16/IPlaneF.png"
proc setInitial {} {
if {$::initialValues == "false"} {
set ::commentInitial [$::comment getCurrentValue]
set ::seriesInitial [$::series getCurrentValue]
set ::sequenceInitial [$::sequence getCurrentValue]
set ::awayInitial [$::away getCurrentValue]
set ::towardsInitial [$::towards getCurrentValue]
set ::northingInitial [$::northing getCurrentValue]
set ::eastingInitial [$::easting getCurrentValue]
set ::lengthInitial [$::length getCurrentValue]
set ::azimuthInitial [$::azimuth getCurrentValue]
set ::minimum_elevationInitial [$::minimum_elevation getCurrentValue]
set ::maximum_elevationInitial [$::maximum_elevation getCurrentValue]
set ::dipInitial [$::dip getCurrentValue]
set ::dip_directionInitial [$::dip_direction getCurrentValue]
set ::view_modeInitial [$::view_mode getCurrentValue]
set ::viewing_directionInitial [$::viewing_direction getCurrentValue]
set ::initialValues true
}
}
proc changedData {} {
setInitial
if {[string compare $::commentInitial [$::comment getCurrentValue]] != 0 ||
[string compare $::seriesInitial [$::series getCurrentValue]] != 0 ||
$::sequenceInitial != [$::sequence getCurrentValue] ||
$::awayInitial != [$::away getCurrentValue] ||
$::towardsInitial != [$::towards getCurrentValue] ||
$::northingInitial != [$::northing getCurrentValue] ||
$::eastingInitial != [$::easting getCurrentValue] ||
$::lengthInitial != [$::length getCurrentValue] ||
$::azimuthInitial != [$::azimuth getCurrentValue] ||
$::minimum_elevationInitial != [$::minimum_elevation getCurrentValue] ||
$::maximum_elevationInitial != [$::maximum_elevation getCurrentValue] ||
$::dipInitial != [$::dip getCurrentValue] ||
$::dip_directionInitial != [$::dip_direction getCurrentValue] ||
$::view_modeInitial != [$::view_mode getCurrentValue] ||
$::viewing_directionInitial != [$::viewing_direction getCurrentValue]} {
return true
}
return false
}
proc fetchPlane { tree } {
set rootNode [$tree getRootNode]
if {[$rootNode getChildCount] > 0} {
if {[string compare "[$tree getSelectedNode]" ""] == 0} {
set rootNode [$tree getRootNode]
set child [$rootNode getChildAt 0]
set grandChild [$child getChildAt 0]
set ::nested true
$tree setSelectedNode $child
$tree expandPath "$::containerName\\[$child getLabelText]\\[$grandChild getLabelText]"
set ::nested false
}
if {[string compare "[$tree getSelectedNode]" ""] != 0 &&
[[$tree getSelectedNode] isLeaf]} {
set leaf [$tree getSelectedNode]
set group_name [[$leaf getParent] getLabelText]
set params [GuidoExecServer "$::getFunction" [subst {name = "[[$tree getSelectedNode] getCurrentValue]" group = "$group_name"}]]
$::comment setCurrentValue "[GuidoGetParamBufferValue $params comment]"
$::series setCurrentValue "[GuidoGetParamBufferValue $params group]"
$::sequence setCurrentValue "[GuidoGetParamBufferValue $params sequence]"
$::created setCurrentValue "[GuidoGetParamBufferValue $params created]"
$::updated setCurrentValue "[GuidoGetParamBufferValue $params updated]"
$::away setCurrentValue "[GuidoGetParamBufferValue $params away]"
$::towards setCurrentValue "[GuidoGetParamBufferValue $params towards]"
$::northing setCurrentValue "[GuidoGetParamBufferValue $params northing]"
$::easting setCurrentValue "[GuidoGetParamBufferValue $params easting]"
$::length setCurrentValue "[GuidoGetParamBufferValue $params length]"
$::azimuth setCurrentValue "[GuidoGetParamBufferValue $params azimuth]"
$::minimum_elevation setCurrentValue "[GuidoGetParamBufferValue $params minimum_elevation]"
$::maximum_elevation setCurrentValue "[GuidoGetParamBufferValue $params maximum_elevation]"
$::dip setCurrentValue "[GuidoGetParamBufferValue $params dip]"
$::dip_direction setCurrentValue "[GuidoGetParamBufferValue $params dip_direction]"
$::view_mode setCurrentValue "[GuidoGetParamBufferValue $params view_mode]"
$::viewing_direction setCurrentValue "[GuidoGetParamBufferValue $params viewing_direction]"
set ::initialValues false
setInitial
}
$::depend setCurrentValue "true"
$::updated setInputAllowed false
$::created setInputAllowed false
$::verb setCurrentValue "Editing:"
$::noun setCurrentValue "[[$tree getSelectedNode] getCurrentValue]"
$::noun_group setCurrentValue "[[[$tree getSelectedNode] getParent] getLabelText]"
} else {
$::depend setCurrentValue "false"
$::verb setCurrentValue "Creating:"
$::noun setCurrentValue ""
$::noun_group setCurrentValue ""
}
}
proc doSavePlane {name} {
set params [GuidoExecServer "$::setFunction" [subst {name = "$name"
comment = "[$::comment getCurrentValue]"
group = "[$::series getCurrentValue]"
sequence = "[$::sequence getCurrentValue]"
created = "[$::created getCurrentValue]"
updated = "[$::updated getCurrentValue]"
away = "[$::away getCurrentValue]"
towards = "[$::towards getCurrentValue]"
northing = "[$::northing getCurrentValue]"
easting = "[$::easting getCurrentValue]"
length = "[$::length getCurrentValue]"
azimuth = "[$::azimuth getCurrentValue]"
minimum_elevation = "[$::minimum_elevation getCurrentValue]"
maximum_elevation = "[$::maximum_elevation getCurrentValue]"
dip = "[$::dip getCurrentValue]"
dip_direction = "[$::dip_direction getCurrentValue]"
view_mode = "[$::view_mode getCurrentValue]"
viewing_direction = "[$::viewing_direction getCurrentValue]"}]]
set status "[GuidoGetParamBufferValue $params status ]"
return $status
}
proc blankFields {} {
$::comment setCurrentValue ""
$::series setCurrentValue ""
$::sequence setCurrentValue 0
$::away setCurrentValue 0.0
$::towards setCurrentValue 0.0
$::northing setCurrentValue 0.0
$::easting setCurrentValue 0.0
$::length setCurrentValue 0.0
$::azimuth setCurrentValue 0.0
$::minimum_elevation setCurrentValue 0.0
$::maximum_elevation setCurrentValue 0.0
$::dip setCurrentValue 0.0
$::dip_direction setCurrentValue RIGHT
$::view_mode setCurrentValue vertical
$::viewing_direction setCurrentValue right
$::depend setCurrentValue "true"
$::updated setInputAllowed false
$::created setInputAllowed false
set ::initialValues false
setInitial
}
proc validate {} {
set valid true
if {[$::away getCurrentValue] == 0.0 && [$::towards getCurrentValue] == 0.0} {
GuidoMessage warning "The definition should have thickness."
set valid false
$::away requestFocus
}
if {[$::minimum_elevation getCurrentValue] == [$::maximum_elevation getCurrentValue]} {
GuidoMessage warning "Min. elevation cannot equal Max. elevation."
set valid false
$::minimum_elevation requestFocus
}
if {[$::minimum_elevation getCurrentValue] > [$::maximum_elevation getCurrentValue]} {
GuidoMessage warning "Min. elevation cannot exceed Max. elevation."
set valid false
$::minimum_elevation requestFocus
}
if {[$::length getCurrentValue] == 0} {
GuidoMessage warning "Length must not be 0."
set valid false
$::length requestFocus
}
set seriesValue [string trim "[$::series getCurrentValue]"]
if {[string length $seriesValue] == 0} {
GuidoMessage warning "The group cannot be left blank."
set valid false
$::series requestFocus
}
return $valid
}
set buffer [ GuidoExecServer GetTCLPath { } ]
set tclPath [ GuidoGetParamBufferValue $buffer tclPath ]
source "$tclPath/commonPlane.tcl"
set editPlane ""
GuidoForm form {
-default_buttons
-label "Inclined Plane Properties"
-tip "FRM_INCLINEDPLANE_2"
-layout BorderLayout
GuidoPanel top {
-position North
-layout FlowLayout Left 0 0
GuidoField depend {
-default "false"
-visible false
}
source "$tclPath/toolbarPlane.tcl"
$newProfile setIconByName "icons/16/menu_create_inclined_planes.png"
}
GuidoPanel bottom {
-layout BorderLayout
-border etched true
GuidoScrollPane scroll {
-height 15
GuidoTree planes_tree {
-label ""
-editable false
-no_mlt
-multiple_selection false
set buffer [GuidoExecServer PlaneTreeStructure [subst {type = "$::containerName"}]]
set nSeries "[GuidoGetParamBufferValue $buffer nSeries ]"
set editPlane "[GuidoGetParamBufferValue $buffer editPlane ]"
for {set i 0} {$i < $nSeries} {incr i} {
set pname "[GuidoGetParamBufferValue $buffer series_$i]"
GuidoTreeBranch branch_$i {
-label_no_mlt "$pname"
set nPlanes "[GuidoGetParamBufferValue $buffer nPlanes_$i]"
for {set j 0} {$j < $nPlanes} {incr j} {
set name "[GuidoGetParamBufferValue $buffer "plane\_$i\_$j"]"
GuidoTreeLeaf leaf\_$i\_$j {
-default $name
-label $name
-no_mlt
-action focusGained {[leafChanged $form $planes_tree]}
-menu_enabled true
-menu $::leafPopup
}
if {$i == 0 && $j == 0 && [string compare $editPlane ""] == 0} {
set editPlane "$pname/$name"
}
}
}
}
}
}
$scroll setScrollSize 15 15
$planes_tree setTreeIcons icons/16/menu_create_inclined_planes.png icons/16/menu_create_inclined_planes.png icons/16/IPlaneF.png
GuidoPanel editableWrapper {
-position East
-layout OverlayLayout
GuidoPanel no_planes {
-dependency {[$depend getCurrentValue] == "false"}
GuidoLabel no_planes_label {
-label "FRM_HORIZONTALPLANE_1"
-width 31
}
}
GuidoPanel editable {
-layout BorderLayout
-border etched true
-label "Definition"
-dependency {[$depend getCurrentValue] != "false"}
GuidoPanel commentPanel {
-position North
-layout CentreLineLayout
GuidoField comment {
-display_length 20
-label "PLANES_LABEL_COMMENTS"
-max_length 100
-action focusGained {[setInitial]}
-tip "You can add an arbitrary comment for this plane."
}
GuidoPanel paddingPanel {
-width 7.1
}
}
GuidoPanel nonCommentPanel {
-layout BorderLayout
GuidoPanel orientationPanel {
-position North
-layout BorderLayout
-border etched true
-label "Orientation"
GuidoPanel northEastPanel {
-position West
-layout CentreLineLayout
GuidoField northing {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_NORTHING"
-max_length 16
-null false
-action focusGained {[setInitial]}
-tip "FRM_INCLINEDPLANE_3"
}
GuidoField easting {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_EASTING"
-max_length 16
-null false
-action focusGained {[setInitial]}
-tip "FRM_INCLINEDPLANE_4"
}
GuidoLabel padding {
-label "PLANES_LABEL_MAX_ELEVATION"
-visible false
-height 0.1
}
}
GuidoPanel lengthAzimuthPanel {
-position East
-layout CentreLineLayout
GuidoField length {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_LENGTH"
-max_length 16
-null false
-low_bound 0.001
-action focusGained {[setInitial]}
-validation {[validate]}
-tip "FRM_INCLINEDPLANE_5"
}
GuidoField azimuth {
-display_length 6
-label "PLANES_LABEL_AZIMUTH"
-format decimal_angle
-high_bound 6.283180459
-low_bound 0
-max_length 10
-null false
-decimals 4
-action focusGained {[setInitial]}
-tip "FRM_INCLINEDPLANE_6"
}
GuidoLabel padding {
-label "PLANES_LABEL_MAX_ELEVATION"
-visible false
-height 0.1
}
}
}
GuidoPanel nonOrientationPanel {
-layout BorderLayout
GuidoPanel inclinationPanel {
-position North
-layout BorderLayout
-border etched true
-label "Inclination"
GuidoPanel minMaxPanel {
-position West
-layout CentreLineLayout
GuidoField minimum_elevation {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_MIN_ELEVATION"
-max_length 16
-null false
-action focusGained {[setInitial]}
-validation {[validate]}
-tip "The lower limit of the plane."
}
GuidoField maximum_elevation {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_MAX_ELEVATION"
-max_length 16
-null false
-action focusGained {[setInitial]}
-validation {[validate]}
-tip "The upper limit of the plane."
}
}
GuidoPanel dipPanel {
-position East
-layout CentreLineLayout
GuidoField dip {
-display_length 6
-label "PLANES_LABEL_DIP_ANGLE"
-format decimal_angle
-high_bound 1.570796327
-low_bound -1.570796327
-max_length 10
-decimals 4
-null false
-action focusGained {[setInitial]}
-tip "FRM_INCLINEDPLANE_7"
}
GuidoComboBox dip_direction {
-display_length 3.6
-label "PLANES_LABEL_DIP_DIRECTION"
-value_in LEFT RIGHT
-null false
-exclusive true
-default RIGHT
-action focusGained {[setInitial]}
-tip "FRM_INCLINEDPLANE_8"
}
GuidoLabel padding {
-label "PLANES_LABEL_MAX_ELEVATION"
-visible false
-height 0.1
}
}
}
GuidoPanel nonInclinationPanel {
-layout BorderLayout
GuidoPanel 2dviewPanel {
-position North
-layout BoxLayout Y_AXIS
-border etched true
-label "2D view"
GuidoPanel otherPanel {
-layout BoxLayout Y_AXIS
GuidoLabel 2dlabel1 {
-label "In 2D view mode, the plane can be viewed either:"
}
GuidoPanel button1 {
-layout BoxLayout X_AXIS
GuidoFiller f1 {
-width 4
}
GuidoButtonGroupPanel view_mode {
-layout BoxLayout Y_AXIS
-action focusGained {[setInitial]}
GuidoRadioButton vertical {
-caption "vertically (with the orientation edge at the top)"
-default true
-selected_value vertical
-height 1
-action focusGained {[setInitial]}
}
GuidoRadioButton plan {
-caption "in plan (with the orientation edge along the side)"
-selected_value plan
-height 1
-action focusGained {[setInitial]}
}
}
}
GuidoFiller f2 {
-height 0.5
}
GuidoLabel 2dlabel4 {
-label "FRM_INCLINEDPLANE_1"
}
GuidoPanel button2 {
-layout BoxLayout X_AXIS
GuidoFiller f3 {
-width 4
}
GuidoButtonGroupPanel viewing_direction {
-layout BoxLayout Y_AXIS
-action focusGained {[setInitial]}
GuidoRadioButton right {
-caption "the right side of the orientation edge"
-default true
-selected_value right
-height 1
-action focusGained {[setInitial]}
}
GuidoRadioButton left {
-caption "the left side of the orientation edge"
-selected_value left
-height 1
-action focusGained {[setInitial]}
}
}
}
}
}
GuidoPanel non2dviewPanel {
-layout BorderLayout
GuidoPanel otherPanel {
-position North
-layout BorderLayout
GuidoPanel seriesPanel {
-position West
-layout CentreLineLayout
-border etched true
-label "Group"
GuidoField series {
-display_length 6
-label "PLANES_LABEL_NAME"
-max_length 32
-action focusGained {[setInitial]}
-null false
-tip "FRM_HORIZONTALPLANE_5"
-format group
}
GuidoField sequence {
-format integer
-display_length 6
-label "PLANES_LABEL_SEQUENCE"
-max_length 100
-low_bound 0
-action focusGained {[setInitial]}
-null false
-tip "FRM_HORIZONTALPLANE_6"
}
GuidoLabel padding {
-label "PLANES_LABEL_MAX_ELEVATION"
-visible false
-height 0.1
}
}
GuidoPanel thicknessPanel {
-position East
-layout CentreLineLayout
-border etched true
-label "Plane corridor"
GuidoField away {
-display_length 6
-format double
-decimals 3
-label "PLANES_LABEL_AWAY"
-max_length 16
-null false
-low_bound 0.0
-action focusGained {[setInitial]}
-validation {[validate]}
-tip "FRM_INCLINEDPLANE_9"
}
GuidoField towards {
-label "PLANES_LABEL_TOWARDS"
-display_length 6
-format double
-decimals 3
-max_length 16
-null false
-low_bound 0.0
-action focusGained {[setInitial]}
-validation {[validate]}
-tip "FRM_INCLINEDPLANE_10"
}
GuidoLabel padding {
-label "PLANES_LABEL_MAX_ELEVATION"
-visible false
-height 0.1
}
}
}
GuidoPanel nonSeriesPanel {
-layout BorderLayout
GuidoPanel datesPanel {
-position North
-layout BorderLayout
-border etched true
-label "Dates"
GuidoPanel datesWest {
-position West
-layout CentreLineLayout
GuidoLabel createdLabel {
-label "PLANES_LABEL_CREATION_DATE"
}
GuidoField created {
-display_length 6
-input false
}
GuidoLabel padding {
-label "PLANES_LABEL_MAX_ELEVATION"
-visible false
-height 0.1
}
}
GuidoPanel datesEast {
-position East
-layout CentreLineLayout
GuidoLabel updatedLabel {
-label "PLANES_LABEL_LAST_UPDATE"
}
GuidoField updated {
-display_length 6
-input false
}
GuidoLabel padding {
-label "PLANES_LABEL_DIP_DIRECTION"
-visible false
-height 0.1
}
}
}
}
}
}
}
}
}
}
}
GuidoPanel status {
-position South
-layout CentrelineLayout
-border etched true
GuidoLabel verb {
-label "Editing:"
}
GuidoLabel noun {
-no_mlt
}
GuidoFiller noun_group_filler {
-height 1
}
GuidoLabel noun_group {
-visible false
-no_mlt
}
}
-action stateChanged {[formClosed $form $planes_tree]}
fetchPlane $planes_tree
if {[string compare $editPlane ""] != 0} {
set parts [split $editPlane /]
set group [lindex $parts 0]
set leaf [lindex $parts 1]
selectLeaf $planes_tree $group $leaf true
}
}
