QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SvgExporter Class Reference

Implementation of a simple SVG exporter that implements the RFileExporter interface. More...

Inheritance diagram for SvgExporter:
RFileExporterAdapter RFileExporter RExporter SvgExporterPG

List of all members.

Public Member Functions

void addToPathBuffer (void str)
void clearPathBuffer ()
void convert (void v)
 Converts the given value v from the document unit into the SVG output unit.
void convertQColor (void qclr)
void convertWidth ()
void endEntity ()
void endExport ()
 Called at the end of a completed export.
void exportArcSegment (void arc)
void exportEntity (void entity, void preview, void allBlocks)
void exportFile (void fileName)
void exportLineSegment (void line)
void exportPainterPaths (void painterPaths, void additionalAttributes)
void exportPoint (void point)
void exportPolyline (void polyline, void offset)
void exportTriangle (void triangle)
void getColorName (void color)
void getDocument ()
void getPathBuffer ()
void getPatternFactor ()
 Line patterns are scaled inversly to the SVG scale factor.
void setAdjustPage (void adjustPage)
void setCircleRadius (void circleRadius)
void setColor (void color)
void setCrossSize (void crossSize)
void setEnableMargins (void enable)
void setEqualMargins (void equal)
void setExportPoints (void exportPoints)
void setInkscapeTags (void inkscapeTags)
void setLineweight (void weight)
void setMargins (void left, void right, void top, void bottom)
void setPointsAsCircles (void pointsAsCircles)
void setProperties (void properties)
void setScaleStr (void scaleStr)
void setUnit (void unit)
void startExport ()
 Called to start a new, complete export.
void SvgExporter (void document, void properties)
void writeAttribute (void name, void value)
void writeCharacters (void text)
void writeComment (void text)
void writeEndDocument ()
void writeEndElement (void name)
void writeEntityComment (void entity)
void writeStartDocument ()
void writeStartElement (void name)
void writeStyleAttribute (void additionalStyles, void path)
- Public Member Functions inherited from RFileExporterAdapter
virtual void exportArcSegment (const RArc &)
virtual bool exportFile (const QString &fileName, const QString &nameFilter, bool setFileName=true)
 Must be implemented by file exporters to export the document into the given file.
virtual void exportLineSegment (const RLine &)
 Exports a line segment (a line without pattern).
virtual void exportPoint (const RPoint &)
 Exports a point with the current attributes.
virtual void exportTriangle (const RTriangle &)
 Exports a triangle with the current attributes.
 RFileExporterAdapter ()
 RFileExporterAdapter (RDocument &document)
virtual ~RFileExporterAdapter ()
- Public Member Functions inherited from RFileExporter
virtual QString getCorrectedFileName (const QString &fileName, const QString &nameFilter)=0
 Must be implemented by file exporters to correct the given file name if necesary (add extension based on chosen name filter).
 RFileExporter ()
 RFileExporter (RDocument &document)
virtual ~RFileExporter ()
- Public Member Functions inherited from RExporter
virtual void exportArc (const RArc &arc, double offset=RNANDOUBLE)
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.
virtual void exportCircle (const RCircle &circle)
 Exports a circle with the current attributes.
virtual void exportCurrentEntity (bool preview=false)
 The default implementation calls the REntity::exportEntity() function of the entity.
virtual bool exportDocument ()
 Exports the visual representation of all objects (including entities) of the document->
virtual void exportDocumentSetting (const QString &, const QVariant &)
virtual bool exportDocumentSettings ()
virtual void exportEllipse (const REllipse &ellipse, double offset=RNANDOUBLE)
 Exports an ellipse with the current attributes.
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.
virtual void exportEntities (QSet< REntity::Id > &entityIds, bool allBlocks=true)
 Calls exportEntity() for all given entities.
virtual void exportEntity (REntity &e, bool preview=false, bool allBlocks=true)
 Sets the current entity to the given entity and calls exportEntity().
virtual void exportEntity (REntity::Id entityId, bool allBlocks=true)
 Calls exportEntity(REntity*) for the entity with the given ID.
