n FWOSDriver
n PCDM
n StdLDrivers
-n StdLObject
n StdLPersistent
n StdObjMgt
n StdDrivers
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";
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
#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");
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
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
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());
}
//=======================================================================
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;
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
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
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
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
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
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
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
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);
}
//=======================================================================
#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;
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
virtual Handle(BRep_PointRepresentation) import() const;
private:
- Reference<ShapePersistent_Geom::Curve> myCurve;
+ Handle(ShapePersistent_Geom::Curve) myCurve;
};
class PointsOnSurface : public PointRepresentation
virtual void Read (StdObjMgt_ReadData& theReadData);
protected:
- Reference<ShapePersistent_Geom::Surface> mySurface;
+ Handle(ShapePersistent_Geom::Surface) mySurface;
};
class PointOnCurveOnSurface : public PointsOnSurface
virtual Handle(BRep_PointRepresentation) import() const;
private:
- Reference<ShapePersistent_Geom2d::Curve> myPCurve;
+ Handle(ShapePersistent_Geom2d::Curve) myPCurve;
};
class PointOnSurface : public PointsOnSurface
virtual Handle(BRep_PointRepresentation) import() const;
private:
- Value<Standard_Real> myParameter2;
+ Standard_Real myParameter2;
};
class CurveRepresentation : public StdObjMgt_Persistent
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
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
virtual Handle(BRep_CurveRepresentation) import() const;
private:
- Reference<ShapePersistent_Geom::Curve> myCurve3D;
+ Handle(ShapePersistent_Geom::Curve) myCurve3D;
};
class CurveOnSurface : public GCurve
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
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
virtual Handle(BRep_CurveRepresentation) import() const;
private:
- Reference<ShapePersistent_Poly::Polygon3D> myPolygon3D;
+ Handle(ShapePersistent_Poly::Polygon3D) myPolygon3D;
};
class PolygonOnTriangulation : public CurveRepresentation
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
virtual Handle(BRep_CurveRepresentation) import() const;
private:
- Reference<ShapePersistent_Poly::PolygonOnTriangulation> myPolygon2;
+ Handle(ShapePersistent_Poly::PolygonOnTriangulation) myPolygon2;
};
class PolygonOnSurface : public CurveRepresentation
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
virtual Handle(BRep_CurveRepresentation) import() const;
private:
- Reference<ShapePersistent_Poly::Polygon2D> myPolygon2;
+ Handle(ShapePersistent_Poly::Polygon2D) myPolygon2;
};
class CurveOn2Surfaces : public CurveRepresentation
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:
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
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
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:
// commercial license or contractual agreement.
#include <ShapePersistent_Geom.hxx>
+#include <StdObject_gp_Axes.hxx>
+#include <StdObject_gp_Vectors.hxx>
//=======================================================================
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;
#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>
};
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 {};
//! 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);
}
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
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
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
virtual Handle(Geom2d_Curve) Import() const;
private:
- Reference<Curve> myBasisCurve;
- Value<Standard_Real> myOffsetValue;
+ Handle(Curve) myBasisCurve;
+ Standard_Real myOffsetValue;
};
public:
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
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
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
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:
{
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 {};
virtual Handle(Geom_Surface) Import() const;
private:
- StdObject_gp::Object<gp_Pnt> myLocation;
+ gp_Pnt myLocation;
};
typedef pBase pBounded;
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
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
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
virtual Handle(Geom_Surface) Import() const;
private:
- Reference<Surface> myBasisSurface;
- Value<Standard_Real> myOffsetValue;
+ Handle(Surface) myBasisSurface;
+ Standard_Real myOffsetValue;
};
public:
+++ /dev/null
-// 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>;
#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;
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
+++ /dev/null
-// 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>;
#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;
#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>
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>
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:
class ShapePersistent_Poly : private StdObjMgt_SharedObject
{
- class pPolygon2D : public PersistentBase
+ class pPolygon2D : public Standard_Transient
{
public:
inline void Read (StdObjMgt_ReadData& theReadData)
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)
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)
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)
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>
//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
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());
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())
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:
//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());
}
//=======================================================================
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))
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;
+++ /dev/null
-StdLObject_GUID.cxx
-StdLObject_GUID.hxx
+++ /dev/null
-// 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]);
-}
+++ /dev/null
-// 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
StdLPersistent_Document.cxx
StdLPersistent_Document.hxx
StdLPersistent_Function.hxx
-StdLPersistent_HArray1OfPersistent.hxx
StdLPersistent_HArray1.cxx
StdLPersistent_HArray1.hxx
StdLPersistent_HArray2.cxx
//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 =
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());
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;
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)
#include <TDataStd_IntPackedMap.hxx>
-class StdLPersistent_Collection : private StdObjMgt_ContentTypes
+class StdLPersistent_Collection
{
// Converters
struct noConversion;
const;
protected:
- Value<Standard_Integer> myLower;
- Value<Standard_Integer> myUpper;
+ Standard_Integer myLower;
+ Standard_Integer myUpper;
};
template <class Base>
Standard_EXPORT virtual void ImportAttribute();
private:
- Value<Standard_Boolean> myDelta;
+ Standard_Boolean myDelta;
};
{
public:
//! Start parsing a persistent data.
- Parser (const TColStd_HArray1OfInteger& theLabels,
+ Parser (const TColStd_HArray1OfInteger& theLabels,
const StdLPersistent_HArray1OfPersistent& theAttributes)
: myLabelsIter (theLabels)
, myAttribIter (theAttributes) {}
}
private:
- TColStd_HArray1OfInteger ::Iterator myLabelsIter;
+ TColStd_HArray1OfInteger ::Iterator myLabelsIter;
StdLPersistent_HArray1OfPersistent::Iterator myAttribIter;
};
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
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:
(const Handle(TDocStd_Document)& theDocument) const;
private:
- Reference<StdLPersistent_Data> myData;
+ Handle(StdLPersistent_Data) myData;
};
#endif
#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>
}
private:
- Object<StdLObject_GUID> myDriverGUID;
- Value<Standard_Integer> myFailure;
+ Standard_GUID myDriverGUID;
+ Standard_Integer myFailure;
};
#endif
// 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<> >;
#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>
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.
protected:
template <class ArrayClass>
- class base : public commonBase
+ class instance : public base
{
public:
typedef Handle(ArrayClass) ArrayHandle;
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
+++ /dev/null
-// 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
// 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>;
#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.
protected:
template <class ArrayClass>
- class base : public commonBase
+ class instance : public base
{
public:
typedef Handle(ArrayClass) ArrayHandle;
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
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();
}
//=======================================================================
#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
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
}
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.
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
#include <StdObjMgt_Attribute.hxx>
#include <TDataStd_Real.hxx>
-#include <TDataStd_RealEnum.hxx>
class StdLPersistent_Real : public StdObjMgt_Attribute<TDataStd_Real>
//! 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
#define _StdLPersistent_TreeNode_HeaderFile
#include <StdObjMgt_Attribute.hxx>
-#include <StdLObject_GUID.hxx>
#include <TDataStd_TreeNode.hxx>
+#include <Standard_GUID.hxx>
class StdLPersistent_TreeNode
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
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();
}
return this->myTransient;
- }
+}
template class StdLPersistent_Value::integer <TDataStd_Integer>;
}
private:
- Value <Standard_Boolean> myIsConstant;
- Reference <StdLPersistent_HString::Ascii> myUnit;
+ Standard_Boolean myIsConstant;
+ Handle(StdLPersistent_HString::Ascii) myUnit;
};
#endif
}
private:
- Reference<StdLPersistent_HString::Ascii> myDocEntry;
- Reference<StdLPersistent_HString::Ascii> myLabEntry;
+ Handle(StdLPersistent_HString::Ascii) myDocEntry;
+ Handle(StdLPersistent_HString::Ascii) myLabEntry;
};
#endif
StdObjMgt_Attribute.hxx
-StdObjMgt_ContentTypes.hxx
StdObjMgt_MapOfInstantiators.cxx
StdObjMgt_MapOfInstantiators.hxx
StdObjMgt_Persistent.cxx
//! 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
{
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>
+++ /dev/null
-// 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
#include <Standard.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Transient.hxx>
-#include <StdObjMgt_ContentTypes.hxx>
#include <TDF_Label.hxx>
//! 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.
#include <StdObjMgt_ReadData.hxx>
#include <StdObjMgt_Persistent.hxx>
+#include <Standard_GUID.hxx>
+
StdObjMgt_ReadData::StdObjMgt_ReadData
(Storage_BaseDriver& theDriver, const Standard_Integer theNumberOfObjects)
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;
+}
#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)
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
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;
-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
//=======================================================================
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();
}
#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
aShape.TShape (myTShape->Import());
aShape.Location (myLocation.Import());
- aShape.Orientation (myOrient);
+ aShape.Orientation (static_cast<TopAbs_Orientation> (myOrient));
return aShape;
}
#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
+++ /dev/null
-// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
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
//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
#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>
#include <TDataXtd_Position.hxx>
-class StdPersistent_DataXtd : private StdObjMgt_ContentTypes
+class StdPersistent_DataXtd
{
class _void : private StdLPersistent_Void
{
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.
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);
#include <StdLPersistent_HArray1.hxx>
#include <TDataXtd_Constraint.hxx>
-#include <TDataXtd_ConstraintEnum.hxx>
class StdPersistent_DataXtd_Constraint
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
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 (
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
+++ /dev/null
-// 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));
-}
#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
+++ /dev/null
-// 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
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)
{
(TNaming_Name& theName, const Handle(TDF_Data)& theDF) const
{
Name_1::Import (theName, theDF);
- theName.Orientation (myOrientation);
+ theName.Orientation (static_cast<TopAbs_Orientation> (myOrientation));
}
//=======================================================================
//=======================================================================
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();
#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>
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
(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
(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
(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
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
void Import (const Handle(TDataXtd_Presentation)& theAttribute) const;
private:
- Value<Standard_Integer> myMode;
+ Standard_Integer myMode;
};
};
#include <StdPersistent_TopLoc.hxx>
#include <StdObjMgt_ReadData.hxx>
-#include <StdObject_gp.hxx>
-
-#include <gp_Trsf.hxx>
+#include <StdObject_gp_Trsfs.hxx>
//=======================================================================
//=======================================================================
void StdPersistent_TopLoc::Datum3D::Read (StdObjMgt_ReadData& theReadData)
{
- StdObject_gp::Object<gp_Trsf> aTrsf;
+ gp_Trsf aTrsf;
theReadData >> aTrsf;
myTransient = new TopLoc_Datum3D (aTrsf);
}
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;
};
};
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:
StdLDrivers
-StdLObject
StdLPersistent
StdObjMgt
--- /dev/null
+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"
+}
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