1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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

View File

@@ -0,0 +1,25 @@
-- File: BinMFunction.cdl
-- Created: Thu May 13 14:40:40 2004
-- Author: Sergey ZARITCHNY <szy@opencascade.com>
-- Copyright: Open CasCade S.A. 2004
package BinMFunction
---Purpose: Storage and Retrieval drivers for TFunction modelling attributes.
uses BinMDF,
BinObjMgt,
TDF,
TFunction,
CDM
is
class FunctionDriver;
class GraphNodeDriver;
class ScopeDriver;
AddDrivers (theDriverTable : ADriverTable from BinMDF;
aMsgDrv : MessageDriver from CDM);
---Purpose: Adds the attribute drivers to <theDriverTable>.
end BinMFunction;

View File

@@ -0,0 +1,24 @@
// File: BinMFunction.cxx
// Created: Thu May 13 15:16:24 2004
// Author: Sergey ZARITCHNY <szy@opencascade.com>
// Copyright: Open CasCade S.A. 2004
#include <BinMFunction.ixx>
#include <BinMDF_ADriverTable.hxx>
#include <CDM_MessageDriver.hxx>
#include <BinMFunction_FunctionDriver.hxx>
#include <BinMFunction_GraphNodeDriver.hxx>
#include <BinMFunction_ScopeDriver.hxx>
//=======================================================================
//function : AddDrivers
//purpose :
//=======================================================================
void BinMFunction::AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable,
const Handle(CDM_MessageDriver)& theMsgDriver)
{
theDriverTable->AddDriver (new BinMFunction_FunctionDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMFunction_GraphNodeDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMFunction_ScopeDriver (theMsgDriver) );
}

View File

