
# Set the initial values of the parameters.
#
# Copyright (c) 1993, 1994 Pacific Marketing and Consulting
# Author:  Wayne A. Christopher, wayne@pmac.com
#          Pacific Marketing and Consulting, Berkeley, California

# Every object has the following fields:
#     current_genus -- usually default but might be free or recirc
#     section_list -- the list of sections that are defined
#     current_section -- which of the sections is being currently edited
#     current_stype -- the type of the shape of the current section
# For each section:
#     <sectname>_shape -- the handle of the actual shape

set object_type_layout {
    domain hexa cyl polygon incline nl
    quad circ pipe sphere oval cad
}
# part ellipse pipe

set object_type_list ""
foreach t $object_type_layout {
    if {$t != "nl"} { lappend object_type_list $t }
}

# This goes from low priority objects to high ones, basically
# volume->flat->wire
set object_category(grid) {
    hexa cyl polygon incline ellipse sphere oval cad quad circ pipe
}

set object_category(grid_priority) {
    {hexa cyl polygon incline ellipse sphere oval cad}
    {quad circ}
    pipe
}

set type_name(domain) domain

set volume_types {solid hollow fluid}

set tree_icon_prefix $app_dir/../icons/auto_generic_
set tree_icon_prefix2 $app_dir/../icons/icepak_

# --------------------------------------------------------------------

set app_graph_types ""
foreach xx {
    { domain   blue   1 ""   "" fixed }
    { hexa     yellow 1 view "" fixed }
    { cyl      pink   1 view "" fixed }
    { polygon  cyan   1 view "" fixed } 
    { incline  green  1 view "" fixed }
    { quad     yellow 1 view "" fixed }
    { circ     beige  1 view "" fixed }
    { pipe     yellow 1 view "" fixed }
    { ellipse  orange 1 view "" fixed }
    { sphere   orange 1 view "" fixed }
    { oval     orange 1 view "" fixed }
    { cad      cyan   1 view "" fixed }
} {
    set type [lindex $xx 0]
    set graph_color($type) [lindex $xx 1]
    set graph_width($type) [lindex $xx 2]
    set graph_shadepolicy($type) [lindex $xx 3]
    set graph_fancy($type) [lindex $xx 4]
    set graph_font($type) [lindex $xx 5]
    
    lappend app_graph_types $type
}

# --------------------------------------------------------------------

