Exemple #1
0
void KstSettingsDlg::defaults() {
  KstSettings s;

  setSettings(&s);
  setDirty();
}
Exemple #2
0
/**
  \brief Sets the translation component
  \param v A translation vector
*/
void
Dcs::setTranslate(const Vector3& v)
{
  _transMatrix.setTranslate(v);
  setDirty();
}
Exemple #3
0
/**
  \brief Sets the scale component
  \param m A scale matrix
*/
void
Dcs::setScale(const Matrix& m)
{
  _scaleMatrix = m;
  setDirty();
}
Exemple #4
0
/**
  \brief Sets the rotation component
  \param x x angle in rad
  \param y y angle in rad
  \param y y angle in rad
*/
void
Dcs::setRotate(const double x, const double y, const double z)
{
  _rotMatrix.setRotate(Vector3(x,y,z));
  setDirty();
}
Exemple #5
0
void
Dcs::rotate(const Matrix& rotMat)
{
  _rotMatrix = rotMat*_rotMatrix;
  setDirty();
}
void LLFloaterInspect::dirty()
{
	setDirty();
}
Exemple #7
0
/**
  \brief Sets the rotation component
  \param matrix A rotation matrix
*/
void
Dcs::setRotate(const Matrix& m)
{
  _rotMatrix = m;
  setDirty();
}
void KstPSD::setRemoveMean(bool in_removeMean) {
  setDirty();
  _RemoveMean = in_removeMean;
}
void KstPSD::setAverage(bool in_average) {
  setDirty();
  _Average = in_average;
}
KstObject::UpdateType KstPSD::update(int update_counter) {
  Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);

  bool force = dirty();
  setDirty(false);

  if (KstObject::checkUpdateCounter(update_counter) && !force) {
    return lastUpdateResult();
  }

  if (recursed()) {
    return setLastUpdateResult(NO_CHANGE);
  }

  writeLockInputsAndOutputs();

  KstVectorPtr iv = _inputVectors[INVECTOR];

  if (update_counter <= 0) {
    assert(update_counter == 0);
    force = true;
  }

  bool xUpdated = KstObject::UPDATE == iv->update(update_counter);

  const int v_len = iv->length();

  // Don't touch _last_n_new if !xUpdated since it will certainly be wrong.
  if (!xUpdated && !force) {
    unlockInputsAndOutputs();
    return setLastUpdateResult(NO_CHANGE);
  }

  _last_n_new += iv->numNew();
  assert(_last_n_new >= 0);

  int n_subsets = v_len/_PSDLen;

  // determine if the PSD needs to be updated. if not using averaging, then we need at least _PSDLen/16 new data points. if averaging, then we want enough new data for a complete subset.
  if ( ((_last_n_new < _PSDLen/16) || (_Average && (n_subsets - _last_n_subsets < 1))) &&  iv->length() != iv->numNew() && !force) {
    unlockInputsAndOutputs();
    return setLastUpdateResult(NO_CHANGE);
  }

  _adjustLengths();

  double *psd = (*_sVector)->value();
  double *f = (*_fVector)->value();

  int i_samp;
  for (i_samp = 0; i_samp < _PSDLen; ++i_samp) {
    f[i_samp] = i_samp * 0.5 * _Freq / (_PSDLen - 1);
  }

  _psdCalculator.calculatePowerSpectrum(iv->value(), v_len, psd, _PSDLen, _RemoveMean,  _interpolateHoles, _Average, _averageLen, _Apodize, _apodizeFxn, _gaussianSigma, _Output, _Freq);

  _last_n_subsets = n_subsets;
  _last_n_new = 0;

  updateVectorLabels();
  (*_sVector)->setDirty();
  (*_sVector)->update(update_counter);
  (*_fVector)->setDirty();
  (*_fVector)->update(update_counter);

  unlockInputsAndOutputs();

  return setLastUpdateResult(UPDATE);
}
void KstPSD::setApodize(bool in_apodize)  {
  setDirty();
  _Apodize = in_apodize;
}
Exemple #12
0
void SynthControl::changeMasterTuning()
{
    synti->setMasterTuning(masterTuning->value());
    changeTuningButton->setEnabled(false);
    setDirty();
}
Exemple #13
0
void KstSettingsDlg::updateTimezone(double hours) {
  _tz->setCurrentIndex(0);
// xxx  _tz->setCurrentText(timezoneFromUTCOffset(hours));
  setDirty();
}
Exemple #14
0
KstSettingsDlg::KstSettingsDlg(QWidget* parent, const char *name, Qt::WindowFlags fl) : QDialog(parent, fl) {
  QString hours = QObject::tr(" hours");
  QLineEdit* edit;

  setupUi(this);
printf("-1\n");
  fillAxesSettings();
  updateCurveColorSettings();
  setSettings(KstSettings::globalSettings());
  setClean();
  updateAxesButtons();
  updateAxesSettings();
  updateEMailSettings();
  updateUTCOffset();
printf("0\n");
  _source->insertItems(0, KstDataSource::pluginList());
  if (_source->count() > 0) {
    sourceChanged(_source->itemText(0));
  } else {
    _configureSource->setEnabled(false);
  }

  edit = _valueOffset->findChild<QLineEdit*>();
  if (edit) {
    edit->setMaxLength(5 + hours.length());
  }
printf("2\n");
  _valueOffset->setRange(-24.0, 24.0);
  _valueOffset->setSingleStep(0.50);
  _valueOffset->setSuffix(QObject::tr(" hours"));
// xxx  _colorPalette->_label->setText(QObject::tr("Curve color sequence: "));

  connect(_spinBoxLineWidth, SIGNAL(valueChanged(int)), this, SLOT(setDirty()));
  connect(_spinBoxLineWidth->findChild<QLineEdit*>(), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_valueOffset->findChild<QLineEdit*>(), SIGNAL(textChanged(const QString&)), this, SLOT(updateTimezone(const QString&)));
  connect(_timer->findChild<QLineEdit*>(), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_kIntSpinBoxEMailPort->findChild<QLineEdit*>(), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_colorPalette->_palette, SIGNAL(activated(int)), this, SLOT(setDirty()));
  connect(_fontSize->findChild<QLineEdit*>(), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_fontMinSize->findChild<QLineEdit*>(), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));

  connect(_cancel, SIGNAL(clicked()), this, SLOT(close()));
  connect(_timer, SIGNAL(valueChanged(int)), this, SLOT(setDirty()));
  connect(_defaults, SIGNAL(clicked()), this, SLOT(defaults()));
  connect(_ok, SIGNAL(clicked()), this, SLOT(save()));
  connect(_ok, SIGNAL(clicked()), this, SLOT(close()));
  connect(_colors, SIGNAL(bgChanged(QColor)), this, SLOT(setDirty()));
  connect(_colors, SIGNAL(bgChanged(QColor)), this, SLOT(setDirty()));
  connect(_xMajorGrid, SIGNAL(clicked()), this, SLOT(updateAxesButtons()));
  connect(_xMinorGrid, SIGNAL(clicked()), this, SLOT(updateAxesButtons()));
  connect(_yMajorGrid, SIGNAL(clicked()), this, SLOT(updateAxesButtons()));
  connect(_yMinorGrid, SIGNAL(clicked()), this, SLOT(updateAxesButtons()));
  connect(_checkBoxDefaultMajorGridColor, SIGNAL(clicked()), this, SLOT(updateAxesButtons()));
  connect(_checkBoxDefaultMinorGridColor, SIGNAL(clicked()), this, SLOT(updateAxesButtons()));
  connect(_checkBoxXInterpret, SIGNAL(toggled(bool)), _comboBoxXInterpret, SLOT(setEnabled(bool)));
  connect(_checkBoxXInterpret, SIGNAL(toggled(bool)), _comboBoxXDisplay, SLOT(setEnabled(bool)));
  connect(_configureSource, SIGNAL(clicked()), this, SLOT(configureSource()));
  connect(_source, SIGNAL(clicked(QString)), this, SLOT(sourceChanged(QString)));
  connect(_xMajorGrid, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_xMinorGrid, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_yMajorGrid, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_yMinorGrid, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_majorGridColor, SIGNAL(changed(QColor)), this, SLOT(setDirty()));
  connect(_minorGridColor, SIGNAL(changed(QColor)), this, SLOT(setDirty()));
  connect(_checkBoxDefaultMajorGridColor, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_checkBoxDefaultMinorGridColor, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_comboBoxXDisplay, SIGNAL(activated(int)), this, SLOT(setDirty()));
  connect(_promptWindowClose, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_showQuickStart, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_tiedZoomGlobal, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_lineEditSender, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
  connect(_lineEditHost, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
  connect(_lineEditLogin, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
  connect(_lineEditPassword, SIGNAL(textChanged(QString)), this, SLOT(setDirty()));
  connect(_checkBoxAuthentication, SIGNAL(clicked()), this, SLOT(setDirty()));
  connect(_buttonGroupEncryption, SIGNAL(clicked(int)), this, SLOT(setDirty()));
  connect(_buttonGroupAuthentication, SIGNAL(clicked(int)), this, SLOT(setDirty()));
  connect(_checkBoxXInterpret, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
  connect(_checkBoxAuthentication, SIGNAL(clicked()), this, SLOT(updateEMailSettings()));
  connect(_comboBoxXInterpret, SIGNAL(activated(QString)), this, SLOT(setDirty()));
  connect(_fontSize, SIGNAL(valueChanged(int)), this, SLOT(setDirty()));
  connect(_valueOffset, SIGNAL(valueChanged(double)), this, SLOT(updateTimezone(double)));
  connect(_fontMinSize, SIGNAL(valueChanged(int)), this, SLOT(setDirty()));
printf("3\n");
}
//virtual
void LLAvatarList::clear()
{
	getIDs().clear();
	setDirty(true);
	LLFlatListViewEx::clear();
}
void KstPSD::setLen(int in_len) {
  if (in_len != _averageLen) {
    _averageLen = in_len;
    setDirty();
  }
}
//////////////////////////////////////////////////////////////////////////
// PROTECTED SECTION
//////////////////////////////////////////////////////////////////////////
void LLAvatarList::refresh()
{
	bool have_names			= TRUE;
	bool add_limit_exceeded	= false;
	bool modified			= false;
	bool have_filter		= !mNameFilter.empty();

	// Save selection.	
	uuid_vec_t selected_ids;
	getSelectedUUIDs(selected_ids);
	LLUUID current_id = getSelectedUUID();

	// Determine what to add and what to remove.
	uuid_vec_t added, removed;
	LLAvatarList::computeDifference(getIDs(), added, removed);

	// Handle added items.
	unsigned nadded = 0;
	const std::string waiting_str = LLTrans::getString("AvatarNameWaiting");

	for (uuid_vec_t::const_iterator it=added.begin(); it != added.end(); it++)
	{
		const LLUUID& buddy_id = *it;
		LLAvatarName av_name;
		have_names &= LLAvatarNameCache::get(buddy_id, &av_name);

		if (!have_filter || findInsensitive(av_name.mDisplayName, mNameFilter))
		{
			if (nadded >= ADD_LIMIT)
			{
				add_limit_exceeded = true;
				break;
			}
			else
			{
				// *NOTE: If you change the UI to show a different string,
				// be sure to change the filter code below.
				if (LLRecentPeople::instance().isAvalineCaller(buddy_id))
				{
					const LLSD& call_data = LLRecentPeople::instance().getData(buddy_id);
					addAvalineItem(buddy_id, call_data["session_id"].asUUID(), call_data["call_number"].asString());
				}
				else
				{
					addNewItem(buddy_id, 
						av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, 
						LLAvatarTracker::instance().isBuddyOnline(buddy_id));
				}
				
				modified = true;
				nadded++;
			}
		}
	}

	// Handle removed items.
	for (uuid_vec_t::const_iterator it=removed.begin(); it != removed.end(); it++)
	{
		removeItemByUUID(*it);
		modified = true;
	}

	// Handle filter.
	if (have_filter)
	{
		std::vector<LLSD> cur_values;
		getValues(cur_values);

		for (std::vector<LLSD>::const_iterator it=cur_values.begin(); it != cur_values.end(); it++)
		{
			const LLUUID& buddy_id = it->asUUID();
			LLAvatarName av_name;
			have_names &= LLAvatarNameCache::get(buddy_id, &av_name);
			if (!findInsensitive(av_name.mDisplayName, mNameFilter))
			{
				removeItemByUUID(buddy_id);
				modified = true;
			}
		}
	}

	// Changed item in place, need to request sort and update columns
	// because we might have changed data in a column on which the user
	// has already sorted. JC
	sort();

	// re-select items
	//	selectMultiple(selected_ids); // TODO: implement in LLFlatListView if need
	selectItemByUUID(current_id);

	// If the name filter is specified and the names are incomplete,
	// we need to re-update when the names are complete so that
	// the filter can be applied correctly.
	//
	// Otherwise, if we have no filter then no need to update again
	// because the items will update their names.
	bool dirty = add_limit_exceeded || (have_filter && !have_names);
	setDirty(dirty);

	// Refreshed all items.
	if(!dirty)
	{
		// Highlight items matching the filter.
		std::vector<LLPanel*> items;
		getItems(items);
		for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++)
		{
			static_cast<LLAvatarListItem*>(*it)->setHighlight(mNameFilter);
		}

		// Send refresh_complete signal.
		mRefreshCompleteSignal(this, LLSD((S32)size(false)));
	}

	// Commit if we've added/removed items.
	if (modified)
		onCommit();
}
void KstPSD::setOutput(PSDType in_output)  {
  if (in_output != _Output) {
    setDirty();
    _Output = in_output;
  }
}
Exemple #19
0
void MeshView::drawMesh( DRAW_MODE d )
{
    if( m_meshPtr )
    {
        std::cout << "MeshView::drawMesh()" << std::endl;

        m_meshPtr->lock();

        Mesh::ConstFaceIter fIt(m_meshPtr->faces_begin()),
             fEnd(m_meshPtr->faces_end());
        Mesh::ConstFaceVertexIter fvIt;
        Mesh::ConstVertexIter vIt(m_meshPtr->vertices_begin());

        float color[4] = { 1.0, 1.0, 1.0, 1.0 };

        switch( d )
        {
        case POINTS_ONLY:
            glBegin(GL_POINTS);
            glColor3fv(color);
            for(; vIt!=m_meshPtr->vertices_end(); ++vIt)
            {
                if( prepareColor( color, m_meshPtr->color(vIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(vIt));
            }
            glEnd();
            break;
        case WIREFRAME:
            for (; fIt!=fEnd; ++fIt)
            {
                glBegin(GL_LINE_STRIP);
                glColor3fv(color);
                fvIt = m_meshPtr->cfv_iter(fIt.handle());
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                ++fvIt;
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                ++fvIt;
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                glEnd();
            }
            break;
        case FACETS:
        case FLAT_FACET:
            glBegin(GL_TRIANGLES);
            glColor3fv(color);
            for (; fIt!=fEnd; ++fIt)
            {
                glNormal3fv( m_meshPtr->normal( fIt.handle() ) );
                fvIt = m_meshPtr->cfv_iter(fIt.handle());
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                ++fvIt;
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                ++fvIt;
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
            }
            glEnd();
            break;
        case SMOOTH_FACET:
            glBegin(GL_TRIANGLES);
            glColor3fv(color);
            for (; fIt!=fEnd; ++fIt)
            {
                fvIt = m_meshPtr->cfv_iter(fIt.handle());
                glNormal3fv(m_meshPtr->normal(fvIt.handle()) );
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                ++fvIt;
                glNormal3fv(m_meshPtr->normal(fvIt.handle()));
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
                ++fvIt;
                glNormal3fv(m_meshPtr->normal(fvIt.handle()));
                if( prepareColor( color, m_meshPtr->color(fvIt) ) )
                    glColor3fv(color);
                glVertex3dv(m_meshPtr->point(fvIt));
            }
            glEnd();
            break;
        default:
            break;
        }
        //glFlush();
        m_meshPtr->unlock();
        setDirty(false);
        //std::cout << " } MeshView::drawMesh()" << std::endl;
    }
}
void KstPSD::setApodizeFxn(ApodizeFunction in_apodizeFxn) {
  if (_apodizeFxn != in_apodizeFxn) {
    setDirty();
    _apodizeFxn = in_apodizeFxn;
  }
}
Exemple #21
0
/**
  \brief Sets the rotation component

  \param matrix A rotation matrix
*/
void
Dcs::setRotate(const Vector3& v)
{
  _rotMatrix.setRotate(v);
  setDirty();
}
void KstPSD::setGaussianSigma(double in_gaussianSigma) {
  if (_gaussianSigma != in_gaussianSigma) {
    setDirty();
    _gaussianSigma = in_gaussianSigma;
  }
}
Exemple #23
0
/**
  \brief Sets the rotation component
  \param v Vector specifiy the fraction of the angle for this axis
  \param angle Vector specifiy the fraction of the angle for this axis
*/
void
Dcs::setRotate(const Vector3& v, double angle)
{
  _rotMatrix.setRotate(v, angle);
  setDirty();
}
void KstPSD::setInterpolateHoles(bool interpolate) {
  if (interpolate != _interpolateHoles) {
    _interpolateHoles = interpolate;
    setDirty();
  }
}
Exemple #25
0
/**
  \brief Sets the translation component
  \param m A translation matrix
*/
void
Dcs::setTranslate(const Matrix& m)
{
  _transMatrix = m;
  setDirty();
}
void LLFloaterInspect::onGetCreatorNameCallback(const LLUUID& id)
{
	mCreatorNameCacheConnection.erase(id);
	setDirty();
}
Exemple #27
0
/**
  \brief Sets the translation component
  \param x Translation along the x axis
  \param y Translation along the y axis
  \param z Translation along the z axis
*/
void
Dcs::setTranslate(const double x, const double y, const double z)
{
  _transMatrix.setTranslate(x,y,z);
  setDirty();
}
Exemple #28
0
void Sprite::updateTransform(void)
{
    CCASSERT(_batchNode, "updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode");

    // recalculate matrix only if it is dirty
    if( isDirty() ) {

        // If it is not visible, or one of its ancestors is not visible, then do nothing:
        if( !_visible || ( _parent && _parent != _batchNode && static_cast<Sprite*>(_parent)->_shouldBeHidden) )
        {
            _quad.br.vertices.setZero();
            _quad.tl.vertices.setZero();
            _quad.tr.vertices.setZero();
            _quad.bl.vertices.setZero();
            _shouldBeHidden = true;
        }
        else
        {
            _shouldBeHidden = false;

            if( ! _parent || _parent == _batchNode )
            {
                _transformToBatch = getNodeToParentTransform();
            }
            else
            {
                CCASSERT( dynamic_cast<Sprite*>(_parent), "Logic error in Sprite. Parent must be a Sprite");
                const Mat4 &nodeToParent = getNodeToParentTransform();
                Mat4 &parentTransform = static_cast<Sprite*>(_parent)->_transformToBatch;
                _transformToBatch = parentTransform * nodeToParent;
            }

            //
            // calculate the Quad based on the Affine Matrix
            //

            Size &size = _rect.size;

            float x1 = _offsetPosition.x;
            float y1 = _offsetPosition.y;

            float x2 = x1 + size.width;
            float y2 = y1 + size.height;
            float x = _transformToBatch.m[12];
            float y = _transformToBatch.m[13];

            float cr = _transformToBatch.m[0];
            float sr = _transformToBatch.m[1];
            float cr2 = _transformToBatch.m[5];
            float sr2 = -_transformToBatch.m[4];
            float ax = x1 * cr - y1 * sr2 + x;
            float ay = x1 * sr + y1 * cr2 + y;

            float bx = x2 * cr - y1 * sr2 + x;
            float by = x2 * sr + y1 * cr2 + y;

            float cx = x2 * cr - y2 * sr2 + x;
            float cy = x2 * sr + y2 * cr2 + y;

            float dx = x1 * cr - y2 * sr2 + x;
            float dy = x1 * sr + y2 * cr2 + y;

            _quad.bl.vertices.set(RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _positionZ);
            _quad.br.vertices.set(RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _positionZ);
            _quad.tl.vertices.set(RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _positionZ);
            _quad.tr.vertices.set(RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _positionZ);
        }

        // MARMALADE CHANGE: ADDED CHECK FOR nullptr, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS
        if (_textureAtlas)
        {
            _textureAtlas->updateQuad(&_quad, _atlasIndex);
        }

        _recursiveDirty = false;
        setDirty(false);
    }

    // MARMALADE CHANGED
    // recursively iterate over children
/*    if( _hasChildren )
    {
        // MARMALADE: CHANGED TO USE Node*
        // NOTE THAT WE HAVE ALSO DEFINED virtual Node::updateTransform()
        arrayMakeObjectsPerformSelector(_children, updateTransform, Sprite*);
    }*/
    Node::updateTransform();
}
Exemple #29
0
/**
  \brief Sets the scale component
  \param v A Vector3 with the scale factors for each axis
*/
void
Dcs::setScale(const Vector3& v)
{
  _scaleMatrix.setScale(v);
  setDirty();
}
Exemple #30
0
void TrackInfoObject::slotCueUpdated() {
    setDirty(true);
    emit(cuesUpdated());
}