Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::input::InputReader Class Reference

Detailed Description

The InputReader class reads input data from a file.

XML filfes like:

  • SVG files
  • IPE files
  • (KML Google Earth not implemented)
  • (CSV files not implemented)
  • JavaScript files (.js,.jscript)

As well as from (g)zipped files KMZ (=zipped kml) SVGZ (=gzipped svg)

Author
Peter Schäfer

Definition at line 32 of file inputreader.h.

#include <inputreader.h>

Classes

class  XmlMessageHandler
 handles XML parse errors; used for debugging only More...
 

Public Member Functions

QVector< Path > & getResults ()
 
void clear ()
 clear results More...
 
void readAll (const DataPath &path)
 read polygonal curves from a file More...
 
bool isSvg () const
 
bool isIpe () const
 
bool isScript () const
 
QString errorMessage ()
 

Private Member Functions

void readAll (QIODevice *device, QString fileSuffix, QString queryString)
 read polygonal curves from a file More...
 
void readXml (QIODevice *device, QString fileSuffix, QString xmlPath)
 read polygonal curves from an XML file More...
 
Path readSvgPath (QString text, QTransform tf=QTransform())
 read a polygonal curve from an SVG string More...
 
Path readIpePath (QString text, QTransform tf=QTransform())
 read a polygonal curve from an IPE string More...
 
bool readScript (QString program)
 read a JavaScript file More...
 
QTransform readTransformationMatrix (QXmlItem item, QXmlNamePool namepool)
 read a transformation matrix from XML More...
 

Static Private Member Functions

static bool isZipFile (QString suffix)
 
static bool isGzipFile (QString suffix)
 
static bool isXmlFile (QString suffix)
 
static bool isCsvFile (QString suffix)
 
static bool isSvgFile (QString suffix)
 
static bool isIpeFile (QString suffix)
 
static bool isScriptFile (QString suffix)
 

Private Attributes

QVector< Pathresults
 result values; expected to contain 2 result More...
 
QString error_message
 parse error More...
 
bool is_svg
 is it an SVG file? More...
 
bool is_ipe
 is it an IPE file? More...
 
bool is_kml
 not implemented More...
 
bool is_script
 is it a JavaScript file More...
 

Member Function Documentation

◆ clear()

void InputReader::clear ( )

clear results

Definition at line 20 of file inputreader.cpp.

◆ errorMessage()

QString frechet::input::InputReader::errorMessage ( )
inline
Returns
error message during reading a file

Definition at line 62 of file inputreader.h.

◆ getResults()

QVector<Path>& frechet::input::InputReader::getResults ( )
inline
Returns
result data: 2 polygonal curves

Definition at line 46 of file inputreader.h.

◆ isCsvFile()

bool InputReader::isCsvFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it a CSV file ?

Definition at line 188 of file inputreader.cpp.

◆ isGzipFile()

bool InputReader::isGzipFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it a GZIP file ?

Definition at line 180 of file inputreader.cpp.

◆ isIpe()

bool frechet::input::InputReader::isIpe ( ) const
inline
Returns
true if the input is an IPE file

Definition at line 57 of file inputreader.h.

◆ isIpeFile()

bool InputReader::isIpeFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it an IPE file ?

Definition at line 196 of file inputreader.cpp.

◆ isScript()

bool frechet::input::InputReader::isScript ( ) const
inline
Returns
true if the input is an SVG file

Definition at line 59 of file inputreader.h.

◆ isScriptFile()

bool InputReader::isScriptFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it a JavaScript file ?

Definition at line 200 of file inputreader.cpp.

◆ isSvg()

bool frechet::input::InputReader::isSvg ( ) const
inline
Returns
true if the input is an SVG file

Definition at line 55 of file inputreader.h.

◆ isSvgFile()

bool InputReader::isSvgFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it an SVG file ?

Definition at line 192 of file inputreader.cpp.

◆ isXmlFile()

bool InputReader::isXmlFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it an XML file ?

Definition at line 184 of file inputreader.cpp.

◆ isZipFile()

bool InputReader::isZipFile ( QString  suffix)
staticprivate
Parameters
suffixfile name suffix
Returns
is it a ZIP file ?

Definition at line 176 of file inputreader.cpp.

◆ readAll() [1/2]

void InputReader::readAll ( const DataPath path)

read polygonal curves from a file

Parameters
pathlocation of inpupt data within the file

Definition at line 26 of file inputreader.cpp.

◆ readAll() [2/2]

void InputReader::readAll ( QIODevice *  device,
QString  fileSuffix,
QString  queryString 
)
private

read polygonal curves from a file

Parameters
deviceinput stream
fileSuffixfile name suffix determines the file type
queryStringpath into XML structure

Definition at line 56 of file inputreader.cpp.

◆ readIpePath()

Path InputReader::readIpePath ( QString  text,
QTransform  tf = QTransform() 
)
private

read a polygonal curve from an IPE string

Parameters
textIPE data string
tfapply transform (optional)
Returns
a polygonal curve

Definition at line 169 of file inputreader.cpp.

◆ readScript()

bool frechet::input::InputReader::readScript ( QString  program)
private

read a JavaScript file

Parameters
programJavaScript code
Returns
true if successful

Definition at line 12 of file scriptinput.cpp.

◆ readSvgPath()

Path InputReader::readSvgPath ( QString  text,
QTransform  tf = QTransform() 
)
private

read a polygonal curve from an SVG string

Parameters
textSVG data string
tfapply transform (optional)
Returns
a polygonal curve

Definition at line 162 of file inputreader.cpp.

◆ readTransformationMatrix()

QTransform InputReader::readTransformationMatrix ( QXmlItem  item,
QXmlNamePool  namepool 
)
private

read a transformation matrix from XML

Parameters
itemXML item that contains the transformation matrix
namepoolimplements an XML namespace
Returns
an affine transformation

Definition at line 138 of file inputreader.cpp.

◆ readXml()

void InputReader::readXml ( QIODevice *  device,
QString  fileSuffix,
QString  xmlPath 
)
private

read polygonal curves from an XML file

Parameters
deviceinput stream
fileSuffixfile name suffix determines the file type
xmlPathpath into XML structure

Definition at line 78 of file inputreader.cpp.

Member Data Documentation

◆ error_message

QString frechet::input::InputReader::error_message
private

parse error

Definition at line 38 of file inputreader.h.

◆ is_ipe

bool frechet::input::InputReader::is_ipe
private

is it an IPE file?

Definition at line 40 of file inputreader.h.

◆ is_kml

bool frechet::input::InputReader::is_kml
private

not implemented

Definition at line 41 of file inputreader.h.

◆ is_script

bool frechet::input::InputReader::is_script
private

is it a JavaScript file

Definition at line 42 of file inputreader.h.

◆ is_svg

bool frechet::input::InputReader::is_svg
private

is it an SVG file?

Definition at line 39 of file inputreader.h.

◆ results

QVector<Path> frechet::input::InputReader::results
private

result values; expected to contain 2 result

Definition at line 36 of file inputreader.h.


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