0027241: Create a complete test case to verify reading of all attribute types from...
authormyn <myn@opencascade.com>
Fri, 11 Mar 2016 19:08:01 +0000 (22:08 +0300)
committerabv <abv@opencascade.com>
Wed, 16 Mar 2016 15:52:44 +0000 (18:52 +0300)
Added test case that works in one of two modes:
1) create synthetic document (in old version of OCCT) containing all possible attributes.
2) open the document and compare all attributes with expected values.

Fixed reading of TDataStd_NamedData, TDataXtd_PatternStd, and PColStd_HArray2OfReal.
Point and curve representations are created even from NULL geometry handles.
The code is simplified by abandoning usage of templates from StdObjMgt_ContentTypes class for persistent data elements.

Fixed SetAsciiString Draw command failed when the target label contained NamedData attribute.

82 files changed:
adm/UDLIST
src/DDataStd/DDataStd_BasicCommands.cxx
src/ShapePersistent/FILES
src/ShapePersistent/ShapePersistent.cxx
src/ShapePersistent/ShapePersistent_BRep.cxx
src/ShapePersistent/ShapePersistent_BRep.hxx
src/ShapePersistent/ShapePersistent_Geom.cxx
src/ShapePersistent/ShapePersistent_Geom.hxx
src/ShapePersistent/ShapePersistent_Geom2d_Curve.hxx
src/ShapePersistent/ShapePersistent_Geom_Curve.hxx
src/ShapePersistent/ShapePersistent_Geom_Surface.hxx
src/ShapePersistent/ShapePersistent_HArray1.cxx [deleted file]
src/ShapePersistent/ShapePersistent_HArray1.hxx
src/ShapePersistent/ShapePersistent_HArray2.cxx [deleted file]
src/ShapePersistent/ShapePersistent_HArray2.hxx
src/ShapePersistent/ShapePersistent_HSequence.hxx
src/ShapePersistent/ShapePersistent_Poly.hxx
src/ShapePersistent/ShapePersistent_TopoDS.cxx
src/ShapePersistent/ShapePersistent_TopoDS.hxx
src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx
src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx
src/StdLObject/FILES [deleted file]
src/StdLObject/StdLObject_GUID.cxx [deleted file]
src/StdLObject/StdLObject_GUID.hxx [deleted file]
src/StdLPersistent/FILES
src/StdLPersistent/StdLPersistent_Collection.cxx
src/StdLPersistent/StdLPersistent_Collection.hxx
src/StdLPersistent/StdLPersistent_Data.cxx
src/StdLPersistent/StdLPersistent_Data.hxx
src/StdLPersistent/StdLPersistent_Dependency.hxx
src/StdLPersistent/StdLPersistent_Document.hxx
src/StdLPersistent/StdLPersistent_Function.hxx
src/StdLPersistent/StdLPersistent_HArray1.cxx
src/StdLPersistent/StdLPersistent_HArray1.hxx
src/StdLPersistent/StdLPersistent_HArray1OfPersistent.hxx [deleted file]
src/StdLPersistent/StdLPersistent_HArray2.cxx
src/StdLPersistent/StdLPersistent_HArray2.hxx
src/StdLPersistent/StdLPersistent_HString.cxx
src/StdLPersistent/StdLPersistent_NamedData.cxx
src/StdLPersistent/StdLPersistent_NamedData.hxx
src/StdLPersistent/StdLPersistent_Real.hxx
src/StdLPersistent/StdLPersistent_TreeNode.hxx
src/StdLPersistent/StdLPersistent_Value.cxx
src/StdLPersistent/StdLPersistent_Variable.hxx
src/StdLPersistent/StdLPersistent_XLink.hxx
src/StdObjMgt/FILES
src/StdObjMgt/StdObjMgt_Attribute.hxx
src/StdObjMgt/StdObjMgt_ContentTypes.hxx [deleted file]
src/StdObjMgt/StdObjMgt_Persistent.hxx
src/StdObjMgt/StdObjMgt_ReadData.cxx
src/StdObjMgt/StdObjMgt_ReadData.hxx
src/StdObjMgt/StdObjMgt_SharedObject.hxx
src/StdObject/FILES
src/StdObject/StdObject_Location.cxx
src/StdObject/StdObject_Location.hxx
src/StdObject/StdObject_Shape.cxx
src/StdObject/StdObject_Shape.hxx
src/StdObject/StdObject_gp.hxx [deleted file]
src/StdObject/StdObject_gp_Axes.hxx [new file with mode: 0644]
src/StdObject/StdObject_gp_Curves.hxx [new file with mode: 0644]
src/StdObject/StdObject_gp_Surfaces.hxx [new file with mode: 0644]
src/StdObject/StdObject_gp_Trsfs.hxx [new file with mode: 0644]
src/StdObject/StdObject_gp_Vectors.hxx [new file with mode: 0644]
src/StdPersistent/FILES
src/StdPersistent/StdPersistent_DataXtd.cxx
src/StdPersistent/StdPersistent_DataXtd.hxx
src/StdPersistent/StdPersistent_DataXtd_Constraint.cxx
src/StdPersistent/StdPersistent_DataXtd_Constraint.hxx
src/StdPersistent/StdPersistent_DataXtd_PatternStd.cxx
src/StdPersistent/StdPersistent_DataXtd_PatternStd.hxx
src/StdPersistent/StdPersistent_HArray1.cxx [deleted file]
src/StdPersistent/StdPersistent_HArray1.hxx
src/StdPersistent/StdPersistent_HArray1OfShape1.hxx [deleted file]
src/StdPersistent/StdPersistent_Naming.cxx
src/StdPersistent/StdPersistent_Naming.hxx
src/StdPersistent/StdPersistent_PPrsStd.hxx
src/StdPersistent/StdPersistent_TopLoc.cxx
src/StdPersistent/StdPersistent_TopLoc.hxx
src/StdPersistent/StdPersistent_TopoDS.hxx
src/TKStdL/PACKAGES
tests/caf/bugs/D2 [new file with mode: 0644]
tests/parse.rules

index 26cf2eb..b6d6b2f 100644 (file)
@@ -244,7 +244,6 @@ n CDM
 n FWOSDriver
 n PCDM
 n StdLDrivers
-n StdLObject
 n StdLPersistent
 n StdObjMgt
 n StdDrivers
index 65ea997..732d161 100644 (file)
@@ -2856,7 +2856,7 @@ static Standard_Integer DDataStd_SetAsciiString (Draw_Interpretor& di,
     DDF::AddLabel(DF, arg[2], aLabel);
     TCollection_AsciiString aString(arg[3]);
     Handle(TDataStd_AsciiString) anAtt;
-    if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
+    if(!aLabel.FindAttribute(TDataStd_AsciiString::GetID(), anAtt))
       anAtt = TDataStd_AsciiString::Set(aLabel, aString);
     if(anAtt.IsNull()) {
       di << "AsciiString attribute is not found or not set"  << "\n";
index d90ed48..4042c5f 100644 (file)
@@ -11,9 +11,7 @@ ShapePersistent_Geom_Surface.hxx
 ShapePersistent_Geom2d.hxx
 ShapePersistent_Geom2d_Curve.cxx
 ShapePersistent_Geom2d_Curve.hxx
-ShapePersistent_HArray1.cxx
 ShapePersistent_HArray1.hxx
-ShapePersistent_HArray2.cxx
 ShapePersistent_HArray2.hxx
 ShapePersistent_HSequence.cxx
 ShapePersistent_HSequence.hxx
index ec9db1e..f2e69d8 100644 (file)
@@ -15,6 +15,7 @@
 #include <StdObjMgt_MapOfInstantiators.hxx>
 
 #include <StdLPersistent_HArray1.hxx>
+#include <StdLPersistent_HArray2.hxx>
 #include <StdPersistent_TopoDS.hxx>
 #include <ShapePersistent_TopoDS.hxx>
 #include <ShapePersistent_HArray1.hxx>
 void ShapePersistent::BindTypes (StdObjMgt_MapOfInstantiators& theMap)
 {
   theMap.Bind <StdLPersistent_HArray1::Persistent> ("PTopoDS_HArray1OfHShape");
-
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_HShape");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Vertex");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Edge");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Wire");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Face");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Shell");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Solid");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_CompSolid");
-  theMap.Bind <ShapePersistent_TopoDS::Shape>       ("PTopoDS_Compound");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom_HArray1OfCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom_HArray1OfBoundedCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom_HArray1OfBezierCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom_HArray1OfBSplineCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom_HArray1OfSurface");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom_HArray1OfBoundedSurface");
+  theMap.Bind <StdLPersistent_HArray2::Persistent> ("PColPGeom_HArray2OfSurface");
+  theMap.Bind <StdLPersistent_HArray2::Persistent> ("PColPGeom_HArray2OfBoundedSurface");
+  theMap.Bind <StdLPersistent_HArray2::Persistent> ("PColPGeom_HArray2OfBezierSurface");
+  theMap.Bind <StdLPersistent_HArray2::Persistent> ("PColPGeom_HArray2OfBSplineSurface");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom2d_HArray1OfCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom2d_HArray1OfBoundedCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom2d_HArray1OfBezierCurve");
+  theMap.Bind <StdLPersistent_HArray1::Persistent> ("PColPGeom2d_HArray1OfBSplineCurve");
+
+  theMap.Bind <StdLPersistent_HArray2::Real>       ("PColStd_HArray2OfReal");
+
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_HShape");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Vertex");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Edge");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Wire");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Face");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Shell");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Solid");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_CompSolid");
+  theMap.Bind <ShapePersistent_TopoDS::HShape>      ("PTopoDS_Compound");
 
   theMap.Bind <StdPersistent_TopoDS::TShape>        ("PTopoDS_TShape");
 
index cb401ca..6c2a894 100644 (file)
@@ -74,11 +74,12 @@ void ShapePersistent_BRep::PointOnCurve::Read
 Handle(BRep_PointRepresentation)
   ShapePersistent_BRep::PointOnCurve::import() const
 {
-  if (myCurve.IsNull())
-    return NULL;
+  Handle(Geom_Curve) aCurve;
+  if (myCurve)
+    aCurve = myCurve->Import();
 
   return new BRep_PointOnCurve
-    (myParameter, myCurve->Import(), myLocation.Import());
+    (myParameter, aCurve, myLocation.Import());
 }
 
 void ShapePersistent_BRep::PointsOnSurface::Read
@@ -98,11 +99,16 @@ void ShapePersistent_BRep::PointOnCurveOnSurface::Read
 Handle(BRep_PointRepresentation)
   ShapePersistent_BRep::PointOnCurveOnSurface::import() const
 {
-  if (mySurface.IsNull() || myPCurve.IsNull())
-    return NULL;
+  Handle(Geom2d_Curve) aPCurve;
+  if (myPCurve)
+    aPCurve = myPCurve->Import();
+
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
 
   return new BRep_PointOnCurveOnSurface
-    (myParameter, myPCurve->Import(), mySurface->Import(), myLocation.Import());
+    (myParameter, aPCurve, aSurface, myLocation.Import());
 }
 
 void ShapePersistent_BRep::PointOnSurface::Read
@@ -115,11 +121,12 @@ void ShapePersistent_BRep::PointOnSurface::Read
 Handle(BRep_PointRepresentation)
   ShapePersistent_BRep::PointOnSurface::import() const
 {
-  if (mySurface.IsNull())
-    return NULL;
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
 
   return new BRep_PointOnSurface
-    (myParameter, myParameter2, mySurface->Import(), myLocation.Import());
+    (myParameter, myParameter2, aSurface, myLocation.Import());
 }
 
 //=======================================================================
@@ -164,12 +171,12 @@ void ShapePersistent_BRep::Curve3D::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::Curve3D::import() const
 {
-  Handle(Geom_Curve) aCurve;
+  Handle(Geom_Curve) aCurve3D;
   if (myCurve3D)
-    aCurve = myCurve3D->Import();
+    aCurve3D = myCurve3D->Import();
 
   Handle(BRep_Curve3D) aRepresentation =
-    new BRep_Curve3D (aCurve, myLocation.Import());
+    new BRep_Curve3D (aCurve3D, myLocation.Import());
 
   aRepresentation->SetRange (myFirst, myLast);
   return aRepresentation;
@@ -185,18 +192,21 @@ void ShapePersistent_BRep::CurveOnSurface::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::CurveOnSurface::import() const
 {
-  if (myPCurve.IsNull() || mySurface.IsNull())
-    return NULL;
+  Handle(Geom2d_Curve) aPCurve;
+  if (myPCurve)
+    aPCurve = myPCurve->Import();
+
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
 
-  Handle(BRep_CurveOnSurface) aCurve =
-    new BRep_CurveOnSurface (myPCurve->Import(),
-                             mySurface->Import(),
-                             myLocation.Import());
+  Handle(BRep_CurveOnSurface) aRepresentation =
+    new BRep_CurveOnSurface (aPCurve, aSurface, myLocation.Import());
 
-  aCurve->SetUVPoints (myUV1, myUV2);
-  aCurve->SetRange (myFirst, myLast);
+  aRepresentation->SetUVPoints (myUV1, myUV2);
+  aRepresentation->SetRange (myFirst, myLast);
 
-  return aCurve;
+  return aRepresentation;
 }
 
 void ShapePersistent_BRep::CurveOnClosedSurface::Read
@@ -209,21 +219,29 @@ void ShapePersistent_BRep::CurveOnClosedSurface::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::CurveOnClosedSurface::import() const
 {
-  if (myPCurve.IsNull() || mySurface.IsNull() || myPCurve2.IsNull())
-    return NULL;
+  Handle(Geom2d_Curve) aPCurve;
+  if (myPCurve)
+    aPCurve = myPCurve->Import();
 
-  Handle(BRep_CurveOnClosedSurface) aCurve =
-    new BRep_CurveOnClosedSurface (myPCurve->Import(),
-                                   myPCurve2->Import(),
-                                   mySurface->Import(),
-                                   myLocation.Import(),
-                                   myContinuity);
+  Handle(Geom2d_Curve) aPCurve2;
+  if (myPCurve2)
+    aPCurve2 = myPCurve2->Import();
+
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
 
-  aCurve->SetUVPoints  (myUV1  , myUV2 );
-  aCurve->SetUVPoints2 (myUV21 , myUV22);
-  aCurve->SetRange     (myFirst, myLast);
+  GeomAbs_Shape aContinuity = static_cast<GeomAbs_Shape> (myContinuity);
 
-  return aCurve;
+  Handle(BRep_CurveOnClosedSurface) aRepresentation =
+    new BRep_CurveOnClosedSurface
+      (aPCurve, aPCurve2, aSurface, myLocation.Import(), aContinuity);
+
+  aRepresentation->SetUVPoints  (myUV1  , myUV2 );
+  aRepresentation->SetUVPoints2 (myUV21 , myUV22);
+  aRepresentation->SetRange     (myFirst, myLast);
+
+  return aRepresentation;
 }
 
 void ShapePersistent_BRep::Polygon3D::Read
@@ -236,10 +254,11 @@ void ShapePersistent_BRep::Polygon3D::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::Polygon3D::import() const
 {
-  if (myPolygon3D.IsNull())
-    return NULL;
+  Handle(Poly_Polygon3D) aPolygon3D;
+  if (myPolygon3D)
+    aPolygon3D = myPolygon3D->Import();
 
-  return new BRep_Polygon3D (myPolygon3D->Import(), myLocation.Import());
+  return new BRep_Polygon3D (aPolygon3D, myLocation.Import());
 }
 
 void ShapePersistent_BRep::PolygonOnTriangulation::Read
@@ -252,12 +271,16 @@ void ShapePersistent_BRep::PolygonOnTriangulation::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::PolygonOnTriangulation::import() const
 {
-  if (myPolygon.IsNull() || myTriangulation.IsNull())
-    return NULL;
+  Handle(Poly_PolygonOnTriangulation) aPolygon;
+  if (myPolygon)
+    aPolygon = myPolygon->Import();
 
-  return new BRep_PolygonOnTriangulation (myPolygon->Import(),
-                                          myTriangulation->Import(),
-                                          myLocation.Import());
+  Handle(Poly_Triangulation) aTriangulation;
+  if (myTriangulation)
+    aTriangulation = myTriangulation->Import();
+
+  return new BRep_PolygonOnTriangulation
+    (aPolygon, aTriangulation, myLocation.Import());
 }
 
 void ShapePersistent_BRep::PolygonOnClosedTriangulation::Read
@@ -270,13 +293,20 @@ void ShapePersistent_BRep::PolygonOnClosedTriangulation::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::PolygonOnClosedTriangulation::import() const
 {
-  if (myPolygon.IsNull() || myTriangulation.IsNull() || myPolygon2.IsNull())
-    return NULL;
+  Handle(Poly_PolygonOnTriangulation) aPolygon;
+  if (myPolygon)
+    aPolygon = myPolygon->Import();
 
-  return new BRep_PolygonOnClosedTriangulation (myPolygon->Import(),
-                                                myPolygon2->Import(),
-                                                myTriangulation->Import(),
-                                                myLocation.Import());
+  Handle(Poly_PolygonOnTriangulation) aPolygon2;
+  if (myPolygon2)
+    aPolygon2 = myPolygon2->Import();
+
+  Handle(Poly_Triangulation) aTriangulation;
+  if (myTriangulation)
+    aTriangulation = myTriangulation->Import();
+
+  return new BRep_PolygonOnClosedTriangulation
+    (aPolygon, aPolygon2, aTriangulation, myLocation.Import());
 }
 
 void ShapePersistent_BRep::PolygonOnSurface::Read
@@ -289,12 +319,15 @@ void ShapePersistent_BRep::PolygonOnSurface::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::PolygonOnSurface::import() const
 {
-  if (myPolygon2D.IsNull() || mySurface.IsNull())
-    return NULL;
+  Handle(Poly_Polygon2D) aPolygon2D;
+  if (myPolygon2D)
+    aPolygon2D = myPolygon2D->Import();
+
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
 
-  return new BRep_PolygonOnSurface (myPolygon2D->Import(),
-                                    mySurface->Import(),
-                                    myLocation.Import());
+  return new BRep_PolygonOnSurface (aPolygon2D, aSurface, myLocation.Import());
 }
 
 void ShapePersistent_BRep::PolygonOnClosedSurface::Read
@@ -307,13 +340,20 @@ void ShapePersistent_BRep::PolygonOnClosedSurface::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::PolygonOnClosedSurface::import() const
 {
-  if (myPolygon2D.IsNull() || mySurface.IsNull() || myPolygon2.IsNull())
-    return NULL;
+  Handle(Poly_Polygon2D) aPolygon2D;
+  if (myPolygon2D)
+    aPolygon2D = myPolygon2D->Import();
 
-  return new BRep_PolygonOnClosedSurface (myPolygon2D->Import(),
-                                          myPolygon2->Import(),
-                                          mySurface->Import(),
-                                          myLocation.Import());
+  Handle(Poly_Polygon2D) aPolygon2;
+  if (myPolygon2)
+    aPolygon2 = myPolygon2->Import();
+
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
+
+  return new BRep_PolygonOnClosedSurface
+    (aPolygon2D, aPolygon2, aSurface, myLocation.Import());
 }
 
 void ShapePersistent_BRep::CurveOn2Surfaces::Read
@@ -326,14 +366,18 @@ void ShapePersistent_BRep::CurveOn2Surfaces::Read
 Handle(BRep_CurveRepresentation)
   ShapePersistent_BRep::CurveOn2Surfaces::import() const
 {
-  if (mySurface.IsNull() || mySurface2.IsNull())
-    return NULL;
+  Handle(Geom_Surface) aSurface;
+  if (mySurface)
+    aSurface = mySurface->Import();
+
+  Handle(Geom_Surface) aSurface2;
+  if (mySurface2)
+    aSurface2 = mySurface2->Import();
+
+  GeomAbs_Shape aContinuity = static_cast<GeomAbs_Shape> (myContinuity);
 
-  return new BRep_CurveOn2Surfaces (mySurface->Import(),
-                                    mySurface2->Import(),
-                                    myLocation.Import(),
-                                    myLocation2.Import(),
-                                    myContinuity);
+  return new BRep_CurveOn2Surfaces
+    (aSurface, aSurface2, myLocation.Import(), myLocation2.Import(), aContinuity);
 }
 
 //=======================================================================
index 6a660ac..3ef0f6d 100644 (file)
 #include <ShapePersistent_Geom2d.hxx>
 #include <ShapePersistent_Poly.hxx>
 #include <StdObject_Location.hxx>
-#include <StdObject_gp.hxx>
+#include <StdObject_gp_Vectors.hxx>
 
 #include <BRep_ListOfPointRepresentation.hxx>
 #include <BRep_ListOfCurveRepresentation.hxx>
 
 #include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
-#include <GeomAbs_Shape.hxx>
 
 class BRep_PointRepresentation;
 class BRep_CurveRepresentation;
@@ -50,11 +49,11 @@ public:
     virtual Handle(BRep_PointRepresentation) import() const;
 
   protected:
-    Object <StdObject_Location> myLocation;
-    Value  <Standard_Real>      myParameter;
+    StdObject_Location myLocation;
+    Standard_Real      myParameter;
 
   private:
-    Reference<PointRepresentation> myNext;
+    Handle(PointRepresentation) myNext;
   };
 
   class PointOnCurve : public PointRepresentation
