diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 36f93289e0..3ad008d1f2 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -1881,9 +1881,20 @@ Geometry *GeomTrimmedCurve::copy(void) const } // Persistence implementer -unsigned int GeomTrimmedCurve::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomTrimmedCurve::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomTrimmedCurve::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomTrimmedCurve::getMemSize (void) const +{ + return sizeof(Geom_TrimmedCurve); +} + +void GeomTrimmedCurve::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomTrimmedCurve::Save"); +} + +void GeomTrimmedCurve::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomTrimmedCurve::Restore"); +} PyObject *GeomTrimmedCurve::getPyObject(void) { @@ -4174,9 +4185,20 @@ const Handle(Geom_Geometry)& GeomOffsetCurve::handle() const } // Persistence implementer -unsigned int GeomOffsetCurve::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomOffsetCurve::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomOffsetCurve::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomOffsetCurve::getMemSize (void) const +{ + return sizeof(Geom_OffsetCurve); +} + +void GeomOffsetCurve::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomOffsetCurve::Save"); +} + +void GeomOffsetCurve::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomOffsetCurve::Restore"); +} PyObject *GeomOffsetCurve::getPyObject(void) { @@ -4343,9 +4365,25 @@ Geometry *GeomBezierSurface::copy(void) const } // Persistence implementer -unsigned int GeomBezierSurface::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomBezierSurface::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomBezierSurface::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomBezierSurface::getMemSize (void) const +{ + unsigned int size = sizeof(Geom_BezierSurface); + if (!mySurface.IsNull()) { + size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(gp_Pnt); + size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(Standard_Real); + } + return size; +} + +void GeomBezierSurface::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomBezierSurface::Save"); +} + +void GeomBezierSurface::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomBezierSurface::Restore"); +} PyObject *GeomBezierSurface::getPyObject(void) { @@ -4402,9 +4440,29 @@ Geometry *GeomBSplineSurface::copy(void) const } // Persistence implementer -unsigned int GeomBSplineSurface::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomBSplineSurface::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomBSplineSurface::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomBSplineSurface::getMemSize (void) const +{ + unsigned int size = sizeof(Geom_BSplineSurface); + if (!mySurface.IsNull()) { + size += mySurface->NbUKnots() * sizeof(Standard_Real); + size += mySurface->NbUKnots() * sizeof(Standard_Integer); + size += mySurface->NbVKnots() * sizeof(Standard_Real); + size += mySurface->NbVKnots() * sizeof(Standard_Integer); + size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(gp_Pnt); + size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(Standard_Real); + } + return size; +} + +void GeomBSplineSurface::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomBSplineSurface::Save"); +} + +void GeomBSplineSurface::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomBSplineSurface::Restore"); +} PyObject *GeomBSplineSurface::getPyObject(void) { @@ -4449,9 +4507,20 @@ Geometry *GeomCylinder::copy(void) const } // Persistence implementer -unsigned int GeomCylinder::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomCylinder::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomCylinder::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomCylinder::getMemSize (void) const +{ + return sizeof(Geom_CylindricalSurface); +} + +void GeomCylinder::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomCylinder::Save"); +} + +void GeomCylinder::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomCylinder::Restore"); +} PyObject *GeomCylinder::getPyObject(void) { @@ -4496,9 +4565,20 @@ Geometry *GeomCone::copy(void) const } // Persistence implementer -unsigned int GeomCone::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomCone::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomCone::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomCone::getMemSize (void) const +{ + return sizeof(Geom_ConicalSurface); +} + +void GeomCone::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomCone::Save"); +} + +void GeomCone::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomCone::Restore"); +} PyObject *GeomCone::getPyObject(void) { @@ -4587,9 +4667,20 @@ Geometry *GeomToroid::copy(void) const } // Persistence implementer -unsigned int GeomToroid::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomToroid::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomToroid::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomToroid::getMemSize (void) const +{ + return sizeof(Geom_ToroidalSurface); +} + +void GeomToroid::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomToroid::Save"); +} + +void GeomToroid::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomToroid::Restore"); +} PyObject *GeomToroid::getPyObject(void) { @@ -4634,9 +4725,20 @@ Geometry *GeomSphere::copy(void) const } // Persistence implementer -unsigned int GeomSphere::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomSphere::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomSphere::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomSphere::getMemSize (void) const +{ + return sizeof(Geom_SphericalSurface); +} + +void GeomSphere::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomSphere::Save"); +} + +void GeomSphere::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomSphere::Restore"); +} PyObject *GeomSphere::getPyObject(void) { @@ -4683,7 +4785,7 @@ Geometry *GeomPlane::copy(void) const // Persistence implementer unsigned int GeomPlane::getMemSize (void) const { - throw Base::NotImplementedError("GeomPlane::getMemSize"); + return sizeof(Geom_Plane); } void GeomPlane::Save(Base::Writer &/*writer*/) const @@ -4741,9 +4843,20 @@ Geometry *GeomOffsetSurface::copy(void) const } // Persistence implementer -unsigned int GeomOffsetSurface::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomOffsetSurface::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomOffsetSurface::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomOffsetSurface::getMemSize (void) const +{ + return sizeof(Geom_OffsetSurface); +} + +void GeomOffsetSurface::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomOffsetSurface::Save"); +} + +void GeomOffsetSurface::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomOffsetSurface::Restore"); +} PyObject *GeomOffsetSurface::getPyObject(void) { @@ -4851,9 +4964,20 @@ Geometry *GeomTrimmedSurface::copy(void) const } // Persistence implementer -unsigned int GeomTrimmedSurface::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomTrimmedSurface::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomTrimmedSurface::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomTrimmedSurface::getMemSize (void) const +{ + return sizeof(Geom_RectangularTrimmedSurface); +} + +void GeomTrimmedSurface::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomTrimmedSurface::Save"); +} + +void GeomTrimmedSurface::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomTrimmedSurface::Restore"); +} PyObject *GeomTrimmedSurface::getPyObject(void) { @@ -4900,9 +5024,20 @@ Geometry *GeomSurfaceOfRevolution::copy(void) const } // Persistence implementer -unsigned int GeomSurfaceOfRevolution::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomSurfaceOfRevolution::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomSurfaceOfRevolution::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomSurfaceOfRevolution::getMemSize (void) const +{ + return sizeof(Geom_SurfaceOfRevolution); +} + +void GeomSurfaceOfRevolution::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomSurfaceOfRevolution::Save"); +} + +void GeomSurfaceOfRevolution::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomSurfaceOfRevolution::Restore"); +} PyObject *GeomSurfaceOfRevolution::getPyObject(void) { @@ -4949,9 +5084,20 @@ Geometry *GeomSurfaceOfExtrusion::copy(void) const } // Persistence implementer -unsigned int GeomSurfaceOfExtrusion::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomSurfaceOfExtrusion::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomSurfaceOfExtrusion::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomSurfaceOfExtrusion::getMemSize (void) const +{ + return sizeof(Geom_SurfaceOfLinearExtrusion); +} + +void GeomSurfaceOfExtrusion::Save(Base::Writer &/*writer*/) const +{ + throw Base::NotImplementedError("GeomSurfaceOfExtrusion::Save"); +} + +void GeomSurfaceOfExtrusion::Restore(Base::XMLReader &/*reader*/) +{ + throw Base::NotImplementedError("GeomSurfaceOfExtrusion::Restore"); +} PyObject *GeomSurfaceOfExtrusion::getPyObject(void) {