1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

43
src/BinMXCAFDoc/BinMXCAFDoc.cdl Executable file
View File

@@ -0,0 +1,43 @@
-- File: BinMXCAFDoc.cdl
-- Created: Mon Apr 18 17:43:47 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
package BinMXCAFDoc
uses
BinMDF,
BinObjMgt,
TopLoc,
CDM,
TDF,
BinTools
is
class AreaDriver;
class CentroidDriver;
class ColorDriver;
class GraphNodeDriver;
class LocationDriver;
class VolumeDriver;
class DatumDriver;
class DimTolDriver;
class MaterialDriver;
class ColorToolDriver;
class DocumentToolDriver;
class LayerToolDriver;
class ShapeToolDriver;
class DimTolToolDriver;
class MaterialToolDriver;
AddDrivers (theDriverTable : ADriverTable from BinMDF;
theMsgDrv : MessageDriver from CDM);
---Purpose: Adds the attribute drivers to <theDriverTable>.
end;

62
src/BinMXCAFDoc/BinMXCAFDoc.cxx Executable file
View File

@@ -0,0 +1,62 @@
// File: BinMXCAFDoc.cxx
// Created: Mon Apr 18 17:45:27 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc.ixx>
#include <BinMXCAFDoc_AreaDriver.hxx>
#include <BinMXCAFDoc_CentroidDriver.hxx>
#include <BinMXCAFDoc_ColorDriver.hxx>
#include <BinMXCAFDoc_GraphNodeDriver.hxx>
#include <BinMXCAFDoc_LocationDriver.hxx>
#include <BinMXCAFDoc_VolumeDriver.hxx>
#include <BinMXCAFDoc_DatumDriver.hxx>
#include <BinMXCAFDoc_DimTolDriver.hxx>
#include <BinMXCAFDoc_MaterialDriver.hxx>
#include <BinMXCAFDoc_ColorToolDriver.hxx>
#include <BinMXCAFDoc_DocumentToolDriver.hxx>
#include <BinMXCAFDoc_LayerToolDriver.hxx>
#include <BinMXCAFDoc_ShapeToolDriver.hxx>
#include <BinMXCAFDoc_DimTolToolDriver.hxx>
#include <BinMXCAFDoc_MaterialToolDriver.hxx>
#include <BinMNaming_NamedShapeDriver.hxx>
#include <TNaming_NamedShape.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
const Handle(CDM_MessageDriver)& theMsgDrv) {
theDriverTable->AddDriver( new BinMXCAFDoc_AreaDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_CentroidDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ColorDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_GraphNodeDriver(theMsgDrv));
//oan: changes for sharing locations map
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver;
theDriverTable->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aNamedShapeDriver);
Handle(BinMXCAFDoc_LocationDriver) aLocationDriver = new BinMXCAFDoc_LocationDriver (theMsgDrv);
if( !aNamedShapeDriver.IsNull() )
{
aLocationDriver->SetSharedLocations( &(aNamedShapeDriver->GetShapesLocations()) );
}
theDriverTable->AddDriver( aLocationDriver);
theDriverTable->AddDriver( new BinMXCAFDoc_VolumeDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_DatumDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_DimTolDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ColorToolDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_DocumentToolDriver(theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_LayerToolDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ShapeToolDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_DimTolToolDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_MaterialToolDriver(theMsgDrv));
}

View File

@@ -0,0 +1,32 @@
-- File: BinMXCAFDoc_AreaDriver.cdl
-- Created: Tue May 17 09:39:56 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class AreaDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable AreaDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,53 @@
// File: BinMXCAFDoc_AreaDriver.cxx
// Created: Tue May 17 09:45:48 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_AreaDriver.ixx>
#include <XCAFDoc_Area.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_AreaDriver::BinMXCAFDoc_AreaDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Area)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_AreaDriver::NewEmpty() const {
return new XCAFDoc_Area();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_AreaDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& ) const
{
Handle(XCAFDoc_Area) anAtt = Handle(XCAFDoc_Area)::DownCast(theTarget);
Standard_Real aValue;
Standard_Boolean isOk = theSource >> aValue;
if(isOk)
anAtt->Set(aValue);
return isOk;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_AreaDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& ) const
{
Handle(XCAFDoc_Area) anAtt = Handle(XCAFDoc_Area)::DownCast(theSource);
theTarget << anAtt->Get();
}