virtual void exportExplodable (const RExplodable &explodable, double offset=RNANDOUBLE)
virtual void exportImage (const RImageData &image)
virtual void exportLayer (RLayer &)
virtual void exportLayer (RLayer::Id layerId)
virtual void exportLayers ()
virtual void exportLine (const RLine &line, double offset=RNANDOUBLE)
 Exports a line with the current attributes.
virtual void exportLinetype (RLinetype &)
virtual void exportLinetypes ()
virtual void exportPainterPaths (const QList< RPainterPath > &paths)
virtual void exportPainterPathSource (const RPainterPathSource &pathSource)
virtual void exportPolyline (const RPolyline &polyline, 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.
virtual void exportRectangle (const RVector &p1, const RVector &p2)
 Exports a rectangle with the current attributes.
virtual void exportShape (QSharedPointer< RShape > shape)
 Exports the given shapes as part of the geometry of the current entity.
virtual void exportShapes (const QList< QSharedPointer< RShape > > &shapes)
 Exports the given shapes as part of the geometry of the current entity.
virtual void exportSpline (const RSpline &spline, double offset=RNANDOUBLE)
virtual void exportTrialEntities ()
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.
virtual void exportView (RView &)
virtual void exportView (RView::Id viewId)
virtual void exportViews ()
virtual REntitygetBlockRefOrEntity ()
virtual QBrush getBrush (const RPainterPath &path)
virtual QBrush getBrush ()
RDocumentgetDocument () const
 
bool getDraftMode () const
virtual REntitygetEntity ()
 Sets the current export color for entities.
virtual const REntitygetEntity () const
QStack< REntity * > getEntityStack ()
QString getErrorMessage () const
RLinetypePattern getLinetypePattern ()
double getPatternOffset (double length, const RLinetypePattern &pattern)
double getPatternOffset (double length, const RLinetypePattern &pattern, int index, double *gap=NULL)
virtual QPen getPen (const RPainterPath &path)
virtual QPen getPen ()
RS::ProjectionRenderingHint getProjectionRenderingHint ()
virtual bool isEntitySelected ()
bool isVisualExporter () const
 RExporter ()
 RExporter (RDocument &document)
void setBlockSource (RDocument *bs)
virtual void setBrush (const QBrush &brush)
virtual void setBrushStyle (Qt::BrushStyle brushStyle)
virtual void setColor (float r, float g, float b, float a=1.0f)
 Sets the current export color in RGB and Alpha.
virtual void setColor (const RColor &color)
virtual void setDashPattern (const QVector< qreal > &dashes)
void setDraftMode (bool on)
virtual void setEntityAttributes ()
void setLayerSource (RDocument *ls)
virtual void setLinetypeId (RLinetype::Id ltId)
virtual void setLinetypePattern (const RLinetypePattern &ltPattern)
virtual void setLineweight (RLineweight::Lineweight weight)
virtual void setPen (const QPen &pen)
 Sets the current pen (currentPen).
void setProjectionRenderingHint (RS::ProjectionRenderingHint p)
 Sets a rendering hint for the current projection used for exports.
virtual void setStyle (Qt::PenStyle penStyle)
void setVisualExporter (bool on)
virtual void startEntity (bool)
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.
virtual ~RExporter ()

Public Attributes

int adjustPage
int circleRadius
int color
int crossSize
int doc
int enableMargins
int equalsMargins
int exportPoints
int inkscapeTags
int isPGExporter
int marginBottom
int marginLeft
int marginRight
int marginTop
int pathBuffer
int pointsAsCircles
int scale
int scaleStr
int stream
int svgUnit
int svgUnitAbbr
int text
int textColor
int unit
int weight

Detailed Description

Implementation of a simple SVG exporter that implements the RFileExporter interface.


Constructor & Destructor Documentation

void SvgExporter::SvgExporter ( void  document,
void  properties 
)
inline

Member Function Documentation

void SvgExporter::addToPathBuffer ( void  str)
inline
void SvgExporter::clearPathBuffer ( )
inline
void SvgExporter::convert ( void  v)
inline

Converts the given value v from the document unit into the SVG output unit.

void SvgExporter::convertQColor ( void  qclr)
inline
void SvgExporter::convertWidth ( )
inline
void SvgExporter::endEntity ( )
inlinevirtual

Reimplemented from RExporter.

void SvgExporter::endExport ( )
inlinevirtual

Called at the end of a completed export.

The default implementation does nothing.

Reimplemented from RExporter.

void SvgExporter::exportArcSegment ( void  arc)
inline
void SvgExporter::exportEntity ( void  entity,
void  preview,
void  allBlocks 
)
inline

Reimplemented in SvgExporterPG.

void SvgExporter::exportFile ( void  fileName)
inline
void SvgExporter::exportLineSegment ( void  line)
inline
void SvgExporter::exportPainterPaths ( void  painterPaths,
void  additionalAttributes 
)
inline
void SvgExporter::exportPoint ( void  point)
inline
void SvgExporter::exportPolyline ( void  polyline,
void  offset 
)
inline

Reimplemented in SvgExporterPG.

void SvgExporter::exportTriangle ( void  triangle)
inline
void SvgExporter::getColorName ( void  color)
inline
void SvgExporter::getDocument ( )
inline
void SvgExporter::getPathBuffer ( )
inline
void SvgExporter::getPatternFactor ( )
inlinevirtual

Line patterns are scaled inversly to the SVG scale factor.

Reimplemented from RFileExporterAdapter.

void SvgExporter::setAdjustPage ( void  adjustPage)
inline
void SvgExporter::setCircleRadius ( void  circleRadius)
inline
void SvgExporter::setColor ( void  color)
inline
void SvgExporter::setCrossSize ( void  crossSize)
inline
void SvgExporter::setEnableMargins ( void  enable)
inline
void SvgExporter::setEqualMargins ( void  equal)
inline
void SvgExporter::setExportPoints ( void  exportPoints)
inline
void SvgExporter::setInkscapeTags ( void  inkscapeTags)
inline
void SvgExporter::setLineweight ( void  weight)
inline
void SvgExporter::setMargins ( void  left,
void  right,
void  top,
void  bottom 
)
inline
void SvgExporter::setPointsAsCircles ( void  pointsAsCircles)
inline
void SvgExporter::setProperties ( void  properties)
inline
void SvgExporter::setScaleStr ( void  scaleStr)
inline
void SvgExporter::setUnit ( void  unit)
inline
void SvgExporter::startExport ( void  )
inlinevirtual

Called to start a new, complete export.

Implementors can for example clear any stored exported entities or caches. The default implementation does nothing.

Reimplemented from RExporter.

void SvgExporter::writeAttribute ( void  name,
void  value 
)
inline
void SvgExporter::writeCharacters ( void  text)
inline
void SvgExporter::writeComment ( void  text)
inline
void SvgExporter::writeEndDocument ( )
inline
void SvgExporter::writeEndElement ( void  name)
inline
void SvgExporter::writeEntityComment ( void  entity)
inline
void SvgExporter::writeStartDocument ( )
inline
void SvgExporter::writeStartElement ( void  name)
inline
void SvgExporter::writeStyleAttribute ( void  additionalStyles,
void  path 
)
inline

Reimplemented in SvgExporterPG.


Member Data Documentation

int SvgExporter::adjustPage
int SvgExporter::circleRadius
int SvgExporter::color
int SvgExporter::crossSize
int SvgExporter::doc
int SvgExporter::enableMargins
int SvgExporter::equalsMargins
int SvgExporter::exportPoints
int SvgExporter::inkscapeTags
int SvgExporter::isPGExporter

Reimplemented in SvgExporterPG.

int SvgExporter::marginBottom
int SvgExporter::marginLeft
int SvgExporter::marginRight
int SvgExporter::marginTop
int SvgExporter::pathBuffer
int SvgExporter::pointsAsCircles
int SvgExporter::scale
int SvgExporter::scaleStr
int SvgExporter::stream
int SvgExporter::svgUnit
int SvgExporter::svgUnitAbbr
int SvgExporter::text
int SvgExporter::textColor
int SvgExporter::unit
int SvgExporter::weight

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