QCAD
Open Source 2D CAD
SvgImporter Class Reference

Very basic SVG import implementation. Only supports a few SVG tags. More...

Inheritance diagram for SvgImporter:

Public Member Functions

void canImport (void fileName, void nameFilter)
 Implementation from RFileImporterAdapter. More...
 
void createArc (void ox, void oy, void x, void y, void rx, void ry, void angle, void isLarge, void sweep)
 
void createBezier (void x1, void y1, void px1, void py1, void px2, void py2, void x2, void y2)
 Imports a cubic spline with the given start point, control points and ent point. More...
 
void createBezier2 (void x1, void y1, void px, void py, void x2, void y2)
 
void createLine (void x1, void y1, void x2, void y2)
 
void importCircle (void x, void y, void r)
 
void importEllipse (void x, void y, void rx, void ry)
 
void importFile (void fileName)
 
void importLine (void x1, void y1, void x2, void y2)
 
void importPath (void dData)
 Parses the given path data string and imports the lines, arcs and splines from the path. More...
 
void importPolygon (void pointsData, void open)
 
void importRectangle (void x, void y, void w, void h)
 
void importShape (void shape)
 
void setStyle (void s)
 Sets the current style to apply to all imported entities. More...
 
void setTransform (void t)
 Sets the current QTransform to apply to all imported entities. More...
 
void SvgImporter (void document, void resolution)
 

Public Attributes

int resolution
 
int resolutionScale
 
int style
 
int transform
 

Detailed Description

Very basic SVG import implementation. Only supports a few SVG tags.

Returns
QTransform object from given transform attribute string.
Todo:
Use a 3rd party library to fully support SVG.

Constructor & Destructor Documentation

◆ SvgImporter()

void SvgImporter::SvgImporter ( void  document,
void  resolution 
)
inline

Member Function Documentation

◆ canImport()

void SvgImporter::canImport ( void  fileName,
void  nameFilter 
)
inline

Implementation from RFileImporterAdapter.

◆ createArc()

void SvgImporter::createArc ( void  ox,
void  oy,
void  x,
void  y,
void  rx,
void  ry,
void  angle,
void  isLarge,
void  sweep 
)
inline

◆ createBezier()

void SvgImporter::createBezier ( void  x1,
void  y1,
void  px1,
void  py1,
void  px2,
void  py2,
void  x2,
void  y2 
)
inline

Imports a cubic spline with the given start point, control points and ent point.

If the spline is almost exactly resembling an arc, an arc is imported instead.

◆ createBezier2()

void SvgImporter::createBezier2 ( void  x1,
void  y1,
void  px,
void  py,
void  x2,
void  y2 
)
inline

◆ createLine()

void SvgImporter::createLine ( void  x1,
void  y1,
void  x2,
void  y2 
)
inline

◆ importCircle()

void SvgImporter::importCircle ( void  x,
void  y,
void  r 
)
inline

◆ importEllipse()

void SvgImporter::importEllipse ( void  x,
void  y,
void  rx,
void  ry 
)
inline

◆ importFile()

void SvgImporter::importFile ( void  fileName)
inline

◆ importLine()

void SvgImporter::importLine ( void  x1,
void  y1,
void  x2,
void  y2 
)
inline

◆ importPath()

void SvgImporter::importPath ( void  dData)
inline

Parses the given path data string and imports the lines, arcs and splines from the path.

◆ importPolygon()

void SvgImporter::importPolygon ( void  pointsData,
void  open 
)
inline

◆ importRectangle()

void SvgImporter::importRectangle ( void  x,
void  y,
void  w,
void  h 
)
inline

◆ importShape()

void SvgImporter::importShape ( void  shape)
inline

◆ setStyle()

void SvgImporter::setStyle ( void  s)
inline

Sets the current style to apply to all imported entities.

Parameters
sobject with style attributes (e.g. s.stroke="red")...

◆ setTransform()

void SvgImporter::setTransform ( void  t)
inline

Sets the current QTransform to apply to all imported entities.

Member Data Documentation

◆ resolution

int SvgImporter::resolution

◆ resolutionScale

int SvgImporter::resolutionScale

◆ style

int SvgImporter::style

◆ transform

int SvgImporter::transform

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