Example #1
0
void Constraint::setAtomList(AtomList const& atoms)
{ 
   m_atoms = atoms;
   if (m_configurator) delete m_configurator;
   m_configurator = 0;

   switch (m_atoms.size()) {
      case 1:
         m_type = Position; 
         m_configurator = new Configurator::VectorConstraint(*this);
         break;
      case 2:
         m_type = Distance; 
         m_configurator = new Configurator::ScalarConstraint(*this);
         break;
      case 3:
         m_type = Angle; 
         m_configurator = new Configurator::ScalarConstraint(*this);
         break;
      case 4:
         m_type = Torsion; 
         m_configurator = new Configurator::ScalarConstraint(*this);
         break;
      default:
         m_type = Invalid; 
         setText("Invalid");
         return;
         break;
   }

   if (m_configurator) setConfigurator(m_configurator);

   AtomList::iterator iter;
   for (iter = m_atoms.begin(); iter != m_atoms.end(); ++iter) {
       connect(*iter, SIGNAL(orphaned()), this, SIGNAL(invalid()));
   }
}
Example #2
0
VertInf::~VertInf()
{
    COLA_ASSERT(orphaned());
}