QCAD
Open Source 2D CAD
|
Abstract base class for exporters. More...
#include <RExporter.h>
Public Member Functions | |
virtual void | endEntity () |
virtual void | endExport () |
Called at the end of a completed export. More... | |
virtual void | exportArc (const RArc &arc, double offset=RNANDOUBLE) |
virtual void | exportArcSegment (const RArc &arc, bool allowForZeroLength=false) |
virtual void | exportBlock (RBlock &) |
virtual void | exportBlock (RBlock::Id blockId) |
virtual void | exportBlocks () |
virtual void | exportBoundingBoxPaths (const QList< RPainterPath > &paths) |
virtual void | exportBox (const RBox &box) |
Exports the surfaces of the given box. More... | |
virtual void | exportCircle (const RCircle &circle) |
Exports a circle with the current attributes. More... | |
virtual void | exportClipRectangle (const RBox &clipRectangle, bool forceSelected=false) |
virtual void | exportCurrentEntity (bool preview=false, bool forceSelected=false) |
The default implementation calls the REntity::exportEntity() function of the entity. More... | |
virtual bool | exportDocument () |
Exports the visual representation of all objects (including entities) of the document. More... | |
virtual void | exportDocumentSetting (const QString &key, const QVariant &value, const QString &dictionaryName="QCAD_OBJECTS") |
virtual bool | exportDocumentSettings () |
virtual void | exportEllipse (const REllipse &ellipse, double offset=RNANDOUBLE) |
Exports an ellipse with the current attributes. More... | |
virtual void | exportEndTransform () |
virtual void | exportEntities (bool allBlocks=true, bool undone=false) |
virtual void | exportEntities (const RBox &box) |
Exports the visual representation of all entities that are completely or partly inside the given area. More... | |
virtual void | exportEntities (QSet< REntity::Id > &entityIds, bool allBlocks=true) |
Calls exportEntity() for all given entities. More... | |
virtual void | exportEntity (REntity &entity, bool preview=false, bool allBlocks=true, bool forceSelected=false) |
Exports the given entity as part of a block definition to be reused by block references. More... | |
virtual void | exportEntity (REntity::Id entityId, bool allBlocks=true, bool forceSelected=false) |
Calls exportEntity(REntity*) for the entity with the given ID. More... | |
virtual void | exportExplodable (const RExplodable &explodable, double offset=RNANDOUBLE) |
virtual void | exportImage (const RImageData &image, bool forceSelected=false) |
virtual void | exportIntListWithName (const QString &dictionaryName, const QString &name, const QString &listName, QList< int64_t > &values) |
virtual void | exportLayer (RLayer &) |
virtual void | exportLayer (RLayer::Id layerId) |
virtual void | exportLayers () |
virtual void | exportLayerState (RLayerState &) |
virtual void | exportLayerStates () |
virtual double | exportLine (const RLine &line, double offset=RNANDOUBLE) |
Exports a line with the current attributes. More... | |
virtual void | exportLineSegment (const RLine &line, double angle=RNANDOUBLE)=0 |
Exports a line segment (a line without pattern). More... | |
virtual void | exportLinetype (RLinetype &) |
virtual void | exportLinetypes () |
virtual bool | exportLinetypeShape (QList< RPainterPath > &pps, const RLine &line, double total, double length, double angle, const RVector &cursor) |
virtual void | exportPainterPaths (const QList< RPainterPath > &paths, double angle, const RVector &pos) |
virtual void | exportPainterPaths (const QList< RPainterPath > &paths, double z=0.0) |
virtual void | exportPainterPathSource (const RPainterPathSource &pathSource, double z=0.0) |
virtual void | exportPoint (const RPoint &point)=0 |
Exports a point with the current attributes. More... | |
virtual void | exportPolyline (const RPolyline &polyline, bool polylineGen=true, double offset=RNANDOUBLE) |
virtual void | exportQuad (const RVector &p1, const RVector &p2, const RVector &p3, const RVector &p4) |
Exports a quadrilateral with the current attributes. More... | |
virtual void | exportRay (const RRay &ray)=0 |
Exports an infinite ray. More... | |
virtual void | exportRectangle (const RVector &p1, const RVector &p2) |
Exports a rectangle with the current attributes. More... | |
virtual void | exportShape (QSharedPointer< RShape > shape) |
Exports the given shapes as part of the geometry of the current entity. More... | |
virtual void | exportShapes (const QList< QSharedPointer< RShape > > &shapes) |
Exports the given shapes as part of the geometry of the current entity. More... | |
virtual void | exportShapeSegment (QSharedPointer< RShape > shape, double angle) |
virtual void | exportSpline (const RSpline &spline, double offset=RNANDOUBLE) |
virtual void | exportSplineSegment (const RSpline &spline) |
virtual QList< RPainterPath > | exportText (const RTextBasedData &text, bool forceSelected=false) |
virtual void | exportThickPolyline (const RPolyline &polyline) |
virtual void | exportTransform (const RTransform &t) |
virtual void | exportTriangle (const RTriangle &triangle)=0 |
Exports a triangle with the current attributes. More... | |
virtual void | exportVerticalQuad (const RVector &p1, const RVector &p2, double height) |
Exports a vertical quadrilateral with the two given base points and the given height. More... | |
virtual void | exportView (RView &) |
virtual void | exportView (RView::Id viewId) |
virtual void | exportViews () |
virtual void | exportXLine (const RXLine &xLine)=0 |
Exports an infinite line. More... | |
virtual REntity * | getBlockRefOrEntity () |
virtual REntity::Id | getBlockRefOrEntityId () |
virtual QStack< REntity * > | getBlockRefViewportStack () const |
virtual QBrush | getBrush () |
virtual QBrush | getBrush (const RPainterPath &path) |
bool | getClipping () const |
virtual RColor | getColor (bool resolve) |
virtual RColor | getColor (const RColor &unresolvedColor) |
virtual REntity * | getCurrentBlockRef () const |
virtual double | getCurrentPixelSizeHint () const |
virtual RViewportEntity * | getCurrentViewport () const |
RDocument & | getDocument () const |
\nonscriptoverwritable More... | |
bool | getDraftMode () const |
virtual REntity * | getEntity () |
virtual const REntity * | getEntity () const |
virtual QSharedPointer< RLayer > | getEntityLayer (REntity &entity) |
QStack< REntity * > | getEntityStack () |
QString | getErrorMessage () const |
virtual RLinetypePattern | getLinetypePattern () |
virtual double | getLineTypePatternScale (const RLinetypePattern &p) const |
virtual QPen | getPen () |
virtual QPen | getPen (const RPainterPath &path) |
double | getPixelSizeHint () const |
bool | getPixelUnit () const |
bool | getPixelWidth () const |
RS::ProjectionRenderingHint | getProjectionRenderingHint () |
virtual bool | getScreenBasedLinetypes () const |
bool | getTwoColorSelectedMode () const |
virtual bool | isEntitySelected () |
virtual bool | isPatternContinuous (const RLinetypePattern &p) |
virtual bool | isTextRenderedAsText () |
Override to force text rendering mode. More... | |
virtual bool | isVisible (REntity &entity) |
bool | isVisualExporter () const |
void | popEntity () |
void | pushEntity (REntity *e) |
RExporter () | |
RExporter (RDocument &document, RMessageHandler *messageHandler=NULL, RProgressHandler *progressHandler=NULL) | |
void | setBlockSource (RDocument *bs) |
virtual void | setBrush (const QBrush &brush) |
virtual void | setBrushStyle (Qt::BrushStyle brushStyle) |
void | setClipping (bool on) |
virtual void | setColor (const RColor &color) |
virtual void | setColor (float r, float g, float b, float a=1.0f) |
Sets the current export color in RGB and Alpha. More... | |
virtual void | setDashPattern (const QVector< qreal > &dashes) |
void | setDraftMode (bool on) |
void | setEnablePatterns (bool on) |
virtual void | setEntityAttributes (bool forceSelected=false) |
void | setLayerSource (RDocument *ls) |
virtual void | setLinetypeId (RLinetype::Id ltId) |
virtual void | setLinetypePattern (const RLinetypePattern <Pattern) |
virtual void | setLineweight (RLineweight::Lineweight weight) |
virtual void | setPen (const QPen &pen) |
Sets the current pen (currentPen). More... | |
void | setPixelSizeHint (double v) |
void | setPixelUnit (bool on) |
void | setPixelWidth (bool on) |
void | setProjectionRenderingHint (RS::ProjectionRenderingHint p) |
Sets a rendering hint for the current projection used for exports. More... | |
void | setScreenBasedLinetypes (bool on) |
virtual void | setStyle (Qt::PenStyle penStyle) |
void | setTwoColorSelectedMode (bool on) |
void | setVisualExporter (bool on) |
virtual void | startEntity (bool) |
virtual void | startExport () |
Called to start a new, complete export. More... | |
void | toggleDraftMode () |
void | toggleScreenBasedLinetypes () |
virtual void | unexportEntity (REntity::Id entityId) |
This is called for entities for which an export was requested but which cannot be instantiated because they either do not exist (anymore) in the DB or they are currently undone. More... | |
virtual | ~RExporter () |
Protected Attributes | |
QStack< REntity * > | blockRefViewportStack |
RDocument * | blockSource |
bool | clipping |
QBrush | currentBrush |
RLayer * | currentLayer |
RLinetypePattern | currentLinetypePattern |
QPen | currentPen |
RDocument * | document |
bool | draftMode |
bool | enablePatterns |
QStack< REntity * > | entityStack |
QString | errorMessage |
RDocument * | layerSource |
Qt::PenCapStyle | penCapStyle |
double | pixelSizeHint |
bool | pixelUnit |
bool | pixelWidth |
bool | screenBasedLinetypes |
QTransform | transform |
bool | twoColorSelectedMode |
bool | visualExporter |
Private Member Functions | |
void | init () |
Private Attributes | |
RS::ProjectionRenderingHint | projectionRenderingHint |
Abstract base class for exporters.
Exporters export documents into files, views, etc.
RExporter::RExporter | ( | ) |
RExporter::RExporter | ( | RDocument & | document, |
RMessageHandler * | messageHandler = NULL , |
||
RProgressHandler * | progressHandler = NULL |
||
) |
|
virtual |
|
inlinevirtual |
|
virtual |
Called at the end of a completed export.
The default implementation notifies listeners.
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
Reimplemented in RDxfExporter, and RGraphicsSceneQt.
|
inlinevirtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Exports the surfaces of the given box.
This is a convenience function that exports 12 triangles but may also be re-implemented to do something else.
|
virtual |
Exports a circle with the current attributes.
The default implementation calls exportArc with a full circle arc.
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
The default implementation calls the REntity::exportEntity() function of the entity.
This method may use the currentEntity
stack to access the entity that is currently being exported. Exporters can choose to reimplement this function to export an entity in a target platform specific manner (e.g. to optimize things for a specific platform).
Reimplemented in RGraphicsScene.
|
virtual |
Exports the visual representation of all objects (including entities) of the document.
|
virtual |
|
virtual |
Reimplemented in RGraphicsScene.
|
virtual |
Exports an ellipse with the current attributes.
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
Exports the visual representation of all entities that are completely or partly inside the given area.
|
virtual |
Calls exportEntity() for all given entities.
|
virtual |
Exports the given entity as part of a block definition to be reused by block references.
This is called for entities which have no attributes ByBlock. Sets the current entity to the given entity and calls exportEntity(). Note that entity is a temporary clone.
\forceSelected Force selection, used to export entities as part of a selected block reference.
|
virtual |
Calls exportEntity(REntity*) for the entity with the given ID.
|
virtual |
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
|
inlinevirtual |
|
virtual |
|
virtual |
|
inlinevirtual |
|
virtual |
|
virtual |
Exports a line with the current attributes.
Reimplemented in RGraphicsSceneQt.
|
pure virtual |
Exports a line segment (a line without pattern).
This is called from the standard implementation of exportLine for every dash in a dashed line.
Implemented in RDxfExporter, RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
|
inlinevirtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in RShapesExporter, and RArcExporter.
|
virtual |
Reimplemented in RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
|
virtual |
|
pure virtual |
Exports a point with the current attributes.
Implemented in RDxfExporter, RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
|
virtual |
polylineGen | True: use pattern along whole polyline, False: pattern per segment. |
Reimplemented in RGraphicsSceneQt.
|
virtual |
Exports a quadrilateral with the current attributes.
This is a convenience function that exports two triangles but may also be re-implemented to do something else.
|
pure virtual |
Exports an infinite ray.
Used for rays.
Implemented in RDxfExporter, RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
Exports a rectangle with the current attributes.
This is a convenience function that exports two triangles but may also be re-implemented to do something else.
Reimplemented in RGraphicsSceneQt.
|
virtual |
Exports the given shapes as part of the geometry of the current entity.
|
virtual |
Exports the given shapes as part of the geometry of the current entity.
|
virtual |
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
inlinevirtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
Reimplemented in RGraphicsSceneQt.
|
pure virtual |
Exports a triangle with the current attributes.
Implemented in RDxfExporter, RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
|
virtual |
Exports a vertical quadrilateral with the two given base points and the given height.
|
inlinevirtual |
|
virtual |
|
virtual |
|
pure virtual |
Exports an infinite line.
Used for xlines (construction lines).
Implemented in RDxfExporter, RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
bool RExporter::getClipping | ( | ) | const |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
RDocument & RExporter::getDocument | ( | ) | const |
\nonscriptoverwritable
|
inline |
|
virtual |
|
virtual |
QStack< REntity * > RExporter::getEntityStack | ( | ) |
QString RExporter::getErrorMessage | ( | ) | const |
|
virtual |
Reimplemented in RShapesExporter, and RArcExporter.
|
virtual |
Reimplemented in RGraphicsSceneQt, RPainterPathExporter, RShapesExporter, and RArcExporter.
|
virtual |
|
virtual |
|
inline |
|
inline |
|
inline |
RS::ProjectionRenderingHint RExporter::getProjectionRenderingHint | ( | ) |
|
inlinevirtual |
Reimplemented in RGraphicsSceneQt.
|
inline |
|
private |
|
virtual |
|
virtual |
|
inlinevirtual |
Override to force text rendering mode.
|
virtual |
|
inline |
void RExporter::popEntity | ( | ) |
void RExporter::pushEntity | ( | REntity * | e | ) |
void RExporter::setBlockSource | ( | RDocument * | bs | ) |
|
virtual |
|
virtual |
void RExporter::setClipping | ( | bool | on | ) |
|
virtual |
|
virtual |
Sets the current export color in RGB and Alpha.
All components are in the range of 0.0 <= component <= 1.0. If isColorFixed is true, this function does nothing.
|
virtual |
void RExporter::setDraftMode | ( | bool | on | ) |
|
inline |
|
virtual |
void RExporter::setLayerSource | ( | RDocument * | ls | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Sets the current pen (currentPen).
|
inline |
|
inline |
|
inline |
void RExporter::setProjectionRenderingHint | ( | RS::ProjectionRenderingHint | p | ) |
Sets a rendering hint for the current projection used for exports.
This is a rendering hint for the exporting entity to decide how its geometry should be rendered. For example a wall with a window exports itself differently when viewed from top than when viewed from the front or side. Note that the rendering difference is not only in the projection in a mathematical sense, but also in what edges are exported, how they are visualized and what types of shapes are exported (lines and arcs or triangles).
This rendering hint may also be used to determine what grid is appropriate to display for exporters that export to a graphics scene.
The mathematical projection is defined separately by setProjection().
void RExporter::setScreenBasedLinetypes | ( | bool | on | ) |
|
virtual |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in RGraphicsSceneQt.
|
virtual |
Called to start a new, complete export.
Implementors can for example clear any stored exported entities or caches. The default implementation does nothing.
|
inline |
|
inline |
|
virtual |
This is called for entities for which an export was requested but which cannot be instantiated because they either do not exist (anymore) in the DB or they are currently undone.
Reimplemented in RGraphicsScene, and RGraphicsSceneQt.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |