GuidoForm form {
-default_buttons
-label "Create a road outline"
-layout BoxLayout Y_AXIS
-help_id 438
GuidoPanel output_panel {
-border etched true
-label "Output"
-layout CentreLineLayout
GuidoField output_string {
-label "Output string"
-tip "The string that the outline will be created in "
-format integer
-null false
-low_bound 1
-high_bound 32000
}
GuidoCheckBox join_start_of_road {
-default false
-label ROAD_JOIN_START_OF_ROAD
-selected_value Y
-unselected_value N
}
GuidoCheckBox join_end_of_road {
-default false
-label ROAD_JOIN_END_OF_ROAD
-selected_value Y
-unselected_value N
}
}
GuidoPanel road_width_panel {
-border etched true
-label "Road width"
-layout CentreLineLayout
GuidoField road_width_left {
-default "4"
-label "Left road width"
-tip "Width of the left hand side of the road"
-format double
-low_bound 0.01
}
GuidoField road_width_right {
-default "4"
-label "Right road width"
-tip "Width of the right hand side of the road"
-format double
-low_bound 0.01
}
}
GuidoPanel other_fields {
-border etched true
-label "Description Fields"
-layout CentreLineLayout
GuidoCheckBox use_chainage_field {
-default true
-label ROAD_USE_CHAINAGE_FIELD
-tip ROAD_USE_CHAINAGE_FIELD_TIP
-selected_value Y
-unselected_value N
}
GuidoCheckBox use_super_elevation_field {
-default true
-label ROAD_USE_SUPER_FIELD
-selected_value Y
-unselected_value N
}
GuidoCheckBox use_left_width_field {
-default false
-label ROAD_USE_LEFT_WIDTH_FIELD
-tip ROAD_USE_LEFT_WIDTH_FIELD_TIP
-selected_value Y
-unselected_value N
}
GuidoCheckBox use_right_width_field {
-default false
-label ROAD_USE_RIGHT_WIDTH_FIELD
-tip ROAD_USE_RIGHT_WIDTH_FIELD_TIP
-selected_value Y
-unselected_value N
}
}
}
proc getBufferValue { buffer attribute } {
return [GuidoGetParamBufferValue $buffer $attrbiute]
}
proc isChecked { checkbox } {
if { [$checkbox getCurrentValue] == "Y" } {
return 1
} else {
return 0
}
}
set tclPath [ GuidoGetParamBufferValue [ GuidoExecServer GetTCLPath { } ] tclPath ]
source "$tclPath/../scripts/graphicsPickSegment.tcl"
set pickresult [graphicsPickSegment "Pick a road centreline" dataset string segment source_points source_is_collinear]
if { $pickresult } {
$output_string setCurrentValue $string
set return_code [$form interact]
GuidoApp app "CREATE ROAD OUTLINE"
if {$return_code == "apply"} {
$app setParam dataset $dataset
$app setParam string $string
$app setParam segment $segment
$app setParam output_string [$output_string getCurrentValue]
$app setParam leftWidth [$road_width_left getCurrentValue]
$app setParam rightWidth [$road_width_right getCurrentValue]
$app setParam join_start_of_road [isChecked $join_start_of_road]
$app setParam join_end_of_road [isChecked $join_end_of_road]
$app setParam use_right_width_field [isChecked $use_right_width_field]
$app setParam use_chainage_field [isChecked $use_chainage_field]
$app setParam use_super_elevation_field [isChecked $use_super_elevation_field]
$app setParam use_left_width_field [isChecked $use_left_width_field]
$app setParam use_right_width_field [isChecked $use_right_width_field]
set return_code [$app invoke]
}
}
$app destroy
$form destroy