@@ -64,7 +63,7 @@ public:
     virtual Handle(BRep_PointRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Geom::Curve> myCurve;
+    Handle(ShapePersistent_Geom::Curve) myCurve;
   };
 
   class PointsOnSurface : public PointRepresentation
@@ -73,7 +72,7 @@ public:
     virtual void Read (StdObjMgt_ReadData& theReadData);
 
   protected:
-    Reference<ShapePersistent_Geom::Surface> mySurface;
+    Handle(ShapePersistent_Geom::Surface) mySurface;
   };
 
   class PointOnCurveOnSurface : public PointsOnSurface
@@ -83,7 +82,7 @@ public:
     virtual Handle(BRep_PointRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Geom2d::Curve> myPCurve;
+    Handle(ShapePersistent_Geom2d::Curve) myPCurve;
   };
 
   class PointOnSurface : public PointsOnSurface
@@ -93,7 +92,7 @@ public:
     virtual Handle(BRep_PointRepresentation) import() const;
 
   private:
-    Value<Standard_Real> myParameter2;
+    Standard_Real myParameter2;
   };
 
   class CurveRepresentation : public StdObjMgt_Persistent
@@ -110,10 +109,10 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   protected:
-    Object<StdObject_Location> myLocation;
+    StdObject_Location myLocation;
 
   private:
-    Reference<CurveRepresentation> myNext;
+    Handle(CurveRepresentation) myNext;
   };
 
   class GCurve : public CurveRepresentation
@@ -122,8 +121,8 @@ public:
     virtual void Read (StdObjMgt_ReadData& theReadData);
 
   protected:
-    Value<Standard_Real> myFirst;
-    Value<Standard_Real> myLast;
+    Standard_Real myFirst;
+    Standard_Real myLast;
   };
 
   class Curve3D : public GCurve
@@ -133,7 +132,7 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Geom::Curve> myCurve3D;
+    Handle(ShapePersistent_Geom::Curve) myCurve3D;
   };
 
   class CurveOnSurface : public GCurve
@@ -143,10 +142,10 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   protected:
-    Reference<ShapePersistent_Geom2d::Curve> myPCurve;
-    Reference<ShapePersistent_Geom::Surface> mySurface;
-    StdObject_gp::Object<gp_Pnt2d>           myUV1;
-    StdObject_gp::Object<gp_Pnt2d>           myUV2;
+    Handle(ShapePersistent_Geom2d::Curve) myPCurve;
+    Handle(ShapePersistent_Geom::Surface) mySurface;
+    gp_Pnt2d                              myUV1;
+    gp_Pnt2d                              myUV2;
   };
 
   class CurveOnClosedSurface : public CurveOnSurface
@@ -156,10 +155,10 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Geom2d::Curve> myPCurve2;
-    Enum<GeomAbs_Shape>                      myContinuity;
-    StdObject_gp::Object<gp_Pnt2d>           myUV21;
-    StdObject_gp::Object<gp_Pnt2d>           myUV22;
+    Handle(ShapePersistent_Geom2d::Curve) myPCurve2;
+    Standard_Integer                      myContinuity;
+    gp_Pnt2d                              myUV21;
+    gp_Pnt2d                              myUV22;
   };
 
   class Polygon3D : public CurveRepresentation
@@ -169,7 +168,7 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Poly::Polygon3D> myPolygon3D;
+    Handle(ShapePersistent_Poly::Polygon3D) myPolygon3D;
   };
 
   class PolygonOnTriangulation : public CurveRepresentation
@@ -179,8 +178,8 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   protected:
-    Reference<ShapePersistent_Poly::PolygonOnTriangulation> myPolygon;
-    Reference<ShapePersistent_Poly::Triangulation>          myTriangulation;
+    Handle(ShapePersistent_Poly::PolygonOnTriangulation) myPolygon;
+    Handle(ShapePersistent_Poly::Triangulation)          myTriangulation;
   };
 
   class PolygonOnClosedTriangulation : public PolygonOnTriangulation
@@ -190,7 +189,7 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Poly::PolygonOnTriangulation> myPolygon2;
+    Handle(ShapePersistent_Poly::PolygonOnTriangulation) myPolygon2;
   };
 
   class PolygonOnSurface : public CurveRepresentation
@@ -200,8 +199,8 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   protected:
-    Reference<ShapePersistent_Poly::Polygon2D> myPolygon2D;
-    Reference<ShapePersistent_Geom::Surface>   mySurface;
+    Handle(ShapePersistent_Poly::Polygon2D) myPolygon2D;
+    Handle(ShapePersistent_Geom::Surface)   mySurface;
   };
 
   class PolygonOnClosedSurface : public PolygonOnSurface
@@ -211,7 +210,7 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   private:
-    Reference<ShapePersistent_Poly::Polygon2D> myPolygon2;
+    Handle(ShapePersistent_Poly::Polygon2D) myPolygon2;
   };
 
   class CurveOn2Surfaces : public CurveRepresentation
@@ -221,10 +220,10 @@ public:
     virtual Handle(BRep_CurveRepresentation) import() const;
 
   private:
-    Reference <ShapePersistent_Geom::Surface> mySurface;
-    Reference <ShapePersistent_Geom::Surface> mySurface2;
-    Object    <StdObject_Location>            myLocation2;
-    Enum      <GeomAbs_Shape>                 myContinuity;
+    Handle(ShapePersistent_Geom::Surface) mySurface;
+    Handle(ShapePersistent_Geom::Surface) mySurface2;
+    StdObject_Location                    myLocation2;
+    Standard_Integer                      myContinuity;
   };
 
 private:
@@ -241,9 +240,9 @@ private:
     virtual Handle(TopoDS_TShape) createTShape() const;
 
   private:
-    Value<Standard_Real>           myTolerance;
-    StdObject_gp::Object<gp_Pnt>   myPnt;
-    Reference<PointRepresentation> myPoints;
+    Standard_Real               myTolerance;
+    gp_Pnt                      myPnt;
+    Handle(PointRepresentation) myPoints;
   };
 
   class pTEdge : public pTBase
@@ -259,9 +258,9 @@ private:
     virtual Handle(TopoDS_TShape) createTShape() const;
 
   private:
-    Value     <Standard_Real>       myTolerance;
-    Value     <Standard_Integer>    myFlags;
-    Reference <CurveRepresentation> myCurves;
+    Standard_Real               myTolerance;
+    Standard_Integer            myFlags;
+    Handle(CurveRepresentation) myCurves;
   };
 
   class pTFace : public pTBase
@@ -278,11 +277,11 @@ private:
     virtual Handle(TopoDS_TShape) createTShape() const;
 
   private:
-    Reference <ShapePersistent_Geom::Surface>       mySurface;
-    Reference <ShapePersistent_Poly::Triangulation> myTriangulation;
-    Object    <StdObject_Location>                  myLocation;
-    Value     <Standard_Real>                       myTolerance;
-    Value     <Standard_Boolean>                    myNaturalRestriction;
+    Handle(ShapePersistent_Geom::Surface)       mySurface;
+    Handle(ShapePersistent_Poly::Triangulation) myTriangulation;
+    StdObject_Location                          myLocation;
+    Standard_Real                               myTolerance;
+    Standard_Boolean                            myNaturalRestriction;
   };
 
 public:
index 17ae4ce..b5d1505 100644 (file)
@@ -12,6 +12,8 @@
 // commercial license or contractual agreement.
 
 #include <ShapePersistent_Geom.hxx>
+#include <StdObject_gp_Axes.hxx>
+#include <StdObject_gp_Vectors.hxx>
 
 
 //=======================================================================
@@ -29,8 +31,8 @@ void ShapePersistent_Geom::instance<ShapePersistent_Geom::AxisPlacement,
                                     Geom_Axis2Placement>
   ::Read (StdObjMgt_ReadData& theReadData)
 {
-  StdObject_gp::Object<gp_Ax1> anAxis;
-  StdObject_gp::Object<gp_Dir> anXDirection;
+  gp_Ax1 anAxis;
+  gp_Dir anXDirection;
 
   theReadData >> anAxis >> anXDirection;
 
index 9da47d7..b0ec0d3 100644 (file)
 #define _ShapePersistent_Geom_HeaderFile
 
 #include <StdObjMgt_SharedObject.hxx>
-#include <StdObject_gp.hxx>
+
+#include <StdObject_gp_Vectors.hxx>
+#include <StdObject_gp_Axes.hxx>
+#include <StdObject_gp_Curves.hxx>
+#include <StdObject_gp_Surfaces.hxx>
+#include <StdObject_gp_Trsfs.hxx>
 
 #include <Geom_CartesianPoint.hxx>
 #include <Geom_Direction.hxx>
@@ -52,7 +57,16 @@ protected:
   };
 
   template <class Base, class GpData>
-  struct subBase_gp : subBase <Base, StdObject_gp::Object<GpData> > {};
+  struct subBase_gp : public Base
+  {
+  public:
+    //! Read persistent data from a file.
+    Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData)
+    {
+      GpData aData;
+      theReadData >> aData;
+    }
+  };
 
   template <class Base>
   struct subBase_empty : Base {};
@@ -64,7 +78,7 @@ protected:
     //! Read persistent data from a file.
     Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData)
     {
-      StdObject_gp::Object<Data> aData;
+      Data aData;
       theReadData >> aData;
       this->myTransient = new Target (aData);
     }
index da39ac3..c253038 100644 (file)
@@ -46,9 +46,9 @@ class ShapePersistent_Geom2d_Curve : protected ShapePersistent_Geom2d
     virtual Handle(Geom2d_Curve) Import() const;
 
   private:
-    Value     <Standard_Boolean>               myRational;
-    Reference <ShapePersistent_HArray1::Pnt2d> myPoles;
-    Reference <StdLPersistent_HArray1::Real>   myWeights;
+    Standard_Boolean                       myRational;
+    Handle(ShapePersistent_HArray1::Pnt2d) myPoles;
+    Handle(StdLPersistent_HArray1::Real)   myWeights;
   };
 
   class pBSpline : public pBounded
@@ -63,13 +63,13 @@ class ShapePersistent_Geom2d_Curve : protected ShapePersistent_Geom2d
     virtual Handle(Geom2d_Curve) Import() const;
 
   private:
-    Value     <Standard_Boolean>                myRational;
-    Value     <Standard_Boolean>                myPeriodic;
-    Value     <Standard_Integer>                mySpineDegree;
-    Reference <ShapePersistent_HArray1::Pnt2d>  myPoles;
-    Reference <StdLPersistent_HArray1::Real>    myWeights;
-    Reference <StdLPersistent_HArray1::Real>    myKnots;
-    Reference <StdLPersistent_HArray1::Integer> myMultiplicities;
+    Standard_Boolean                        myRational;
+    Standard_Boolean                        myPeriodic;
+    Standard_Integer                        mySpineDegree;
+    Handle(ShapePersistent_HArray1::Pnt2d)  myPoles;
+    Handle(StdLPersistent_HArray1::Real)    myWeights;
+    Handle(StdLPersistent_HArray1::Real)    myKnots;
+    Handle(StdLPersistent_HArray1::Integer) myMultiplicities;
   };
 
   class pTrimmed : public pBounded
@@ -81,9 +81,9 @@ class ShapePersistent_Geom2d_Curve : protected ShapePersistent_Geom2d
     virtual Handle(Geom2d_Curve) Import() const;
 
   private:
-    Reference<Curve>     myBasisCurve;
-    Value<Standard_Real> myFirstU;
-    Value<Standard_Real> myLastU;
+    Handle(Curve) myBasisCurve;
+    Standard_Real myFirstU;
+    Standard_Real myLastU;
   };
 
   class pOffset : public pBase
@@ -95,8 +95,8 @@ class ShapePersistent_Geom2d_Curve : protected ShapePersistent_Geom2d
     virtual Handle(Geom2d_Curve) Import() const;
 
   private:
-    Reference<Curve>             myBasisCurve;
-    Value<Standard_Real>         myOffsetValue;
+    Handle(Curve) myBasisCurve;
+    Standard_Real myOffsetValue;
   };
 
 public:
index 7ba8b41..1cb00a6 100644 (file)
@@ -48,9 +48,9 @@ class ShapePersistent_Geom_Curve : private ShapePersistent_Geom
     virtual Handle(Geom_Curve) Import() const;
 
   private:
-    Value     <Standard_Boolean>             myRational;
-    Reference <ShapePersistent_HArray1::Pnt> myPoles;
-    Reference <StdLPersistent_HArray1::Real> myWeights;
+    Standard_Boolean                     myRational;
+    Handle(ShapePersistent_HArray1::Pnt) myPoles;
+    Handle(StdLPersistent_HArray1::Real) myWeights;
   };
 
   class pBSpline : public pBounded
@@ -65,13 +65,13 @@ class ShapePersistent_Geom_Curve : private ShapePersistent_Geom
     virtual Handle(Geom_Curve) Import() const;
 
   private:
-    Value     <Standard_Boolean>                myRational;
-    Value     <Standard_Boolean>                myPeriodic;
-    Value     <Standard_Integer>                mySpineDegree;
-    Reference <ShapePersistent_HArray1::Pnt>    myPoles;
-    Reference <StdLPersistent_HArray1::Real>    myWeights;
-    Reference <StdLPersistent_HArray1::Real>    myKnots;
-    Reference <StdLPersistent_HArray1::Integer> myMultiplicities;
+    Standard_Boolean                        myRational;
+    Standard_Boolean                        myPeriodic;
+    Standard_Integer                        mySpineDegree;
+    Handle(ShapePersistent_HArray1::Pnt)    myPoles;
+    Handle(StdLPersistent_HArray1::Real)    myWeights;
+    Handle(StdLPersistent_HArray1::Real)    myKnots;
+    Handle(StdLPersistent_HArray1::Integer) myMultiplicities;
   };
 
   class pTrimmed : public pBounded
@@ -83,9 +83,9 @@ class ShapePersistent_Geom_Curve : private ShapePersistent_Geom
     virtual Handle(Geom_Curve) Import() const;
 
   private:
-    Reference<Curve>     myBasisCurve;
-    Value<Standard_Real> myFirstU;
-    Value<Standard_Real> myLastU;
+    Handle(Curve) myBasisCurve;
+    Standard_Real myFirstU;
+    Standard_Real myLastU;
   };
 
   class pOffset : public pBase
@@ -97,9 +97,9 @@ class ShapePersistent_Geom_Curve : private ShapePersistent_Geom
     virtual Handle(Geom_Curve) Import() const;
 
   private:
-    Reference<Curve>             myBasisCurve;
-    StdObject_gp::Object<gp_Dir> myOffsetDirection;
-    Value<Standard_Real>         myOffsetValue;
+    Handle(Curve) myBasisCurve;
+    gp_Dir        myOffsetDirection;
+    Standard_Real myOffsetValue;
   };
 
 public:
index 380a958..fd48747 100644 (file)
@@ -40,15 +40,15 @@ class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
 {
   typedef Surface::PersistentBase pBase;
 
-  class pSweptData : protected StdObjMgt_ContentTypes
+  class pSweptData
   {
   public:
     inline void Read (StdObjMgt_ReadData& theReadData)
       { theReadData >> myBasisCurve >> myDirection; }
 
   protected:
-    Reference            <Curve>  myBasisCurve;
-    StdObject_gp::Object <gp_Dir> myDirection;
+    Handle(Curve) myBasisCurve;
+    gp_Dir        myDirection;
   };
 
   struct pSwept : pBase, pSweptData {};
@@ -71,7 +71,7 @@ class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
     virtual Handle(Geom_Surface) Import() const;
 
   private:
-    StdObject_gp::Object<gp_Pnt> myLocation;
+    gp_Pnt myLocation;
   };
 
   typedef pBase pBounded;
@@ -85,10 +85,10 @@ class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
     virtual Handle(Geom_Surface) Import() const;
 
   private:
-    Value     <Standard_Boolean>             myURational;
-    Value     <Standard_Boolean>             myVRational;
-    Reference <ShapePersistent_HArray2::Pnt> myPoles;
-    Reference <StdLPersistent_HArray2::Real> myWeights;
+    Standard_Boolean                     myURational;
+    Standard_Boolean                     myVRational;
+    Handle(ShapePersistent_HArray2::Pnt) myPoles;
+    Handle(StdLPersistent_HArray2::Real) myWeights;
   };
 
   class pBSpline : public pBounded
@@ -108,18 +108,18 @@ class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
     virtual Handle(Geom_Surface) Import() const;
 
   private:
-    Value     <Standard_Boolean>                myURational;
-    Value     <Standard_Boolean>                myVRational;
-    Value     <Standard_Boolean>                myUPeriodic;
-    Value     <Standard_Boolean>                myVPeriodic;
-    Value     <Standard_Integer>                myUSpineDegree;
-    Value     <Standard_Integer>                myVSpineDegree;
-    Reference <ShapePersistent_HArray2::Pnt>    myPoles;
-    Reference <StdLPersistent_HArray2::Real>    myWeights;
-    Reference <StdLPersistent_HArray1::Real>    myUKnots;
-    Reference <StdLPersistent_HArray1::Real>    myVKnots;
-    Reference <StdLPersistent_HArray1::Integer> myUMultiplicities;
-    Reference <StdLPersistent_HArray1::Integer> myVMultiplicities;
+    Standard_Boolean                        myURational;
+    Standard_Boolean                        myVRational;
+    Standard_Boolean                        myUPeriodic;
+    Standard_Boolean                        myVPeriodic;
+    Standard_Integer                        myUSpineDegree;
+    Standard_Integer                        myVSpineDegree;
+    Handle(ShapePersistent_HArray2::Pnt)    myPoles;
+    Handle(StdLPersistent_HArray2::Real)    myWeights;
+    Handle(StdLPersistent_HArray1::Real)    myUKnots;
+    Handle(StdLPersistent_HArray1::Real)    myVKnots;
+    Handle(StdLPersistent_HArray1::Integer) myUMultiplicities;
+    Handle(StdLPersistent_HArray1::Integer) myVMultiplicities;
   };
 
   class pRectangularTrimmed : public pBounded
