proc smoothColourTransition {attTable color colourType first_colour last_colour num_values range_field} {
set num_colours $num_values
if {[$colourType getCurrentValue] == "3"} {
set buffer [GuidoExecServer GetRangeCount [subst {range = "[$range_field getCurrentValue]"}]]
set num_colours [GuidoGetParamBufferValue $buffer "num_values"]
}
if {$num_colours == "" || $num_colours <= 0} {
set num_colours 5
}
if {$num_colours > 25} {
set num_colours 25
GuidoMessage warning DRAW_SHELLS_TOO_MANY_COLOURS
}
set numberOfRowsToAdd [expr $num_colours - [$attTable getRowCount]];
if { $numberOfRowsToAdd > 0 } {
$attTable addRows $numberOfRowsToAdd
}
set buffer [GuidoExecServer GetSmoothColourTransition [subst {num_values = "$num_colours" first_colour = "[$first_colour getCurrentValue]" last_colour = "[$last_colour getCurrentValue]"}]]
set colorList [GuidoGetParamBufferValue $buffer color]
for {set row_idx 0} {$row_idx < [$attTable getRowCount]} {incr row_idx} {
$color setCurrentValue $row_idx "[lindex $colorList [expr $row_idx +1]]"
}
}
GuidoForm frm00530 {
-help_id 1637
-default_buttons
-label "Surface or Solid Colour Banding"
-layout BoxLayout Y_AXIS
-next_focus range1
-tip "DTM_COLOURING_TIP"
GuidoLabel draw_type {}
GuidoPanel topPanel {
-layout CentreLineLayout
-label "Display Properties"
-border etched true
GuidoComboBox layer_name {
-display_length 28
-format none
-label "Layer name"
-max_length "APP_MAX_LAYER_NAME_LENGTH"
-tip "DTM_DRAW_LAYER_TIP"
}
GuidoField range1 {
-display_length 31
-format none
-label "Object Range"
-max_length 32
-tip "DTM_DRAW_RANGE_TIP"
}
GuidoField range2 {
-display_length 31
-format none
-label "Trisol Range"
-max_length 32
-tip "DTM_DRAW_RANGE_TIP"
}
GuidoField range3 {
-display_length 31
-format none
-label "Triangle Range"
-max_length 32
-tip "DTM_DRAW_RANGE_TIP"
}
GuidoField grade_field {
-display_length 5
-format string_field
-label "Field to colour by"
-max_length 30
-null false
-translate upper
-tip "DTM_DRAW_FIELD_TIP"
}
}
GuidoFiller space {
-height 0.5
}
GuidoPanel middlePanel {
-layout BoxLayout X_AXIS
GuidoPanel panel99 {
-border etched true
-label "Banding Type"
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel false_colour_type {
-layout BoxLayout Y_AXIS
GuidoRadioButton frm00530_12 {
-caption none
-selected_value 0
-tip "Triangles are drawn using the colour defined for the object using the Object drawing styles."
}
GuidoRadioButton frm00530_13 {
-caption "bands of specified size"
-selected_value 1
-tip "DTM_DRAW_FIXED_SIZE_BANDS_TIP"
}
GuidoRadioButton frm00530_14 {
-caption "set number of bands"
-selected_value 2
-default true
-tip "DTM_DRAW_FIXED_NUMBER_OF_BANDS_TIP"
}
GuidoRadioButton frm00530_15 {
-caption "range for bands"
-selected_value 3
-tip "DTM_DRAW_COLOUR_RANGE_TIP"
}
GuidoRadioButton frm00530_16 {
-caption "using algebraic expressions"
-selected_value 4
-tip "DTM_DRAW_COLOUR_EXPRESSIONS_TIP"
}
}
$grade_field setDependency {"[ $false_colour_type getCurrentValue]" >= 1 && "[$false_colour_type getCurrentValue]" <= 3}
$range3 setDependency {"[ $false_colour_type getCurrentValue]" >= 1 && "[$false_colour_type getCurrentValue]" <= 3}
}
GuidoPanel heatMapPanel {
-layout BoxLayout Y_AXIS
-label "Set colour range"
-border etched true
-dependency {"[ $false_colour_type getCurrentValue]" != "0"}
GuidoPanel heatMapPanel2 {
-alignmentX left
-layout CentrelineLayout
GuidoField slice_size {
-dependency {"[ $false_colour_type getCurrentValue]" == "1"}
-display_length 12
-format double
-label "Size of bands"
-max_length 10
-null false
-tip "DTM_DRAW_SLICE_SIZE_TIP"
}
GuidoField grade_range {
-dependency {"[ $false_colour_type getCurrentValue]" == "3"}
-display_length 12
-format range
-label "Band Range"
-max_length 256
-null false
-tip "DTM_DRAW_BAND_RANGE_TIP"
}
GuidoColourBrowserField fromColour {
-label "Starting colour"
-display_length 12
-exclusive false
-max_length 32
-default "Blue"
}
GuidoColourBrowserField toColour {
-label "Ending colour"
-display_length 12
-exclusive false
-max_length 32
-default "Red"
}
GuidoField num_colours {
-dependency {"[ $false_colour_type getCurrentValue]" != "0" && "[ $false_colour_type getCurrentValue]" != "3"}
-display_length 12
-format integer
-label "Number of colours"
-max_length 10
-null true
-default 5
-tip "DTM_DRAW_SLICE_SIZE_TIP"
}
}
GuidoFiller space {
-height 0.2
}
GuidoButton smooth_button {
-alignmentX right
-caption "Reset colour range"
-action valueChanged {[smoothColourTransition $colours $colour $false_colour_type $fromColour $toColour [$num_colours getCurrentValue] $grade_range ]}
}
}
}
GuidoFiller space {
-height 0.5
}
GuidoScrollPane frm00530_154 {
-dependency {"[ $false_colour_type getCurrentValue]" != "0"}
-scroll_size 40 10
GuidoTable colours {
-instances 5 1 25
-interactive true
GuidoColourBrowserField colour {
-translate lower
-display_length 14
-exclusive false
-label Colour
-max_length 32
-tip "Select a colour using the browser icon."
}
GuidoField label {
-dependency {"[ $false_colour_type getCurrentValue]" == "4"}
-translate none
-display_length 12
-label "Label"
-max_length 16
-tip "Enter the label to be used for the legend."
}
GuidoField expression {
-dependency {"[ $false_colour_type getCurrentValue]" == "4"}
-translate none
-display_length 35
-label "Expression"
-max_length 128
-tip "DTM_DRAW_EXPRESSION_TIP"
}
}
}
}
