bool CSSMutableStyleDeclaration::setProperty(int propertyID, const String& value, bool important, bool notifyChanged, ExceptionCode& ec) { ec = 0; // Setting the value to an empty string just removes the property in both IE and Gecko. // Setting it to null seems to produce less consistent results, but we treat it just the same. if (value.isEmpty()) { removeProperty(propertyID, notifyChanged, false, ec); return ec == 0; } // When replacing an existing property value, this moves the property to the end of the list. // Firefox preserves the position, and MSIE moves the property to the beginning. CSSParser parser(useStrictParsing()); bool success = parser.parseValue(this, propertyID, value, important); if (!success) { // CSS DOM requires raising SYNTAX_ERR here, but this is too dangerous for compatibility, // see <http://bugs.webkit.org/show_bug.cgi?id=7296>. } else if (notifyChanged) setChanged(); ASSERT(!ec); return success; }
//_______________________________________________________ void ExceptionListWidget::edit( void ) { // retrieve selection QModelIndex current( m_ui.exceptionListView->selectionModel()->currentIndex() ); if( ! model().contains( current ) ) return; InternalSettingsPtr exception( model().get( current ) ); // create dialog QPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) ); dialog->setWindowTitle( i18n( "Edit Exception - Menda Settings" ) ); dialog->setException( exception ); // map dialog if( !dialog->exec() ) { delete dialog; return; } // check modifications if( !dialog->isChanged() ) return; // retrieve exception dialog->save(); delete dialog; // check new exception validity checkException( exception ); resizeColumns(); setChanged( true ); return; }
DECLARE_EXPORT void Buffer::setMaximumCalendar(CalendarDefault *cal) { // Resetting the same calendar if (max_cal == cal) return; // Mark as changed setChanged(); // Delete previous events. for (flowplanlist::iterator oo=flowplans.begin(); oo!=flowplans.end(); ) if (oo->getType() == 4) { flowplans.erase(&(*oo)); delete &(*(oo++)); } else ++oo; // Null pointer passed. Change back to time independent max. if (!cal) { setMaximum(max_val); return; } // Create timeline structures for every bucket. A new entry is created only // when the value changes. max_cal = const_cast<CalendarDefault*>(cal); double curMax = 0.0; for (CalendarDefault::EventIterator x(max_cal); x.getDate()<Date::infiniteFuture; ++x) if (curMax != x.getValue()) { curMax = x.getValue(); flowplanlist::EventMaxQuantity *newBucket = new flowplanlist::EventMaxQuantity(x.getDate(), &flowplans, curMax); flowplans.insert(newBucket); } }
//_______________________________________________________ void ExceptionListWidget::add( void ) { QPointer<ExceptionDialog> dialog = new ExceptionDialog( this ); ConfigurationPtr exception( new Configuration() ); exception->readConfig(); dialog->setException( exception ); // run dialog and check existence if( !dialog->exec() ) { delete dialog; return; } dialog->save(); delete dialog; // check exceptions if( !checkException( exception ) ) return; // create new item model().add( exception ); setChanged( true ); // make sure item is selected QModelIndex index( model().index( exception ) ); if( index != ui.exceptionListView->selectionModel()->currentIndex() ) { ui.exceptionListView->selectionModel()->select( index, QItemSelectionModel::Clear|QItemSelectionModel::Select|QItemSelectionModel::Rows ); ui.exceptionListView->selectionModel()->setCurrentIndex( index, QItemSelectionModel::Current|QItemSelectionModel::Rows ); } resizeColumns(); return; }
DECLARE_EXPORT void Resource::setMaximumCalendar(CalendarDefault* c) { // Resetting the same calendar if (size_max_cal == c) return; // Mark as changed setChanged(); // Remove the current max events. for (loadplanlist::iterator oo=loadplans.begin(); oo!=loadplans.end(); ) if (oo->getType() == 4) { loadplans.erase(&(*oo)); delete &(*(oo++)); } else ++oo; // Null pointer passed. Change back to time independent maximum size. if (!c) { setMaximum(size_max); return; } // Create timeline structures for every bucket. size_max_cal = c; double curMax = 0.0; for (CalendarDefault::EventIterator x(size_max_cal); x.getDate()<Date::infiniteFuture; ++x) if (curMax != x.getValue()) { curMax = x.getValue(); loadplanlist::EventMaxQuantity *newBucket = new loadplanlist::EventMaxQuantity(x.getDate(), &loadplans, curMax); loadplans.insert(newBucket); } }
//_______________________________________________ void ConfigWidget::updateChanged( void ) { // check configuration if( !m_internalSettings ) return; // track modifications bool modified( false ); if( m_ui.titleAlignment->currentIndex() != m_internalSettings->titleAlignment() ) modified = true; else if( m_ui.buttonSize->currentIndex() != m_internalSettings->buttonSize() ) modified = true; else if( m_ui.drawBorderOnMaximizedWindows->isChecked() != m_internalSettings->drawBorderOnMaximizedWindows() ) modified = true; else if( m_ui.drawSizeGrip->isChecked() != m_internalSettings->drawSizeGrip() ) modified = true; // exceptions else if( m_ui.exceptions->isChanged() ) modified = true; // animations else if( m_ui.animationsEnabled->isChecked() != m_internalSettings->animationsEnabled() ) modified = true; else if( m_ui.animationsDuration->value() != m_internalSettings->animationsDuration() ) modified = true; setChanged( modified ); }
//_______________________________________________ void ConfigWidget::updateChanged( void ) { // check configuration if( !_configuration ) return; // track modifications bool modified( false ); if( ui.titleAlignment->currentIndex() != _configuration->titleAlignment() ) modified = true; else if( ui.buttonSize->currentIndex() != _configuration->buttonSize() ) modified = true; else if( ui.frameBorder->currentIndex() != _configuration->frameBorder() ) modified = true; else if( ui.separatorMode->currentIndex() != _configuration->separatorMode() ) modified = true; else if( ui.drawSizeGrip->isChecked() != _configuration->drawSizeGrip() ) modified = true; else if( ui.titleOutline->isChecked() != _configuration->drawTitleOutline() ) modified = true; else if( ui.narrowButtonSpacing->isChecked() != _configuration->useNarrowButtonSpacing() ) modified = true; else if( ui.closeFromMenuButton->isChecked() != _configuration->closeWindowFromMenuButton() ) modified = true; // transparency else if( ui.opacityFromStyle->isChecked() != _configuration->opacityFromStyle() ) modified = true; else if( ui.backgroundOpacity->value() != _configuration->backgroundOpacity() ) modified = true; // exceptions else if( ui.exceptions->isChanged() ) modified = true; // shadow configurations else if( shadowConfigurations[0]->isChanged() ) modified = true; else if( shadowConfigurations[1]->isChanged() ) modified = true; // animations else if( !_expertMode && ui.animationsEnabled->isChecked() != _configuration->animationsEnabled() ) modified = true; else if( _expertMode && _animationConfigWidget->isChanged() ) modified = true; setChanged( modified ); }
void LayoutPropertySheet::setChanged(int index, bool changed) { const LayoutPropertyType type = layoutPropertyType(propertyName(index)); switch (type) { case LayoutPropertySpacing: if (LayoutProperties::visibleProperties(m_layout) & LayoutProperties::HorizSpacingProperty) { setChanged(indexOf(QLatin1String(horizontalSpacing)), changed); setChanged(indexOf(QLatin1String(verticalSpacing)), changed); } break; case LayoutPropertyMargin: setChanged(indexOf(QLatin1String(leftMargin)), changed); setChanged(indexOf(QLatin1String(topMargin)), changed); setChanged(indexOf(QLatin1String(rightMargin)), changed); setChanged(indexOf(QLatin1String(bottomMargin)), changed); break; default: break; } QDesignerPropertySheet::setChanged(index, changed); }
//__________________________________________________________ InternalSettingsList ExceptionListWidget::exceptions( void ) { return model().get(); setChanged( false ); }
//__________________________________________________________ void ExceptionListWidget::setExceptions( const InternalSettingsList& exceptions ) { model().set( exceptions ); resizeColumns(); setChanged( false ); }
/** * @brief TvShowEpisode::setThumbnailImage * @param thumbnail */ void TvShowEpisode::setThumbnailImage(QByteArray thumbnail) { m_thumbnailImage = thumbnail; m_thumbnailImageChanged = true; setChanged(true); }
void CSSMutableStyleDeclaration::setImageProperty(int propertyId, const String& url, bool important) { removeProperty(propertyId); m_values.append(CSSProperty(propertyId, CSSImageValue::create(url), important)); setChanged(); }
void TvShowEpisode::addActor(Actor actor) { m_actors.append(actor); setChanged(true); }
void ContactWidget::init() { _ignoreSignals = false; _titleSingular = tr("Contact"); _titlePlural = tr("Contacts"); _query = "SELECT cntct.*, crmacct_name " "FROM cntct LEFT OUTER JOIN crmacct ON (cntct_crmacct_id = crmacct_id) "; _layoutDone = false; _minimalLayout = false; _searchAcctId = -1; _list = new QPushButton(tr("..."), this); _list->setObjectName("_list"); _list->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); #ifndef Q_WS_MAC _list->setMaximumWidth(25); #else _list->setMinimumWidth(60); _list->setMinimumHeight(32); #endif _grid->removeWidget(_label); // will be reinserted _grid->removeWidget(_description); delete _description; _description = 0; _grid->setMargin(0); _grid->setSpacing(2); _nameBox = new QHBoxLayout; _nameBox->setSpacing(2); _initialsBox = new QHBoxLayout; _initialsBox->setSpacing(2); _titleBox = new QHBoxLayout; _titleBox->setSpacing(2); _change = new XLineEdit(this); _numberLit = new QLabel(tr("Number:"), this); _numberLit->setObjectName("_numberLit"); _number = new XLineEdit(this, "_number"); _change->hide(); _number->hide(); _numberLit->hide(); _nameLit = new QLabel(tr("Name:"), this); _nameLit->setObjectName("_nameLit"); _honorific = new XComboBox(this, "_honorific"); _first = new XLineEdit(this, "_first"); _middle = new XLineEdit(this, "_middle"); _middle->setFixedWidth(20); _last = new XLineEdit(this, "_last"); _suffix = new XLineEdit(this, "_suffix"); _suffix->setFixedWidth(30); _initialsLit = new QLabel(tr("Initials:"), this); _initialsLit->setObjectName("_initialsLit"); _initials = new XLineEdit(this, "_initials"); _initials->setFixedWidth(_initials->size().width() / 3); _titleLit = new QLabel(tr("Job Title:"), this); _titleLit->setObjectName("_titleLit"); _title = new XLineEdit(this, "_title"); _mapper = new XDataWidgetMapper(this); //_nameBox->addWidget(_nameLit, 0); _nameBox->addWidget(_honorific, 0); _nameBox->addWidget(_first, 1); _nameBox->addWidget(_middle, 0); _nameBox->addWidget(_last, 2); _nameBox->addWidget(_suffix, 0); _nameBox->addWidget(_list, 0, Qt::AlignRight); //_initialsBox->addWidget(_initialsLit, 0); _initialsBox->addWidget(_initials, 0); _initialsBox->addStretch(0); //_titleBox->addWidget(_titleLit, 0); _titleBox->addWidget(_title, 2); _buttonBox = new QGridLayout; _crmAcct = new CRMAcctCluster(this, "_crmAcct"); _active = new QCheckBox(tr("Active"), this); _active->setObjectName("_active"); _owner = new UsernameCluster(this, "_owner"); _buttonBox->addWidget(_crmAcct, 0, 1, Qt::AlignTop); _buttonBox->addWidget(_owner, 0, 2, Qt::AlignTop); _phoneLit = new QLabel(tr("Voice:"), this); _phoneLit->setObjectName("_phoneLit"); _phone = new XLineEdit(this, "_phone"); _phone2Lit = new QLabel(tr("Alternate:"), this); _phone2Lit->setObjectName("_phone2Lit"); _phone2 = new XLineEdit(this, "_phone2"); _faxLit = new QLabel(tr("Fax:"), this); _faxLit->setObjectName("_faxLit"); _fax = new XLineEdit(this, "_fax"); _emailLit = new QLabel(tr("E-Mail:"), this); _emailLit->setObjectName("_emailLit"); _email = new XLineEdit(this, "_email"); _webaddrLit = new QLabel(tr("Web:"), this); _webaddrLit->setObjectName("_webaddrLit"); _webaddr = new XLineEdit(this, "_webaddr"); _address = new AddressCluster(this, "_address"); #if defined Q_OS_MAC _honorific->setMinimumHeight(26); _first->setMinimumHeight(22); _middle->setMinimumHeight(22); _last->setMinimumHeight(22); _suffix->setMinimumHeight(22); _phone->setMinimumWidth(140); _crmAcct->setMinimumHeight(72); #endif QPalette p = _email->palette(); p.setColor(QPalette::Text, Qt::blue); _email->setPalette(p); _webaddr->setPalette(p); QFont newFont = _email->font(); newFont.setUnderline(TRUE); _email->setFont(newFont); _webaddr->setFont(newFont); _numberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _nameLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _titleLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _phoneLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _phone2Lit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _faxLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _emailLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _initialsLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _webaddrLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _honorific->setEditable(true); _honorific->setType(XComboBox::Honorifics); _crmAcct->setLabel(tr("CRM Account:")); _owner->setLabel(tr("Owner:")); layout(); connect(_list, SIGNAL(clicked()), this, SLOT(sEllipses())); connect(_honorific, SIGNAL(newID(int)), this, SIGNAL(changed())); connect(_first, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_middle, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_last, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_suffix, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_initials, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_crmAcct, SIGNAL(newId(int)), this, SIGNAL(changed())); connect(_title, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_phone, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_phone2, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_fax, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_email, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_webaddr, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_address, SIGNAL(changed()), this, SIGNAL(changed())); connect(this, SIGNAL(changed()), this, SLOT(setChanged())); connect(_honorific, SIGNAL(newID(int)), this, SLOT(sCheck())); connect(_first, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_middle, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_last, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_suffix, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_initials, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_crmAcct, SIGNAL(newId(int)), this, SLOT(sCheck())); connect(_title, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_phone, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_phone2, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_fax, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_email, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_webaddr, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_address, SIGNAL(changed()), this, SLOT(sCheck())); connect(_email, SIGNAL(doubleClicked()), this, SLOT(sLaunchEmail())); connect(_webaddr, SIGNAL(doubleClicked()), this, SLOT(sLaunchWebaddr())); setListVisible(true); connect(_first, SIGNAL(lostFocus()), this, SLOT(findDuplicates())); connect(_last, SIGNAL(lostFocus()), this, SLOT(findDuplicates())); connect(_crmAcct, SIGNAL(newId(int)), this, SLOT(setSearchAcct(int))); setFocusPolicy(Qt::StrongFocus); setFocusProxy(_honorific); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setLabel(""); _limits = 0; silentSetId(-1); setOwnerVisible(false); _mode = Edit; }
void rice::p2p::multiring::MultiringNodeHandle::update(::java::util::Observable* o, ::java::lang::Object* obj) { setChanged(); notifyObservers(obj); }
void KRandRModule::slotRefreshChanged(int index) { currentScreen()->proposeRefreshRate(index); setChanged(); }
void InputMethod::update() { setChanged(false); }
void Transform::setScale( const Vector3& scale ) { setChanged(); this->scale = scale; }
void Transform::setRotation( const Quaternion& rotation ) { setChanged(); this->rotation = rotation; }
void Transform::setPosition( const Vector3& position ) { setChanged(); this->position = position; }
void clear() { freeLayouts(); m_blocks.clear(); setChanged(true); }
void SharpnessFilter::somethingChanged(){ setChanged(true); }
void DPArrow::dataChanged() { DPLine::dataChanged(); m_headAngle = dataDouble( "HeadAngle" ); setChanged(); }
void WPdfImage::drawText(const WRectF& rect, WFlags<AlignmentFlag> flags, TextFlag textFlag, const WString& text, const WPointF *clipPoint) { // FIXME: textFlag if (clipPoint && painter() && !painter()->clipPath().isEmpty()) { if (!painter()->clipPathTransform().map(painter()->clipPath()) .isPointInPath(painter()->worldTransform().map(*clipPoint))) return; } if (trueTypeFont_ && !trueTypeFonts_->busy()) trueTypeFonts_->drawText(painter()->font(), rect, flags, text); else { HPDF_REAL left, top, right, bottom; HPDF_TextAlignment alignment = HPDF_TALIGN_LEFT; AlignmentFlag horizontalAlign = flags & AlignHorizontalMask; AlignmentFlag verticalAlign = flags & AlignVerticalMask; switch (horizontalAlign) { default: // should never happen case AlignmentFlag::Left: left = rect.left(); right = left + 10000; alignment = HPDF_TALIGN_LEFT; break; case AlignmentFlag::Right: right = rect.right(); left = right - 10000; alignment = HPDF_TALIGN_RIGHT; break; case AlignmentFlag::Center: { float center = rect.center().x(); left = center - 5000; right = center + 5000; alignment = HPDF_TALIGN_CENTER; break; } } switch (verticalAlign) { default: // fall-through ; should never happen case AlignmentFlag::Top: top = rect.top(); break; case AlignmentFlag::Middle: // FIXME: use font metrics to center middle of ascent ! top = rect.center().y() - 0.60 * fontSize_; break; case AlignmentFlag::Bottom: top = rect.bottom() - fontSize_; break; } bottom = top + fontSize_; if (trueTypeFonts_->busy()) setChanged(PainterChangeFlag::Font); HPDF_Page_GSave(page_); // Undo the global inversion HPDF_Page_Concat(page_, 1, 0, 0, -1, 0, bottom); HPDF_Page_BeginText(page_); // Need to fill text using pen color const WColor& penColor = painter()->pen().color(); HPDF_Page_SetRGBFill(page_, penColor.red() / 255., penColor.green() / 255., penColor.blue() / 255.); std::string s = trueTypeFont_ ? text.toUTF8() : text.narrow(); HPDF_Page_TextRect(page_, left, fontSize_, right, 0, s.c_str(), alignment, nullptr); HPDF_Page_EndText(page_); HPDF_Page_GRestore(page_); } }
KRandRModule::KRandRModule(QWidget *parent, const char *name, const QStringList&) : KCModule(parent, name) , m_changed(false) { if (!isValid()) { QVBoxLayout *topLayout = new QVBoxLayout(this); topLayout->addWidget(new QLabel(i18n("<qt>Your X server does not support resizing and rotating the display. Please update to version 4.3 or greater. You need the X Resize And Rotate extension (RANDR) version 1.1 or greater to use this feature.</qt>"), this)); kdWarning() << "Error: " << errorCode() << endl; return; } QVBoxLayout* topLayout = new QVBoxLayout(this, 0, KDialog::spacingHint()); QHBox* screenBox = new QHBox(this); topLayout->addWidget(screenBox); QLabel *screenLabel = new QLabel(i18n("Settings for screen:"), screenBox); m_screenSelector = new KComboBox(screenBox); for (int s = 0; s < numScreens(); s++) { m_screenSelector->insertItem(i18n("Screen %1").arg(s+1)); } m_screenSelector->setCurrentItem(currentScreenIndex()); screenLabel->setBuddy( m_screenSelector ); QWhatsThis::add(m_screenSelector, i18n("The screen whose settings you would like to change can be selected using this drop-down list.")); connect(m_screenSelector, SIGNAL(activated(int)), SLOT(slotScreenChanged(int))); if (numScreens() <= 1) m_screenSelector->setEnabled(false); QHBox* sizeBox = new QHBox(this); topLayout->addWidget(sizeBox); QLabel *sizeLabel = new QLabel(i18n("Screen size:"), sizeBox); m_sizeCombo = new KComboBox(sizeBox); QWhatsThis::add(m_sizeCombo, i18n("The size, otherwise known as the resolution, of your screen can be selected from this drop-down list.")); connect(m_sizeCombo, SIGNAL(activated(int)), SLOT(slotSizeChanged(int))); sizeLabel->setBuddy( m_sizeCombo ); QHBox* refreshBox = new QHBox(this); topLayout->addWidget(refreshBox); QLabel *rateLabel = new QLabel(i18n("Refresh rate:"), refreshBox); m_refreshRates = new KComboBox(refreshBox); QWhatsThis::add(m_refreshRates, i18n("The refresh rate of your screen can be selected from this drop-down list.")); connect(m_refreshRates, SIGNAL(activated(int)), SLOT(slotRefreshChanged(int))); rateLabel->setBuddy( m_refreshRates ); m_rotationGroup = new QButtonGroup(2, Qt::Horizontal, i18n("Orientation (degrees counterclockwise)"), this); topLayout->addWidget(m_rotationGroup); m_rotationGroup->setRadioButtonExclusive(true); QWhatsThis::add(m_rotationGroup, i18n("The options in this section allow you to change the rotation of your screen.")); m_applyOnStartup = new QCheckBox(i18n("Apply settings on KDE startup"), this); topLayout->addWidget(m_applyOnStartup); QWhatsThis::add(m_applyOnStartup, i18n("If this option is enabled the size and orientation settings will be used when KDE starts.")); connect(m_applyOnStartup, SIGNAL(clicked()), SLOT(setChanged())); QHBox* syncBox = new QHBox(this); syncBox->layout()->addItem(new QSpacerItem(20, 1, QSizePolicy::Maximum)); m_syncTrayApp = new QCheckBox(i18n("Allow tray application to change startup settings"), syncBox); topLayout->addWidget(syncBox); QWhatsThis::add(m_syncTrayApp, i18n("If this option is enabled, options set by the system tray applet will be saved and loaded when KDE starts instead of being temporary.")); connect(m_syncTrayApp, SIGNAL(clicked()), SLOT(setChanged())); topLayout->addStretch(1); // just set the "apply settings on startup" box load(); m_syncTrayApp->setEnabled(m_applyOnStartup->isChecked()); slotScreenChanged(QApplication::desktop()->primaryScreen()); setButtons(KCModule::Apply); }
BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) { LLMemType m1(LLMemType::MTYPE_VOLUME); LLVolume *volumep; if (unique_volume) { F32 volume_detail = LLVolumeLODGroup::getVolumeScaleFromDetail(detail); if (mVolumep.notNull() && volume_params == mVolumep->getParams() && (volume_detail == mVolumep->getDetail())) { return FALSE; } volumep = new LLVolume(volume_params, volume_detail, FALSE, TRUE); } else { if (mVolumep.notNull()) { F32 volume_detail = LLVolumeLODGroup::getVolumeScaleFromDetail(detail); if (volume_params == mVolumep->getParams() && (volume_detail == mVolumep->getDetail())) { return FALSE; } } volumep = sVolumeManager->refVolume(volume_params, detail); if (volumep == mVolumep) { sVolumeManager->unrefVolume( volumep ); // LLVolumeMgr::refVolume() creates a reference, but we don't need a second one. return TRUE; } } setChanged(GEOMETRY); if (!mVolumep) { mVolumep = volumep; //mFaceMask = mVolumep->generateFaceMask(); setNumTEs(mVolumep->getNumFaces()); return TRUE; } #if 0 // #if 0'd out by davep // this is a lot of cruft to set texture entry values that just stay the same for LOD switch // or immediately get overridden by an object update message, also crashes occasionally U32 old_face_mask = mVolumep->mFaceMask; S32 face_bit = 0; S32 cur_mask = 0; // Grab copies of the old faces from the original shape, ordered by type. // We will use these to figure out what old texture info gets mapped to new // faces in the new shape. std::vector<LLProfile::Face> old_faces; for (S32 face = 0; face < mVolumep->getNumFaces(); face++) { old_faces.push_back(mVolumep->getProfile().mFaces[face]); } // Copy the old texture info off to the side, but not in the order in which // they live in the mTextureList, rather in order of ther "face id" which // is the corresponding value of LLVolueParams::LLProfile::mFaces::mIndex. // // Hence, some elements of old_tes::mEntryList will be invalid. It is // initialized to a size of 9 (max number of possible faces on a volume?) // and only the ones with valid types are filled in. LLPrimTextureList old_tes; old_tes.setSize(9); for (face_bit = 0; face_bit < 9; face_bit++) { cur_mask = 0x1 << face_bit; if (old_face_mask & cur_mask) { S32 te_index = face_index_from_id(cur_mask, old_faces); old_tes.copyTexture(face_bit, *(getTE(te_index))); //llinfos << face_bit << ":" << te_index << ":" << old_tes[face_bit].getID() << llendl; } } // build the new object sVolumeManager->unrefVolume(mVolumep); mVolumep = volumep; U32 new_face_mask = mVolumep->mFaceMask; S32 i; if (old_face_mask == new_face_mask) { // nothing to do return TRUE; } if (mVolumep->getNumFaces() == 0 && new_face_mask != 0) { llwarns << "Object with 0 faces found...INCORRECT!" << llendl; setNumTEs(mVolumep->getNumFaces()); return TRUE; } // initialize face_mapping S32 face_mapping[9]; for (face_bit = 0; face_bit < 9; face_bit++) { face_mapping[face_bit] = face_bit; } // The new shape may have more faces than the original, but we can't just // add them to the end -- the ordering matters and it may be that we must // insert the new faces in the middle of the list. When we add a face it // will pick up the texture/color info of one of the old faces an so we // now figure out which old face info gets mapped to each new face, and // store in the face_mapping lookup table. for (face_bit = 0; face_bit < 9; face_bit++) { cur_mask = 0x1 << face_bit; if (!(new_face_mask & cur_mask)) { // Face doesn't exist in new map. face_mapping[face_bit] = -1; continue; } else if (old_face_mask & cur_mask) { // Face exists in new and old map. face_mapping[face_bit] = face_bit; continue; } // OK, how we've got a mismatch, where we have to fill a new face with one from // the old face. if (cur_mask & (LL_FACE_PATH_BEGIN | LL_FACE_PATH_END | LL_FACE_INNER_SIDE)) { // It's a top/bottom/hollow interior face. if (old_face_mask & LL_FACE_PATH_END) { face_mapping[face_bit] = 1; continue; } else { S32 cur_outer_mask = LL_FACE_OUTER_SIDE_0; for (i = 0; i < 4; i++) { if (old_face_mask & cur_outer_mask) { face_mapping[face_bit] = 5 + i; break; } cur_outer_mask <<= 1; } if (i == 4) { llwarns << "No path end or outer face in volume!" << llendl; } continue; } } if (cur_mask & (LL_FACE_PROFILE_BEGIN | LL_FACE_PROFILE_END)) { // A cut slice. Use the hollow interior if we have it. if (old_face_mask & LL_FACE_INNER_SIDE) { face_mapping[face_bit] = 2; continue; } // No interior, use the bottom face. // Could figure out which of the outer faces was nearest, but that would be harder. if (old_face_mask & LL_FACE_PATH_END) { face_mapping[face_bit] = 1; continue; } else { S32 cur_outer_mask = LL_FACE_OUTER_SIDE_0; for (i = 0; i < 4; i++) { if (old_face_mask & cur_outer_mask) { face_mapping[face_bit] = 5 + i; break; } cur_outer_mask <<= 1; } if (i == 4) { llwarns << "No path end or outer face in volume!" << llendl; } continue; } } // OK, the face that's missing is an outer face... // Pull from the nearest adjacent outer face (there's always guaranteed to be one... S32 cur_outer = face_bit - 5; S32 min_dist = 5; S32 min_outer_bit = -1; S32 i; for (i = 0; i < 4; i++) { if (old_face_mask & (LL_FACE_OUTER_SIDE_0 << i)) { S32 dist = abs(i - cur_outer); if (dist < min_dist) { min_dist = dist; min_outer_bit = i + 5; } } } if (-1 == min_outer_bit) { llinfos << (LLVolume *)mVolumep << llendl; llwarns << "Bad! No outer faces, impossible!" << llendl; } face_mapping[face_bit] = min_outer_bit; } setNumTEs(mVolumep->getNumFaces()); for (face_bit = 0; face_bit < 9; face_bit++) { // For each possible face type on the new shape we check to see if that // face exists and if it does we create a texture entry that is a copy // of one of the originals. Since the originals might not have a // matching face, we use the face_mapping lookup table to figure out // which face information to copy. cur_mask = 0x1 << face_bit; if (new_face_mask & cur_mask) { if (-1 == face_mapping[face_bit]) { llwarns << "No mapping from old face to new face!" << llendl; } S32 te_num = face_index_from_id(cur_mask, mVolumep->getProfile().mFaces); setTE(te_num, *(old_tes.getTexture(face_mapping[face_bit]))); } } #else // build the new object sVolumeManager->unrefVolume(mVolumep); mVolumep = volumep; setNumTEs(mVolumep->getNumFaces()); #endif return TRUE; }
void FaceDetector::somethingChanged() { setChanged(true); }
void TypedRenderTargetCapability::resetRenderTarget(RenderTargetType type) { m_renderTargets[type] = RenderTarget(); setChanged(true); }
void Image4uint8::load(const std::string& filename, GImage::Format fmt) { copyGImage(GImage(filename, fmt)); setChanged(true); }
void CSSMutableStyleDeclaration::setStringProperty(int propertyId, const String &value, CSSPrimitiveValue::UnitTypes type, bool important) { removeProperty(propertyId); m_values.append(CSSProperty(propertyId, CSSPrimitiveValue::create(value, type), important)); setChanged(); }