@@ -134,11 +134,11 @@ class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
     virtual Handle(Geom_Surface) Import() const;
 
   private:
-    Reference<Surface>   myBasisSurface;
-    Value<Standard_Real> myFirstU;
-    Value<Standard_Real> myLastU;
-    Value<Standard_Real> myFirstV;
-    Value<Standard_Real> myLastV;
+    Handle(Surface) myBasisSurface;
+    Standard_Real   myFirstU;
+    Standard_Real   myLastU;
+    Standard_Real   myFirstV;
+    Standard_Real   myLastV;
   };
 
   class pOffset : public pBase
@@ -150,8 +150,8 @@ class ShapePersistent_Geom_Surface : private ShapePersistent_Geom
     virtual Handle(Geom_Surface) Import() const;
 
   private:
-    Reference<Surface>   myBasisSurface;
-    Value<Standard_Real> myOffsetValue;
+    Handle(Surface) myBasisSurface;
+    Standard_Real   myOffsetValue;
   };
 
 public:
diff --git a/src/ShapePersistent/ShapePersistent_HArray1.cxx b/src/ShapePersistent/ShapePersistent_HArray1.cxx
deleted file mode 100644 (file)
index 2c363f6..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <ShapePersistent_HArray1.hxx>
-#include <StdObjMgt_ReadData.hxx>
-#include <StdObject_gp.hxx>
-
-
-template <class ArrayClass>
-void ShapePersistent_HArray1::instance<ArrayClass>::readValue
-  (StdObjMgt_ReadData& theReadData, const Standard_Integer theIndex)
-{
-  theReadData.ReadObject (StdObject_gp::Ref (this->myArray->ChangeValue (theIndex)));
-}
-
-template<>
-void ShapePersistent_HArray1::instance<Poly_HArray1OfTriangle>::readValue
-  (StdObjMgt_ReadData& theReadData, const Standard_Integer theIndex)
-{
-  Value<Standard_Integer> N1, N2, N3;
-  theReadData >> N1 >> N2 >> N3;
-  this->myArray->ChangeValue (theIndex).Set (N1, N2, N3);
-}
-
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfXYZ>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfPnt>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfDir>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfVec>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfXY>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfPnt2d>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfDir2d>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfVec2d>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfLin2d>;
-template class ShapePersistent_HArray1::instance<TColgp_HArray1OfCirc2d>;
-template class ShapePersistent_HArray1::instance<Poly_HArray1OfTriangle>;
index 7619baa..d25a7f5 100644 (file)
@@ -16,6 +16,8 @@
 #define _ShapePersistent_HArray1_HeaderFile
 
 #include <StdLPersistent_HArray1.hxx>
+#include <StdObject_gp_Vectors.hxx>
+#include <StdObject_gp_Curves.hxx>
 
 #include <TColgp_HArray1OfXYZ.hxx>
 #include <TColgp_HArray1OfPnt.hxx>
 
 class ShapePersistent_HArray1 : private StdLPersistent_HArray1
 {
-  template <class ArrayClass>
-  class instance : public StdLPersistent_HArray1::base<ArrayClass>
-  {
-    virtual void readValue (StdObjMgt_ReadData& theReadData,
-                            const Standard_Integer theIndex);
-  };
-
 public:
   typedef instance<TColgp_HArray1OfXYZ>    XYZ;
   typedef instance<TColgp_HArray1OfPnt>    Pnt;
@@ -53,4 +48,13 @@ public:
   typedef instance<Poly_HArray1OfTriangle> Triangle;
 };
 
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData& theReadData, Poly_Triangle& theTriangle)
+{
+  Standard_Integer N1, N2, N3;
+  theReadData >> N1 >> N2 >> N3;
+  theTriangle.Set (N1, N2, N3);
+  return theReadData;
+}
+
 #endif
diff --git a/src/ShapePersistent/ShapePersistent_HArray2.cxx b/src/ShapePersistent/ShapePersistent_HArray2.cxx
deleted file mode 100644 (file)
index 6879e17..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <ShapePersistent_HArray2.hxx>
-#include <StdObjMgt_ReadData.hxx>
-#include <StdObject_gp.hxx>
-
-
-template <class ArrayClass>
-void ShapePersistent_HArray2::instance<ArrayClass>::readValue (
-  StdObjMgt_ReadData&    theReadData,
-  const Standard_Integer theRow,
-  const Standard_Integer theCol)
-{
-  theReadData.ReadObject (
-    StdObject_gp::Ref (this->myArray->ChangeValue (theRow, theCol)));
-}
-
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfXYZ>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfPnt>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfDir>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfVec>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfXY>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfPnt2d>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfDir2d>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfVec2d>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfLin2d>;
-template class ShapePersistent_HArray2::instance<TColgp_HArray2OfCirc2d>;
index bd3d6c8..ed36464 100644 (file)
@@ -16,6 +16,8 @@
 #define _ShapePersistent_HArray2_HeaderFile
 
 #include <StdLPersistent_HArray2.hxx>
+#include <StdObject_gp_Vectors.hxx>
+#include <StdObject_gp_Curves.hxx>
 
 #include <TColgp_HArray2OfXYZ.hxx>
 #include <TColgp_HArray2OfPnt.hxx>
 
 class ShapePersistent_HArray2 : private StdLPersistent_HArray2
 {
-  template <class ArrayClass>
-  class instance : public StdLPersistent_HArray2::base<ArrayClass>
-  {
-    virtual void readValue (StdObjMgt_ReadData&    theReadData,
-                            const Standard_Integer theRow,
-                            const Standard_Integer theCol);
-  };
-
 public:
   typedef instance<TColgp_HArray2OfXYZ>    XYZ;
   typedef instance<TColgp_HArray2OfPnt>    Pnt;
index ad96e71..87d5dd6 100644 (file)
@@ -16,7 +16,7 @@
 #define _ShapePersistent_HSequence_HeaderFile
 
 #include <StdObjMgt_Persistent.hxx>
-#include <StdObject_gp.hxx>
+#include <StdObject_gp_Vectors.hxx>
 
 #include <TColgp_HSequenceOfXYZ.hxx>
 #include <TColgp_HSequenceOfPnt.hxx>
@@ -41,9 +41,9 @@ class ShapePersistent_HSequence
     const ItemType&     Item()     const  { return myItem; }
 
   private:
-    Reference<node>                myPreviuos;
-    Reference<node>                myNext;
-    StdObject_gp::Object<ItemType> myItem;
+    Handle(node) myPreviuos;
+    Handle(node) myNext;
+    ItemType     myItem;
   };
 
   template <class SequenceClass>
@@ -60,9 +60,9 @@ class ShapePersistent_HSequence
     Standard_EXPORT Handle(SequenceClass) Import() const;
 
   private:
-    Reference<Node>         myFirst;
-    Reference<Node>         myLast;
-    Value<Standard_Integer> mySize;
+    Handle(Node)     myFirst;
+    Handle(Node)     myLast;
+    Standard_Integer mySize;
   };
 
 public:
