示例#1
0
Background::Background() : m_backgroundColor(Preferences::BackgroundColor()), 
   m_foregroundColor(Preferences::ForegroundColor()), m_configurator(*this) 
{ 
   setText("Background");
   setCheckState(Qt::Checked);
   setConfigurator(&m_configurator);
   connect(newAction("Edit Color"), SIGNAL(triggered()), this, SLOT(configure()));
}
示例#2
0
EfpFragmentList::EfpFragmentList(Layer::Base* parent) : Base("EFP Fragments"), m_atomScale(0.5),
   m_bondScale(0.5), m_drawMode(Primitive::Tubes), m_configurator(*this) 
{
   setConfigurator(&m_configurator);
   setPersistentParent(parent);
   setProperty(RemoveWhenChildless);
   setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled );
   setCheckState(Qt::Checked);
}
示例#3
0
Surface::Surface(Grid::DataType const type, int const quality, double const isovalue, 
   QColor const& positive, QColor const& negative, bool const upsample) 
   : m_type(type), m_quality(quality), m_isovalue(isovalue), m_shininess(50.0), 
     m_specular(0.5), m_drawMode(Fill), m_upsample(upsample),  m_configurator(this), 
     m_callListPositive(0), m_callListNegative(0), m_areaPositive(0.0), m_areaNegative(0.0)
{ 
   setFlags(Qt::ItemIsUserCheckable);
   setCheckState(Qt::Unchecked);
   setColor(positive, Positive); 
   setColor(negative, Negative); 
   setConfigurator(&m_configurator); 
   setText(m_type.info());
   m_configurator.setWindowTitle("Configure Surface: " + m_type.info());
   createToolTip();
   // This is slightly less than 1 to ensure all surfaces are drawn after the
   // Primitives (which have alpha = 1.0) when sorted in the ViewerModel, but
   // because it is > 0.99 it won't tigger the transparency overhead in draw();
   setAlpha(0.999); 
   updated();
}
示例#4
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()));
   }
}
示例#5
0
File::File(QString const& filePath) : m_filePath(filePath), m_configurator(*this)
{
   QFileInfo fileInfo(m_filePath);
   setText(fileInfo.fileName());
   setConfigurator(&m_configurator);
}
示例#6
0
File::File(Data::File const& file) : m_filePath(file.path()), m_configurator(*this)
{
   QFileInfo fileInfo(m_filePath);
   setText(fileInfo.fileName());
   setConfigurator(&m_configurator);
}