Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
datapath.cpp
Go to the documentation of this file.
1 
2 #include <datapath.h>
3 #include <limits>
4 using namespace frechet;
5 using namespace input;
12 const QString DataPath::SVG_QUERY (
13  "declare default element namespace \"http://www.w3.org/2000/svg\"; "
14  "if(/svg/g) "
15  "then /svg/g//path/data(@d) "
16  "else /svg//path/data(@d)");
17 // QXmlQuery is peculiar about namespaces.
22 const QString DataPath::IPE_QUERY (
23  "//page//path");
24 
30 const QStringList DataPath::INPUT_FILTERS = QStringList()
31  << "Input Files (*.svg *.ipe *.js *.jscript)"
32  << "Vector Graphics (*.svg *.ipe)"
33 // << "Google Earth files (*.kml *.kmz)"
34 // << "CSV files (*.csv)"
35  << "Scripts (*.js *.jscript)"
36  << "Any files (*)";
37 
38 DataPath::DataPath(QString arg)
39 {
40  int k1 = arg.indexOf(ZIP_SEPARATOR);
41  int k2 = arg.indexOf(XML_SEPARATOR);
42 
43  if (k1<0) k1=arg.length();
44  if (k2<0) k2=arg.length();
45 
46  file = arg.mid(0,std::min(k1,k2));
47  archFile = arg.mid(std::min(k1,k2)+1,k2);
48  selector = arg.mid(k2+1);
49 
51  // TODO
52 }
std::pair< int, int > IndexInterval
Definition: datapath.h:8
global definitions for all algorithms.
static const QString IPE_QUERY
default xml path for ipe files
Definition: datapath.h:39
QString selector
XQuery path into XML structure.
Definition: datapath.h:28
DataPath(QString arg)
constructor from string
Definition: datapath.cpp:38
QFileInfo archFile
file inside zip (not used)
Definition: datapath.h:27
static const QStringList INPUT_FILTERS
name filters for file input dialogs
Definition: datapath.h:44
double min(double a, double b)
minimum function with checks for NAN
Definition: numeric.h:222
IndexInterval intval
which entries to read
Definition: datapath.h:29
static const QString SVG_QUERY
default xml path for svg files (= all path elements and the attribute "d")
Definition: datapath.h:37
QFileInfo file
file
Definition: datapath.h:26
static const char XML_SEPARATOR
Definition: datapath.h:32
static const char ZIP_SEPARATOR
Definition: datapath.h:31
double max(double a, double b)
maximum function with checks for NAN
Definition: numeric.h:233