index e97a949..18efeaf 100644 (file)
@@ -28,7 +28,7 @@ class Poly_Triangulation;
 
 class ShapePersistent_Poly : private StdObjMgt_SharedObject
 {
-  class pPolygon2D : public PersistentBase
+  class pPolygon2D : public Standard_Transient
   {
   public:
     inline void Read (StdObjMgt_ReadData& theReadData)
@@ -37,11 +37,11 @@ class ShapePersistent_Poly : private StdObjMgt_SharedObject
     Handle(Poly_Polygon2D) Import() const;
 
   private:
-    Value     <Standard_Real>                  myDeflection;
-    Reference <ShapePersistent_HArray1::Pnt2d> myNodes;
+    Standard_Real                          myDeflection;
+    Handle(ShapePersistent_HArray1::Pnt2d) myNodes;
   };
 
-  class pPolygon3D : public PersistentBase
+  class pPolygon3D : public Standard_Transient
   {
   public:
     inline void Read (StdObjMgt_ReadData& theReadData)
@@ -50,12 +50,12 @@ class ShapePersistent_Poly : private StdObjMgt_SharedObject
     Handle(Poly_Polygon3D) Import() const;
 
   private:
-    Value     <Standard_Real>                myDeflection;
-    Reference <ShapePersistent_HArray1::Pnt> myNodes;
-    Reference <StdLPersistent_HArray1::Real> myParameters;
+    Standard_Real                        myDeflection;
+    Handle(ShapePersistent_HArray1::Pnt) myNodes;
+    Handle(StdLPersistent_HArray1::Real) myParameters;
   };
 
-  class pPolygonOnTriangulation : public PersistentBase
+  class pPolygonOnTriangulation : public Standard_Transient
   {
   public:
     inline void Read (StdObjMgt_ReadData& theReadData)
@@ -64,12 +64,12 @@ class ShapePersistent_Poly : private StdObjMgt_SharedObject
     Handle(Poly_PolygonOnTriangulation) Import() const;
 
   private:
-    Value     <Standard_Real>                   myDeflection;
-    Reference <StdLPersistent_HArray1::Integer> myNodes;
-    Reference <StdLPersistent_HArray1::Real>    myParameters;
+    Standard_Real                           myDeflection;
+    Handle(StdLPersistent_HArray1::Integer) myNodes;
+    Handle(StdLPersistent_HArray1::Real)    myParameters;
   };
 
-  class pTriangulation : public PersistentBase
+  class pTriangulation : public Standard_Transient
   {
   public:
     inline void Read (StdObjMgt_ReadData& theReadData)
@@ -78,10 +78,10 @@ class ShapePersistent_Poly : private StdObjMgt_SharedObject
     Handle(Poly_Triangulation) Import() const;
 
   private:
-    Value     <Standard_Real>                     myDeflection;
-    Reference <ShapePersistent_HArray1::Pnt>      myNodes;
-    Reference <ShapePersistent_HArray1::Pnt2d>    myUVNodes;
-    Reference <ShapePersistent_HArray1::Triangle> myTriangles;
+    Standard_Real                             myDeflection;
+    Handle(ShapePersistent_HArray1::Pnt)      myNodes;
+    Handle(ShapePersistent_HArray1::Pnt2d)    myUVNodes;
+    Handle(ShapePersistent_HArray1::Triangle) myTriangles;
   };
 
   template <class Persistent, class Transient>
index 0e4e315..3d3defd 100644 (file)
@@ -31,10 +31,10 @@ enum
 //function : Read
 //purpose  : Read persistent data from a file
 //=======================================================================
-void ShapePersistent_TopoDS::Shape::Read (StdObjMgt_ReadData& theReadData)
+void ShapePersistent_TopoDS::HShape::Read (StdObjMgt_ReadData& theReadData)
 {
   theReadData >> myEntry;
-  myShape.Read (theReadData);
+  StdObject_Shape::read (theReadData);
 }
 
 void ShapePersistent_TopoDS::pTBase::setFlags
@@ -52,8 +52,8 @@ void ShapePersistent_TopoDS::pTBase::setFlags
 static inline void AddShape
   (TopoDS_Shape& theParent, const Handle(StdObjMgt_Persistent)& theRef)
 {
-  Handle(ShapePersistent_TopoDS::Shape) aShape =
-    Handle(ShapePersistent_TopoDS::Shape)::DownCast (theRef);
+  Handle(ShapePersistent_TopoDS::HShape) aShape =
+    Handle(ShapePersistent_TopoDS::HShape)::DownCast (theRef);
 
   if (aShape)
     BRep_Builder().Add (theParent, aShape->Import());
@@ -69,8 +69,8 @@ template <class ShapesArray>
 void ShapePersistent_TopoDS::pTBase::addShapesT
   (TopoDS_Shape& theParent) const
 {
-  Handle(ShapesArray) aShapes;
-  if (myShapes.Cast (aShapes))
+  Handle(ShapesArray) aShapes = Handle(ShapesArray)::DownCast (myShapes);
+  if (aShapes)
   {
     typename ShapesArray::Iterator anIter (*aShapes->Array());
     for (; anIter.More(); anIter.Next())
index ecee607..de0d0b1 100644 (file)
 class ShapePersistent_TopoDS : public StdPersistent_TopoDS
 {
 public:
-  class Shape : public StdObjMgt_Persistent
+  class HShape : public StdObjMgt_Persistent, public StdObject_Shape
   {
   public:
     //! Read persistent data from a file.
     Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
 
-    //! Import transient object from the persistent data.
-    TopoDS_Shape Import() const  { return myShape.Import(); }
-
   private:
-    Reference<>     myEntry;
-    StdObject_Shape myShape;
+    Handle(StdObjMgt_Persistent) myEntry;
   };
 
 protected:
index 3559780..5c2ebad 100644 (file)
@@ -50,24 +50,22 @@ Handle(CDM_Document) StdLDrivers_DocumentRetrievalDriver::CreateDocument()
 //function : Read
 //purpose  : Retrieve the content of a file into a new document
 //=======================================================================
-void StdLDrivers_DocumentRetrievalDriver::Read (
-  const TCollection_ExtendedString& theFileName,
+void StdLDrivers_DocumentRetrievalDriver::Read (const TCollection_ExtendedString& theFileName,
                                                 const Handle(CDM_Document)&       theNewDocument,
                                                 const Handle(CDM_Application)&)
 {
   // Read header data and persistent document
   Storage_HeaderData aHeaderData;
   Handle(StdObjMgt_Persistent) aPDocument = read (theFileName, aHeaderData);
+  if (aPDocument.IsNull())
+    return;
 
   // Import transient document from the persistent one
-  if (!aPDocument.IsNull())
-  {
-    aPDocument->ImportDocument (
-      Handle(TDocStd_Document)::DownCast (theNewDocument));
+  aPDocument->ImportDocument (
+    Handle(TDocStd_Document)::DownCast (theNewDocument));
 
-    // Copy comments from the header data
-    theNewDocument->SetComments (aHeaderData.Comments());
-  }
+  // Copy comments from the header data
+  theNewDocument->SetComments (aHeaderData.Comments());
 }
 
 //=======================================================================
@@ -91,20 +89,20 @@ Handle(StdObjMgt_Persistent) StdLDrivers_DocumentRetrievalDriver::read (
   NCollection_Handle<Storage_BaseDriver> aFileDriver (aFileDriverPtr);
 
   // Try to open the file
-    try
-    {
-      OCC_CATCH_SIGNALS
-      PCDM_ReadWriter::Open (*aFileDriver, theFileName, Storage_VSRead);
-      myReaderStatus = PCDM_RS_OK;
-    } 
-    catch (Standard_Failure)
-    {
-      myReaderStatus = PCDM_RS_OpenError;
+  try
+  {
+    OCC_CATCH_SIGNALS
+    PCDM_ReadWriter::Open (*aFileDriver, theFileName, Storage_VSRead);
+    myReaderStatus = PCDM_RS_OK;
+  } 
+  catch (Standard_Failure)
+  {
+    myReaderStatus = PCDM_RS_OpenError;
 
-      Standard_SStream aMsg;
-      aMsg << Standard_Failure::Caught() << endl;
-      Standard_Failure::Raise (aMsg);
-    }
+    Standard_SStream aMsg;
+    aMsg << Standard_Failure::Caught() << endl;
+    Standard_Failure::Raise (aMsg);
+  }
   
   // Read header section
   if (!theHeaderData.Read (*aFileDriver))
index dc076de..b5f86e7 100644 (file)
@@ -28,8 +28,7 @@ public:
   Standard_EXPORT virtual Handle(CDM_Document) CreateDocument() Standard_OVERRIDE;
 
   //! Retrieve the content of a file into a new document.
-  Standard_EXPORT virtual void Read (
-    const TCollection_ExtendedString& theFileName,
+  Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName,
                                      const Handle(CDM_Document)&       theNewDocument,
                                      const Handle(CDM_Application)&    theApplication) Standard_OVERRIDE;
 
diff --git a/src/StdLObject/FILES b/src/StdLObject/FILES
deleted file mode 100644 (file)
index 1df0b8c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-StdLObject_GUID.cxx
-StdLObject_GUID.hxx
diff --git a/src/StdLObject/StdLObject_GUID.cxx b/src/StdLObject/StdLObject_GUID.cxx
deleted file mode 100644 (file)
index 81c80fa..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <StdLObject_GUID.hxx>
-
-
-//=======================================================================
-//function : Read
-//purpose  : Read persistent data from a file
-//=======================================================================
-void StdLObject_GUID::Read (StdObjMgt_ReadData& theReadData)
-{
-  Value<Standard_Integer>      a32b;
-  Value<Standard_ExtCharacter> a16b[3];
-  Value<Standard_Character>    a8b [6];
-
-  theReadData >> a32b >> a16b[0] >> a16b[1] >> a16b[2];
-  theReadData >> a8b[0] >> a8b[1] >> a8b[2] >> a8b[3] >> a8b[4] >> a8b[5];
-
-  *static_cast<Standard_GUID*> (this) =
-    Standard_GUID (a32b, a16b[0], a16b[1], a16b[2],
-                   a8b[0], a8b[1], a8b[2], a8b[3], a8b[4], a8b[5]);
-}
diff --git a/src/StdLObject/StdLObject_GUID.hxx b/src/StdLObject/StdLObject_GUID.hxx
deleted file mode 100644 (file)
index 30afc1b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#ifndef _StdLObject_GUID_HeaderFile
-#define _StdLObject_GUID_HeaderFile
-
-#include <StdObjMgt_Attribute.hxx>
-
-#include <Standard_GUID.hxx>
-
-
-class StdLObject_GUID : public Standard_GUID, private StdObjMgt_ContentTypes
-{
-public:
-  void Read (StdObjMgt_ReadData& theReadData);
-};
-
-#endif
index dafe9dd..bd1fed4 100644 (file)
@@ -9,7 +9,6 @@ StdLPersistent_Dependency.hxx
 StdLPersistent_Document.cxx
 StdLPersistent_Document.hxx
 StdLPersistent_Function.hxx
-StdLPersistent_HArray1OfPersistent.hxx
 StdLPersistent_HArray1.cxx
 StdLPersistent_HArray1.hxx
 StdLPersistent_HArray2.cxx
index ec44de4..3deffb8 100644 (file)
@@ -66,17 +66,17 @@ private:
 //function : Read
 //purpose  : Read persistent data from a file
 //=======================================================================
-template <class Persistent>
-void StdLPersistent_Collection::booleanArrayBase<Persistent>::Read
+template <class Base>
+void StdLPersistent_Collection::booleanArrayBase<Base>::Read
   (StdObjMgt_ReadData& theReadData)
 {
-  StdLPersistent_Collection::booleanArrayBase<Persistent>::SingleRef::Read (theReadData);
+  Base::Read (theReadData);
   theReadData >> myLower >> myUpper;
 }
 
-template <class Persistent>
+template <class Base>
 template <class ArrayHandle, class Converter>
-void StdLPersistent_Collection::booleanArrayBase<Persistent>::import
+void StdLPersistent_Collection::booleanArrayBase<Base>::import
   (const ArrayHandle& theArray, Converter theConverter) const
 {
   Handle(TColStd_HArray1OfByte) aByteArray =
@@ -89,17 +89,17 @@ void StdLPersistent_Collection::booleanArrayBase<Persistent>::import
   this->myTransient->SetInternalArray (aByteArray);
 }
 
-template <class Persistent>
+template <class Base>
 template <class ArrayHandle, class Converter>
-void StdLPersistent_Collection::directArrayBase<Persistent>::import
+void StdLPersistent_Collection::directArrayBase<Base>::import
   (const ArrayHandle& theArray, Converter) const
 {
   this->myTransient->ChangeArray (theArray);
 }
 
-template <class Persistent>
+template <class Base>
 template <class ArrayHandle, class Converter>
-void StdLPersistent_Collection::arrayBase<Persistent>::import
+void StdLPersistent_Collection::arrayBase<Base>::import
   (const ArrayHandle& theArray, Converter theConverter) const
 {
   this->myTransient->Init (theArray->Lower(), theArray->Upper());
@@ -107,18 +107,18 @@ void StdLPersistent_Collection::arrayBase<Persistent>::import
     this->myTransient->SetValue (i, theConverter (theArray->Value(i)));
 }
 
-template <class Persistent>
+template <class Base>
 template <class ArrayHandle, class Converter>
-void StdLPersistent_Collection::listBase<Persistent>::import
+void StdLPersistent_Collection::listBase<Base>::import
   (const ArrayHandle& theArray, Converter theConverter) const
 {
   for (Standard_Integer i = theArray->Lower(); i <= theArray->Upper(); i++)
     this->myTransient->Append (theConverter (theArray->Value(i)));
 }
 
-template <class Persistent>
+template <class Base>
 template <class ArrayHandle, class Converter>
-void StdLPersistent_Collection::mapBase<Persistent>::import
+void StdLPersistent_Collection::mapBase<Base>::import
   (const ArrayHandle& theArray, Converter theConverter) const
 {
   Handle(TColStd_HPackedMapOfInteger) anHMap = new TColStd_HPackedMapOfInteger;
@@ -138,8 +138,8 @@ template <template<class> class BaseT,
 void StdLPersistent_Collection::
        instance<BaseT, HArrayClass, AttribClass, Converter>::ImportAttribute()
 {
-  Handle(HArrayClass) anHArray;
-  if (this->myData.Cast (anHArray))
+  Handle(HArrayClass) anHArray = Handle(HArrayClass)::DownCast (this->myData);
+  if (anHArray)
   {
     typename HArrayClass::ArrayHandle anArray = anHArray->Array();
     if (anArray)
index 643e89d..aebdab2 100644 (file)
@@ -32,7 +32,7 @@
 #include <TDataStd_IntPackedMap.hxx>
 
 
-class StdLPersistent_Collection : private StdObjMgt_ContentTypes
+class StdLPersistent_Collection
 {
   // Converters
   struct noConversion;
@@ -54,8 +54,8 @@ class StdLPersistent_Collection : private StdObjMgt_ContentTypes
       const;
 
   protected:
-    Value<Standard_Integer> myLower;
-    Value<Standard_Integer> myUpper;
+    Standard_Integer myLower;
+    Standard_Integer myUpper;
   };
 
   template <class Base>
@@ -118,7 +118,7 @@ class StdLPersistent_Collection : private StdObjMgt_ContentTypes
     Standard_EXPORT virtual void ImportAttribute();
 
   private:
-    Value<Standard_Boolean> myDelta;
+    Standard_Boolean myDelta;
   };
 
 
index c36bb49..5276e50 100644 (file)
@@ -23,7 +23,7 @@ class StdLPersistent_Data::Parser
 {
 public:
   //! Start parsing a persistent data.
-  Parser (const TColStd_HArray1OfInteger&    theLabels,
+  Parser (const TColStd_HArray1OfInteger&           theLabels,
           const StdLPersistent_HArray1OfPersistent& theAttributes)
     : myLabelsIter (theLabels)
     , myAttribIter (theAttributes) {}
@@ -67,7 +67,7 @@ public:
   }
 
 private:
-  TColStd_HArray1OfInteger   ::Iterator myLabelsIter;
+  TColStd_HArray1OfInteger          ::Iterator myLabelsIter;
   StdLPersistent_HArray1OfPersistent::Iterator myAttribIter;
 };
 
index 441a677..d6d7b3d 100644 (file)
@@ -34,9 +34,9 @@ private:
   class Parser;
 
 private:
-  Value     <Standard_Integer>                   myVersion;
-  Reference <StdLPersistent_HArray1::Integer>    myLabels;
-  Reference <StdLPersistent_HArray1::Persistent> myAttributes;
+  Standard_Integer                           myVersion;
+  Handle(StdLPersistent_HArray1::Integer)    myLabels;
+  Handle(StdLPersistent_HArray1::Persistent) myAttributes;
 };
 
 #endif
index 4d7884a..cc82951 100644 (file)
@@ -37,8 +37,8 @@ class StdLPersistent_Dependency
     void Import (const Handle(AttribClass)& theAttribute) const;
 
   private:
-    StdObjMgt_ContentTypes::Reference<StdLPersistent_HString::Extended>   myName;
-    StdObjMgt_ContentTypes::Reference<StdLPersistent_HArray1::Persistent> myVariables;
+    Handle(StdLPersistent_HString::Extended)   myName;
+    Handle(StdLPersistent_HArray1::Persistent) myVariables;
   };
 
 public:
index b68a034..5ce8b61 100644 (file)
@@ -32,7 +32,7 @@ public:
     (const Handle(TDocStd_Document)& theDocument) const;
 
 private:
-  Reference<StdLPersistent_Data> myData;
+  Handle(StdLPersistent_Data) myData;
 };
 
 #endif
index 845cb45..4d74f42 100644 (file)
@@ -16,9 +16,9 @@
 #define _StdLPersistent_Function_HeaderFile
 
 #include <StdObjMgt_Attribute.hxx>
-#include <StdLObject_GUID.hxx>
 
 #include <TFunction_Function.hxx>
+#include <Standard_GUID.hxx>
 
 
 class StdLPersistent_Function : public StdObjMgt_Attribute<TFunction_Function>
@@ -36,8 +36,8 @@ public:
   }
 
 private:
-  Object<StdLObject_GUID> myDriverGUID;
-  Value<Standard_Integer> myFailure;
+  Standard_GUID    myDriverGUID;
+  Standard_Integer myFailure;
 };
 
 #endif
index ef0cb92..99e4e42 100644 (file)
 // commercial license or contractual agreement.
 
 #include <StdLPersistent_HArray1.hxx>
-#include <StdObjMgt_ReadData.hxx>
 
 
 //=======================================================================
 //function : Read
 //purpose  : Read persistent data from a file
 //=======================================================================
-void StdLPersistent_HArray1::commonBase::Read (StdObjMgt_ReadData& theReadData)
+void StdLPersistent_HArray1::base::Read (StdObjMgt_ReadData& theReadData)
 {
-  Value<Standard_Integer> aLowerBound, anUpperBound;
+  Standard_Integer aLowerBound, anUpperBound;
   theReadData >> aLowerBound >> anUpperBound;
   createArray (aLowerBound, anUpperBound);
 
-  theReadData.Driver().BeginReadObjectData();
+  StdObjMgt_ReadData::Object anObjectData (theReadData);
 
   Standard_Integer aSize;
-  theReadData.ReadValue (aSize);
+  anObjectData >> aSize;
 
   for (Standard_Integer i = aLowerBound; i <= anUpperBound; i++)
-    readValue (theReadData, i);
-
-  theReadData.Driver().EndReadObjectData();
-}
-
-template <class ArrayClass, class ValueClass>
-void StdLPersistent_HArray1::instance<ArrayClass, ValueClass>::readValue (
-  StdObjMgt_ReadData& theReadData,
-  const Standard_Integer theIndex)
-{
-  ValueClass aValue;
-  theReadData >> aValue;
-  this->myArray->SetValue (theIndex, static_cast<typename ArrayClass::value_type> (aValue));
+    readValue (anObjectData, i);
 }
-
-
-template class StdLPersistent_HArray1::instance<TColStd_HArray1OfInteger>;
-template class StdLPersistent_HArray1::instance<TColStd_HArray1OfReal>;
-template class StdLPersistent_HArray1::instance<TColStd_HArray1OfByte,
-  StdObjMgt_ContentTypes::Value<Standard_Character> >;
-template class StdLPersistent_HArray1::instance<StdLPersistent_HArray1OfPersistent,
-  StdObjMgt_ContentTypes::Reference<> >;
index c8c9bce..e24faa5 100644 (file)
 #define _StdLPersistent_HArray1_HeaderFile
 
 #include <StdObjMgt_Persistent.hxx>
-#include <StdLPersistent_HArray1OfPersistent.hxx>
+#include <StdObjMgt_ReadData.hxx>
+
+#include <NCollection_DefineHArray1.hxx>
+
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TColStd_HArray1OfReal.hxx>
 #include <TColStd_HArray1OfByte.hxx>
@@ -26,9 +29,13 @@ class TDF_Label;
 class TDF_Data;
 
 
-class StdLPersistent_HArray1 : protected StdObjMgt_ContentTypes
+DEFINE_HARRAY1 (StdLPersistent_HArray1OfPersistent,
+                NCollection_Array1<Handle(StdObjMgt_Persistent)>)
+
+
+class StdLPersistent_HArray1
 {
-  class commonBase : public StdObjMgt_Persistent
+  class base : public StdObjMgt_Persistent
   {
   public:
     //! Read persistent data from a file.
@@ -44,7 +51,7 @@ class StdLPersistent_HArray1 : protected StdObjMgt_ContentTypes
 
 protected:
   template <class ArrayClass>
-  class base : public commonBase
+  class instance : public base
   {
   public:
     typedef Handle(ArrayClass)              ArrayHandle;
@@ -60,24 +67,23 @@ protected:
                               const Standard_Integer theUpperBound)
       { myArray = new ArrayClass (theLowerBound, theUpperBound); }
 
-  protected:
-    Handle(ArrayClass) myArray;
-  };
+    virtual void readValue (StdObjMgt_ReadData& theReadData,
+                            const Standard_Integer theIndex)
+      { theReadData >> myArray->ChangeValue (theIndex); }
 
-private:
-  template <class ArrayClass, class ValueClass = Value<typename ArrayClass::value_type> >
-  class instance : public base<ArrayClass>
-  {
   protected:
-    Standard_EXPORT virtual void readValue (StdObjMgt_ReadData& theReadData,
-                                            const Standard_Integer theIndex);
+    Handle(ArrayClass) myArray;
   };
 
 public:
-  typedef instance<TColStd_HArray1OfInteger>                         Integer;
-  typedef instance<TColStd_HArray1OfReal>                            Real;
-  typedef instance<TColStd_HArray1OfByte, Value<Standard_Character> >Byte;
-  typedef instance<StdLPersistent_HArray1OfPersistent, Reference<> >        Persistent;
+  typedef instance<TColStd_HArray1OfInteger>           Integer;
+  typedef instance<TColStd_HArray1OfReal>              Real;
+  typedef instance<TColStd_HArray1OfByte>              Byte;
+  typedef instance<StdLPersistent_HArray1OfPersistent> Persistent;
 };
 
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData& theReadData, Standard_Byte& theByte)
+    { return theReadData >> reinterpret_cast<Standard_Character&> (theByte); }
+
 #endif
diff --git a/src/StdLPersistent/StdLPersistent_HArray1OfPersistent.hxx b/src/StdLPersistent/StdLPersistent_HArray1OfPersistent.hxx
deleted file mode 100644 (file)
index e22a6ae..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StdLPersistent_HArray1OfPersistent_HeaderFile
-#define _StdLPersistent_HArray1OfPersistent_HeaderFile
-
-
-#include <NCollection_DefineHArray1.hxx>
-#include <StdObjMgt_Persistent.hxx>
-
-DEFINE_HARRAY1 (StdLPersistent_HArray1OfPersistent,
-                NCollection_Array1<Handle(StdObjMgt_Persistent)>)
-
-#endif // _StdLPersistent_HArray1OfPersistent_HeaderFile
index 99135e4..8c8afa4 100644 (file)
@@ -12,7 +12,6 @@
 // commercial license or contractual agreement.
 
 #include <StdLPersistent_HArray2.hxx>
-#include <StdObjMgt_ReadData.hxx>
 
 #include <TColStd_HArray2OfInteger.hxx>
 #include <TColStd_HArray2OfReal.hxx>
 //function : Read
 //purpose  : Read persistent data from a file
 //=======================================================================
-void StdLPersistent_HArray2::commonBase::Read (StdObjMgt_ReadData& theReadData)
+void StdLPersistent_HArray2::base::Read (StdObjMgt_ReadData& theReadData)
 {
-  Value<Standard_Integer> aLowerRow, aLowerCol, anUpperRow, anUpperCol;
+  Standard_Integer aLowerRow, aLowerCol, anUpperRow, anUpperCol;
   theReadData >> aLowerRow >> aLowerCol >> anUpperRow >> anUpperCol;
   createArray (aLowerRow, aLowerCol, anUpperRow, anUpperCol);
 
-  theReadData.Driver().BeginReadObjectData();
+  StdObjMgt_ReadData::Object anObjectData (theReadData);
 
   Standard_Integer aSize;
-  theReadData.ReadValue (aSize);
+  anObjectData >> aSize;
 
   for (Standard_Integer aRow = aLowerRow; aRow <= anUpperRow; aRow++)
     for (Standard_Integer aCol = aLowerCol; aCol <= anUpperCol; aCol++)
-      readValue (theReadData, aRow, aCol);
-
-  theReadData.Driver().EndReadObjectData();
-}
-
-template <class ArrayClass>
-void StdLPersistent_HArray2::instance<ArrayClass>::readValue (
-  StdObjMgt_ReadData&    theReadData,
-  const Standard_Integer theRow,
-  const Standard_Integer theCol)
-{
-  typename ArrayClass::value_type aValue;
-  theReadData.ReadValue (aValue);
-  this->myArray->SetValue (theRow, theCol, aValue);
+      readValue (anObjectData, aRow, aCol);
 }
-
-
-template class StdLPersistent_HArray2::instance<TColStd_HArray2OfInteger>;
-template class StdLPersistent_HArray2::instance<TColStd_HArray2OfReal>;
index 045bcb5..c4941fc 100644 (file)
 #define _StdLPersistent_HArray2_HeaderFile
 
 #include <StdObjMgt_Persistent.hxx>
+#include <StdObjMgt_ReadData.hxx>
+
+#include <NCollection_DefineHArray2.hxx>
 
 #include <TColStd_HArray2OfInteger.hxx>
 #include <TColStd_HArray2OfReal.hxx>
 
 
+DEFINE_HARRAY2 (StdLPersistent_HArray2OfPersistent,
+                NCollection_Array2<Handle(StdObjMgt_Persistent)>)
+
+
 class StdLPersistent_HArray2
 {
-  class commonBase : public StdObjMgt_Persistent
+  class base : public StdObjMgt_Persistent
   {
   public:
     //! Read persistent data from a file.
@@ -42,7 +49,7 @@ class StdLPersistent_HArray2
 
 protected:
   template <class ArrayClass>
-  class base : public commonBase
+  class instance : public base
   {
   public:
     typedef Handle(ArrayClass) ArrayHandle;
@@ -60,23 +67,19 @@ protected:
                                 theLowerCol, theUpperCol);
     }
 
-  protected:
-    Handle(ArrayClass) myArray;
-  };
+    virtual void readValue (StdObjMgt_ReadData&    theReadData,
+                            const Standard_Integer theRow,
+                            const Standard_Integer theCol)
+      { theReadData >> myArray->ChangeValue (theRow, theCol); }
 
-private:
-  template <class ArrayClass>
-  class instance : public base<ArrayClass>
-  {
   protected:
-    Standard_EXPORT virtual void readValue (StdObjMgt_ReadData&    theReadData,
-                                            const Standard_Integer theRow,
-                                            const Standard_Integer theCol);
+    Handle(ArrayClass) myArray;
   };
 
 public:
-  typedef instance<TColStd_HArray2OfInteger> Integer;
-  typedef instance<TColStd_HArray2OfReal>    Real;
+  typedef instance<TColStd_HArray2OfInteger>           Integer;
+  typedef instance<TColStd_HArray2OfReal>              Real;
+  typedef instance<StdLPersistent_HArray2OfPersistent> Persistent;
 };
 
 #endif
index 04000c4..98e5d83 100644 (file)
@@ -25,20 +25,18 @@ template <class StringClass, typename CharType>
 void StdLPersistent_HString::instance<StringClass, CharType>::Read
   (StdObjMgt_ReadData& theReadData)
 {
-  theReadData.Driver().BeginReadObjectData();
+  StdObjMgt_ReadData::Object anObjectData (theReadData);
 
   Standard_Integer aSize;
-  theReadData.ReadValue (aSize);
+  anObjectData >> aSize;
   myValue = new StringClass (aSize, 0);
 
   for (Standard_Integer i = 1; i <= aSize; i++)
   {
     CharType aChar;
-    theReadData.ReadValue (aChar);
+    anObjectData >> aChar;
     myValue->SetValue (i, aChar);
   }
-
-  theReadData.Driver().EndReadObjectData();
 }
 
 //=======================================================================
index 01a68d1..cbb0e32 100644 (file)
@@ -13,8 +13,6 @@
 
 #include <StdLPersistent_NamedData.hxx>
 
-#include <TCollection_HExtendedString.hxx>
-
 #include <TColStd_DataMapOfStringInteger.hxx>
 #include <TDataStd_DataMapOfStringReal.hxx>
 #include <TDataStd_DataMapOfStringString.hxx>
 #include <TDataStd_DataMapOfStringHArray1OfReal.hxx>
 
 
+static const TCollection_ExtendedString&
+  String (Handle(StdObjMgt_Persistent) theValue)
+{
+  if (theValue)
+    return theValue->ExtString()->String();
+
+  static TCollection_ExtendedString anEmptyString;
+  return anEmptyString;
+}
+
+template <class HArray>
+static typename HArray::ArrayHandle
+  Array (Handle(StdObjMgt_Persistent) theValue)
+{
+  Handle(HArray) anArray = Handle(HArray)::DownCast (theValue);
+  return anArray ? anArray->Array() : NULL;
+}
+
 //=======================================================================
 //function : Import
 //purpose  : Import transient attribuite from the persistent data
@@ -37,10 +53,8 @@ void StdLPersistent_NamedData::Import
   {
     TColStd_DataMapOfStringInteger aMap;
     for (Standard_Integer i = lower(0); i <= upper(0); i++)
-    {
-      Standard_Integer aValue = 0;
-      aMap.Bind (myInts.Get (i, aValue), aValue);
-    }
+      aMap.Bind (myInts.Key(i), myInts.Value(i));
+
     theAttribute->ChangeIntegers (aMap);
   }
 
@@ -48,10 +62,8 @@ void StdLPersistent_NamedData::Import
   {
     TDataStd_DataMapOfStringReal aMap;
     for (Standard_Integer i = lower(1); i <= upper(1); i++)
-    {
-      Standard_Real aValue = 0.0;
-      aMap.Bind (myReals.Get (i, aValue), aValue);
-    }
+      aMap.Bind (myReals.Key(i), myReals.Value(i));
+
     theAttribute->ChangeReals (aMap);
   }
 
@@ -59,12 +71,8 @@ void StdLPersistent_NamedData::Import
   {
     TDataStd_DataMapOfStringString aMap;
     for (Standard_Integer i = lower(2); i <= upper(2); i++)
-    {
-      Handle(StdObjMgt_Persistent) aValue;
-      aMap.Bind (myStrings.Get (i, aValue),
-                 aValue ? aValue->ExtString()->String()
-                        : TCollection_ExtendedString());
-    }
+      aMap.Bind (myStrings.Key(i), String (myStrings.Value(i)));
+
     theAttribute->ChangeStrings (aMap);
   }
 
@@ -72,10 +80,8 @@ void StdLPersistent_NamedData::Import
   {
     TDataStd_DataMapOfStringByte aMap;
     for (Standard_Integer i = lower(3); i <= upper(3); i++)
-    {
-      Standard_Byte aValue = 0;
-      aMap.Bind (myBytes.Get (i, aValue), aValue);
-    }
+      aMap.Bind (myBytes.Key(i), myBytes.Value(i));
+
     theAttribute->ChangeBytes (aMap);
   }
 
@@ -83,19 +89,9 @@ void StdLPersistent_NamedData::Import
   {
     TDataStd_DataMapOfStringHArray1OfInteger aMap;
     for (Standard_Integer i = lower(4); i <= upper(4); i++)
-    {
-      Handle(StdObjMgt_Persistent)      aValue;
-      const TCollection_ExtendedString& aKey = myIntArrays.Get (i, aValue);
+      aMap.Bind (myIntArrays.Key(i),
+                 Array<StdLPersistent_HArray1::Integer> (myIntArrays.Value(i)));
 
-      Handle(StdLPersistent_HArray1::Integer) aPArray =
-        Handle(StdLPersistent_HArray1::Integer)::DownCast (aValue);
-
-      Handle(TColStd_HArray1OfInteger) aTArray;
-      if (aPArray)
-        aTArray = aPArray->Array();
-
-      aMap.Bind (aKey, aTArray);
-    }
     theAttribute->ChangeArraysOfIntegers (aMap);
   }
 
@@ -103,19 +99,9 @@ void StdLPersistent_NamedData::Import
   {
     TDataStd_DataMapOfStringHArray1OfReal aMap;
     for (Standard_Integer i = lower(5); i <= upper(5); i++)
-    {
-      Handle(StdObjMgt_Persistent)      aValue;
-      const TCollection_ExtendedString& aKey = myRealArrays.Get (i, aValue);
-
-      Handle(StdLPersistent_HArray1::Real) aPArray =
-        Handle(StdLPersistent_HArray1::Real)::DownCast (aValue);
-
-      Handle(TColStd_HArray1OfReal) aTArray;
-      if (aPArray)
-        aTArray = aPArray->Array();
+      aMap.Bind (myRealArrays.Key(i),
+                 Array<StdLPersistent_HArray1::Real> (myRealArrays.Value(i)));
 
-      aMap.Bind (aKey, aTArray);
-    }
     theAttribute->ChangeArraysOfReals (aMap);
   }
 }
index 56d40e2..27c79ce 100644 (file)
 class StdLPersistent_NamedData : public StdObjMgt_Attribute<TDataStd_NamedData>
 {
   template <class HValuesArray>
-  class element
+  class pMapData
   {
   public:
+    typedef typename HValuesArray::ValueType ValueType;
+
     inline void Read (StdObjMgt_ReadData& theReadData)
       { theReadData >> myKeys >> myValues; }
 
     inline operator bool() const
-      { return ! myKeys.IsNull(); }
+      { return !myKeys.IsNull(); }
+
+    const TCollection_ExtendedString& Key (Standard_Integer theIndex) const
+      { return myKeys->Array()->Value(theIndex)->ExtString()->String(); }
 
-    template <class Value>
-    inline const TCollection_ExtendedString& Get
-      (Standard_Integer theIndex, Value& theValue) const
-    {
-      if (myValues)
-        theValue = myValues->Array()->Value(theIndex);
-      return myKeys->Array()->Value(theIndex)->ExtString()->String();
-    }
+    ValueType Value (Standard_Integer theIndex) const
+      { return myValues ? myValues->Array()->Value(theIndex) : 0; }
 
   private:
-    Reference <StdLPersistent_HArray1::Persistent> myKeys;
-    Reference <HValuesArray>                       myValues;
+    Handle(StdLPersistent_HArray1::Persistent) myKeys;
+    Handle(HValuesArray)                       myValues;
   };
 
 public:
   //! Read persistent data from a file.
   inline void Read (StdObjMgt_ReadData& theReadData)
   {
-    theReadData >> myDimensions >>
-      myInts >> myReals >> myStrings >> myBytes >> myIntArrays >> myRealArrays;
+    theReadData >> myDimensions;
+    myInts      .Read (theReadData);
+    myReals     .Read (theReadData);
+    myStrings   .Read (theReadData);
+    myBytes     .Read (theReadData);
+    myIntArrays .Read (theReadData);
+    myRealArrays.Read (theReadData);
   }
 
   //! Import transient attribuite from the persistent data.
@@ -64,13 +68,13 @@ private:
   inline Standard_Integer upper (Standard_Integer theIndex) const;
 
 private:
-  Reference <StdLPersistent_HArray2::Integer>           myDimensions;
-  Object <element<StdLPersistent_HArray1::Integer>    > myInts;
-  Object <element<StdLPersistent_HArray1::Real>       > myReals;
-  Object <element<StdLPersistent_HArray1::Persistent> > myStrings;
-  Object <element<StdLPersistent_HArray1::Byte>       > myBytes;
-  Object <element<StdLPersistent_HArray1::Persistent> > myIntArrays;
-  Object <element<StdLPersistent_HArray1::Persistent> > myRealArrays;
+  Handle(StdLPersistent_HArray2::Integer)      myDimensions;
+  pMapData<StdLPersistent_HArray1::Integer>    myInts;
+  pMapData<StdLPersistent_HArray1::Real>       myReals;
+  pMapData<StdLPersistent_HArray1::Persistent> myStrings;
+  pMapData<StdLPersistent_HArray1::Byte>       myBytes;
+  pMapData<StdLPersistent_HArray1::Persistent> myIntArrays;
+  pMapData<StdLPersistent_HArray1::Persistent> myRealArrays;
 };
 
 #endif
index 5cac248..18be36f 100644 (file)
@@ -18,7 +18,6 @@
 #include <StdObjMgt_Attribute.hxx>
 
 #include <TDataStd_Real.hxx>
-#include <TDataStd_RealEnum.hxx>
 
 
 class StdLPersistent_Real : public StdObjMgt_Attribute<TDataStd_Real>
@@ -31,13 +30,13 @@ public:
   //! Import transient attribuite from the persistent data.
   void Import (const Handle(TDataStd_Real)& theAttribute) const
   {
-    theAttribute->Set (myValue);
-    theAttribute->SetDimension (myDimension);
+    theAttribute->Set          (myValue);
+    theAttribute->SetDimension (static_cast<TDataStd_RealEnum> (myDimension));
   }
 
 private:
-  Value<Standard_Real>    myValue;
-  Enum<TDataStd_RealEnum> myDimension;
+  Standard_Real    myValue;
+  Standard_Integer myDimension;
 };
 
 #endif
