void RLineweightCombo::init() { clear(); setMaxVisibleItems(12); QVariant v; QListIterator<QPair<QString, RLineweight::Lineweight> > it( RLineweight::getList(onlyFixed)); while (it.hasNext()) { QPair<QString, RLineweight::Lineweight> p = it.next(); v.setValue<RLineweight::Lineweight> (p.second); addItem(RLineweight::getIcon(p.second), p.first, v); } if (!onlyFixed) { setLineweight(RLineweight::WeightByLayer); } else { // TODO: make configurable: //RLineweight::Lineweight lw = RSettings::getIntValue(""); setLineweight(RLineweight::Weight025); } }
void RExporter::setEntityAttributes() { REntity* currentEntity = getEntity(); if (currentEntity == NULL) { return; } setColor(currentEntity->getColor(true, blockRefStack)); setLineweight(currentEntity->getLineweight(true, blockRefStack)); setLinetypeId(currentEntity->getLinetypeId(true, blockRefStack)); setStyle(Qt::SolidLine); setBrushStyle(Qt::SolidPattern); }
/** * Copies all attributes (layer, block, color, line weight, line style) from the given entity. */ void REntity::copyAttributesFrom(REntity* entity) { if (entity==NULL) { qWarning("REntity::copyAttributesFrom: source entity is NULL"); return; } if (getDocument()!=entity->getDocument()) { qWarning("REntity::copyAttributesFrom: source entity not from same document"); return; } setLayerId(entity->getLayerId()); setBlockId(entity->getBlockId()); setColor(entity->getColor()); setLineweight(entity->getLineweight()); setLinetypeId(entity->getLinetypeId()); }
void RExporter::setEntityAttributes(bool forceSelected) { REntity* currentEntity = getEntity(); if (currentEntity == NULL) { return; } if (forceSelected || currentEntity->isSelected()) { setColor(RSettings::getSelectionColor()); } else { setColor(currentEntity->getColor(true, blockRefStack)); } setLineweight(currentEntity->getLineweight(true, blockRefStack)); setLinetypeId(currentEntity->getLinetypeId(true, blockRefStack)); setStyle(Qt::SolidLine); setBrushStyle(Qt::SolidPattern); }
/** * Copies all attributes (layer, block, color, line weight, line style) from the given entity. */ void REntity::copyAttributesFrom(REntity* entity, bool copyBlockId) { if (entity==NULL) { qWarning("REntity::copyAttributesFrom: source entity is NULL"); return; } if (getDocument()!=entity->getDocument()) { qWarning("REntity::copyAttributesFrom: source entity not from same document"); //RDebug::printBacktrace(); return; } setLayerId(entity->getLayerId()); if (copyBlockId) { setBlockId(entity->getBlockId()); } setColor(entity->getColor()); setLineweight(entity->getLineweight()); setLinetypeId(entity->getLinetypeId()); setLinetypeScale(entity->getLinetypeScale()); setDrawOrder(entity->getDrawOrder()); }