|
@@ -8,7 +8,6 @@
|
|
|
#include <QDomDocument>
|
|
|
#include <QDomElement>
|
|
|
#include <QDataStream>
|
|
|
-#include "geometryDatum.h"
|
|
|
#include "GeoComponent.h"
|
|
|
|
|
|
namespace Geometry
|
|
@@ -30,15 +29,7 @@ namespace Geometry
|
|
|
{
|
|
|
_geometryList.append(set);
|
|
|
}
|
|
|
- void GeometryData::appendGeometryDatum(GeometryDatum *plane)
|
|
|
- {
|
|
|
- _geomtretryDatumList.append(plane);
|
|
|
- }
|
|
|
|
|
|
- QList<GeometryDatum *> GeometryData::getGeometryDatum()
|
|
|
- {
|
|
|
- return _geomtretryDatumList;
|
|
|
- }
|
|
|
|
|
|
int GeometryData::getGeometrySetCount()
|
|
|
{
|
|
@@ -85,11 +76,6 @@ namespace Geometry
|
|
|
return ishas;
|
|
|
}
|
|
|
|
|
|
- void GeometryData::removeGeometryDatum(GeometryDatum *plane)
|
|
|
- {
|
|
|
- if (_geomtretryDatumList.contains(plane))
|
|
|
- _geomtretryDatumList.removeOne(plane);
|
|
|
- }
|
|
|
|
|
|
void GeometryData::setVisable(int index, bool visable)
|
|
|
{
|
|
@@ -108,20 +94,6 @@ namespace Geometry
|
|
|
}
|
|
|
_geometryList.clear();
|
|
|
|
|
|
- const int nd = _geomtretryDatumList.size();
|
|
|
- for (int i = 0; i < nd; ++i)
|
|
|
- {
|
|
|
- auto set = _geomtretryDatumList.at(i);
|
|
|
- delete set;
|
|
|
- }
|
|
|
- _geomtretryDatumList.clear();
|
|
|
-
|
|
|
- if (_sketchPlan != nullptr)
|
|
|
- {
|
|
|
- delete _sketchPlan;
|
|
|
- _sketchPlan = nullptr;
|
|
|
- }
|
|
|
-
|
|
|
const int nc = _geoCpList.size();
|
|
|
for (int i = 0; i < nc; ++i)
|
|
|
{
|
|
@@ -163,14 +135,6 @@ namespace Geometry
|
|
|
geoSet->writeToProjectFile(doc, &geoSetsRoot, isdiso);
|
|
|
}
|
|
|
|
|
|
- n = _geomtretryDatumList.size();
|
|
|
- if (n > 0)
|
|
|
- {
|
|
|
- QDomElement geoDatumsRoot = doc->createElement("GeoDatums");
|
|
|
- georoot.appendChild(geoDatumsRoot);
|
|
|
- for (auto datum : _geomtretryDatumList)
|
|
|
- datum->writeToProjectFile(doc, &geoDatumsRoot, isdiso);
|
|
|
- }
|
|
|
|
|
|
n = _geoCpList.size();
|
|
|
if (n > 0)
|
|
@@ -186,11 +150,9 @@ namespace Geometry
|
|
|
{
|
|
|
QDomElement georoot = nodelist->at(0).toElement();
|
|
|
QDomElement geoSetRoot = georoot.elementsByTagName("GeoSets").at(0).toElement();
|
|
|
- QDomElement datumRoot = georoot.elementsByTagName("GeoDatums").at(0).toElement();
|
|
|
QDomElement gcRoot = georoot.elementsByTagName("GeoComponents").at(0).toElement();
|
|
|
|
|
|
QDomNodeList geoSetList = geoSetRoot.elementsByTagName("GeoSet");
|
|
|
- QDomNodeList datumList = datumRoot.elementsByTagName("GeoDatum");
|
|
|
QDomNodeList gcList = gcRoot.elementsByTagName("GeoComponent");
|
|
|
|
|
|
const int geoCount = geoSetList.size();
|
|
@@ -202,14 +164,7 @@ namespace Geometry
|
|
|
s->readDataFromProjectFile(&geoset, isdiso);
|
|
|
}
|
|
|
|
|
|
- const int nd = datumList.size();
|
|
|
- for (int i = 0; i < nd; ++i)
|
|
|
- {
|
|
|
- QDomElement geoDat = datumList.at(i).toElement();
|
|
|
- GeometryDatum *s = new GeometryDatum;
|
|
|
- _geomtretryDatumList.append(s);
|
|
|
- s->readDataFromProjectFile(&geoDat, isdiso);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
const int gcCount = gcList.size();
|
|
|
for (int i = 0; i < gcCount; ++i)
|
|
@@ -235,14 +190,6 @@ namespace Geometry
|
|
|
return nullptr;
|
|
|
}
|
|
|
|
|
|
- GeometryDatum *GeometryData::getDatumByIndex(const int index)
|
|
|
- {
|
|
|
- GeometryDatum *d = nullptr;
|
|
|
- if (index >= 0 && index < _geomtretryDatumList.size())
|
|
|
- d = _geomtretryDatumList.at(index);
|
|
|
- return d;
|
|
|
- }
|
|
|
-
|
|
|
GeoComponent *GeometryData::getGeoComponentByIndex(int index)
|
|
|
{
|
|
|
if (index >= 0 && index < _geoCpList.size())
|
|
@@ -269,7 +216,6 @@ namespace Geometry
|
|
|
void GeometryData::sort()
|
|
|
{
|
|
|
std::sort(_geometryList.begin(), _geometryList.end(), compareSet);
|
|
|
- std::sort(_geomtretryDatumList.begin(), _geomtretryDatumList.end(), compareSet);
|
|
|
std::sort(_geoCpList.begin(), _geoCpList.end(), compareSet);
|
|
|
}
|
|
|
|