proc validateObjectID { objectIDField } {
set objectID [$objectIDField getCurrentValue]
if { objectID != "" && objectID > 0 } {
return true;
} else {
return false;
}
}
GuidoForm form {
-default_buttons
-label "Triangulate multiple connected segments"
-layout BoxLayout Y_AXIS
-tip TRI_CONNECTED_SEGMENTS_MULTIPLE_TIP
-help_id 1340
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"
-tip TRI_CONNECTED_SEGMENTS_MULTIPLE_SELECT
-border etched true
-layout CentreLineLayout
GuidoButtonGroupPanel selectionMethod {
-layout BoxLayout Y_AXIS
GuidoRadioButton allSegments {
-caption "Graphical"
-selected_value picked
}
GuidoRadioButton stringRange {
-caption "Segment range"
-selected_value range
}
}
}
GuidoPanel sourceStringPanel {
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
-label "Segments"
-border etched true
-layout BoxLayout X_AXIS
GuidoPanel triangulateFromPanel {
-layout CentreLineLayout
-label "Triangulate From"
-border etched true
GuidoField sourceStringsStart {
-default ""
-display_length 5
-label "String range"
}
GuidoField sourceSegmentsStart {
-default ""
-display_length 5
-label "Segment range"
}
}
GuidoPanel triangulateToPanel {
-layout CentreLineLayout
-label "Triangulate To"
-border etched true
GuidoField sourceStringsEnd {
-default ""
-display_length 5
-label "String range"
-tip "FRM_TRIANGULATECONNECTEDSEGMENTSMULTIPLE_1"
}
GuidoField sourceSegmentsEnd {
-default ""
-display_length 5
-label "Segment range"
-tip "FRM_TRIANGULATECONNECTEDSEGMENTSMULTIPLE_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 BETWEEN CONNECTED SEGMENTS"
if {$return_code == "apply"} {
$app setParam triobject [$destTriobject getCurrentValue]
$app setParam trisol [$destTrisol getCurrentValue]
$app setParam stringRangeStart [$sourceStringsStart getCurrentValue]
$app setParam segmentRangeStart [$sourceSegmentsStart getCurrentValue]
$app setParam stringRangeEnd [$sourceStringsEnd getCurrentValue]
$app setParam segmentRangeEnd [$sourceSegmentsEnd getCurrentValue]
$app setParam selectionMethod [$selectionMethod getCurrentValue]
$app setParam onlyFirstNormal [$onlyFirstNormal getCurrentValue]
$app setParam multipleInputs "1"
set return_code [$app invoke]
}
$app destroy
$form destroy
