QCAD
Open Source 2D CAD
RImporter Class Reference

Base class for importers. More...

#include <RImporter.h>

Inheritance diagram for RImporter:
RFileImporter RDxfImporter

Public Member Functions

virtual void endImport ()
 Ends the import. More...
 
virtual RBlock::Id getCurrentBlockId ()
 
RDocumentgetDocument ()
 
virtual void importObject (RObject *object)
 Provided for script importers as importObjectP will loose the object ID. More...
 
virtual void importObjectP (QSharedPointer< RObject > object)
 Imports an entity into the document. More...
 
 RImporter ()
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 
 RImporter (RDocument &document, RMessageHandler *messageHandler=NULL, RProgressHandler *progressHandler=NULL)
 
virtual void setCurrentBlockId (RBlock::Id id)
 
void setDocument (RDocument *d)
 
void setKnownVariable (RS::KnownVariable key, const QVariant &value)
 
void setKnownVariable (RS::KnownVariable key, const RVector &value)
 
virtual void startImport ()
 Starts the import. More...
 
virtual ~RImporter ()
 

Protected Attributes

RBlock::Id blockId
 
RDocumentdocument
 
RMessageHandlermessageHandler
 
RProgressHandlerprogressHandler
 
RTransaction transaction
 

Detailed Description

Base class for importers.

Importers import entities from a source (e.g. file, DB, network, ...) into a graphics document. The implementing importer is expected to call the import functions to add objects (e.g. entities) to the document. Custom import functions may be implemented to support custom entity types supported by a specific importer.

Scriptable:\nThis class is available in script environments.\n

Constructor & Destructor Documentation

◆ RImporter() [1/2]

RImporter::RImporter ( )

Copyright (c) 2011-2018 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

◆ RImporter() [2/2]

RImporter::RImporter ( RDocument document,
RMessageHandler messageHandler = NULL,
RProgressHandler progressHandler = NULL 
)

◆ ~RImporter()

RImporter::~RImporter ( )
virtual

Member Function Documentation

◆ endImport()

void RImporter::endImport ( )
virtual

Ends the import.

Reimplementations should call this base implementation first since this commits the transaction after importing entities into the document.

◆ getCurrentBlockId()

RBlock::Id RImporter::getCurrentBlockId ( )
virtual

◆ getDocument()

RDocument & RImporter::getDocument ( )

◆ importObject()

void RImporter::importObject ( RObject object)
virtual

Provided for script importers as importObjectP will loose the object ID.

◆ importObjectP()

void RImporter::importObjectP ( QSharedPointer< RObject object)
virtual

Imports an entity into the document.

Non-Scriptable:\nThis function is not available in script environments.\n

◆ setCurrentBlockId()

void RImporter::setCurrentBlockId ( RBlock::Id  id)
virtual

◆ setDocument()

void RImporter::setDocument ( RDocument d)

◆ setKnownVariable() [1/2]

void RImporter::setKnownVariable ( RS::KnownVariable  key,
const QVariant &  value 
)

◆ setKnownVariable() [2/2]

void RImporter::setKnownVariable ( RS::KnownVariable  key,
const RVector value 
)

◆ startImport()

void RImporter::startImport ( )
virtual

Starts the import.

Reimplementations should call this base implementation first since this starts a transaction.

Member Data Documentation

◆ blockId

RBlock::Id RImporter::blockId
protected

◆ document

RDocument* RImporter::document
protected

◆ messageHandler

RMessageHandler* RImporter::messageHandler
protected

◆ progressHandler

RProgressHandler* RImporter::progressHandler
protected

◆ transaction

RTransaction RImporter::transaction
protected

The documentation for this class was generated from the following files: