proc validateObjectID { objectIDField } {
set objectID [$objectIDField getCurrentValue]
if { objectID != "" && objectID > 0 } {
return true;
} else {
return false;
}
}
GuidoForm form {
-default_buttons
-label "Triangulate all connected segments"
-layout BoxLayout Y_AXIS
-tip TRI_CONNECTED_SEGMENTS_ALL_TIP
-help_id 255
GuidoPanel panel {
-layout CentreLineLayout
-label "Trisolation"
-border etched true
GuidoField destTriobject {
-default "1"
-label "Object"
-tip "The object number that will be created."
-validation { [ validateObjectID $destTriobject ] }
-format integer
}
GuidoField destTrisol {
-default "1"
-label "Trisolation"
-tip "The trisolation number that will be created."
-validation { [ validateObjectID $destTrisol ] }
-format integer
}
}
GuidoPanel selectionMethodPanel {
-font_style bold
-label "Selection method"
-border etched true
-layout CentreLineLayout
-tip TRI_CONNECTED_SEGMENTS_ALL_SELECT
GuidoButtonGroupPanel selectionMethod {
-layout BoxLayout Y_AXIS
GuidoRadioButton allSegments {
-caption "All strings/segments"
-selected_value all
}
GuidoRadioButton stringRange {
-caption "Range of strings/segments"
-selected_value range
}
GuidoRadioButton connectedStrings {
-caption "Selected control segments"
-selected_value connected
}
GuidoRadioButton specifiedStrings {
-caption "Selected segments"
-selected_value explicit
}
}
}
GuidoPanel sourceStringPanel {
-label "Strings/segments"
-border etched true
-layout CentreLineLayout
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
GuidoField sourceStrings {
-default ""
-display_length 15
-label "String range"
-tip "FRM_TRIANGULATECONNECTEDSEGMENTSALL_1"
}
GuidoField sourceSegments {
-default ""
-display_length 15
-label "Segment range"
-tip "FRM_TRIANGULATECONNECTEDSEGMENTSALL_2"
}
}
GuidoPanel algorithm {
-layout CentreLineLayout
-label "Triangulation algorithm"
-border etched true
-tip TRIANGULATION_NORMAL_TIP
GuidoButtonGroupPanel ftype {
GuidoRadioButton onlyFirstNormal {
-caption "First normal"
-selected_value 1
}
GuidoRadioButton averageNormal {
-caption "Average normal"
-selected_value 1
}
}
}
}
set return_code [$form interact]
GuidoApp app "TRIANGULATE ALL CONNECTED SEGMENTS"
if {$return_code == "apply"} {
$app setParam triobject [$destTriobject getCurrentValue]
$app setParam trisol [$destTrisol getCurrentValue]
$app setParam stringRange [$sourceStrings getCurrentValue]
$app setParam segmentRange [$sourceSegments getCurrentValue]
$app setParam selectionMethod [$selectionMethod getCurrentValue]
$app setParam onlyFirstNormal [$onlyFirstNormal getCurrentValue]
set return_code [$app invoke]
}
$app destroy
$form destroy