set object_params(domain) {
    { "Min X family"    fam_minx string __default_side_family__ }
    { "Max X family"    fam_maxx string __default_side_family__ }
    { "Min Y family"    fam_miny string __default_side_family__ }
    { "Max Y family"    fam_maxy string __default_side_family__ }
    { "Min Z family"    fam_minz string __default_side_family__ }
    { "Max Z family"    fam_maxz string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}

set object_edit_info(domain) {
    { default default {
	body Body { hexa Prism } { cyl Cylinder } { polygon Polygon }
	{ sphere Ellipsoid } { oval "E. cylinder" }
    } }
}

set object_type_title(domain) "Domain"

set object_edit_params(domain,body,hexa) {
    { button "Autoscale" app_domain_autoscale }
}

# this is not quite correct but it needs to be here anyway
set object_edit_params(domain,body,none) {
    { button "Autoscale" app_domain_autoscale }
}

# --------------------------------------------------------------------

set object_params(hexa) {
    { "Block type"      type     string solid }
    { "Interior family" fam_int  string "" }
    { "Min X family"    fam_minx string __default_side_family__ }
    { "Max X family"    fam_maxx string __default_side_family__ }
    { "Min Y family"    fam_miny string __default_side_family__ }
    { "Max Y family"    fam_maxy string __default_side_family__ }
    { "Min Z family"    fam_minz string __default_side_family__ }
    { "Max Z family"    fam_maxz string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(hexa) \
    { { default default { body Body { hexa Hexa } } } }
set object_type_title(hexa) "Hexas"
set object_edit_params(hexa,body,hexa) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set object_params(cyl) {
    { "Block type"      type      string solid } 
    { "Interior family" fam_int   string "" }
    { "Bottom family"   fam_bot   string __default_side_family__ }
    { "Top family"      fam_top   string __default_side_family__ }
    { "Side family"     fam_sides string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(cyl) \
    { { default default { body Body { cyl Cyl } } } }
set object_type_title(cyl) "Cylinders"
set object_edit_params(cyl,body,cyl) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set object_params(polygon) {
    { "Block type"      type      string solid } 
    { "Interior family" fam_int   string "" }
    { "Bottom family"   fam_bot   string __default_side_family__ }
    { "Top family"      fam_top   string __default_side_family__ }
    { "Side family"     fam_sides string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(polygon) \
    { { default default { body Body { polygon Polygon } } } }
set object_type_title(polygon) "Polygons"
set object_edit_params(polygon,body,polygon) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set object_params(incline) { 
    { "Block type"      type      string solid } 
    { "Interior family" fam_int   string "" }
    { "Top family"      fam_top   string __default_side_family__ }
    { "Bottom family"   fam_bot   string __default_side_family__ }
    { "Side family"     fam_sides string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(incline) \
    { { default default { body Body { incline Incline } } } }
set object_type_title(incline) "Inclines"
set object_edit_params(incline,body,incline) {
    {Thick "Thickness" shape_data(thickness) has_units length }
    {Type  "Type"      model_data(type) hollow solid fluid }
}

set object_params(pipe) {
    { "Block type"      type      string solid } 
    { "Interior family" fam_int   string "" }
    { "Bottom family"   fam_bot   string __default_side_family__ }
    { "Top family"      fam_top   string __default_side_family__ }
    { "Side family"     fam_sides string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(pipe) \
    { { default default { body Body { pipe Pipe } } } }
set object_type_title(pipe) "Pipes/wires"
set type_name(pipe) pipe
set object_edit_params(pipe,body,pipe) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set full_pipe_model 1

set object_params(ellipse) {
    { "Block type"      type     string solid }
    { "Interior family" fam_int  string "" }
    { "Outer family"    fam_outer string __default_side_family__ }
    { "Inner family"    fam_inner string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(ellipse) \
    { { default default { body Body { ellipse Ellipse } } } }
set object_type_title(ellipse) "Ellipses"
set object_edit_params(ellipse,body,ellipse) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set object_params(sphere) {
    { "Block type"      type     string solid }
    { "Interior family" fam_int  string "" }
    { "Sides family"    fam_sides string __default_side_family__ }
    { "Inner family"    fam_inner string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(sphere) \
    { { default default { body Body { sphere Ellipsoid } } } }
set object_type_title(sphere) "Ellipsoids"
set object_edit_params(sphere,body,sphere) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set object_params(oval) {
    { "Block type"      type      string solid } 
    { "Interior family" fam_int   string "" }
    { "Bottom family"   fam_bot   string __default_side_family__ }
    { "Top family"      fam_top   string __default_side_family__ }
    { "Side family"     fam_sides string __default_side_family__ }
    { "Inner radius family"    fam_irad string __default_side_family__ }
    { "Inner family"    fam_inner string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(oval) \
    { { default default { body Body { oval "E. cylinder" } } } }
set object_type_title(oval) "E. cylinders"
set object_edit_params(oval,body,oval) {
    {Type "Type" model_data(type) hollow solid fluid }
}

set object_params(cad) {
    { "Block type"      type         string solid } 
    { "Point family"    fam_point    string __default_side_family__ }
    { "Curve family"    fam_curve    string __default_side_family__ }
    { "Surface family"  fam_surface  string __default_side_family__ }
    { "Material family" fam_material string __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(cad) \
    { { default default { body Body { cad "Cad object" } } } }
set object_type_title(cad) "CAD objects"
set object_edit_params(cad,body,cad) {
    {Type "Type" model_data(type) hollow solid fluid }
}

# ------------------

set object_params(quad) {
    { "Family" fam_face string  __default_side_family__ }
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(quad) \
    { { default default { body Body { quad Quad } } } }
set object_type_title(quad) "Quads"
set object_edit_params(quad,body,quad) {
}

set object_params(circ) {
    { "Family" fam_face string  __default_side_family__ } 
    { "Default color"   obj_color_default int 1 }
    { "Object color"    obj_color  string white }
}
set object_edit_info(circ) \
    { { default default { body Body { circ Circ } } } }
set object_type_title(circ) "Circles"
set object_edit_params(circ,body,circ) {
}

if $default_families_from_object_names {
    set defname ""
} else {
    set defname $default_side_family
}

foreach ppp [array names object_params] {
    regsub -all __default_side_family__ $object_params($ppp) \
	$defname object_params($ppp)
}

foreach type $object_category(grid) {
    set object_sections($type) \
	[list "Body body_shape $type"]
}
