Ignore:
Timestamp:
Sep 26, 2011 5:37:47 PM (10 years ago)
Author:
toby
Message:

fix/enhance rigid bodies some

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/rigid.tcl

    r1171 r1172  
    366366     AddRigidBody $temp_mat $temp_car
    367367     RecordMacroEntry "AddRigidBody $temp_mat $temp_car" 0
    368 
     368    RecordMacroEntry "incr expgui(changed)" 0
    369369     incr ::expgui(changed)
    370370     destroy .nbt
     
    406406#    increment expgui
    407407     incr ::expgui(changed)
     408    RecordMacroEntry "incr expgui(changed)" 0
    408409     RB_Load_RBdata
    409410     RB_Control_Panel 0
     
    424425
    425426     #Rigid body mapping control panel along with matrix multipliers and damping factor labels
    426      grid [label  $con.rb_num -text "Rigid Body Type $bodnum"] -row 0 -column 0 -padx 5 -pady 5
     427    set n [lindex [ReadRigidBody $bodnum] 0]
     428    if {$n == 0} {
     429        set str "(not mapped)"
     430    } elseif {$n == 1} {
     431        set str "(mapped 1 time)"
     432    } else {
     433        set str "(mapped $n times)"
     434    }
     435     grid [label  $con.rb_num -text "Rigid Body Type $bodnum\n$str"] -row 0 -column 0 -padx 5 -pady 5
    427436     grid [button $con.rb_newmap -text "Map Body $bodnum" -command "RB_Map_New $bodnum" -width 18] -row 0 -column 1 -padx 5 -pady 5
    428437     grid [button $con.rb_unmap -text "Unmap Body $bodnum" -command "RB_Unmap $bodnum" -width 18] -row 0 -column 2 -padx 5 -pady 5
     
    799808   RunRecalcRBCoords
    800809   incr ::expgui(changed)
     810   RecordMacroEntry "incr expgui(changed)" 0
    801811   RB_Populate $::rb_notebook $::body_type
    802812   $::rb_notebook raise rb_body$::body_type
     
    917927        }
    918928        incr ::expgui(changed)
     929         RecordMacroEntry "incr expgui(changed)" 0
    919930        destroy $panel
    920931        set curpage [$::rb_notebook raise]
     
    12701281     RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
    12711282     ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp
    1272      RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
     1283     RecordMacroEntry "ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp" 0
    12731284     #SetRigidBodyVar $bodnum $temp_var $temp_damp
    12741285     incr ::expgui(changed)
     1286    RecordMacroEntry "incr expgui(changed)" 0
    12751287     RB_Load_RBdata
    12761288     RB_Control_Panel $bodnum
     
    13981410        set temp1 [ExtractRigidBody $::rb_phase $::gcon_atoms $::gcon_start $::gcon_origin_list $vector1list $vector2list]
    13991411        if {[lindex $temp1 0] == {} || [lindex $temp1 1] == {} || [lindex $temp1 2] == {}} {
    1400    }
     1412            # an error occurred
     1413            return
     1414        }
    14011415
    14021416   set coordlist ""
     
    16281642
    16291643        set bodnum [AddRigidBody 1 $cartesian]
     1644     RecordMacroEntry "AddRigidBody 1 [list $cartesian]" 0
    16301645        # set ::rb_damp($bodnum,1) 0
    16311646        set ::rb_coord_num($bodnum,1) $::gcon_atoms
     
    16331648        MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]
    16341649        RecordMacroEntry "MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]" 0
    1635         destroy .geometry
    1636         RB_Control_Panel 0
     1650     incr ::expgui(changed)
     1651     RecordMacroEntry "incr expgui(changed)" 0
     1652     destroy .geometry
     1653     RB_Control_Panel 0
    16371654}
    16381655
     
    19651982                       }
    19661983                       incr ::expgui(changed)
    1967                        #RecordMacroEntry "incr expgui(changed)" 0
     1984                       RecordMacroEntry "incr expgui(changed)" 0
    19681985
    19691986               }
Note: See TracChangeset for help on using the changeset viewer.