proc validateObjectID { objectIDField } {
set objectID [$objectIDField getCurrentValue]
if { objectID != "" && objectID > 0 } {
return true;
} else {
return false;
}
}
GuidoForm form {
-default_buttons
-label "Triangulate end of solid"
-layout BoxLayout Y_AXIS
-tip TRI_CONNECTED_SEGMENTS_END_TIP
-help_id 1345
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_END_SELECT
GuidoButtonGroupPanel selectionMethod {
-layout BoxLayout Y_AXIS
GuidoRadioButton allSegments {
-caption "Graphical"
-selected_value picked
}
GuidoRadioButton stringRange {
-caption "Segment range"
-selected_value range
}
}
}
GuidoPanel sourceStringPanel {
-label "Segment range and point"
-border etched true
-layout CentreLineLayout
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
GuidoField sourceStringsStart {
-default ""
-display_length 5
-label "String range"
-tip TRI_CONNECTED_SEGMENTS_END_SELECT
}
GuidoField sourceSegmentsStart {
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
-default ""
-display_length 5
-label "Segment range"
-tip TRI_CONNECTED_SEGMENTS_END_SELECT
}
GuidoField yField {
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
-default ""
-display_length 10
-label "Y"
-tip TRI_CONNECTED_SEGMENTS_END_SELECT
}
GuidoField xField {
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
-default ""
-display_length 10
-label "X"
-tip TRI_CONNECTED_SEGMENTS_END_SELECT
}
GuidoField zField {
-dependency {"[ $selectionMethod getCurrentValue]" == "range"}
-default ""
-display_length 10
-label "Z"
-tip TRI_CONNECTED_SEGMENTS_END_SELECT
}
}
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 END 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 x [$xField getCurrentValue]
$app setParam y [$yField getCurrentValue]
$app setParam z [$zField getCurrentValue]
$app setParam selectionMethod [$selectionMethod getCurrentValue]
$app setParam onlyFirstNormal [$onlyFirstNormal getCurrentValue]
set return_code [$app invoke]
}
$app destroy
$form destroy