@@ -0,0 +1,35 @@
-- File: BinMFunction_FunctionDriver.cdl
-- Created: Thu May 13 14:43:39 2004
-- Author: Sergey ZARITCHNY <szy@opencascade.com>
-- Copyright: Open CasCade S.A. 2004
class FunctionDriver from BinMFunction inherits ADriver from BinMDF
---Purpose: Function attribute Driver.
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMessageDriver:MessageDriver from CDM)
returns mutable FunctionDriver from BinMFunction;
NewEmpty (me) returns mutable Attribute from TDF
is redefined;
Paste(me; Source : Persistent from BinObjMgt;
Target : mutable Attribute from TDF;
RelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; Source : Attribute from TDF;
Target : in out Persistent from BinObjMgt;
RelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end FunctionDriver;

View File

@@ -0,0 +1,73 @@
// File: BinMFunction_FunctionDriver.cxx
// Created: Thu May 13 14:46:12 2004
// Author: Sergey ZARITCHNY <szy@opencascade.com>
// Copyright: Open CasCade S.A. 2004
#include <BinMFunction_FunctionDriver.ixx>
#include <CDM_MessageDriver.hxx>
#include <TDF_Attribute.hxx>
#include <TFunction_Function.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
//=======================================================================
//function : BinMFunction_FunctionDriver
//purpose :
//=======================================================================
BinMFunction_FunctionDriver::BinMFunction_FunctionDriver
(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TFunction_Function)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMFunction_FunctionDriver::NewEmpty() const
{
return new TFunction_Function();
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMFunction_FunctionDriver::Paste
(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& ) const
{
Handle(TFunction_Function) anAtt = Handle(TFunction_Function)::DownCast(theTarget);
Standard_GUID aGUID("00000000-0000-0000-0000-000000000000");
Standard_Boolean ok = theSource >> aGUID;
if (ok) {
anAtt->SetDriverGUID(aGUID);
Standard_Integer aValue;
ok = theSource >> aValue;
if(ok)
anAtt->SetFailure(aValue);
}
return ok;
}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMFunction_FunctionDriver::Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& ) const
{
Handle(TFunction_Function) aS = Handle(TFunction_Function)::DownCast (theSource);
theTarget << aS->GetDriverGUID();
theTarget << aS->GetFailure();
}

View File

@@ -0,0 +1,37 @@
-- File: BinMFunction_GraphNodeDriver.cdl
-- Created: Thu May 11 14:45:49 2008
-- Author: Vlad ROMASHKO <vladislav.romashko@opencascade.com>
-- Copyright: Open CasCade S.A. 2008
class GraphNodeDriver from BinMFunction inherits ADriver from BinMDF
---Purpose: GraphNode attribute Driver.
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMessageDriver:MessageDriver from CDM)
returns mutable GraphNodeDriver from BinMFunction;
NewEmpty (me)
returns mutable Attribute from TDF
is redefined;
Paste(me; Source : Persistent from BinObjMgt;
Target : mutable Attribute from TDF;
RelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; Source : Attribute from TDF;
Target : in out Persistent from BinObjMgt;
RelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end GraphNodeDriver;

View File

@@ -0,0 +1,129 @@
// File: BinMFunction_GraphNodeDriver.cxx
// Created: Thu May 11 11:26:02 2008
// Author: Vlad Romashko <vladislav.romashko@opencascade.com>
// Copyright: Open CasCade S.A. 2008
#include <BinMFunction_GraphNodeDriver.ixx>
#include <CDM_MessageDriver.hxx>
#include <TDF_Attribute.hxx>
#include <TFunction_GraphNode.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
//=======================================================================
//function : BinMFunction_GraphNodeDriver
//purpose :
//=======================================================================
BinMFunction_GraphNodeDriver::BinMFunction_GraphNodeDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TFunction_GraphNode)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMFunction_GraphNodeDriver::NewEmpty() const
{
return new TFunction_GraphNode();
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMFunction_GraphNodeDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& ) const
{
Handle(TFunction_GraphNode) GN = Handle(TFunction_GraphNode)::DownCast(theTarget);
Standard_Integer intStatus, nb_previous, nb_next;
if (! (theSource >> intStatus >> nb_previous >> nb_next))
return Standard_False;
// Execution status
GN->SetStatus((TFunction_ExecutionStatus) intStatus);
// Previous functions
if (nb_previous)
{
TColStd_Array1OfInteger aTargetArray(1, nb_previous);
theSource.GetIntArray (&aTargetArray(1), nb_previous);
for (Standard_Integer i = 1; i <= nb_previous; i++)
{
GN->AddPrevious(aTargetArray.Value(i));
}
}
// Next functions
if (nb_next)
{
TColStd_Array1OfInteger aTargetArray(1, nb_next);
theSource.GetIntArray (&aTargetArray(1), nb_next);
for (Standard_Integer i = 1; i <= nb_next; i++)
{
GN->AddNext(aTargetArray.Value(i));
}
}
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMFunction_GraphNodeDriver::Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& ) const
{
Handle(TFunction_GraphNode) GN = Handle(TFunction_GraphNode)::DownCast(theSource);
// Execution status
theTarget << (Standard_Integer) GN->GetStatus();
// Number of previous functions
theTarget << GN->GetPrevious().Extent();
// Number of next functions
theTarget << GN->GetNext().Extent();
// Previous functions
Standard_Integer nb = GN->GetPrevious().Extent();
if (nb)
{
TColStd_Array1OfInteger aSourceArray(1, nb);
TColStd_MapIteratorOfMapOfInteger itr(GN->GetPrevious());
for (Standard_Integer i = 1; itr.More(); itr.Next(), i++)
{
aSourceArray.SetValue(i, itr.Key());
}
Standard_Integer *aPtr = (Standard_Integer *) &aSourceArray(1);
theTarget.PutIntArray(aPtr, nb);
}
// Next functions
nb = GN->GetNext().Extent();
if (nb)
{
TColStd_Array1OfInteger aSourceArray(1, nb);
TColStd_MapIteratorOfMapOfInteger itr(GN->GetNext());
for (Standard_Integer i = 1; itr.More(); itr.Next(), i++)
{
aSourceArray.SetValue(i, itr.Key());
}
Standard_Integer *aPtr = (Standard_Integer *) &aSourceArray(1);
theTarget.PutIntArray(aPtr, nb);
}
}