index cc4ee2a..6fb7e67 100644 (file)
@@ -16,9 +16,9 @@
 #define _StdLPersistent_TreeNode_HeaderFile
 
 #include <StdObjMgt_Attribute.hxx>
-#include <StdLObject_GUID.hxx>
 
 #include <TDataStd_TreeNode.hxx>
+#include <Standard_GUID.hxx>
 
 
 class StdLPersistent_TreeNode
@@ -37,12 +37,12 @@ public:
 private:
   struct dynamic : public Standard_Transient
   {
-    Reference <StdLPersistent_TreeNode> First;
-    Object    <StdLObject_GUID>         TreeID;
+    Handle(StdLPersistent_TreeNode) First;
+    Standard_GUID                   TreeID;
   };
 
   Handle(dynamic) myDynamicData;
-  Reference<StdLPersistent_TreeNode> myNext;
+  Handle(StdLPersistent_TreeNode) myNext;
 };
 
 #endif
index 130ec7a..98dde81 100644 (file)
@@ -34,8 +34,9 @@ void StdLPersistent_Value::integer<AttribClass>::ImportAttribute()
 template <class AttribClass, class HStringClass>
 void StdLPersistent_Value::string<AttribClass, HStringClass>::ImportAttribute()
 {
-  Handle(HStringClass) anHString;
-  if (this->myData.Cast (anHString))
+  Handle(HStringClass) anHString =
+    Handle(HStringClass)::DownCast (this->myData);
+  if (anHString)
   {
     this->myTransient->Set (anHString->Value()->String());
     this->myData.Nullify();
@@ -83,7 +84,7 @@ Handle(TDF_Attribute) StdLPersistent_Value::UAttribute::CreateAttribute()
   }
 
   return this->myTransient;
-  }
+}
 
 
 template class StdLPersistent_Value::integer <TDataStd_Integer>;
index 2d78212..8b9f21c 100644 (file)
@@ -37,8 +37,8 @@ public:
   }
 
 private:
-  Value     <Standard_Boolean>              myIsConstant;
-  Reference <StdLPersistent_HString::Ascii> myUnit;
+  Standard_Boolean                      myIsConstant;
+  Handle(StdLPersistent_HString::Ascii) myUnit;
 };
 
 #endif
index 940f6c3..b370f15 100644 (file)
@@ -39,8 +39,8 @@ public:
   }
 
 private:
-  Reference<StdLPersistent_HString::Ascii> myDocEntry;
-  Reference<StdLPersistent_HString::Ascii> myLabEntry;
+  Handle(StdLPersistent_HString::Ascii) myDocEntry;
+  Handle(StdLPersistent_HString::Ascii) myLabEntry;
 };
 
 #endif
index c07fc4b..6ca1b5f 100644 (file)
@@ -1,5 +1,4 @@
 StdObjMgt_Attribute.hxx
-StdObjMgt_ContentTypes.hxx
 StdObjMgt_MapOfInstantiators.cxx
 StdObjMgt_MapOfInstantiators.hxx
 StdObjMgt_Persistent.cxx
index 897606d..4d891e8 100644 (file)
@@ -20,8 +20,7 @@
 
 //! Root class for a temporary persistent object corresponding to an attribute.
 template <class Transient>
-class StdObjMgt_Attribute : public    Standard_Transient,
-                            protected StdObjMgt_ContentTypes
+class StdObjMgt_Attribute : public Standard_Transient
 {
   class base : public StdObjMgt_Persistent
   {
@@ -53,8 +52,8 @@ public:
     DataType myData;
   };
 
-  struct SingleInt : Simple <Value<Standard_Integer> > {};
-  struct SingleRef : Simple <Reference<> > {};
+  struct SingleInt : Simple<Standard_Integer> {};
+  struct SingleRef : Simple<Handle(StdObjMgt_Persistent)> {};
 
 private:
   template <class Persistent>
diff --git a/src/StdObjMgt/StdObjMgt_ContentTypes.hxx b/src/StdObjMgt/StdObjMgt_ContentTypes.hxx
deleted file mode 100644 (file)
index 5455fe0..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StdObjMgt_ContentTypes_HeaderFile
-#define _StdObjMgt_ContentTypes_HeaderFile
-
-
-#include <StdObjMgt_ReadData.hxx>
-
-class StdObjMgt_Persistent;
-
-
-//! Root class for an object containing other obects.
-class StdObjMgt_ContentTypes
-{
-  template <typename Type>
-  class holder
-  {
-  public:
-    //! Return the value.
-    operator Type() const { return myValue; }
-
-  protected:
-    Type myValue;
-  };
-
-  template <typename Type>
-  struct enum_ : holder<Type>
-  {
-    //! Read the value from a file.
-    void Read (StdObjMgt_ReadData& theReadData)
-      { theReadData.ReadEnum (this->myValue); }
-  };
-
-  template <typename Type>
-  struct value : holder<Type>
-  {
-    //! Read the value from a file.
-    void Read (StdObjMgt_ReadData& theReadData)
-      { theReadData.ReadValue (this->myValue); }
-  };
-
-  template <class Class>
-  struct object : Class
-  {
-    //! Read object data from a file.
-    void Read (StdObjMgt_ReadData& theReadData)
-      { theReadData.ReadObject ((Class&)*this); }
-  };
-
-  template <class Persistent>
-  struct referenceT : Handle(Persistent)
-  {
-    //! Read object data from a file.
-    void Read (StdObjMgt_ReadData& theReadData)
-      { theReadData.ReadReference (*this); }
-  };
-
-  struct reference : Handle(StdObjMgt_Persistent)
-  {
-    //! Read object data from a file.
-    void Read (StdObjMgt_ReadData& theReadData)
-      { Handle(StdObjMgt_Persistent)::operator= (theReadData.ReadReference()); }
-
-    //! Cast the reference to a target type.
-    template <class Persistent>
-    bool Cast (Handle(Persistent)& theTarget) const
-    {
-      theTarget = Handle(Persistent)::DownCast(*this);
-      return ! theTarget.IsNull();
-    }
-  };
-
-public:
-  template <class Type>
-  struct Enum      : StdObjMgt_ReadData::Content <enum_<Type> > {};
-
-  template <class Type>
-  struct Value     : StdObjMgt_ReadData::Content <value<Type> > {};
-
-  template <class Class>
-  struct Object    : StdObjMgt_ReadData::Content <object<Class> > {};
-
-  template <class Persistent = StdObjMgt_Persistent>
-  struct Reference : StdObjMgt_ReadData::Content <referenceT<Persistent> > {};
-};
-
-template<>
-struct StdObjMgt_ContentTypes::Reference<StdObjMgt_Persistent>
-    : StdObjMgt_ReadData::Content <reference> {};
-
-#endif // _StdObjMgt_ContentTypes_HeaderFile
index 5c7f68f..c95754e 100644 (file)
@@ -18,7 +18,6 @@
 #include <Standard.hxx>
 #include <Standard_Handle.hxx>
 #include <Standard_Transient.hxx>
-#include <StdObjMgt_ContentTypes.hxx>
 
 #include <TDF_Label.hxx>
 
@@ -32,8 +31,7 @@ class TCollection_HExtendedString;
 
 //! Root class for a temporary persistent object that reads data from a file
 //! and then creates transient object using the data.
-class StdObjMgt_Persistent : public    Standard_Transient,
-                             protected StdObjMgt_ContentTypes
+class StdObjMgt_Persistent : public Standard_Transient
 {
 public:
   //! Derived class instance create function.
index 99472cb..9bb9214 100644 (file)
@@ -14,6 +14,8 @@
 #include <StdObjMgt_ReadData.hxx>
 #include <StdObjMgt_Persistent.hxx>
 
+#include <Standard_GUID.hxx>
+
 
 StdObjMgt_ReadData::StdObjMgt_ReadData
   (Storage_BaseDriver& theDriver, const Standard_Integer theNumberOfObjects)
@@ -39,3 +41,23 @@ Handle(StdObjMgt_Persistent) StdObjMgt_ReadData::ReadReference()
   myDriver->GetReference (aRef);
   return aRef ? PersistentObject (aRef) : NULL;
 }
+
+//=======================================================================
+//function : operator >>
+//purpose  : Read persistent data from a file
+//=======================================================================
+StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, Standard_GUID& theGUID)
+{
+  Standard_Integer      a32b;
+  Standard_ExtCharacter a16b[3];
+  Standard_Character    a8b [6];
+
+  theReadData >> a32b >> a16b[0] >> a16b[1] >> a16b[2];
+  theReadData >> a8b[0] >> a8b[1] >> a8b[2] >> a8b[3] >> a8b[4] >> a8b[5];
+
+  theGUID = Standard_GUID (a32b, a16b[0], a16b[1], a16b[2],
+                           a8b[0], a8b[1], a8b[2], a8b[3], a8b[4], a8b[5]);
+
+  return theReadData;
+}
index b952ba0..3063f80 100644 (file)
 #include <NCollection_Array1.hxx>
 
 class StdObjMgt_Persistent;
+class Standard_GUID;
+
 
 //! Auxiliary data used to read persistent objects from a file.
 class StdObjMgt_ReadData
 {
 public:
+  class Object;
+
   Standard_EXPORT StdObjMgt_ReadData
     (Storage_BaseDriver& theDriver, const Standard_Integer theNumberOfObjects);
 
-  Storage_BaseDriver& Driver() const
-    { return *myDriver; }
-
   template <class Instantiator>
   void CreatePersistentObject
     (const Standard_Integer theRef, Instantiator theInstantiator)
@@ -45,45 +46,69 @@ public:
   Standard_EXPORT Handle(StdObjMgt_Persistent) ReadReference();
 
   template <class Persistent>
-  void ReadReference (Handle(Persistent)& theTarget)
+  StdObjMgt_ReadData& operator >> (Handle(Persistent)& theTarget)
   {
     theTarget = Handle(Persistent)::DownCast (ReadReference());
+    return *this;
   }
 
-  template <class Object>
-  void ReadObject (Object& theObject)
+  StdObjMgt_ReadData& operator >> (Handle(StdObjMgt_Persistent)& theTarget)
   {
-    myDriver->BeginReadObjectData();
-    theObject.Read (*this);
-    myDriver->EndReadObjectData();
+    theTarget = ReadReference();
+    return *this;
   }
 
   template <class Type>
-  void ReadValue (Type& theValue)
+  StdObjMgt_ReadData& ReadValue (Type& theValue)
   {
     *myDriver >> theValue;
-  }
-
-  template <class Type>
-  void ReadEnum (Type& theEnum)
-  {
-    Standard_Integer aValue;
-    *myDriver >> aValue;
-    theEnum = static_cast<Type> (aValue);
-  }
-
-  template <class Base> struct Content : Base {};
-
-  template <class Base>
-  StdObjMgt_ReadData& operator >> (Content<Base>& theContent)
-  {
-    theContent.Read (*this);
     return *this;
   }
 
+  StdObjMgt_ReadData& operator >> (Standard_Character& theValue)
+    { return ReadValue (theValue); }
+  
+  StdObjMgt_ReadData& operator >> (Standard_ExtCharacter& theValue)
+    { return ReadValue (theValue); }
+  
+  StdObjMgt_ReadData& operator >> (Standard_Integer& theValue)
+    { return ReadValue (theValue); }
+  
+  StdObjMgt_ReadData& operator >> (Standard_Boolean& theValue)
+    { return ReadValue (theValue); }
+  
+  StdObjMgt_ReadData& operator >> (Standard_Real& theValue)
+    { return ReadValue (theValue); }
+  
+  StdObjMgt_ReadData& operator >> (Standard_ShortReal& theValue)
+    { return ReadValue (theValue); }
+
 private:
   Storage_BaseDriver* myDriver;
   NCollection_Array1<Handle(StdObjMgt_Persistent)> myPersistentObjects;
 };
 
