Update of /cvsroot/pure-data/externals/nusmuk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18370
Modified Files: msd.h Log Message: bugs fixed and lists methods ordered
Index: msd.h =================================================================== RCS file: /cvsroot/pure-data/externals/nusmuk/msd.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** msd.h 4 May 2005 16:12:09 -0000 1.7 --- msd.h 9 May 2005 14:12:19 -0000 1.8 *************** *** 336,340 **** t_float limit[N][2]; // Limit values ! unsigned int id_mass, id_link, mouse_grab, nearest_mass;
// --------------------------------------------------------------- RESET --- 336,340 ---- t_float limit[N][2]; // Limit values ! unsigned int id_mass, id_link, mouse_grab, nearest_mass, link_deleted, mass_deleted;
// --------------------------------------------------------------- RESET *************** *** 473,480 **** } ! t_mass *m = mass.remove(GetAInt(argv[0])); if(m) { // Delete all associated links ! for(typename std::vector<t_link *>::iterator it = m->links.begin(); it != m->links.end(); ++it) deletelink(*it); outmass(S_Mass_deleted,m); --- 473,480 ---- } ! t_mass *m = mass.find(GetAInt(argv[0])); if(m) { // Delete all associated links ! for(typename std::vector<t_link *>::iterator it = m->links.begin(); it < m->links.end(); ++it) deletelink(*it); outmass(S_Mass_deleted,m); *************** *** 482,485 **** --- 482,486 ---- mass.remove(m->nbr); delete m; + mass_deleted = 1; } else *************** *** 678,683 **** t_link *l = link.find(GetAInt(argv[0])); ! if(l) deletelink(l); else { error("%s - %s : Index not found",thisName(),GetString(thisTag())); --- 679,686 ---- t_link *l = link.find(GetAInt(argv[0])); ! if(l) { deletelink(l); + link_deleted = 1; + } else { error("%s - %s : Index not found",thisName(),GetString(thisTag())); *************** *** 838,860 **** // List of masses positions on first outlet void m_mass_dumpl() ! { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz*N); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! for(int i = 0; i < N; ++i) SetFloat(*(s++),mit.data()->pos[i]); ! ToOutAnything(0, S_massesPosL, sz*N, sortie); ! DELARR(sortie); } // List of masses x positions on first outlet void m_mass_dump_xl() { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! SetFloat(*(s++),mit.data()->pos[0]); ! ToOutAnything(0, S_massesPosXL, sz, sortie); ! DELARR(sortie); }
--- 841,872 ---- // List of masses positions on first outlet void m_mass_dumpl() ! { ! if (mass_deleted ==0) { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz*N); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! for(int i = 0; i < N; ++i) SetFloat(s[mit.data()->nbr*N+i],mit.data()->pos[i]); ! ToOutAnything(0, S_massesPosL, sz*N, sortie); ! DELARR(sortie); ! } ! else ! error("%s - %s : Message Forbidden when deletion is used",thisName(),GetString(thisTag())); } + // List of masses x positions on first outlet void m_mass_dump_xl() { ! if (mass_deleted ==0) { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! SetFloat(s[mit.data()->nbr],mit.data()->pos[0]); ! ToOutAnything(0, S_massesPosXL, sz, sortie); ! DELARR(sortie); ! } ! else ! error("%s - %s : Message Forbidden when deletion is used",thisName(),GetString(thisTag())); }
*************** *** 862,872 **** void m_mass_dump_yl() { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! SetFloat(*(s++),mit.data()->pos[1]); ! ToOutAnything(0, S_massesPosYL, sz, sortie); ! DELARR(sortie); }
--- 874,888 ---- void m_mass_dump_yl() { ! if (mass_deleted ==0) { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! SetFloat(s[mit.data()->nbr],mit.data()->pos[1]); ! ToOutAnything(0, S_massesPosYL, sz, sortie); ! DELARR(sortie); ! } ! else ! error("%s - %s : Message Forbidden when deletion is used",thisName(),GetString(thisTag())); }
*************** *** 874,884 **** void m_mass_dump_zl() { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! SetFloat(*(s++),mit.data()->pos[2]); ! ToOutAnything(0, S_massesPosZL, sz, sortie); ! DELARR(sortie); }
--- 890,904 ---- void m_mass_dump_zl() { ! if (mass_deleted ==0) { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! SetFloat(s[mit.data()->nbr],mit.data()->pos[2]); ! ToOutAnything(0, S_massesPosZL, sz, sortie); ! DELARR(sortie); ! } ! else ! error("%s - %s : Message Forbidden when deletion is used",thisName(),GetString(thisTag())); }
*************** *** 886,896 **** void m_force_dumpl() { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz*N); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! for(int i = 0; i < N; ++i) SetFloat(*(s++),mit.data()->out_force[i]); ! ToOutAnything(0, S_massesForcesL, sz*N, sortie); ! DELARR(sortie); }
--- 906,920 ---- void m_force_dumpl() { ! if (mass_deleted ==0) { ! int sz = mass.size(); ! NEWARR(t_atom,sortie,sz*N); ! t_atom *s = sortie; ! for(typename IndexMap<t_mass *>::iterator mit(mass); mit; ++mit) ! for(int i = 0; i < N; ++i) SetFloat(s[mit.data()->nbr*N+i],mit.data()->out_force[i]); ! ToOutAnything(0, S_massesForcesL, sz*N, sortie); ! DELARR(sortie); ! } ! else ! error("%s - %s : Message Forbidden when deletion is used",thisName(),GetString(thisTag())); }
*************** *** 919,923 **** mass.reset(); ! id_mass = id_link = mouse_grab = 0; } --- 943,947 ---- mass.reset(); ! id_mass = id_link = mouse_grab = mass_deleted = link_deleted = 0; }