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()); }