QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SvgImporter Class Reference

Very basic SVG import implementation. More...

List of all members.

Public Member Functions

void canImport (void fileName, void nameFilter)
 Implementation from RFileImporterAdapter.
void importArc (void ox, void oy, void x, void y, void rx, void ry, void angle, void isLarge, void sweep)
void importBezier (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.
void importBezier2 (void x1, void y1, void px, void py, 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.
void importPolygon (void pointsData)
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.
void setTransform (void t)
 Sets the current QTransform to apply to all imported entities.
void SvgImporter (void document, void resolution)

Public Attributes

int resolution
int resolutionScale
int style
int transform

Detailed Description

Very basic SVG import implementation.

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

Constructor & Destructor Documentation

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

Member Function Documentation

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

Implementation from RFileImporterAdapter.

void SvgImporter::importArc ( void  ox,
void  oy,
void  x,
void  y,
void  rx,
void  ry,
void  angle,
void  isLarge,
void  sweep 
)
inline
void SvgImporter::importBezier ( 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.

void SvgImporter::importBezier2 ( void  x1,
void  y1,
void  px,
void  py,
void  x2,
void  y2 
)
inline
void SvgImporter::importCircle ( void  x,
void  y,
void  r 
)
inline
void SvgImporter::importEllipse ( void  x,
void  y,
void  rx,
void  ry 
)
inline
void SvgImporter::importFile ( void  fileName)
inline
void SvgImporter::importLine ( void  x1,
void  y1,
void  x2,
void  y2 
)
inline
void SvgImporter::importPath ( void  dData)
inline

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

void SvgImporter::importPolygon ( void  pointsData)
inline
void SvgImporter::importRectangle ( void  x,
void  y,
void  w,
void  h 
)
inline
void SvgImporter::importShape ( void  shape)
inline
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")...
void SvgImporter::setTransform ( void  t)
inline

Sets the current QTransform to apply to all imported entities.


Member Data Documentation

int SvgImporter::resolution
int SvgImporter::resolutionScale
int SvgImporter::style
int SvgImporter::transform

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