+class StdObjMgt_ReadData::Object
+{
+public:
+  Object (StdObjMgt_ReadData& theData) : myReadData (&theData)
+    { myReadData->myDriver->BeginReadObjectData(); }
+
+  ~Object()
+    { myReadData->myDriver->EndReadObjectData(); }
+
+  operator StdObjMgt_ReadData&()
+    { return *myReadData; }
+
+  template <class Data>
+  StdObjMgt_ReadData& operator >> (Data& theData)
+    { return *myReadData >> theData; }
+
+private:
+  StdObjMgt_ReadData* myReadData;
+};
+
+Standard_EXPORT StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, Standard_GUID& theGUID);
+
 #endif // _StdObjMgt_ReadData_HeaderFile
index d2b8998..def5f6e 100644 (file)
 class StdObjMgt_SharedObject
 {
 public:
-  class PersistentBase : public    Standard_Transient,
-                         protected StdObjMgt_ContentTypes {};
-
   template <class Transient>
-  class AbstractPersistentBase : public PersistentBase
+  class AbstractPersistentBase : public Standard_Transient
   {
   public:
     virtual Handle(Transient) Import() const = 0;
index 3fe5d97..c68a357 100644 (file)
@@ -1,4 +1,8 @@
-StdObject_gp.hxx
+StdObject_gp_Axes.hxx
+StdObject_gp_Curves.hxx
+StdObject_gp_Surfaces.hxx
+StdObject_gp_Trsfs.hxx
+StdObject_gp_Vectors.hxx
 StdObject_Location.cxx
 StdObject_Location.hxx
 StdObject_Shape.cxx
index 3515b5b..a905d62 100644 (file)
@@ -21,9 +21,7 @@
 //=======================================================================
 TopLoc_Location StdObject_Location::Import() const
 {
-  Handle(StdPersistent_TopLoc::ItemLocation) anItemLocation;
-  if (myData.Cast (anItemLocation))
-    return anItemLocation->Import();
-  else
-    return TopLoc_Location();
+  Handle(StdPersistent_TopLoc::ItemLocation) anItemLocation =
+    Handle(StdPersistent_TopLoc::ItemLocation)::DownCast (myData);
+  return anItemLocation ? anItemLocation->Import() : TopLoc_Location();
 }
index 9bfa7aa..b082b1e 100644 (file)
 #ifndef _StdObject_Location_HeaderFile
 #define _StdObject_Location_HeaderFile
 
-#include <StdObjMgt_ContentTypes.hxx>
+#include <StdObjMgt_ReadData.hxx>
 
 #include <TopLoc_Location.hxx>
 
 
-class StdObject_Location : private StdObjMgt_ContentTypes
+class StdObject_Location
 {
 public:
-  //! Read persistent data from a file.
-  inline void Read (StdObjMgt_ReadData& theReadData)
-    { theReadData >> myData; }
-
   //! Import transient object from the persistent data.
   TopLoc_Location Import() const;
 
 private:
-  Reference<> myData;
+  Handle(StdObjMgt_Persistent) myData;
+
+  friend StdObjMgt_ReadData& operator >>
+    (StdObjMgt_ReadData::Object, StdObject_Location&);
 };
 
+//! Read persistent data from a file.
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, StdObject_Location& theLocation)
+{
+  return theReadData >> theLocation.myData;
+}
+
 #endif
index e8c85f9..dad07af 100644 (file)
@@ -27,7 +27,7 @@ TopoDS_Shape StdObject_Shape::Import() const
     aShape.TShape (myTShape->Import());
 
   aShape.Location (myLocation.Import());
-  aShape.Orientation (myOrient);
+  aShape.Orientation (static_cast<TopAbs_Orientation> (myOrient));
 
   return aShape;
 }
index 2a57fd7..a4908f4 100644 (file)
 #ifndef _StdObject_Shape_HeaderFile
 #define _StdObject_Shape_HeaderFile
 
-#include <StdObjMgt_ContentTypes.hxx>
+#include <StdObjMgt_ReadData.hxx>
 #include <StdObject_Location.hxx>
 #include <StdPersistent_TopoDS.hxx>
 
-#include <TopAbs_Orientation.hxx>
 #include <TopoDS_Shape.hxx>
 
 
-class StdObject_Shape : private StdObjMgt_ContentTypes
+class StdObject_Shape
 {
 public:
-  //! Read persistent data from a file.
-  inline void Read (StdObjMgt_ReadData& theReadData)
-    { theReadData >> myTShape >> myLocation >> myOrient; }
-
   //! Import transient object from the persistent data.
   Standard_EXPORT TopoDS_Shape Import() const;
 
+protected:
+  //! Read persistent data from a file.
+  inline void read (StdObjMgt_ReadData& theReadData)
+    { theReadData >> myTShape >> myLocation >> myOrient; }
+
 private:
-  Reference <StdPersistent_TopoDS::TShape> myTShape;
-  Object    <StdObject_Location>           myLocation;
-  Enum      <TopAbs_Orientation>           myOrient;
+  Handle(StdPersistent_TopoDS::TShape) myTShape;
+  StdObject_Location                   myLocation;
+  Standard_Integer                     myOrient;
+
+  friend StdObjMgt_ReadData& operator >>
+    (StdObjMgt_ReadData::Object, StdObject_Shape&);
 };
 
+//! Read persistent data from a file.
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, StdObject_Shape& theShape)
+{
+  theShape.read (theReadData);
+  return theReadData;
+}
+
 #endif