View File

@@ -0,0 +1,32 @@
-- File: BinMXCAFDoc_CentroidDriver.cdl
-- Created: Tue May 17 14:18:00 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class CentroidDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable CentroidDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,56 @@
// File: BinMXCAFDoc_CentroidDriver.cxx
// Created: Tue May 17 14:20:54 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_CentroidDriver.ixx>
#include <XCAFDoc_Centroid.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_CentroidDriver::BinMXCAFDoc_CentroidDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Centroid)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_CentroidDriver::NewEmpty() const {
return new XCAFDoc_Centroid();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_CentroidDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Centroid) anAtt = Handle(XCAFDoc_Centroid)::DownCast(theTarget);
Standard_Real x, y, z;
Standard_Boolean isOk = theSource >> x >> y >> z;
if(isOk) {
gp_Pnt aPnt(x, y, z);
anAtt->Set(aPnt);
}
return isOk;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_CentroidDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Centroid) anAtt = Handle(XCAFDoc_Centroid)::DownCast(theSource);
gp_Pnt aPnt = anAtt->Get();
theTarget << aPnt.X() << aPnt.Y() << aPnt.Z();
}

View File

@@ -0,0 +1,32 @@
-- File: BinMXCAFDoc_ColorDriver.cdl
-- Created: Tue May 17 14:32:54 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class ColorDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable ColorDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,55 @@
// File: BinMXCAFDoc_ColorDriver.cxx
// Created: Tue May 17 14:34:24 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_ColorDriver.ixx>
#include <XCAFDoc_Color.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_ColorDriver::BinMXCAFDoc_ColorDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Color)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_ColorDriver::NewEmpty() const {
return new XCAFDoc_Color();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_ColorDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Color) anAtt = Handle(XCAFDoc_Color)::DownCast(theTarget);
Standard_Real R, G, B;
Standard_Boolean isOk = theSource >> R >> G >> B;
if(isOk) {
anAtt->Set(R, G, B);
}
return isOk;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_ColorDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Color) anAtt = Handle(XCAFDoc_Color)::DownCast(theSource);
Standard_Real R, G, B;
anAtt->GetRGB(R, G, B);
theTarget << R << G << B;
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_ColorToolDriver.cdl
-- Created: Tue May 17 12:25:51 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class ColorToolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable ColorToolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,45 @@
// File: BinMXCAFDoc_ColorToolDriver.cxx
// Created: Tue May 17 12:29:31 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_ColorToolDriver.ixx>
#include <XCAFDoc_ColorTool.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_ColorToolDriver::BinMXCAFDoc_ColorToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_ColorTool)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_ColorToolDriver::NewEmpty() const {
return new XCAFDoc_ColorTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_ColorToolDriver::Paste(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_ColorToolDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const {
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_DatumDriver.cdl
-- Created: Wed Dec 10 13:02:14 2008
-- Author: Pavel TELKOV
-- <ptv@valenox>
---Copyright: Open CASCADE 2008
class DatumDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable DatumDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,74 @@
// File: BinMXCAFDoc_DatumDriver.cxx
// Created: 10.12.08 13:15:38
// Author: Pavel TELKOV
// Copyright: Open CASCADE 2008
#include <BinMXCAFDoc_DatumDriver.ixx>
#include <XCAFDoc_Datum.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
BinMXCAFDoc_DatumDriver::BinMXCAFDoc_DatumDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Datum)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_DatumDriver::NewEmpty() const
{
return new XCAFDoc_Datum();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_DatumDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Datum) anAtt = Handle(XCAFDoc_Datum)::DownCast(theTarget);
TCollection_AsciiString aName, aDescr, anId;
if ( !(theSource >> aName >> aDescr >> anId) )
return Standard_False;
anAtt->Set(new TCollection_HAsciiString( aName ),
new TCollection_HAsciiString( aDescr ),
new TCollection_HAsciiString( anId ));
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void BinMXCAFDoc_DatumDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Datum) anAtt = Handle(XCAFDoc_Datum)::DownCast(theSource);
if ( !anAtt->GetName().IsNull() )
theTarget << anAtt->GetName()->String();
else
theTarget << TCollection_AsciiString("");
if ( !anAtt->GetDescription().IsNull() )
theTarget << anAtt->GetDescription()->String();
else
theTarget << TCollection_AsciiString("");
if ( !anAtt->GetIdentification().IsNull() )
theTarget << anAtt->GetIdentification()->String();
else
theTarget << TCollection_AsciiString("");
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_DimTolDriver.cdl
-- Created: Wed Dec 10 13:02:14 2008
-- Author: Pavel TELKOV
-- <ptv@valenox>
---Copyright: Open CASCADE 2008
class DimTolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable DimTolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,93 @@
// File: BinMXCAFDoc_DimTolDriver.cxx
// Created: 10.12.08 13:15:38
// Author: Pavel TELKOV
// Copyright: Open CASCADE 2008
#include <BinMXCAFDoc_DimTolDriver.ixx>
#include <XCAFDoc_DimTol.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
BinMXCAFDoc_DimTolDriver::BinMXCAFDoc_DimTolDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_DimTol)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_DimTolDriver::NewEmpty() const
{
return new XCAFDoc_DimTol();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_DimTolDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_DimTol) anAtt = Handle(XCAFDoc_DimTol)::DownCast(theTarget);
Standard_Integer aKind, aFirstInd, aLastInd;
TCollection_AsciiString aName, aDescr;
if ( !(theSource >> aKind >> aName >> aDescr >> aFirstInd >> aLastInd) )
return Standard_False;
Handle(TColStd_HArray1OfReal) aHArr;
const Standard_Integer aLength = aLastInd - aFirstInd + 1;
if (aLength > 0 ) {
aHArr = new TColStd_HArray1OfReal( aFirstInd, aLastInd );
TColStd_Array1OfReal& aTargetArray = aHArr->ChangeArray1();
if(!theSource.GetRealArray (&aTargetArray(aFirstInd), aLength))
return Standard_False;
}
anAtt->Set(aKind, aHArr,
new TCollection_HAsciiString( aName ),
new TCollection_HAsciiString( aDescr ));
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void BinMXCAFDoc_DimTolDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_DimTol) anAtt = Handle(XCAFDoc_DimTol)::DownCast(theSource);
theTarget << anAtt->GetKind();
if ( !anAtt->GetName().IsNull() )
theTarget << anAtt->GetName()->String();
else
theTarget << TCollection_AsciiString("");
if ( !anAtt->GetDescription().IsNull() )
theTarget << anAtt->GetDescription()->String();
else
theTarget << TCollection_AsciiString("");
Handle(TColStd_HArray1OfReal) aHArr = anAtt->GetVal();
Standard_Integer aFirstInd = 1, aLastInd = 0;
if ( !aHArr.IsNull() ) {
aFirstInd = aHArr->Lower();
aLastInd = aHArr->Upper();
}
theTarget << aFirstInd << aLastInd;
if ( !aHArr.IsNull() ) {
const Standard_Integer aLength = aLastInd - aFirstInd + 1;
const TColStd_Array1OfReal& anArr = aHArr->Array1();
Standard_Real *aPtr = (Standard_Real *) &anArr(aFirstInd);
theTarget.PutRealArray (aPtr, aLength);
}
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_DimTolToolDriver.cdl
-- Created: Wed Dec 10 13:02:55 2008
-- Author: Pavel TELKOV
-- <ptv@valenox>
---Copyright: Open CASCADE 2008
class DimTolToolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable DimTolToolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,48 @@
// File: BinMXCAFDoc_DimTolToolDriver.cxx
// Created: 10.12.08 13:47:58
// Author: Pavel TELKOV
// Copyright: Open CASCADE 2008
#include <BinMXCAFDoc_DimTolToolDriver.ixx>
#include <XCAFDoc_DimTolTool.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_DimTolToolDriver::BinMXCAFDoc_DimTolToolDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_DimTolTool)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_DimTolToolDriver::NewEmpty() const
{
return new XCAFDoc_DimTolTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_DimTolToolDriver::Paste
(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_DimTolToolDriver::Paste
(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const {
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_DocumentToolDriver.cdl
-- Created: Tue May 17 12:26:47 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class DocumentToolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable DocumentToolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,46 @@
// File: BinMXCAFDoc_DocumentToolDriver.cxx
// Created: Tue May 17 13:11:45 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_DocumentToolDriver.ixx>
#include <XCAFDoc_DocumentTool.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_DocumentToolDriver::BinMXCAFDoc_DocumentToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_DocumentTool)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_DocumentToolDriver::NewEmpty() const {
return new XCAFDoc_DocumentTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_DocumentToolDriver::Paste(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_DocumentTool) T = Handle(XCAFDoc_DocumentTool)::DownCast(theTarget);
T->Init();
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_DocumentToolDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
}

View File

@@ -0,0 +1,32 @@
-- File: BinMXCAFDoc_GraphNodeDriver.cdl
-- Created: Tue May 17 14:53:33 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class GraphNodeDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable GraphNodeDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,113 @@
// File: BinMXCAFDoc_GraphNodeDriver.cxx
// Created: Tue May 17 14:54:18 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_GraphNodeDriver.ixx>
#include <XCAFDoc_GraphNode.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_GraphNodeDriver::BinMXCAFDoc_GraphNodeDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_GraphNode)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_GraphNodeDriver::NewEmpty() const {
return new XCAFDoc_GraphNode();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_GraphNodeDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
Handle(XCAFDoc_GraphNode) aT = Handle(XCAFDoc_GraphNode)::DownCast(theTarget);
Standard_Integer anID;
// Read Fathers
if (! (theSource >> anID))
return Standard_False;
while(anID != -1) {
Handle(XCAFDoc_GraphNode) aNode;
if(theRelocTable.IsBound(anID)) {
aNode = Handle(XCAFDoc_GraphNode)::DownCast(theRelocTable.Find(anID));
} else {
aNode = Handle(XCAFDoc_GraphNode)::DownCast(aT->NewEmpty());
theRelocTable.Bind(anID, aNode);
}
aT->SetFather(aNode);
if (! (theSource >> anID))
return Standard_False;
}
// Read Children
if (! (theSource >> anID))
return Standard_False;
while(anID != -1) {
Handle(XCAFDoc_GraphNode) aNode;
if(theRelocTable.IsBound(anID)) {
aNode = Handle(XCAFDoc_GraphNode)::DownCast(theRelocTable.Find(anID));
} else {
aNode = Handle(XCAFDoc_GraphNode)::DownCast(aT->NewEmpty());
theRelocTable.Bind(anID, aNode);
}
aT->SetChild(aNode);
if (! (theSource >> anID))
return Standard_False;
}
// Graph id
Standard_GUID aGUID;
if (! (theSource >> aGUID))
return Standard_False;
aT->SetGraphID(aGUID);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_GraphNodeDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
Handle(XCAFDoc_GraphNode) aS = Handle(XCAFDoc_GraphNode)::DownCast(theSource);
Standard_Integer i, aNb, anID;
// Write fathers
aNb = aS->NbFathers();
for(i = 1; i <= aNb; i++) {
Handle(XCAFDoc_GraphNode) aNode = aS->GetFather(i);
anID = theRelocTable.Add(aNode);
theTarget << anID;
}
theTarget.PutInteger(-1);
// Write children
aNb = aS->NbChildren();
for(i = 1; i <= aNb; i++) {
Handle(XCAFDoc_GraphNode) aNode = aS->GetChild(i);
anID = theRelocTable.Add(aNode);
theTarget << anID;
}
theTarget.PutInteger(-1);
// Graph id
theTarget << aS->ID();
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_LayerToolDriver.cdl
-- Created: Tue May 17 12:27:42 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class LayerToolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable LayerToolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,45 @@
// File: BinMXCAFDoc_LayerToolDriver.cxx
// Created: Tue May 17 13:16:41 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_LayerToolDriver.ixx>
#include <XCAFDoc_LayerTool.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_LayerToolDriver::BinMXCAFDoc_LayerToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_LayerTool)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_LayerToolDriver::NewEmpty() const {
return new XCAFDoc_LayerTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_LayerToolDriver::Paste(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_LayerToolDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
}

View File

@@ -0,0 +1,50 @@
-- File: BinMXCAFDoc_LocationDriver.cdl
-- Created: Tue May 17 14:42:38 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class LocationDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Location from TopLoc,
Attribute from TDF,
LocationSetPtr from BinTools
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable LocationDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
Translate(me; theSource : Persistent from BinObjMgt;
theLoc : in out Location from TopLoc;
theMap : out RRelocationTable from BinObjMgt)
returns Boolean from Standard;
Translate(me; theLoc : Location from TopLoc;
theTarget : in out Persistent from BinObjMgt;
theMap : out SRelocationTable from BinObjMgt);
---Purpose: Translate transient location to storable
SetSharedLocations(me: mutable;
theLocations: in LocationSetPtr from BinTools);
---C++: inline
fields
myLocations : LocationSetPtr from BinTools;
end;

View File

@@ -0,0 +1,187 @@
// File: BinMXCAFDoc_LocationDriver.cxx
// Created: Tue May 17 14:43:51 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_LocationDriver.ixx>
#include <XCAFDoc_Location.hxx>
#include <TopLoc_Datum3D.hxx>
#include <TopLoc_Location.hxx>
#include <gp_Trsf.hxx>
#include <gp_Mat.hxx>
#include <gp_XYZ.hxx>
//#include <Precision.hxx>
#include <BinMDataStd.hxx>
#include <BinTools_LocationSet.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_LocationDriver::BinMXCAFDoc_LocationDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Location)->Name())
, myLocations(0) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_LocationDriver::NewEmpty() const {
return new XCAFDoc_Location();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_LocationDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
Handle(XCAFDoc_Location) anAtt = Handle(XCAFDoc_Location)::DownCast(theTarget);
TopLoc_Location aLoc;
Standard_Boolean aRes = Translate(theSource, aLoc, theRelocTable);
anAtt->Set(aLoc);
return aRes;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_LocationDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
Handle(XCAFDoc_Location) anAtt = Handle(XCAFDoc_Location)::DownCast(theSource);
TopLoc_Location aLoc = anAtt->Get();
Translate(aLoc, theTarget, theRelocTable);
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_LocationDriver::Translate(const BinObjMgt_Persistent& theSource,
TopLoc_Location& theLoc,
BinObjMgt_RRelocationTable& theMap) const
{
Standard_Integer anId = 0;
theSource >> anId;
if(anId == 0)
{
return Standard_True;
}
Standard_Integer aFileVer = BinMDataStd::DocumentVersion();
if( aFileVer > 5 && myLocations == 0 )
{
return Standard_False;
}
Standard_Integer aPower;
Handle(TopLoc_Datum3D) aDatum;
if( aFileVer > 5 )
{
const TopLoc_Location& aLoc = myLocations->Location(anId);
aPower = aLoc.FirstPower();
aDatum = aLoc.FirstDatum();
} else {
theSource >> aPower;
Standard_Integer aDatumID = -1;
Standard_Integer aReadDatum = -1;
theSource >> aReadDatum;
theSource >> aDatumID;
if(aReadDatum != -1) {
if(theMap.IsBound(aDatumID)) {
aDatum = Handle(TopLoc_Datum3D)::DownCast(theMap.Find(aDatumID));
} else
return Standard_False;
} else {
// read the datum's trasformation
gp_Trsf aTrsf;
Standard_Real aScaleFactor;
theSource >> aScaleFactor;
aTrsf._CSFDB_Setgp_Trsfscale(aScaleFactor);
Standard_Integer aForm;
theSource >> aForm;
aTrsf._CSFDB_Setgp_Trsfshape((gp_TrsfForm)aForm);
Standard_Integer R, C;
gp_Mat& aMat = (gp_Mat&)aTrsf._CSFDB_Getgp_Trsfmatrix();
for(R = 1; R <= 3; R++)
for(C = 1; C <= 3; C++) {
Standard_Real aVal;
theSource >> aVal;
aMat.SetValue(R, C, aVal);
}
Standard_Real x, y, z;
theSource >> x >> y >> z;
gp_XYZ& aLoc = (gp_XYZ&)aTrsf._CSFDB_Getgp_Trsfloc();
aLoc.SetX(x);
aLoc.SetY(y);
aLoc.SetZ(z);
aDatum = new TopLoc_Datum3D(aTrsf);
theMap.Bind(aDatumID, aDatum);
}
}
// Get Next Location
TopLoc_Location aNextLoc;
Translate(theSource, aNextLoc, theMap);
// Calculate the result
theLoc = aNextLoc * TopLoc_Location(aDatum).Powered(aPower);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_LocationDriver::Translate(const TopLoc_Location& theLoc,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theMap) const
{
if(theLoc.IsIdentity())
{
theTarget.PutInteger(0);
return;
}
// The location is not identity
if( myLocations == 0 )
{
#ifdef DEB
cout<<"Pointer to LocationSet is NULL\n";
#endif
return;
}
Standard_Integer anId = myLocations->Add(theLoc);
theTarget << anId;
// In earlier version of this driver a datums from location stored in
// the relocation table, but now it's not necessary
// (try to uncomment it if some problems appear)
/*
Handle(TopLoc_Datum3D) aDatum = theLoc.FirstDatum();
if(!theMap.Contains(aDatum)) {
theMap.Add(aDatum);
}
*/
Translate(theLoc.NextLocation(), theTarget, theMap);
}

View File

@@ -0,0 +1,16 @@
// File: BinMXCAFDoc_LocationDriver.lxx
// Created: Tue Feb 8 14:33:30 2011
// Author: Oleg AGASHIN
// <oan@opencascade.com>
//=======================================================================
//function : SetSharedLocations
//purpose :
//=======================================================================
inline void BinMXCAFDoc_LocationDriver::SetSharedLocations(const BinTools_LocationSetPtr& theLocations)
{
if( myLocations != theLocations )
{
myLocations = theLocations;
}
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_MaterialDriver.cdl
-- Created: Wed Dec 10 13:02:14 2008
-- Author: Pavel TELKOV
-- <ptv@valenox>
---Copyright: Open CASCADE 2008
class MaterialDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable MaterialDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,75 @@
// File: BinMXCAFDoc_MaterialDriver.cxx
// Created: 10.12.08 13:15:38
// Author: Pavel TELKOV
// Copyright: Open CASCADE 2008
#include <BinMXCAFDoc_MaterialDriver.ixx>
#include <XCAFDoc_Material.hxx>
#include <TCollection_HAsciiString.hxx>
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
BinMXCAFDoc_MaterialDriver::BinMXCAFDoc_MaterialDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Material)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_MaterialDriver::NewEmpty() const
{
return new XCAFDoc_Material();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_MaterialDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Material) anAtt = Handle(XCAFDoc_Material)::DownCast(theTarget);
Standard_Real aDensity;
TCollection_AsciiString aName, aDescr, aDensName, aDensValType;
if ( !(theSource >> aName >> aDescr >> aDensity >> aDensName >> aDensValType) )
return Standard_False;
anAtt->Set(new TCollection_HAsciiString( aName ),
new TCollection_HAsciiString( aDescr ),
aDensity,
new TCollection_HAsciiString( aDensName ),
new TCollection_HAsciiString( aDensValType ));
return Standard_True;
}
static void pasteString( BinObjMgt_Persistent& theTarget,
Handle(TCollection_HAsciiString) theStr )
{
if ( !theStr.IsNull() )
theTarget << theStr->String();
else
theTarget << TCollection_AsciiString("");
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void BinMXCAFDoc_MaterialDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Material) anAtt = Handle(XCAFDoc_Material)::DownCast(theSource);
pasteString( theTarget, anAtt->GetName() );
pasteString( theTarget, anAtt->GetDescription() );
theTarget << anAtt->GetDensity();
pasteString( theTarget, anAtt->GetDensName() );
pasteString( theTarget, anAtt->GetDensValType() );
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_MaterialToolDriver.cdl
-- Created: Wed Dec 10 13:02:55 2008
-- Author: Pavel TELKOV
-- <ptv@valenox>
---Copyright: Open CASCADE 2008
class MaterialToolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable MaterialToolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,48 @@
// File: BinMXCAFDoc_MaterialToolDriver.cxx
// Created: 10.12.08 13:47:58
// Author: Pavel TELKOV
// Copyright: Open CASCADE 2008
#include <BinMXCAFDoc_MaterialToolDriver.ixx>
#include <XCAFDoc_MaterialTool.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_MaterialToolDriver::BinMXCAFDoc_MaterialToolDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_MaterialTool)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_MaterialToolDriver::NewEmpty() const
{
return new XCAFDoc_MaterialTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_MaterialToolDriver::Paste
(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_MaterialToolDriver::Paste
(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const {
}

View File

@@ -0,0 +1,33 @@
-- File: BinMXCAFDoc_ShapeToolDriver.cdl
-- Created: Tue May 17 12:28:12 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class ShapeToolDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable ShapeToolDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,47 @@
// File: BinMXCAFDoc_ShapeToolDriver.cxx
// Created: Tue May 17 13:20:19 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_ShapeToolDriver.ixx>
#include <XCAFDoc_ShapeTool.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_ShapeToolDriver::BinMXCAFDoc_ShapeToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_ShapeTool)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_ShapeToolDriver::NewEmpty() const {
return new XCAFDoc_ShapeTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_ShapeToolDriver::Paste(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_ShapeToolDriver::Paste(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
}

View File

@@ -0,0 +1,32 @@
-- File: BinMXCAFDoc_VolumeDriver.cdl
-- Created: Tue May 17 15:14:11 2005
-- Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
-- Copyright: Open CasCade S.A. 2005
class VolumeDriver from BinMXCAFDoc inherits ADriver from BinMDF
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMsgDriver:MessageDriver from CDM)
returns mutable VolumeDriver from BinMXCAFDoc;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; theSource : Persistent from BinObjMgt;
theTarget : mutable Attribute from TDF;
theRelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; theSource : Attribute from TDF;
theTarget : in out Persistent from BinObjMgt;
theRelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end;

View File

@@ -0,0 +1,52 @@
// File: BinMXCAFDoc_VolumeDriver.cxx
// Created: Tue May 17 15:16:35 2005
// Author: Eugeny NAPALKOV <eugeny.napalkov@opencascade.com>
// Copyright: Open CasCade S.A. 2005
#include <BinMXCAFDoc_VolumeDriver.ixx>
#include <XCAFDoc_Volume.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_VolumeDriver::BinMXCAFDoc_VolumeDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Volume)->Name()) {
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_VolumeDriver::NewEmpty() const {
return new XCAFDoc_Volume();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_VolumeDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Volume) anAtt = Handle(XCAFDoc_Volume)::DownCast(theTarget);
Standard_Real aVol;
Standard_Boolean isOk = theSource >> aVol;
if(isOk)
anAtt->Set(aVol);
return isOk;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_VolumeDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Volume) anAtt = Handle(XCAFDoc_Volume)::DownCast(theSource);
theTarget << anAtt->Get();
}