Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
0f12eb3e
Commit
0f12eb3e
authored
9 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
changed xml project interface back to using project as parameter
parent
4b245f99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FileIO/XmlIO/Qt/XmlGspInterface.cpp
+15
-16
15 additions, 16 deletions
FileIO/XmlIO/Qt/XmlGspInterface.cpp
FileIO/XmlIO/Qt/XmlGspInterface.h
+3
-17
3 additions, 17 deletions
FileIO/XmlIO/Qt/XmlGspInterface.h
with
18 additions
and
33 deletions
FileIO/XmlIO/Qt/XmlGspInterface.cpp
+
15
−
16
View file @
0f12eb3e
...
@@ -38,15 +38,10 @@
...
@@ -38,15 +38,10 @@
namespace
FileIO
namespace
FileIO
{
{
XmlGspInterface
::
XmlGspInterface
(
GeoLib
::
GEOObjects
&
geoObjects
,
XmlGspInterface
::
XmlGspInterface
(
DataExplorerProject
&
project
)
std
::
vector
<
MeshLib
::
Mesh
*>
const
&
mesh_vector
,
:
XMLInterface
(),
XMLQtInterface
(
BaseLib
::
FileFinder
().
getPath
(
"OpenGeoSysProject.xsd"
)),
std
::
function
<
void
(
MeshLib
::
Mesh
*
const
)
>&&
add_mesh_callback
)
_project
(
project
)
:
XMLInterface
(),
XMLQtInterface
(
BaseLib
::
FileFinder
().
getPath
(
"OpenGeoSysProject.xsd"
)),
_geoObjects
(
geoObjects
),
_mesh_vector
(
mesh_vector
),
_add_mesh_callback
(
std
::
move
(
add_mesh_callback
))
{
{
}
}
...
@@ -74,7 +69,7 @@ int XmlGspInterface::readFile(const QString &fileName)
...
@@ -74,7 +69,7 @@ int XmlGspInterface::readFile(const QString &fileName)
const
QString
file_node
(
fileList
.
at
(
i
).
nodeName
());
const
QString
file_node
(
fileList
.
at
(
i
).
nodeName
());
if
(
file_node
.
compare
(
"geo"
)
==
0
)
if
(
file_node
.
compare
(
"geo"
)
==
0
)
{
{
XmlGmlInterface
gml
(
_geo
Objects
);
XmlGmlInterface
gml
(
*
(
_project
.
getGEO
Objects
())
);
const
QDomNodeList
childList
=
fileList
.
at
(
i
).
childNodes
();
const
QDomNodeList
childList
=
fileList
.
at
(
i
).
childNodes
();
for
(
int
j
=
0
;
j
<
childList
.
count
();
j
++
)
for
(
int
j
=
0
;
j
<
childList
.
count
();
j
++
)
{
{
...
@@ -91,7 +86,7 @@ int XmlGspInterface::readFile(const QString &fileName)
...
@@ -91,7 +86,7 @@ int XmlGspInterface::readFile(const QString &fileName)
}
}
else
if
(
file_node
.
compare
(
"stn"
)
==
0
)
else
if
(
file_node
.
compare
(
"stn"
)
==
0
)
{
{
XmlStnInterface
stn
(
_geo
Objects
);
XmlStnInterface
stn
(
*
(
_project
.
getGEO
Objects
())
);
const
QDomNodeList
childList
=
fileList
.
at
(
i
).
childNodes
();
const
QDomNodeList
childList
=
fileList
.
at
(
i
).
childNodes
();
for
(
int
j
=
0
;
j
<
childList
.
count
();
j
++
)
for
(
int
j
=
0
;
j
<
childList
.
count
();
j
++
)
if
(
childList
.
at
(
j
).
nodeName
().
compare
(
"file"
)
==
0
)
if
(
childList
.
at
(
j
).
nodeName
().
compare
(
"file"
)
==
0
)
...
@@ -103,7 +98,8 @@ int XmlGspInterface::readFile(const QString &fileName)
...
@@ -103,7 +98,8 @@ int XmlGspInterface::readFile(const QString &fileName)
const
std
::
string
msh_name
=
path
.
toStdString
()
+
const
std
::
string
msh_name
=
path
.
toStdString
()
+
fileList
.
at
(
i
).
toElement
().
text
().
toStdString
();
fileList
.
at
(
i
).
toElement
().
text
().
toStdString
();
MeshLib
::
Mesh
*
msh
=
FileIO
::
readMeshFromFile
(
msh_name
);
MeshLib
::
Mesh
*
msh
=
FileIO
::
readMeshFromFile
(
msh_name
);
if
(
msh
)
_add_mesh_callback
(
msh
);
if
(
msh
)
_project
.
addMesh
(
msh
);
}
}
}
}
...
@@ -118,6 +114,7 @@ int XmlGspInterface::writeToFile(const std::string& filename)
...
@@ -118,6 +114,7 @@ int XmlGspInterface::writeToFile(const std::string& filename)
bool
XmlGspInterface
::
write
()
bool
XmlGspInterface
::
write
()
{
{
GeoLib
::
GEOObjects
&
geoObjects
=
*
_project
.
getGEOObjects
();
QFileInfo
fi
(
QString
::
fromStdString
(
_filename
));
QFileInfo
fi
(
QString
::
fromStdString
(
_filename
));
std
::
string
path
((
fi
.
absolutePath
()).
toStdString
()
+
"/"
);
std
::
string
path
((
fi
.
absolutePath
()).
toStdString
()
+
"/"
);
...
@@ -135,11 +132,11 @@ bool XmlGspInterface::write()
...
@@ -135,11 +132,11 @@ bool XmlGspInterface::write()
// GML
// GML
std
::
vector
<
std
::
string
>
geoNames
;
std
::
vector
<
std
::
string
>
geoNames
;
_
geoObjects
.
getGeometryNames
(
geoNames
);
geoObjects
.
getGeometryNames
(
geoNames
);
for
(
std
::
vector
<
std
::
string
>::
const_iterator
it
(
geoNames
.
begin
());
it
!=
geoNames
.
end
();
++
it
)
for
(
std
::
vector
<
std
::
string
>::
const_iterator
it
(
geoNames
.
begin
());
it
!=
geoNames
.
end
();
++
it
)
{
{
// write GLI file
// write GLI file
XmlGmlInterface
gml
(
_
geoObjects
);
XmlGmlInterface
gml
(
geoObjects
);
std
::
string
name
(
*
it
);
std
::
string
name
(
*
it
);
gml
.
setNameForExport
(
name
);
gml
.
setNameForExport
(
name
);
if
(
gml
.
writeToFile
(
std
::
string
(
path
+
name
+
".gml"
)))
if
(
gml
.
writeToFile
(
std
::
string
(
path
+
name
+
".gml"
)))
...
@@ -156,6 +153,7 @@ bool XmlGspInterface::write()
...
@@ -156,6 +153,7 @@ bool XmlGspInterface::write()
}
}
// MSH
// MSH
const
std
::
vector
<
MeshLib
::
Mesh
*>
_mesh_vector
=
_project
.
getMeshObjects
();
for
(
auto
const
&
mesh
:
_mesh_vector
)
for
(
auto
const
&
mesh
:
_mesh_vector
)
{
{
// write mesh file
// write mesh file
...
@@ -175,11 +173,11 @@ bool XmlGspInterface::write()
...
@@ -175,11 +173,11 @@ bool XmlGspInterface::write()
// STN
// STN
std
::
vector
<
std
::
string
>
stnNames
;
std
::
vector
<
std
::
string
>
stnNames
;
_
geoObjects
.
getStationVectorNames
(
stnNames
);
geoObjects
.
getStationVectorNames
(
stnNames
);
for
(
std
::
vector
<
std
::
string
>::
const_iterator
it
(
stnNames
.
begin
());
it
!=
stnNames
.
end
();
++
it
)
for
(
std
::
vector
<
std
::
string
>::
const_iterator
it
(
stnNames
.
begin
());
it
!=
stnNames
.
end
();
++
it
)
{
{
// write STN file
// write STN file
XmlStnInterface
stn
(
_
geoObjects
);
XmlStnInterface
stn
(
geoObjects
);
std
::
string
name
(
*
it
);
std
::
string
name
(
*
it
);
stn
.
setNameForExport
(
name
);
stn
.
setNameForExport
(
name
);
...
@@ -202,4 +200,5 @@ bool XmlGspInterface::write()
...
@@ -202,4 +200,5 @@ bool XmlGspInterface::write()
_out
<<
xml
;
_out
<<
xml
;
return
true
;
return
true
;
}
}
}
}
This diff is collapsed.
Click to expand it.
FileIO/XmlIO/Qt/XmlGspInterface.h
+
3
−
17
View file @
0f12eb3e
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
#ifndef XMLGSPINTERFACE_H
#ifndef XMLGSPINTERFACE_H
#define XMLGSPINTERFACE_H
#define XMLGSPINTERFACE_H
#include
<functional>
#include
<vector>
#include
<vector>
#include
<string>
#include
<string>
...
@@ -24,15 +23,7 @@
...
@@ -24,15 +23,7 @@
#include
"../XMLInterface.h"
#include
"../XMLInterface.h"
#include
"XMLQtInterface.h"
#include
"XMLQtInterface.h"
namespace
MeshLib
#include
"DataHolderLib/DataExplorerProject.h"
{
class
Mesh
;
}
namespace
GeoLib
{
class
GEOObjects
;
}
namespace
FileIO
namespace
FileIO
{
{
...
@@ -43,10 +34,7 @@ namespace FileIO
...
@@ -43,10 +34,7 @@ namespace FileIO
class
XmlGspInterface
:
public
XMLInterface
,
public
XMLQtInterface
class
XmlGspInterface
:
public
XMLInterface
,
public
XMLQtInterface
{
{
public:
public:
XmlGspInterface
(
XmlGspInterface
(
DataExplorerProject
&
project
);
GeoLib
::
GEOObjects
&
geoObjects
,
std
::
vector
<
MeshLib
::
Mesh
*>
const
&
mesh_vector
,
std
::
function
<
void
(
MeshLib
::
Mesh
*
const
)
>&&
add_mesh_callback
);
virtual
~
XmlGspInterface
()
{}
virtual
~
XmlGspInterface
()
{}
...
@@ -63,9 +51,7 @@ protected:
...
@@ -63,9 +51,7 @@ protected:
private
:
private
:
std
::
string
_filename
;
std
::
string
_filename
;
GeoLib
::
GEOObjects
&
_geoObjects
;
DataExplorerProject
&
_project
;
std
::
vector
<
MeshLib
::
Mesh
*>
const
&
_mesh_vector
;
std
::
function
<
void
(
MeshLib
::
Mesh
*
const
)
>
_add_mesh_callback
;
};
};
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment