Пример #1
0
KoShape *ThreedShapeFactory::createShape(const KoProperties *params,
                                         KoDocumentResourceManager *documentResources) const
{
    Q_UNUSED(params);

    SceneObject *shape = static_cast<SceneObject*>(createDefaultShape(documentResources));

    return shape;
}
//--------------------------------------------------------------
void ofxMtlMapping2DPolygon::init(int sId, bool defaultShape) 
{
    shapeId = sId;
	
    if (defaultShape) {
        createDefaultShape();
    }
    
    updatePolyline();
}
Пример #3
0
VectorNode::VectorNode(const ArgList& args)
    : m_Transform(glm::mat4(0))
{
    m_pShape = ShapePtr(createDefaultShape());

    ObjectCounter::get()->incRef(&typeid(*this));
    m_TexHRef = args.getArgVal<UTF8String>("texhref"); 
    setTexHRef(m_TexHRef);
    m_sColorName = args.getArgVal<string>("color");
    m_Color = colorStringToColor(m_sColorName);
}
Пример #4
0
KoShape *AnnotationTextShapeFactory::createShape(const KoProperties *params, KoDocumentResourceManager *documentResources) const
{
    Q_UNUSED(params);
    AnnotationTextShape *shape = static_cast<AnnotationTextShape*>(createDefaultShape(documentResources));
    shape->textShapeData()->document()->setUndoRedoEnabled(false);

    if (documentResources) {
        shape->setImageCollection(documentResources->imageCollection());
    }
    shape->textShapeData()->document()->setUndoRedoEnabled(true);
    return shape;
}
KoShape *PictureShapeFactory::createShape(const KoProperties *params, KoDocumentResourceManager *documentResources) const
{
    PictureShape *shape = static_cast<PictureShape*>(createDefaultShape(documentResources));
    if (params->contains("qimage")) {
        QImage image = params->property("qimage").value<QImage>();
        Q_ASSERT(!image.isNull());

        if (shape->imageCollection()) {
            KoImageData *data = shape->imageCollection()->createImageData(image);
            shape->setUserData(data);
            shape->setSize(data->imageSize());
            shape->update();
        }
    }
    return shape;

}
Пример #6
0
KShape *TextShapeFactory::createShape(const KProperties *params, KResourceManager *documentResources) const
{
    TextShape *shape = static_cast<TextShape*>(createDefaultShape(documentResources));
    shape->textShapeData()->document()->setUndoRedoEnabled(false);
    shape->setSize(QSizeF(300, 200));
    shape->setDemoText(params->boolProperty("demo"));
    QString text("text");
    if (params->contains(text)) {
        KTextShapeData *shapeData = qobject_cast<KTextShapeData*>(shape->userData());
        QTextCursor cursor(shapeData->document());
        cursor.insertText(params->stringProperty(text));
    }
    if (documentResources) {
        shape->setImageCollection(documentResources->imageCollection());
    }
    shape->textShapeData()->document()->setUndoRedoEnabled(true);
    return shape;
}
Пример #7
0
KoShape * KoRectangleShapeFactory::createShape( const KoProperties * params ) const 
{
    Q_UNUSED(params);
    return createDefaultShape();
}
KoShape *KoDeferredShapeFactoryBase::createShape(const KoProperties *, KoDocumentResourceManager *documentResources) const
{
    return createDefaultShape(documentResources);
}
Пример #9
0
KoShape * KPrPlaceholderShapeFactory::createShape(const KoProperties * params) const
{
    Q_UNUSED( params );
    return createDefaultShape();
}