Ejemplo n.º 1
0
void MetaGLInfoClass::removeObjectSlot(Geometry::Type type, qint32 objectNumber)
{
    if (type == Geometry::Line)
    {
        Line3DNode* lineNode = lineHash->value(objectNumber);
        lineHash->remove(objectNumber);
        if (lineNode)
            lineNode->deleteLater();
    }
    else if (type == Geometry::Rect)
    {
        Rect3DNode* rectNode = rectHash->value(objectNumber);
        rectHash->remove(objectNumber);
        if (rectNode)
            rectNode->deleteLater();
    }
    else if (type == Geometry::Pin || type == Geometry::Tag || type == Geometry::Point)
    {
        Point3DNode* pointNode = pointHash->value(objectNumber);
        pointHash->remove(objectNumber);
        if (pointNode)
            pointNode->deleteLater();
    }
    displayed();
}
Ejemplo n.º 2
0
void FPS::prepare() {
  if (!displayed()) return;
  ++loop_count;
  double curtime = time_of_day();
  // force a redraw....
  need_matrix_recalc();
  // but don't redraw indicator more than twice per second
  if (curtime - last_update < 0.5) return;
  double rate = loop_count / (curtime - last_update);
  last_update = curtime;
  loop_count = 0;

  reset_disp_list();
  append(DMATERIALOFF);

  float asp = disp->aspect();
  float poscale = 1.2f;
  float pos[3];
  pos[0] = asp * poscale;
  pos[1] = poscale;
  pos[2] = 0;
  
  DispCmdColorIndex cmdColor;
  cmdColor.putdata(usecolor, cmdList);

  DispCmdText cmdText;
  char buf[20];
  sprintf(buf, "%5.2f", rate);
  cmdText.putdata(pos, buf, 1.0f, cmdList);
}
Ejemplo n.º 3
0
// Return true if ANY representation is displaying atom n
int DrawMolecule::atom_displayed(int n) {
  if (displayed() && n >= 0 && n < nAtoms) {
    for (int i=(components() - 1); i >= 0; i--) {
      if ((repList[i])->atom_displayed(n))
        return TRUE; // atom is shown
    }
  }
  return FALSE; // atom is not shown
}
void ImageWidget::fitToWindow()
{
    bool fitToWindow = m_actionFitToWindow->isChecked();
    m_scrollArea->setWidgetResizable(fitToWindow);
    if (!fitToWindow) {
        normalSize();
    }
    updateActions();
    emit displayed(fitToWindow);
}
Ejemplo n.º 5
0
void Video_RX::run(){




        emit displayed(video_sink,2);
        gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
        gst_x_overlay_expose(GST_X_OVERLAY(video_sink));
        new_video_rx_stream=true;

}
void ImageWidget::load(const QPixmap& pixmap, QString comment)
{

    m_imageLabel->setPixmap(pixmap);

    m_scaleFactor = 1.0;

    m_actionFitToWindow->setEnabled(true);
    updateActions();

    if (!m_actionFitToWindow->isChecked())
        m_imageLabel->adjustSize();
    m_imageLabel->show();
    m_fileName = comment;
    //this->fitToWindow();
    emit displayed(m_actionFitToWindow->isChecked());
    if (!m_actionFitToWindow->isChecked())
        m_actionFitToWindow->trigger();
}
Ejemplo n.º 7
0
void HWChatWidget::setStyleSheet(const QString & styleSheet)
{
    QString orgStyleSheet = styleSheet;
    QString style = QString(orgStyleSheet);

    // no stylesheet supplied, search for one or use default
    if (orgStyleSheet.isEmpty())
    {
        // load external stylesheet if there is any
        QFile extFile("physfs://css/chat.css");

        QFile resFile(":/res/css/chat.css");

        QFile & file = (extFile.exists()?extFile:resFile);

        if (file.open(QIODevice::ReadOnly | QIODevice::Text))
        {
            QTextStream in(&file);
            while (!in.atEnd())
            {
                style.append(in.readLine()+"\n");
            }
            orgStyleSheet = style;

            file.close();
        }
    }

    // let's parse display:none; ...

    // prepare for MAGIC :D

    // matches (multi-)whitespaces (for replacement with simple space)
    QRegExp ws("\\s+");

    // matches comments (for removal)
    QRegExp rem("/\\*([^*]|\\*(?!/))*\\*/");

    // strip comments and multi-whitespaces to compress the style-sheet a bit
    style = style.remove(rem).replace(ws," ");


    // now let's see what messages the user does not want to be displayed
    // by checking for display:none; (since QTextBrowser does not support it)

    // MOAR MAGIC :DDD

    // matches definitions lacking display:none; (for removal)
    QRegExp displayed(
        "([^{}]*\\{)(?!([^}]*;)* ?display ?: ?none ?(;[^}]*)?\\})[^}]*\\}");

    // matches all {...} and , (used as seperator for splitting into names)
    QRegExp split(" *(\\{[^}]*\\}|,) *");

    // matches class names that are referenced without hierachy
    QRegExp nohierarchy("^.[^ .]+$");

    QStringList victims = QString(style).
                          remove(displayed). // remove visible stuff
                          trimmed().
                          split(split). // get a list of the names
                          filter(nohierarchy). // only direct class names
                          replaceInStrings(QRegExp("^."),""); // crop .


    if (victims.contains("timestamp"))
    {
        s_isTimeStamped = false;
        victims.removeAll("timestamp");
    }
    else
    {
        s_isTimeStamped = true;
        s_tsFormat =
            ((victims.contains("timestamp:hours"))?"":"hh:") +
            QString("mm") +
            ((victims.contains("timestamp:seconds"))?"":":ss");
    }

    victims.removeAll("timestamp:hours");
    victims.removeAll("timestamp:seconds");

    victims.removeDuplicates();

    QStringList * oldDisplayNone = s_displayNone;
    QString * oldStyleSheet = s_styleSheet;

    s_displayNone = new QStringList(victims);
    s_styleSheet = new QString(orgStyleSheet);

    if (oldDisplayNone != NULL)
        delete oldDisplayNone;

    if (oldStyleSheet != NULL)
        delete oldStyleSheet;

}
Ejemplo n.º 8
0
void Sorting::hideEvent(QHideEvent *) {
    emit(displayed(false));
}
Ejemplo n.º 9
0
void Sorting::closeEvent(QCloseEvent *) {
    emit(displayed(false));
}
Ejemplo n.º 10
0
void Sorting::showEvent(QShowEvent *) {
    emit(displayed(true));
}
Ejemplo n.º 11
0
void TimelineControl::hideEvent(QHideEvent *) {
    emit(displayed(false));
}
Ejemplo n.º 12
0
void TimelineControl::closeEvent(QCloseEvent *) {
    emit(displayed(false));
}
Ejemplo n.º 13
0
void TimelineControl::showEvent(QShowEvent *) {
    emit(displayed(true));
}
Ejemplo n.º 14
0
// return whether the pickable object is being displayed
int Displayable::pickable_on(void) {
  return displayed();
}