Пример #1
0
void RMemoryStorage::setKnownVariable(RS::KnownVariable key, const QVariant& value) {
    if (key==RS::INSUNITS) {
        setUnit((RS::Unit)value.toInt());
    }
    else if (key==RS::LTSCALE) {
        setLinetypeScale(value.toDouble());
    }
    else {
        knownVariables.insert(key, value);
    }

    // dimension settings might affect bounding box:
    boundingBoxChanged = true;
    setModified(true);
}
Пример #2
0
void RDocumentVariables::setKnownVariable(RS::KnownVariable key, const QVariant& value) {
    if (key==RS::INSUNITS) {
        setUnit((RS::Unit)value.toInt());
        return;
    }
    else if (key==RS::MEASUREMENT) {
        setMeasurement((RS::Measurement)value.toInt());
        return;
    }
    else if (key==RS::LTSCALE) {
        setLinetypeScale(value.toDouble());
        return;
    }

    knownVariables.insert(key, value);
}
Пример #3
0
/**
 * 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());
}