diff --git a/src/StdObject/StdObject_gp.hxx b/src/StdObject/StdObject_gp.hxx
deleted file mode 100644 (file)
index 2d5c272..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#ifndef _StdObject_gp_HeaderFile
-#define _StdObject_gp_HeaderFile
-
-#include <StdObjMgt_ContentTypes.hxx>
-
-class StdObject_gp : private StdObjMgt_ContentTypes
-{
-  template <class Data>
-  struct object : Data
-    { Standard_EXPORT void Read (StdObjMgt_ReadData& theReadData); };
-
-public:
-  template <class Data>
-  struct Object : StdObjMgt_ContentTypes::Object <object<Data> > {};
-
-  template <class Data>
-  static Object<Data>& Ref (Data& theData)
-    { return static_cast<Object<Data>&> (theData); }
-};
-
-// read vectors
-
-#include <gp_Pnt2d.hxx>
-#include <gp_Vec2d.hxx>
-#include <gp_Dir2d.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Dir.hxx>
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_XY& theXY)
-{
-  Standard_Real aX, aY;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theXY.SetCoord(aX, aY);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Pnt2d& thePnt)
-{
-  Standard_Real aX, aY;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  thePnt.SetCoord(aX, aY);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Vec2d& theVec)
-{
-  Standard_Real aX, aY;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theVec.SetCoord(aX, aY);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Dir2d& theDir)
-{
-  Standard_Real aX, aY;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theDir.SetCoord(aX, aY);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_XYZ& theXYZ)
-{
-  Standard_Real aX, aY, aZ;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theReadData.ReadValue(aZ);
-  theXYZ.SetCoord(aX, aY, aZ);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Pnt& thePnt)
-{
-  Standard_Real aX, aY, aZ;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theReadData.ReadValue(aZ);
-  thePnt.SetCoord(aX, aY, aZ);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Vec& theVec)
-{
-  Standard_Real aX, aY, aZ;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theReadData.ReadValue(aZ);
-  theVec.SetCoord(aX, aY, aZ);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Dir& theDir)
-{
-  Standard_Real aX, aY, aZ;
-  theReadData.ReadValue(aX);
-  theReadData.ReadValue(aY);
-  theReadData.ReadValue(aZ);
-  theDir.SetCoord(aX, aY, aZ);
-  return theReadData;
-}
-
-// read axis placements
-
-#include <gp_Ax2d.hxx>
-#include <gp_Ax22d.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Ax2.hxx>
-#include <gp_Ax3.hxx>
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Ax2d& theAx)
-{
-  gp_Pnt2d aLoc;
-  gp_Dir2d aDir;
-  theReadData >> aLoc >> aDir;
-  theAx = gp_Ax2d (aLoc, aDir);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Ax22d& theAx)
-{
-  gp_Pnt2d aLoc;
-  gp_Dir2d aYDir, aXDir;
-  theReadData >> aLoc >> aYDir >> aXDir;
-  theAx = gp_Ax22d (aLoc, aXDir, aYDir);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Ax1& theAx)
-{
-  gp_XYZ aLoc;
-  gp_Dir aDir;
-  theReadData >> aLoc >> aDir;
-  theAx = gp_Ax1 (aLoc, aDir);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Ax2& theAx)
-{
-  gp_Ax1 anAx;
-  gp_Dir aYDir, aXDir;
-  theReadData >> anAx >> aYDir >> aXDir;
-  theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Ax3& theAx)
-{
-  gp_Ax1 anAx;
-  gp_Dir aYDir, aXDir;
-  theReadData >> anAx >> aYDir >> aXDir;
-  theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
-  if (aYDir * theAx.YDirection() < 0.)
-    theAx.YReverse();
-  return theReadData;
-}
-
-// read curves
-
-#include <gp_Lin2d.hxx>
-#include <gp_Circ2d.hxx>
-#include <gp_Elips2d.hxx>
-#include <gp_Hypr2d.hxx>
-#include <gp_Parab2d.hxx>
-#include <gp_Lin.hxx>
-#include <gp_Circ.hxx>
-#include <gp_Elips.hxx>
-#include <gp_Hypr.hxx>
-#include <gp_Parab.hxx>
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Lin2d& theLin)
-{
-  gp_Ax2d anAx;
-  theReadData >> anAx;
-  theLin.SetPosition(anAx);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Circ2d& theCirc)
-{
-  gp_Ax22d anAx;
-  Standard_Real aRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aRadius);
-  theCirc.SetAxis(anAx);
-  theCirc.SetRadius (aRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Elips2d& theElips)
-{
-  gp_Ax22d anAx;
-  Standard_Real aMajorRadius, aMinorRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aMajorRadius);
-  theReadData.ReadValue(aMinorRadius);
-  theElips.SetAxis(anAx);
-  theElips.SetMajorRadius(aMajorRadius);
-  theElips.SetMinorRadius(aMinorRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Hypr2d& theHypr)
-{
-  gp_Ax22d anAx;
-  Standard_Real aMajorRadius, aMinorRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aMajorRadius);
-  theReadData.ReadValue(aMinorRadius);
-  theHypr.SetAxis(anAx);
-  theHypr.SetMajorRadius(aMajorRadius);
-  theHypr.SetMinorRadius(aMinorRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Parab2d& theParab)
-{
-  gp_Ax22d anAx;
-  Standard_Real aFocalLength;
-  theReadData >> anAx;
-  theReadData.ReadValue(aFocalLength);
-  theParab.SetAxis(anAx);
-  theParab.SetFocal(aFocalLength);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Lin& theLin)
-{
-  gp_Ax1 anAx;
-  theReadData >> anAx;
-  theLin.SetPosition(anAx);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Circ& theCirc)
-{
-  gp_Ax2 anAx;
-  Standard_Real aRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aRadius);
-  theCirc.SetPosition(anAx);
-  theCirc.SetRadius (aRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Elips& theElips)
-{
-  gp_Ax2 anAx;
-  Standard_Real aMajorRadius, aMinorRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aMajorRadius);
-  theReadData.ReadValue(aMinorRadius);
-  theElips.SetPosition(anAx);
-  theElips.SetMajorRadius(aMajorRadius);
-  theElips.SetMinorRadius(aMinorRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Hypr& theHypr)
-{
-  gp_Ax2 anAx;
-  Standard_Real aMajorRadius, aMinorRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aMajorRadius);
-  theReadData.ReadValue(aMinorRadius);
-  theHypr.SetPosition(anAx);
-  theHypr.SetMajorRadius(aMajorRadius);
-  theHypr.SetMinorRadius(aMinorRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Parab& theParab)
-{
-  gp_Ax2 anAx;
-  Standard_Real aFocalLength;
-  theReadData >> anAx;
-  theReadData.ReadValue(aFocalLength);
-  theParab.SetPosition(anAx);
-  theParab.SetFocal(aFocalLength);
-  return theReadData;
-}
-
-// read surfaces
-
-#include <gp_Cone.hxx>
-#include <gp_Cylinder.hxx>
-#include <gp_Sphere.hxx>
-#include <gp_Torus.hxx>
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Cone& theCone)
-{
-  gp_Ax3 anAx;
-  Standard_Real aRadius, aSemiAngle;
-  theReadData >> anAx;
-  theReadData.ReadValue(aRadius);
-  theReadData.ReadValue(aSemiAngle);
-  theCone.SetPosition(anAx);
-  theCone.SetRadius(aRadius);
-  theCone.SetSemiAngle(aSemiAngle);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Cylinder& theCyl)
-{
-  gp_Ax3 anAx;
-  Standard_Real aRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aRadius);
-  theCyl.SetPosition(anAx);
-  theCyl.SetRadius(aRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Sphere& theSph)
-{
-  gp_Ax3 anAx;
-  Standard_Real aRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aRadius);
-  theSph.SetPosition(anAx);
-  theSph.SetRadius(aRadius);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Torus& theTorus)
-{
-  gp_Ax3 anAx;
-  Standard_Real aMajorRadius, aMinorRadius;
-  theReadData >> anAx;
-  theReadData.ReadValue(aMajorRadius);
-  theReadData.ReadValue(aMinorRadius);
-  theTorus.SetPosition(anAx);
-  theTorus.SetMajorRadius(aMajorRadius);
-  theTorus.SetMinorRadius(aMinorRadius);
-  return theReadData;
-}
-
-// read transformations
-
-#include <gp_Mat2d.hxx>
-#include <gp_Mat.hxx>
-#include <gp_Trsf2d.hxx>
-#include <gp_Trsf.hxx>
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Mat2d& theMat)
-{
-  gp_XY aRow1, aRow2;
-  theReadData >> aRow1 >> aRow2;
-  theMat.SetRows(aRow1, aRow2);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Mat& theMat)
-{
-  gp_XYZ aRow1, aRow2, aRow3;
-  theReadData >> aRow1 >> aRow2 >> aRow3;
-  theMat.SetRows(aRow1, aRow2, aRow3);
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Trsf2d& theTrsf)
-{
-  Standard_Real aScale;
-  gp_TrsfForm aForm;
-  gp_Mat2d aMat;
-  gp_XY aLoc;
-  theReadData.ReadValue(aScale);
-  theReadData.ReadEnum(aForm);
-  theReadData >> aMat >> aLoc;
-  theTrsf.SetValues(aScale * aMat(1, 1), aScale * aMat(1, 2), aLoc.X(),
-                    aScale * aMat(2, 1), aScale * aMat(2, 2), aLoc.Y());
-  return theReadData;
-}
-
-inline StdObjMgt_ReadData& operator >> (StdObjMgt_ReadData& theReadData, gp_Trsf& theTrsf)
-{
-  Standard_Real aScale;
-  gp_TrsfForm aForm;
-  gp_Mat aMat;
-  gp_XYZ aLoc;
-  theReadData.ReadValue(aScale);
-  theReadData.ReadEnum(aForm);
-  theReadData >> aMat >> aLoc;
-  theTrsf.SetValues(aScale * aMat(1, 1), aScale * aMat(1, 2), aScale * aMat(1, 3), aLoc.X(),
-                    aScale * aMat(2, 1), aScale * aMat(2, 2), aScale * aMat(2, 3), aLoc.Y(),
-                    aScale * aMat(3, 1), aScale * aMat(3, 2), aScale * aMat(3, 3), aLoc.Z());
-  return theReadData;
-}
-
-template<class T>
-inline void StdObject_gp::object<T>::Read (StdObjMgt_ReadData& theReadData)
-{
-  theReadData >> (*this);
-}
-
-
-#endif
diff --git a/src/StdObject/StdObject_gp_Axes.hxx b/src/StdObject/StdObject_gp_Axes.hxx
new file mode 100644 (file)
index 0000000..44de3aa
--- /dev/null
@@ -0,0 +1,81 @@
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#ifndef _StdObject_gp_Axes_HeaderFile
+#define _StdObject_gp_Axes_HeaderFile
+
+
+#include <StdObject_gp_Vectors.hxx>
+
+#include <gp_Ax2d.hxx>
+#include <gp_Ax22d.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
+
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Ax2d& theAx)
+{
+  gp_Pnt2d aLoc;
+  gp_Dir2d aDir;
+  theReadData >> aLoc >> aDir;
+  theAx = gp_Ax2d (aLoc, aDir);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Ax22d& theAx)
+{
+  gp_Pnt2d aLoc;
+  gp_Dir2d aYDir, aXDir;
+  theReadData >> aLoc >> aYDir >> aXDir;
+  theAx = gp_Ax22d (aLoc, aXDir, aYDir);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Ax1& theAx)
+{
+  gp_XYZ aLoc;
+  gp_Dir aDir;
+  theReadData >> aLoc >> aDir;
+  theAx = gp_Ax1 (aLoc, aDir);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Ax2& theAx)
+{
+  gp_Ax1 anAx;
+  gp_Dir aYDir, aXDir;
+  theReadData >> anAx >> aYDir >> aXDir;
+  theAx = gp_Ax2 (anAx.Location(), anAx.Direction(), aXDir);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Ax3& theAx)
+{
+  gp_Ax1 anAx;
+  gp_Dir aYDir, aXDir;
+  theReadData >> anAx >> aYDir >> aXDir;
+  theAx = gp_Ax3 (anAx.Location(), anAx.Direction(), aXDir);
+  if (aYDir * theAx.YDirection() < 0.)
+    theAx.YReverse();
+  return theReadData;
+}
+
+
+#endif
diff --git a/src/StdObject/StdObject_gp_Curves.hxx b/src/StdObject/StdObject_gp_Curves.hxx
new file mode 100644 (file)
index 0000000..aef2e17
--- /dev/null
@@ -0,0 +1,168 @@
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#ifndef _StdObject_gp_Curves_HeaderFile
+#define _StdObject_gp_Curves_HeaderFile
+
+
+#include <StdObject_gp_Axes.hxx>
+
+#include <gp_Lin2d.hxx>
+#include <gp_Circ2d.hxx>
+#include <gp_Elips2d.hxx>
+#include <gp_Hypr2d.hxx>
+#include <gp_Parab2d.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Elips.hxx>
+#include <gp_Hypr.hxx>
+#include <gp_Parab.hxx>
+
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Lin2d& theLin)
+{
+  gp_Ax2d anAx;
+  theReadData >> anAx;
+  theLin.SetPosition (anAx);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Circ2d& theCirc)
+{
+  gp_Ax22d anAx;
+  Standard_Real aRadius;
+
+  theReadData >> anAx >> aRadius;
+
+  theCirc.SetAxis   (anAx);
+  theCirc.SetRadius (aRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Elips2d& theElips)
+{
+  gp_Ax22d anAx;
+  Standard_Real aMajorRadius, aMinorRadius;
+
+  theReadData >> anAx >> aMajorRadius >> aMinorRadius;
+
+  theElips.SetAxis        (anAx);
+  theElips.SetMajorRadius (aMajorRadius);
+  theElips.SetMinorRadius (aMinorRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Hypr2d& theHypr)
+{
+  gp_Ax22d anAx;
+  Standard_Real aMajorRadius, aMinorRadius;
+
+  theReadData >> anAx >> aMajorRadius >> aMinorRadius;
+
+  theHypr.SetAxis        (anAx);
+  theHypr.SetMajorRadius (aMajorRadius);
+  theHypr.SetMinorRadius (aMinorRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Parab2d& theParab)
+{
+  gp_Ax22d anAx;
+  Standard_Real aFocalLength;
+
+  theReadData >> anAx >> aFocalLength;
+
+  theParab.SetAxis  (anAx);
+  theParab.SetFocal (aFocalLength);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Lin& theLin)
+{
+  gp_Ax1 anAx;
+  theReadData >> anAx;
+  theLin.SetPosition (anAx);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Circ& theCirc)
+{
+  gp_Ax2 anAx;
+  Standard_Real aRadius;
+
+  theReadData >> anAx >> aRadius;
+
+  theCirc.SetPosition (anAx);
+  theCirc.SetRadius   (aRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Elips& theElips)
+{
+  gp_Ax2 anAx;
+  Standard_Real aMajorRadius, aMinorRadius;
+
+  theReadData >> anAx >> aMajorRadius >> aMinorRadius;
+
+  theElips.SetPosition    (anAx);
+  theElips.SetMajorRadius (aMajorRadius);
+  theElips.SetMinorRadius (aMinorRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Hypr& theHypr)
+{
+  gp_Ax2 anAx;
+  Standard_Real aMajorRadius, aMinorRadius;
+
+  theReadData >> anAx >> aMajorRadius >> aMinorRadius;
+
+  theHypr.SetPosition    (anAx);
+  theHypr.SetMajorRadius (aMajorRadius);
+  theHypr.SetMinorRadius (aMinorRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Parab& theParab)
+{
+  gp_Ax2 anAx;
+  Standard_Real aFocalLength;
+
+  theReadData >> anAx >> aFocalLength;
+
+  theParab.SetPosition (anAx);
+  theParab.SetFocal    (aFocalLength);
+
+  return theReadData;
+}
+
+
+#endif
diff --git a/src/StdObject/StdObject_gp_Surfaces.hxx b/src/StdObject/StdObject_gp_Surfaces.hxx
new file mode 100644 (file)
index 0000000..074a623
--- /dev/null
@@ -0,0 +1,86 @@
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#ifndef _StdObject_gp_Surfaces_HeaderFile
+#define _StdObject_gp_Surfaces_HeaderFile
+
+
+#include <StdObject_gp_Axes.hxx>
+
+#include <gp_Cone.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Sphere.hxx>
+#include <gp_Torus.hxx>
+
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Cone& theCone)
+{
+  gp_Ax3 anAx;
+  Standard_Real aRadius, aSemiAngle;
+
+  theReadData >> anAx >> aRadius >> aSemiAngle;
+
+  theCone.SetPosition  (anAx);
+  theCone.SetRadius    (aRadius);
+  theCone.SetSemiAngle (aSemiAngle);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Cylinder& theCyl)
+{
+  gp_Ax3 anAx;
+  Standard_Real aRadius;
+
+  theReadData >> anAx >> aRadius;
+
+  theCyl.SetPosition (anAx);
+  theCyl.SetRadius   (aRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Sphere& theSph)
+{
+  gp_Ax3 anAx;
+  Standard_Real aRadius;
+
+  theReadData >> anAx >> aRadius;
+
+  theSph.SetPosition (anAx);
+  theSph.SetRadius   (aRadius);
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Torus& theTorus)
+{
+  gp_Ax3 anAx;
+  Standard_Real aMajorRadius, aMinorRadius;
+
+  theReadData >> anAx >> aMajorRadius >> aMinorRadius;
+
+  theTorus.SetPosition    (anAx);
+  theTorus.SetMajorRadius (aMajorRadius);
+  theTorus.SetMinorRadius (aMinorRadius);
+
+  return theReadData;
+}
+
+
+#endif
diff --git a/src/StdObject/StdObject_gp_Trsfs.hxx b/src/StdObject/StdObject_gp_Trsfs.hxx
new file mode 100644 (file)
index 0000000..a8e06bd
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#ifndef _StdObject_gp_Trsfs_HeaderFile
+#define _StdObject_gp_Trsfs_HeaderFile
+
+
+#include <StdObject_gp_Vectors.hxx>
+
+#include <gp_Mat2d.hxx>
+#include <gp_Mat.hxx>
+#include <gp_Trsf2d.hxx>
+#include <gp_Trsf.hxx>
+
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Mat2d& theMat)
+{
+  gp_XY aRow1, aRow2;
+  theReadData >> aRow1 >> aRow2;
+  theMat.SetRows (aRow1, aRow2);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Mat& theMat)
+{
+  gp_XYZ aRow1, aRow2, aRow3;
+  theReadData >> aRow1 >> aRow2 >> aRow3;
+  theMat.SetRows (aRow1, aRow2, aRow3);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Trsf2d& theTrsf)
+{
+  Standard_Real    aScale;
+  Standard_Integer aForm;
+  gp_Mat2d         aMat;
+  gp_XY            aLoc;
+
+  theReadData >> aScale >> aForm >> aMat >> aLoc;
+
+  theTrsf.SetValues (aScale * aMat(1, 1), aScale * aMat(1, 2), aLoc.X(),
+                     aScale * aMat(2, 1), aScale * aMat(2, 2), aLoc.Y());
+
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Trsf& theTrsf)
+{
+  Standard_Real    aScale;
+  Standard_Integer aForm;
+  gp_Mat           aMat;
+  gp_XYZ           aLoc;
+
+  theReadData >> aScale >> aForm >> aMat >> aLoc;
+
+  theTrsf.SetValues (
+    aScale * aMat(1, 1), aScale * aMat(1, 2), aScale * aMat(1, 3), aLoc.X(),
+    aScale * aMat(2, 1), aScale * aMat(2, 2), aScale * aMat(2, 3), aLoc.Y(),
+    aScale * aMat(3, 1), aScale * aMat(3, 2), aScale * aMat(3, 3), aLoc.Z());
+
+  return theReadData;
+}
+
+
+#endif
diff --git a/src/StdObject/StdObject_gp_Vectors.hxx b/src/StdObject/StdObject_gp_Vectors.hxx
new file mode 100644 (file)
index 0000000..3c7a743
--- /dev/null
@@ -0,0 +1,102 @@
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#ifndef _StdObject_gp_Vectors_HeaderFile
+#define _StdObject_gp_Vectors_HeaderFile
+
+
+#include <StdObjMgt_ReadData.hxx>
+
+#include <gp_Pnt2d.hxx>
+#include <gp_Vec2d.hxx>
+#include <gp_Dir2d.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Dir.hxx>
+
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_XY& theXY)
+{
+  Standard_Real aX, aY;
+  theReadData >> aX >> aY;
+  theXY.SetCoord (aX, aY);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Pnt2d& thePnt)
+{
+  Standard_Real aX, aY;
+  theReadData >> aX >> aY;
+  thePnt.SetCoord (aX, aY);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Vec2d& theVec)
+{
+  Standard_Real aX, aY;
+  theReadData >> aX >> aY;
+  theVec.SetCoord (aX, aY);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Dir2d& theDir)
+{
+  Standard_Real aX, aY;
+  theReadData >> aX >> aY;
+  theDir.SetCoord (aX, aY);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_XYZ& theXYZ)
+{
+  Standard_Real aX, aY, aZ;
+  theReadData >> aX >> aY >> aZ;
+  theXYZ.SetCoord (aX, aY, aZ);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Pnt& thePnt)
+{
+  Standard_Real aX, aY, aZ;
+  theReadData >> aX >> aY >> aZ;
+  thePnt.SetCoord (aX, aY, aZ);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Vec& theVec)
+{
+  Standard_Real aX, aY, aZ;
+  theReadData >> aX >> aY >> aZ;
+  theVec.SetCoord (aX, aY, aZ);
+  return theReadData;
+}
+
+inline StdObjMgt_ReadData& operator >>
+  (StdObjMgt_ReadData::Object theReadData, gp_Dir& theDir)
+{
+  Standard_Real aX, aY, aZ;
+  theReadData >> aX >> aY >> aZ;
+  theDir.SetCoord (aX, aY, aZ);
+  return theReadData;
+}
+
+
+#endif
index 5a716b7..454fcaf 100644 (file)
@@ -6,8 +6,6 @@ StdPersistent_DataXtd_Constraint.cxx
 StdPersistent_DataXtd_Constraint.hxx
 StdPersistent_DataXtd_PatternStd.cxx
 StdPersistent_DataXtd_PatternStd.hxx
-StdPersistent_HArray1OfShape1.hxx
-StdPersistent_HArray1.cxx
 StdPersistent_HArray1.hxx
 StdPersistent_Naming.cxx
 StdPersistent_Naming.hxx
index 40d5479..60ac114 100644 (file)
@@ -19,7 +19,7 @@
 //purpose  : Import transient attribuite from the persistent data
 //=======================================================================
 void StdPersistent_DataXtd::Geometry::ImportAttribute()
-  { myTransient->SetType (myData); }
+  { myTransient->SetType (static_cast<TDataXtd_GeometryEnum> (myData)); }
 
 //=======================================================================
 //function : ImportAttribute
index 376d064..fd4943e 100644 (file)
 #ifndef _StdPersistent_DataXtd_HeaderFile
 #define _StdPersistent_DataXtd_HeaderFile
 
-#include <StdObjMgt_ContentTypes.hxx>
 #include <StdObjMgt_Attribute.hxx>
 #include <StdLPersistent_Void.hxx>
-#include <StdObject_gp.hxx>
+#include <StdObject_gp_Vectors.hxx>
 
 #include <TDataXtd_Shape.hxx>
 #include <TDataXtd_Point.hxx>
@@ -29,7 +28,7 @@
 #include <TDataXtd_Position.hxx>
 
 
-class StdPersistent_DataXtd : private StdObjMgt_ContentTypes
+class StdPersistent_DataXtd
 {
   class _void : private StdLPersistent_Void
   {
@@ -45,16 +44,14 @@ public:
   typedef _void::Instance<TDataXtd_Plane>     Plane;
   typedef _void::Instance<TDataXtd_Placement> Placement;
 
-  class Geometry : public StdObjMgt_Attribute<TDataXtd_Geometry>::
-                            Simple <Enum<TDataXtd_GeometryEnum> >
+  class Geometry : public StdObjMgt_Attribute<TDataXtd_Geometry>::SingleInt
   {
   public:
     //! Import transient attribuite from the persistent data.
     Standard_EXPORT virtual void ImportAttribute();
   };
 
-  class Position : public StdObjMgt_Attribute<TDataXtd_Position>::
-                            Simple <StdObject_gp::Object<gp_Pnt> >
+  class Position : public StdObjMgt_Attribute<TDataXtd_Position>::Simple<gp_Pnt>
   {
   public:
     //! Import transient attribuite from the persistent data.
index e5437ed..d158aff 100644 (file)
@@ -24,7 +24,7 @@
 void StdPersistent_DataXtd_Constraint::Import
   (const Handle(TDataXtd_Constraint)& theAttribute) const
 {
-  theAttribute->SetType  (myType);
+  theAttribute->SetType  (static_cast<TDataXtd_ConstraintEnum> (myType));
   theAttribute->Reversed (myIsReversed);
   theAttribute->Inverted (myIsInverted);
   theAttribute->Verified (myIsVerified);
index 8302ff3..b5e1caf 100644 (file)
@@ -19,7 +19,6 @@
 #include <StdLPersistent_HArray1.hxx>
 
 #include <TDataXtd_Constraint.hxx>
-#include <TDataXtd_ConstraintEnum.hxx>
 
 
 class StdPersistent_DataXtd_Constraint
@@ -37,13 +36,13 @@ public:
   void Import (const Handle(TDataXtd_Constraint)& theAttribute) const;
 
 private:
-  Enum<TDataXtd_ConstraintEnum> myType;
-  Reference<StdLPersistent_HArray1::Persistent> myGeometries;
-  Reference<>                   myValue;
-  Value<Standard_Boolean>       myIsReversed;
-  Value<Standard_Boolean>       myIsInverted;
-  Value<Standard_Boolean>       myIsVerified;
-  Reference<>                   myPlane;
+  Standard_Integer              myType;
+  Handle(StdLPersistent_HArray1::Persistent) myGeometries;
+  Handle(StdObjMgt_Persistent)  myValue;
+  Standard_Boolean              myIsReversed;
+  Standard_Boolean              myIsInverted;
+  Standard_Boolean              myIsVerified;
+  Handle(StdObjMgt_Persistent)  myPlane;
 };
 
 #endif
index 4a556f2..75a36a1 100644 (file)
 void StdPersistent_DataXtd_PatternStd::Import
   (const Handle(TDataXtd_PatternStd)& theAttribute) const
 {
+  theAttribute->Signature     (mySignature);
+  theAttribute->Axis1Reversed (myAxis1Reversed);
+  theAttribute->Axis2Reversed (myAxis2Reversed);
+
   if (mySignature < 5)
   {
     theAttribute->Axis1 (
index f0a8893..08de381 100644 (file)
@@ -35,16 +35,16 @@ public:
   void Import (const Handle(TDataXtd_PatternStd)& theAttribute) const;
 
 private:
-  Value<Standard_Integer> mySignature;
-  Value<Standard_Boolean> myAxis1Reversed;
-  Value<Standard_Boolean> myAxis2Reversed;
-  Reference<>             myAxis1;
-  Reference<>             myAxis2;
-  Reference<>             myValue1;
-  Reference<>             myValue2;
-  Reference<>             myNb1;
-  Reference<>             myNb2;
-  Reference<>             myMirror;
+  Standard_Integer             mySignature;
+  Standard_Boolean             myAxis1Reversed;
+  Standard_Boolean             myAxis2Reversed;
+  Handle(StdObjMgt_Persistent) myAxis1;
+  Handle(StdObjMgt_Persistent) myAxis2;
+  Handle(StdObjMgt_Persistent) myValue1;
+  Handle(StdObjMgt_Persistent) myValue2;
+  Handle(StdObjMgt_Persistent) myNb1;
+  Handle(StdObjMgt_Persistent) myNb2;
+  Handle(StdObjMgt_Persistent) myMirror;
 };
 
 #endif
diff --git a/src/StdPersistent/StdPersistent_HArray1.cxx b/src/StdPersistent/StdPersistent_HArray1.cxx
deleted file mode 100644 (file)
index 957c7c2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <StdPersistent_HArray1.hxx>
-#include <StdObjMgt_ReadData.hxx>
-
-
-void StdPersistent_HArray1::Shape1::readValue (StdObjMgt_ReadData& theReadData,
-                                               const Standard_Integer theIndex)
-{
-  theReadData.ReadObject (myArray->ChangeValue (theIndex));
-}
index cd0cf96..6b52a17 100644 (file)
 #define _StdPersistent_HArray1_HeaderFile
 
 #include <StdLPersistent_HArray1.hxx>
-#include <StdPersistent_HArray1OfShape1.hxx>
+#include <StdObject_Shape.hxx>
+
+#include <NCollection_DefineHArray1.hxx>
+
+
+DEFINE_HARRAY1 (StdPersistent_HArray1OfShape1,
+                NCollection_Array1<StdObject_Shape>)
 
 
 class StdPersistent_HArray1 : private StdLPersistent_HArray1
 {
 public:
-  class Shape1 : public StdLPersistent_HArray1::base<StdPersistent_HArray1OfShape1>
-  {
-    virtual void readValue (StdObjMgt_ReadData& theReadData,
-                            const Standard_Integer theIndex);
-  };
+  typedef instance<StdPersistent_HArray1OfShape1> Shape1;
 };
 
 #endif
diff --git a/src/StdPersistent/StdPersistent_HArray1OfShape1.hxx b/src/StdPersistent/StdPersistent_HArray1OfShape1.hxx
deleted file mode 100644 (file)
index 31940e7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StdPersistent_HArray1OfShape1_HeaderFile
-#define _StdPersistent_HArray1OfShape1_HeaderFile
-
-
-#include <NCollection_DefineHArray1.hxx>
-#include <StdObject_Shape.hxx>
-
-DEFINE_HARRAY1 (StdPersistent_HArray1OfShape1, NCollection_Array1<StdObject_Shape>)
-
-#endif // _StdPersistent_HArray1OfShape1_HeaderFile
index d239a83..aaf009f 100644 (file)
@@ -68,8 +68,8 @@ void StdPersistent_Naming::Name::Read (StdObjMgt_ReadData& theReadData)
 void StdPersistent_Naming::Name::Import
   (TNaming_Name& theName, const Handle(TDF_Data)&) const
 {
-  theName.Type      (myType);
-  theName.ShapeType (myShapeType);
+  theName.Type      (static_cast<TNaming_NameType> (myType));
+  theName.ShapeType (static_cast<TopAbs_ShapeEnum> (myShapeType));
 
   if (myArgs)
   {
@@ -134,7 +134,7 @@ void StdPersistent_Naming::Name_2::Import
   (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const
 {
   Name_1::Import (theName, theDF);
-  theName.Orientation (myOrientation);
+  theName.Orientation (static_cast<TopAbs_Orientation> (myOrientation));
 }
 
 //=======================================================================
@@ -143,8 +143,8 @@ void StdPersistent_Naming::Name_2::Import
 //=======================================================================
 void StdPersistent_Naming::Naming::ImportAttribute()
 {
-  Handle(Name) aName;
-  if (myData.Cast (aName))
+  Handle(Name) aName = Handle(Name)::DownCast (myData);
+  if (aName)
   {
     aName->Import (myTransient->ChangeName(), myTransient->Label().Data());
     myData.Nullify();
index 90c2cfe..dbfa8d6 100644 (file)
 #include <StdLPersistent_HArray1.hxx>
 #include <StdLPersistent_HString.hxx>
 
-#include <TopAbs_ShapeEnum.hxx>
-#include <TopAbs_Orientation.hxx>
-
-#include <TNaming_NameType.hxx>
-
 #include <TNaming_NamedShape.hxx>
 #include <TNaming_Naming.hxx>
 
@@ -46,10 +41,10 @@ public:
     void Import (const Handle(TNaming_NamedShape)& theAttribute) const;
 
   private:
-    Reference <StdPersistent_HArray1::Shape1> myOldShapes;
-    Reference <StdPersistent_HArray1::Shape1> myNewShapes;
-    Value     <Standard_Integer>              myShapeStatus;
-    Value     <Standard_Integer>              myVersion;
+    Handle(StdPersistent_HArray1::Shape1) myOldShapes;
+    Handle(StdPersistent_HArray1::Shape1) myNewShapes;
+    Standard_Integer                      myShapeStatus;
+    Standard_Integer                      myVersion;
   };
 
   class Name : public StdObjMgt_Persistent
@@ -63,11 +58,11 @@ public:
       (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const;
 
   private:
-    Enum      <TNaming_NameType>                   myType;
-    Enum      <TopAbs_ShapeEnum>                   myShapeType;
-    Reference <StdLPersistent_HArray1::Persistent> myArgs;
-    Reference<>                                    myStop;
-    Value     <Standard_Integer>                   myIndex;
+    Standard_Integer                           myType;
+    Standard_Integer                           myShapeType;
+    Handle(StdLPersistent_HArray1::Persistent) myArgs;
+    Handle(StdObjMgt_Persistent)               myStop;
+    Standard_Integer                           myIndex;
   };
 
   class Name_1 : public Name
@@ -81,7 +76,7 @@ public:
       (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const;
 
   private:
-    Reference<StdLPersistent_HString::Ascii> myContextLabel;
+    Handle(StdLPersistent_HString::Ascii) myContextLabel;
   };
 
   class Name_2 : public Name_1
@@ -95,7 +90,7 @@ public:
       (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const;
 
   private:
-    Enum<TopAbs_Orientation> myOrientation;
+    Standard_Integer myOrientation;
   };
 
   class Naming : public StdObjMgt_Attribute<TNaming_Naming>::SingleRef
index b288732..672f9ba 100644 (file)
@@ -37,12 +37,12 @@ public:
     void Import (const Handle(TDataXtd_Presentation)& theAttribute) const;
 
   private:
-    Value<Standard_Boolean> myIsDisplayed;
-    Reference<>             myDriverGUID;
-    Value<Standard_Real>    myTransparency;
-    Value<Standard_Integer> myColor;
-    Value<Standard_Integer> myMaterial;
-    Value<Standard_Real>    myWidth;
+    Standard_Boolean             myIsDisplayed;
+    Handle(StdObjMgt_Persistent) myDriverGUID;
+    Standard_Real                myTransparency;
+    Standard_Integer             myColor;
+    Standard_Integer             myMaterial;
+    Standard_Real                myWidth;
   };
 
   class AISPresentation_1 : public AISPresentation
@@ -59,7 +59,7 @@ public:
     void Import (const Handle(TDataXtd_Presentation)& theAttribute) const;
 
   private:
-    Value<Standard_Integer> myMode;
+    Standard_Integer myMode;
   };
 };
 
index 00ffcda..3f26abc 100644 (file)
@@ -13,9 +13,7 @@
 
 #include <StdPersistent_TopLoc.hxx>
 #include <StdObjMgt_ReadData.hxx>
-#include <StdObject_gp.hxx>
-
-#include <gp_Trsf.hxx>
+#include <StdObject_gp_Trsfs.hxx>
 
 
 //=======================================================================
@@ -24,7 +22,7 @@
 //=======================================================================
 void StdPersistent_TopLoc::Datum3D::Read (StdObjMgt_ReadData& theReadData)
 {
-  StdObject_gp::Object<gp_Trsf> aTrsf;
+  gp_Trsf aTrsf;
   theReadData >> aTrsf;
   myTransient = new TopLoc_Datum3D (aTrsf);
 }
index 891921f..96804d2 100644 (file)
@@ -43,9 +43,9 @@ public:
     Standard_EXPORT TopLoc_Location Import() const;
 
   private:
-    Reference<Datum3D>         myDatum;
-    Value<Standard_Integer>    myPower;
-    Object<StdObject_Location> myNext;
+    Handle(Datum3D)    myDatum;
+    Standard_Integer   myPower;
+    StdObject_Location myNext;
   };
 };
 
index 5fc3d80..79bf9b9 100644 (file)
 class StdPersistent_TopoDS : protected StdObjMgt_SharedObject
 {
 protected:
-  class pTShape : public PersistentBase
+  class pTShape : public Standard_Transient
   {
   public:
     inline void Read (StdObjMgt_ReadData& theReadData)
       { theReadData >> myShapes >> myFlags; }
 
   protected:
-    Reference<>             myShapes;
-    Value<Standard_Integer> myFlags;
+    Handle(StdObjMgt_Persistent) myShapes;
+    Standard_Integer             myFlags;
   };
 
 public:
index 6d5a70e..893f136 100644 (file)
@@ -1,4 +1,3 @@
 StdLDrivers
-StdLObject
 StdLPersistent
 StdObjMgt
diff --git a/tests/caf/bugs/D2 b/tests/caf/bugs/D2
new file mode 100644 (file)
index 0000000..1d1fedb
--- /dev/null
@@ -0,0 +1,333 @@
+puts "==========="
+puts "0027241: Create a complete test case to verify reading of all attribute types from MDTV-Standard document"
+puts "==========="
+puts ""
+
+# Set Create_Doc to 1 to generate the document (using OCCT 6.9.1 or earlier)
+set Create_Doc 0
+
+set test_file_name bug27241_ocaf_all_attributes.std
+
+set test_name "OCC26961"
+set test_int 123
+set test_real 123.456e-7
+set test_int_arr {10 20}
+set test_real_arr {1.1 3.14 5.4e18}
+set test_extstr_arr {"sample string 1" "string 2"}
+set test_bool_arr {0 1}
+set test_ref_arr {"0:1:2:3:2" "0:1:2:3:1"}
+set test_byte_arr {15 25}
+set test_map {1 5 2 10}
+set test_map_sorted {1 2 5 10}
+set test_named_ints {i1 1 i2 2}
+set test_named_reals {r1 1.1 r2 2.2}
+set test_named_strings {s1 string1 s2 string2}
+set test_named_bytes {b1 65 b2 66}
+set test_ref "0:1:1"
+set test_guid "00000000-0000-0000-2222-000000000000"
+set test_comment "Sample document containing various attributes"
+set test_string "Sample string"
+set test_expr "2*pi*r"
+set test_var1 "0:1:2:3:2"
+set test_var2 "0:1:2:3:1"
+set test_point "111 222 333"
+set test_axisPos "10 10 30"
+set test_axisDir "11 22 33"
+set test_plane "15 25 35"
+set test_boxXYZ "10 20 30"
+set test_boxDX 100
+set test_boxDY 200
+set test_boxDZ 300
+set test_geom_t "cir"
+set test_failure 1
+set test_driver "G"
+set test_driver_id "2a96b604-ec8b-11d0-bee7-080009dc3333"
+set test_transp 0.5
+set test_color 11
+set test_material 22
+set test_positionX 100
+set test_positionY 200
+set test_positionZ 300
+
+proc checkarray {name array expected} {
+  set exp_len [llength $expected]
+  if {$exp_len != [llength $array]} {puts "Error: invalid $name"; return}
+  for {set i 0} {$i < $exp_len} {incr i} {
+    if {[lindex $array $i] != [lindex $expected $i]} {puts "Error: invalid $name"}
+  }
+}
+
+pload TOPTEST
+
+catch {Close D}
+
+# Normal test execution
+if !$Create_Doc {
+
+  # Load document
+  Open [locate_data_file $test_file_name] D
+
+
+  # Simple values
+  if [catch {GetInteger D 0:1:1 i}] {puts "Error: Integer not found"
+  } elseif {[dval i] != $test_int} {puts "Error: invalid Integer"}
+
+  if [catch {GetReal D 0:1:1 r}] {puts "Error: Real not found"
+  } elseif {[dval r] != $test_real} {puts "Error: invalid Real"}
+
+  if [catch {set name [GetName D 0:1:1]}] {puts "Error: Name not found"
+  } elseif {$name != $test_name} {puts "Error: invalid Name"}
+
+  if [catch {set comment [GetComment D 0:1:1]}] {puts "Error: Comment not found"
+  } elseif {$comment != $test_comment} {puts "Error: invalid Comment"}
+
+  if [catch {set string [GetAsciiString D 0:1:1]}] {puts "Error: AsciiString not found"}
+
+
+  # TagSource
+  if [catch {NewTag D 0:1:2}] {puts "Error: TagSource not found"}
+
+  
+  # Reference
+  if [catch {set ref [GetReference D 0:1:3]}] {puts "Error: Reference not found"
+  } elseif {[string compare $ref $test_ref] != 0} {puts "Error: invalid Reference"}
+
+
+  # Directory
+  if [catch {AddDirectory D 0:1:2:1}] {puts "Error: Directory not found"}
+
+
+  # UAttribute
+  if [catch {set guid [GetUAttribute D 0:1:2:2 $test_guid]}] {puts "Error: no label for UAttribute"
+  } elseif {$guid == "No UAttribute Attribute on label"} {puts "Error: $guid"
+  } elseif {$guid != $test_guid} {puts "Error: invalid UAttribute"}
+
+
+  # Variable
+  if [regexp "no such attribute" [GetVariable D $test_var2 is_const units]] {puts "Error: Variable not found"
+  } elseif {$is_const != 0 || $units != "mm"} {puts "Error: invalid Variable"}
+
+
+  # Relation
+  if [catch {set rel_dump [DumpRelation D 0:1:2:3]}] {puts "Error: Relation not found"
+  } elseif ![regexp "$test_expr.*$test_var1 $test_var2" $rel_dump] {
+      puts "Error: invalid Relation"}
+
+
+  # TreeNode
+  if [catch {set root_node [RootNode D 0:1:2:4]}] {puts "Error: TreeNode not found"
+  } elseif {$root_node != "0:1:2:4"} {puts "Error: invalid TreeNode"}
+
+
+  # Arrays
+  if [catch {set iarr [GetIntArray D 0:1:1]}] {puts "Error: IntegerArray not found"
+  } else { checkarray "IntegerArray" $iarr $test_int_arr }
+
+  if [catch {set rarr [GetRealArray D 0:1:1]}] {puts "Error: RealArray not found"
+  } else { checkarray "RealArray" $rarr $test_real_arr }
+
+  if [catch {set esarr [GetExtStringArray D 0:1:1]}] {puts "Error: ExtStringArray not found"
+  } else { checkarray "ExtStringArray" $esarr [join $test_extstr_arr " "]}
+
+  if [catch {set boolarr [GetBooleanArray D 0:1:1]}] {puts "Error: BooleanArray not found"
+  } else { checkarray "BooleanArray" $boolarr $test_bool_arr }
+
+  if [catch {set refarr [GetRefArray D 0:1:1]}] {puts "Error: ReferenceArray not found"
+  } else { checkarray "ReferenceArray" $refarr $test_ref_arr }
+
+  if [catch {set bytearr [GetByteArray D 0:1:1]}] {puts "Error: ByteArray not found"
+  } else { checkarray "ByteArray" $bytearr $test_byte_arr }
+
+
+  # Lists
+  if [catch {set ilst [GetIntegerList D 0:1:1]}] {puts "Error: IntegerList not found"
+  } else { checkarray "IntegerList" $ilst $test_int_arr }
+
+  if [catch {set rlst [GetRealList D 0:1:1]}] {puts "Error: RealList not found"
+  } else { checkarray "RealList" $rlst $test_real_arr }
+
+  if [catch {set eslst [GetExtStringList D 0:1:1]}] {puts "Error: ExtStringList not found"
+  } else { checkarray "ExtStringList" $eslst [join $test_extstr_arr " "]}
+
+  if [catch {set blst [GetBooleanList D 0:1:1]}] {puts "Error: BooleanList not found"
+  } else { checkarray "BooleanList" $blst $test_bool_arr }
+
+  if [catch {set reflst [GetReferenceList D 0:1:1]}] {puts "Error: ReferenceList not found"
+  } else { checkarray "ReferenceList" $reflst $test_ref_arr }
+
+
+  # IntPackedMap
+  if [catch {set map [GetIntPackedMap D 0:1:1]}] {puts "Error: IntPackedMap not found"
+  } else { checkarray "IntPackedMap" $map $test_map_sorted }
+
+
+  # NamedData
+  if [catch {GetNDIntegers   D 0:1:4}] {puts "Error: NamedData not found"}
+  if [catch {GetNDReals      D 0:1:4}] {puts "Error: NamedData not found"}
+  if [catch {GetNDStrings    D 0:1:4}] {puts "Error: NamedData not found"}
+  if [catch {GetNDBytes      D 0:1:4}] {puts "Error: NamedData not found"}
+  if [catch {GetNDIntArrays  D 0:1:4}] {puts "Error: NamedData not found"}
+  if [catch {GetNDRealArrays D 0:1:4}] {puts "Error: NamedData not found"}
+
+
+  # NamedShape
+  eval box Box $test_boxXYZ $test_boxDX $test_boxDY $test_boxDZ
+  if [catch {GetShape D 0:1:6 b}] {puts "Error: NamedShape not found"
+  } elseif {[bounding b] != [bounding Box]} {puts "Error: invalid NamedShape"
+  } else {
+    checkshape b
+    checkprops b -l [expr $test_boxDX * 8 + $test_boxDY * 8 + $test_boxDZ * 8]
+    checkprops b -s [expr $test_boxDX * $test_boxDY * 2 + $test_boxDY * $test_boxDZ * 2 + $test_boxDX * $test_boxDZ * 2]
+    checkprops b -v [expr $test_boxDX * $test_boxDY * $test_boxDZ]
+  }
+
+
+  # Point, Axis, Plane
+  if [catch {GetPoint D 0:1:5:1 pnt}] {puts "Error: Point not found"}
+  if [catch {GetAxis  D 0:1:5:2 axs}] {puts "Error: Axis not found"}
+  if [catch {GetPlane D 0:1:5:3 pln}] {puts "Error: Plane not found"}
+
+
+  # Geometry
+  if [catch {set geom_t [GetGeometryType D 0:1:6]}] {puts "Error: Geometry not found"
+  } elseif {$geom_t != $test_geom_t} { puts "Error: invalid Geometry" }
+
+
+  # Constraint
+  if [catch {set constraint [GetConstraint D 0:1:1]}] {puts "Error: Constraint not found"
+  } elseif {$constraint != "0:1:1 COINCIDENT G_1 (0:1:6) "} { puts "Error: invalid Constraint" }
+
+
+  # PatternStd
+  if [catch {set pattern [DumpPattern D 0:1:1]}] {puts "Error: PatternStd not found"
+  } elseif {$pattern != "0:1:1 signature = 5 Mirror (0:1:6)"} { puts "Error: invalid PatternStd" }
+
+
+  # Function
+  if [catch {GetFunction D 0:1:1 fguid failure}] {puts "Error: Function not found"
+  } elseif {$fguid != $test_guid || $failure != $test_failure} { puts "Error: invalid Function" }
+
+
+  # AISPresentation
+  AISInitViewer D
+  if       [catch {set driver   [AISDriver       D 0:1:1]}] {puts "Error: AISPresentation not found"
+  } elseif [catch {set transp   [AISTransparency D 0:1:1]}] {puts "Error: AISPresentation not found"
+  } elseif [catch {set color    [AISColor        D 0:1:1]}] {puts "Error: AISPresentation not found"
+  } elseif [catch {set material [AISMaterial     D 0:1:1]}] {puts "Error: AISPresentation not found"
+  } elseif {$driver != $test_driver_id}                          { puts "Error: invalid AISPresentation"
+  } elseif {[lindex [split $transp   "\n"] 1] != $test_transp}   { puts "Error: invalid AISPresentation"
+  } elseif {[lindex [split $color    "\n"] 1] != $test_color}    { puts "Error: invalid AISPresentation"
+  } elseif {[lindex [split $material "\n"] 1] != $test_material} { puts "Error: invalid AISPresentation" }
+
+
+  # Position
+  if [catch {GetPosition D 0:1:1 posX posY posZ}] {puts "Error: Position not found"
+  } elseif {$posX != $test_positionX} { puts "Error: invalid Position"
+  } elseif {$posY != $test_positionY} { puts "Error: invalid Position"
+  } elseif {$posZ != $test_positionZ} { puts "Error: invalid Position" }
+
+} else {
+
+  # Creation of the document to be used in normal execution.
+  # Note! This will work only on OCCT versions older than 7.0,
+  # as since 7.0 there is no more storage driver for old persistence.
+
+  puts "Creating document"
+  NewDocument D MDTV-Standard
+
+  # Simple values
+  SetInteger     D 0:1:1 $test_int
+  SetReal        D 0:1:1 $test_real
+  SetName        D 0:1:1 $test_name
+  SetComment     D 0:1:1 $test_comment
+  SetAsciiString D 0:1:1 $test_string
+
+  # TagSource
+  SetTagger D 0:1:2
+  
+  # Reference
+  SetReference D 0:1:3 $test_ref
+  
+  # Directory
+  NewDirectory D 0:1:2:1
+
+  # UAttribute
+  SetUAttribute D 0:1:2:2 $test_guid
+
+  # Variable
+  SetVariable D $test_var2 0 mm
+  SetVariable D $test_var1 1 ""
+
+  # Relation
+  SetRelation D 0:1:2:3 "2*pi*r" $test_var1 $test_var2
+
+  # TreeNode
+  SetNode D 0:1:2:4
+
+  # Arrays
+  eval SetIntArray       D 0:1:1 1 1 2 $test_int_arr
+  eval SetRealArray      D 0:1:1 1 1 3 $test_real_arr
+  eval SetExtStringArray D 0:1:1 1 1 2 $test_extstr_arr
+  eval SetBooleanArray   D 0:1:1 1 1 2 $test_bool_arr
+  eval SetRefArray       D 0:1:1   1 2 $test_ref_arr
+  eval SetByteArray      D 0:1:1 1 1 2 $test_byte_arr
+
+  # Lists
+  eval SetIntegerList   D 0:1:1 $test_int_arr
+  eval SetRealList      D 0:1:1 $test_real_arr
+  eval SetExtStringList D 0:1:1 $test_extstr_arr
+  eval SetBooleanList   D 0:1:1 $test_bool_arr
+  eval SetReferenceList D 0:1:1 $test_ref_arr
+
+  # IntPackedMap
+  eval SetIntPackedMap  D 0:1:1 1 $test_map
+
+  # NamedData
+  eval SetNDataIntegers   D 0:1:4 2 $test_named_ints
+  eval SetNDataReals      D 0:1:4 2 $test_named_reals
+  eval SetNDataStrings    D 0:1:4 2 $test_named_strings
+  eval SetNDataBytes      D 0:1:4 2 $test_named_bytes
+  eval SetNDataIntArrays  D 0:1:4 ia 2 $test_int_arr
+  eval SetNDataRealArrays D 0:1:4 ra 3 $test_real_arr
+
+  # NamedShape  
+  eval box Box $test_boxXYZ $test_boxDX $test_boxDY $test_boxDZ
+  SetShape D 0:1:6 Box
+
+  # Point
+  eval point Point $test_point
+  SetPoint D 0:1:5:1 Point
+
+  # Axis
+  eval line Axis $test_axisPos $test_axisDir
+  SetAxis D 0:1:5:2 Axis
+
+  # Plane
+  eval plane Plane $test_plane
+  SetPlane D 0:1:5:3 Plane
+
+  # Geometry
+  SetGeometry D 0:1:6 $test_geom_t
+
+  # Constraint
+  SetConstraint D 0:1:1 equal 0:1:6
+
+  # PatternStd
+  SetPattern D 0:1:1 5 0:1:6
+
+  # Function
+  SetFunction D 0:1:1 $test_guid $test_failure
+
+  # AISPresentation
+  AISInitViewer D
+  AISSet          D 0:1:1 $test_driver
+  AISTransparency D 0:1:1 $test_transp
+  AISColor        D 0:1:1 $test_color
+  AISMaterial     D 0:1:1 $test_material
+
+  # Position
+  SetPosition D 0:1:1 $test_positionX $test_positionY $test_positionZ
+
+  SaveAs D $imagedir/ocaf_all_attributes.std
+  puts "Document saved to $imagedir/$test_file_name"
+}
index 29a3f88..452c6d1 100644 (file)
@@ -1,5 +1,6 @@
 SKIPPED /Tcl Exception: .*[fF]ile .* could not be found/ data file is missing
 IGNORE /Tcl Exception: [*][*] Exception [*][*]/ duplicate report on exception on Tcl level
+IGNORE /Relative error of mass computation :/ diagnostic message of *props* commands
 FAILED /\b[Ee]xception\b/ exception
 FAILED /\b[Ee][Rr][Rr][Oo][Rr]\b/ error
-FAILED /Process killed by CPU limit/ Killed by CPU limit
\ No newline at end of file
+FAILED /Process killed by CPU limit/ Killed by CPU limit