View File

@@ -0,0 +1,37 @@
-- File: BinMFunction_ScopeDriver.cdl
-- Created: Thu May 11 16:35:12 2008
-- Author: Vlad ROMASHKO <vladislav.romashko@opencascade.com>
-- Copyright: Open CasCade S.A. 2008
class ScopeDriver from BinMFunction inherits ADriver from BinMDF
---Purpose: Scope attribute Driver.
uses
MessageDriver from CDM,
SRelocationTable from BinObjMgt,
RRelocationTable from BinObjMgt,
Persistent from BinObjMgt,
Attribute from TDF
is
Create (theMessageDriver:MessageDriver from CDM)
returns mutable ScopeDriver from BinMFunction;
NewEmpty (me)
returns mutable Attribute from TDF
is redefined;
Paste(me; Source : Persistent from BinObjMgt;
Target : mutable Attribute from TDF;
RelocTable : out RRelocationTable from BinObjMgt)
returns Boolean from Standard is redefined;
Paste(me; Source : Attribute from TDF;
Target : in out Persistent from BinObjMgt;
RelocTable : out SRelocationTable from BinObjMgt)
is redefined;
end ScopeDriver;

View File

@@ -0,0 +1,132 @@
// File: BinMFunction_ScopeDriver.cxx
// Created: Thu May 11 11:26:02 2008
// Author: Vlad Romashko <vladislav.romashko@opencascade.com>
// Copyright: Open CasCade S.A. 2008
#include <BinMFunction_ScopeDriver.ixx>
#include <CDM_MessageDriver.hxx>
#include <TDF_Attribute.hxx>
#include <TFunction_Scope.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
//=======================================================================
//function : BinMFunction_GraphNodeDriver
//purpose :
//=======================================================================
BinMFunction_ScopeDriver::BinMFunction_ScopeDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TFunction_Scope)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMFunction_ScopeDriver::NewEmpty() const
{
return new TFunction_Scope();
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMFunction_ScopeDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& ) const
{
Handle(TFunction_Scope) S = Handle(TFunction_Scope)::DownCast(theTarget);
Standard_Integer nb;
if ( !(theSource >> nb) )
return Standard_False;
if (!nb)
return Standard_True;
TFunction_DoubleMapOfIntegerLabel& map = S->ChangeFunctions();
// IDs
TColStd_Array1OfInteger IDs(1, nb);
theSource.GetIntArray (&IDs(1), nb);
// Labels
Standard_Integer freeID = 0;
for (Standard_Integer i = 1; i <= nb; i++)
{
TCollection_AsciiString entry;
if ( !(theSource >> entry) )
return Standard_False;
TDF_Label L;
TDF_Tool::Label(S->Label().Data(), entry, L, Standard_True);
if (!L.IsNull())
{
map.Bind(IDs.Value(i), L);
if (IDs.Value(i) > freeID)
freeID = IDs.Value(i);
}
}
// Free ID
freeID++;
S->SetFreeID(freeID);
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMFunction_ScopeDriver::Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& ) const
{
Handle(TFunction_Scope) S = Handle(TFunction_Scope)::DownCast(theSource);
const TFunction_DoubleMapOfIntegerLabel& map = S->GetFunctions();
const Standard_Integer nb = map.Extent();
// Number of functions
theTarget << nb;
if (!nb)
return;
// IDs
{
TColStd_Array1OfInteger aSourceArray(1, nb);
TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel itr(map);
for (Standard_Integer i = 1; itr.More(); itr.Next(), i++)
{
aSourceArray.SetValue(i, itr.Key1());
}
Standard_Integer *aPtr = (Standard_Integer *) &aSourceArray(1);
theTarget.PutIntArray(aPtr, nb);
}
// Labels
{
TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel itr(map);
for (; itr.More(); itr.Next())
{
TDF_Label L = itr.Key2();
if (!L.IsNull())
{
TCollection_AsciiString entry;
TDF_Tool::Entry(L, entry);
theTarget << entry;
}
}
}
}