1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0024927: Getting rid of "Persistent" functionality -- Code

Brute force removal of standard persistence (ShapeSchema, StdLSchema, StdSchema, XCAFSchema) and all persistence-specific toolkits.

OCAF formats "MDTV-Standard", "MDTV-XCAF" are removed from resource files.

Uses of "MDTV-Standard" are changed to "BinOcaf", and "MDTV-XCAF" changed to "BinXCAF".
This commit is contained in:
abv 2014-06-04 12:12:21 +04:00 committed by bugmaster
parent 56a9db93fe
commit fff263bd14
818 changed files with 16 additions and 58399 deletions

View File

@ -243,46 +243,8 @@ p BinObjMgt
p BinTools
p CDF
p CDM
p DBC
p FWOSDriver
p MDF
p MDataStd
p MDataXtd
p MDocStd
p MFunction
p MNaming
p MPrsStd
p MgtBRep
p MgtGeom
p MgtGeom2d
p MgtPoly
p MgtTopLoc
p MgtTopoDS
p ObjMgt
p PBRep
p PCDM
p PCDMShape
p PColStd
p PColgp
p PCollection
p PDF
p PDataStd
p PDataXtd
p PDocStd
p PFunction
p PGeom
p PGeom2d
p PMMgt
p PNaming
p PPoly
p PPrsStd
p PShort
p PStandard
p PTColStd
p PTopLoc
p PTopoDS
p StdDrivers
p StdLDrivers
p TDF
p TDataStd
p TDataXtd
@ -303,9 +265,6 @@ p XmlMPrsStd
p XmlObjMgt
r StdResource
r XmlOcafResource
s ShapeSchema
s StdLSchema
s StdSchema
t FWOSPlugin
t PTKernel
t TKBin
@ -314,12 +273,7 @@ t TKBinTObj
t TKCAF
t TKCDF
t TKLCAF
t TKPCAF
t TKPLCAF
t TKPShape
t TKShapeSchema
t TKStdLSchema
t TKStdSchema
t TKTObj
t TKXml
t TKXmlL
@ -353,9 +307,7 @@ p IGESSolid
p IGESToBRep
p Interface
p LibCtl
p MXCAFDoc
p MoniTool
p PXCAFDoc
p RWHeaderSection
p RWStepAP203
p RWStepAP214
@ -401,7 +353,6 @@ p VrmlConverter
p VrmlData
p XCAFApp
p XCAFDoc
p XCAFDrivers
p XCAFPrs
p XSAlgo
p XSControl
@ -410,7 +361,6 @@ p XmlXCAFDrivers
r SHMessage
r XSMessage
r XSTEPResource
s XCAFSchema
t TKBinXCAF
t TKIGES
t TKSTEP
@ -420,7 +370,6 @@ t TKSTEPBase
t TKSTL
t TKVRML
t TKXCAF
t TKXCAFSchema
t TKXDEIGES
t TKXDESTEP
t TKXSBase

View File

@ -46,7 +46,6 @@ void AppStd_Application::Formats(TColStd_SequenceOfExtendedString& theFormats)
{
theFormats.Append("XmlOcaf");
theFormats.Append("BinOcaf");
theFormats.Append("MDTV-Standard");
}
//=======================================================================

View File

@ -17,7 +17,7 @@
package CDF
uses CDM, PCDM, TCollection, TColStd, Storage, Resource, Quantity, OSD
uses CDM, PCDM, TCollection, TColStd, Resource, Quantity, OSD
is
class Directory;

View File

@ -103,7 +103,7 @@ is
anAlternativeDocument: out Document from CDM)
returns Boolean from Standard
---Purpose: This method can be redefined to extract another document in
-- a different format. For example, to extract a MDTV-Shape
-- a different format. For example, to extract a Shape
-- from an applicative document.
is virtual;

View File

@ -1,36 +0,0 @@
-- Created on: 1996-01-29
-- Created by: Kernel
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
package DBC
uses PStandard
is
class BaseArray;
generic class VArray,VArrayNode,VArrayTNode;
class VArrayOfInteger instantiates
VArray(Integer);
class VArrayOfReal instantiates
VArray(Real);
class VArrayOfCharacter instantiates
VArray(Character);
class VArrayOfExtCharacter instantiates
VArray(ExtCharacter);
imported DBVArray;
end DBC;

View File

@ -1,58 +0,0 @@
-- Created on: 1996-01-29
-- Created by: Kernel
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class BaseArray from DBC
inherits Storable from Standard
uses DBVArray from DBC
raises NullObject,
NegativeValue,
DimensionMismatch
is
Create returns BaseArray;
---Purpose: Creates an BaseArray of NULL size
Create (Size : Integer) returns BaseArray;
---Purpose: Creates an BaseArray of lower bound 0 and
-- upper bound <Size>-1.
Create (BaseArray: BaseArray) returns BaseArray;
---Purpose: Creates an array which is the copy of the given
-- argument.
---C++: alias " Standard_EXPORT virtual ~DBC_BaseArray();"
Length (me) returns Integer is static ;
---C++: inline
Upper (me) returns Integer is static;
---Purpose: Returns the upper bound
---C++: inline
Lock (me) returns Address is static ;
---Purpose: Locks the array <me> in memory and
-- returns its virtual address
Unlock (me) is static;
---Purpose: unlocks the array <me> from memory
fields
mySize : Integer is protected;
myData : DBVArray from DBC is protected;
end BaseArray;

View File

@ -1,251 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <Standard_OutOfRange.hxx>
#include <Standard_NegativeValue.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_NotImplemented.hxx>
//#include <DBC_DBVArray.hxx>
#include <DBC_BaseArray.ixx>
#ifdef OBJS
#include <Standard_Persistent.hxx>
// taille a partir de laquelle la tableau cre son propre container
//
#define DBC_TAILLE_PLAFOND_CREATION_SEGMENT 10000
#include <StandardOBJS_PersistentMacro.hxx>
#include <StandardOBJS_PrimitiveTypes.hxx>
// just use for internal generic identifiaction of Item
//
static PStandard_ArrayNode DBC_tmpItem;
#endif
#ifdef OO2
#include <StandardDB_O2Handle.hxx>
#endif
// --------------------------------------------------------------------
// BaseArray implementation : Temporary arrays known as variable-size arrays.
// BaseArray of BaseArray is not supported in this version.
//
// Last Revision : Feb,10 1992 J.P Tirault
// . Implementation of Lock/Unlock methods :
// . Implementation of ShallowCopy,ShallowDump,IsSameState.
//
// Last Revision : April,4 1992 J.P Tirault, R Barreto
// . Implementation for Object store.
// . Implementation for Memory.
//
// Last Revision : September,17 1992 J.P Tirault
// . Free old area in Resize method.
// Last revision : January,18 1995 N. Massip
// . Implementation for ObjectStore
// with an c++ persistent array
// This version store all the information for the Item
// in case of non primitive type, the handle, the Standard oid,
// and the object itself are stored
// if the oid_standard disapear, it may become interresting to
// store only the object itself. So a special version who store
// only the Object is join in comment with each function who
// may be different, the Haeder of this ccomment is like this :
//
// For no Handle Storing
/*
<code>
*/
// Last revision : April 19 1992 N. Massip
// . Implementation for o2 technology
// with an o2_array for 4.5
// should be d_Varray for 4.6
// Use an Collection of StandardDB_O2Handle
// for none primitive type to avoid to import
// Handle(Standard_Persistent).
// --------------------------------------------------------------------
// Last revision : January 1996 JMS/CLE
// portage OBJY 3.8
// --------------------------------------------------------------------
// Constructor
// --------------------------------------------------------------------
DBC_BaseArray::DBC_BaseArray (const Standard_Integer Size)
#ifdef OBJY
//==== Call the father's constructor.
: myData((unsigned int) Size)
#endif
#ifdef OO2
: myData((unsigned int) Size)
#endif
{
Standard_NegativeValue_Raise_if((Size < 0), "Attempt to create aBaseArray with a bad size");
mySize = Size;
// Standard_Integer i;
#ifdef OBJSold
INTERNAL_MODE_OODB_START {
os_segment *seg = Storage_CurrentContainer();
if ( Size > DBC_TAILLE_PLAFOND_CREATION_SEGMENT ) {
os_database *db = seg->database_of();
Storage_CurrentContainer() = db->create_segment();
}
myData = Standard_PersistentAllocation(DBC_tmpItem, Size);
Storage_CurrentContainer() = seg;
}
INTERNAL_MODE_OODB_END;
#endif
}
DBC_BaseArray::DBC_BaseArray ()
#ifdef OBJY
//==== Call the father's constructor.
: myData(0)
#endif
#ifdef OO2
: myData((unsigned int) 0)
#endif
{
mySize = 0;
#ifdef OBJS
myData = NULL;
#endif
}
// --------------------------------------------------------------------
// Constructor
// --------------------------------------------------------------------
DBC_BaseArray::DBC_BaseArray (const DBC_BaseArray& Other)
#ifdef OBJY
//==== Call the father's constructor.
: myData(Other.myData)
#endif
// utilisable pour d_array mais pas o2_list
#ifdef OO2
//==== Call the father's constructor.
: myData(Other.myData)
#endif
{
mySize = Other.mySize;
#ifdef OBJSold
INTERNAL_MODE_OODB_START {
myData = Standard_PersistentAllocation(DBC_tmpItem, mySize);
for(Standard_Integer i=0; i<mySize; i++)
myData[i] = Other.myData[i];
}
INTERNAL_MODE_OODB_END;
#endif
}
DBC_BaseArray::~DBC_BaseArray()
{
}
// --------------------------------------------------------------------
// Lock
//
// - Call the oodb method update which
// --------------------------------------------------------------------
Standard_Address DBC_BaseArray::Lock () const
{
#ifdef OBJY
return (Standard_Address) &(myData.elem(0));
#endif
#ifdef OO2
return (Standard_Address) &(Value(0));
#endif
#ifdef OBJS
Standard_Address adr;
INTERNAL_MODE_OODB_START {
adr = (Standard_Address) &myData;
}
INTERNAL_MODE_OODB_END;
return adr;
#endif
#ifdef CSFDB
return (Standard_Address) myData;
#endif
}
// --------------------------------------------------------------------
// Unlock
// --------------------------------------------------------------------
void DBC_BaseArray::Unlock() const
{
}
#ifdef OO2
// Liste de fonctionnalire permettent de manipuler StandardDB_O2Handle et
// les types primitifs de maniere tranparente
//
inline Item &O2Handle_getValue(const StandardDB_O2Handle &val) {
//Item *hd = (Item *) val.getHandle();
//return *hd;
return * ((Item *) val.getHandle());
}
// polymorphisme avec type primitif
inline Standard_Boolean &O2Handle_getValue(const Standard_Boolean &val) {
return (Standard_Boolean) val;
};
inline Standard_Integer &O2Handle_getValue(const Standard_Integer &val){
return (Standard_Integer) val;
};
inline Standard_Real &O2Handle_getValue(const Standard_Real &val){
return (Standard_Real) val;
};
inline Standard_Character &O2Handle_getValue(const Standard_Character &val){
return (Standard_Character) val;
};
inline Standard_ExtCharacter &O2Handle_getValue(const Standard_ExtCharacter &val){
return (Standard_ExtCharacter) val;
};
inline Standard_CString &O2Handle_getValue(const Standard_CString &val){
return (Standard_CString) val;
};
inline Standard_ExtString &O2Handle_getValue(const Standard_ExtString &val){
return (Standard_ExtString) val;
};
inline Standard_Address &O2Handle_getValue(const Standard_Address &val){
return (Standard_Address ) val;
};
inline Standard_ShortReal &O2Handle_getValue(const Standard_ShortReal &val){
return (Standard_ShortReal) val;
};
#endif

View File

@ -1,33 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// --------------------------------------------------------------------
// Length
// --------------------------------------------------------------------
inline Standard_Integer DBC_BaseArray::Length () const
{
return mySize;
}
// --------------------------------------------------------------------
// Upper
// --------------------------------------------------------------------
inline Standard_Integer DBC_BaseArray::Upper () const
{
return (mySize - 1);
}

View File

@ -1,83 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 _DBC_BaseArray_HeaderFile
#define _DBC_BaseArray_HeaderFile
#include <DBC_DBVArray.hxx>
#include <Standard_Storable.hxx>
#include <Standard_OStream.hxx>
#include <Standard_TypeDef.hxx>
class Standard_NullObject;
class Standard_NegativeValue;
class Standard_DimensionMismatch;
#ifndef Standard_EXPORT
#if defined(WNT) && !defined(HAVE_NO_DLL)
#define Standard_EXPORT __declspec(dllexport)
#else
#define Standard_EXPORT
#endif
#endif
class Standard_EXPORT DBC_BaseArray :
public os_virtual_behavior /* New */ {
public:
// Methods PUBLIC
//
DBC_BaseArray();
DBC_BaseArray(const Standard_Integer Size);
DBC_BaseArray(const DBC_BaseArray& BaseArray);
Standard_Integer Length() const;
Standard_Integer Upper() const;
Standard_Address Lock() const;
void Unlock() const;
void Destroy() ;
~DBC_BaseArray()
{
Destroy();
}
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
Standard_Integer mySize;
DBC_DBVArray myData;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
#include <DBC_BaseArray.lxx>
#endif

View File

@ -1,59 +0,0 @@
# Copyright (c) 1999-2014 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.
proc DBC_Copy:AdmFileType {} {
return "dbadmfile";
}
proc DBC_Copy:OutputDirTypeName {} {
return "dbtmpfile";
}
proc DBC_Copy:HandleInputFile { ID } {
scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name
switch $name {
DBC_BaseArray.hxx {return 1;}
default {
return 0;
}
}
}
proc DBC_Copy:Execute { unit args } {
msgprint -i -c "DBC_Copy:Execute" "Copy of DBC_BaseArray include"
foreach file $args {
scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name
if { $name == "DBC_BaseArray.hxx" } {
set source [woklocate -p DBC:source:DBC_BaseArray_objs.hxx [wokinfo -N $unit]]
} else {
set source [woklocate -p DBC:source:$name [wokinfo -N $unit]]
}
set vistarget [woklocate -p DBC:pubinclude:$name [wokinfo -N $unit]]
set target [wokinfo -p pubinclude:$name $unit]
if { [catch {eval exec "cmp $source $vistarget"} ] } {
msgprint -i -c "DBC_Copy:Execute" "Copy $source to $target"
eval exec "cp -p $source $target"
} else {
msgprint -i -c "DBC_Copy:Execute" "No change in $source"
}
}
return 0;
}

View File

@ -1,19 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <DBC_DBVArray.hxx>
#ifdef OBJY
implement(ooVArray, PHandle_PStandard_ArrayNode);
#endif

View File

@ -1,35 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 _DBC_DBVArray_HeaderFile
#define _DBC_DBVArray_HeaderFile
#ifdef OBJY
#include <PStandard_ArrayNode.hxx>
declare(ooVArray,PHandle_PStandard_ArrayNode)
typedef ooVArray(PHandle_PStandard_ArrayNode) DBC_DBVArray;
#endif
#ifdef CSFDB
#include <PStandard_ArrayNode.hxx>
//typedef Handle(PStandard_ArrayNode)* DBC_DBVArray;
typedef void* DBC_DBVArray;
#endif
#ifdef OBJS
#include <PStandard_ArrayNode.hxx>
typedef PStandard_ArrayNode* DBC_DBVArray;
#endif
#endif

View File

@ -1,116 +0,0 @@
-- Created on: 1996-01-30
-- Created by: Kernel
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
generic class VArray from DBC (Item as Storable) inherits BaseArray from DBC
---Purpose: The class VArray represents a unidimensional
-- array of fixed size known at execution time.
-- The range of the element is user defined and varies
-- from 0 to N - 1.
-- Warning: Programs client of such a class must be independant
-- of the range of the last element. Thus, a C++ "for"
-- loop must be written like this
--
-- for (i = 0; i < A.Size(); i++)
-- Implement for ObjectStore and Objectivity
-- with the same functionnality
-- Purpose: New development for OBJY 3.5
uses
BaseArray from DBC
raises NegativeValue, OutOfRange , DimensionMismatch, NullObject
class VArrayNode from DBC
inherits ArrayNode from PStandard
is
Create returns VArrayNode from DBC;
Create(aValue : Item) returns VArrayNode from DBC;
SetValue(me : mutable; aValue : Item);
Value(me) returns Address from Standard;
fields
myValue : Item;
end;
---Purpose: for DFLT profile, we dont need persistent nodes
class VArrayTNode from DBC
is
Create returns VArrayTNode from DBC;
---C++: inline
Create(aValue : Item) returns VArrayTNode from DBC;
---C++: inline
SetValue(me : out; aValue : Item);
---C++: inline
Value(me) returns Address from Standard;
---C++: inline
fields
myValue : Item;
end;
is
Create returns VArray;
---Puspose: Creates an array of null size
-- Raise NullOject if there is no
-- default database
Create (Size: Integer) returns VArray
---Purpose: Creates an array of lower bound 0 and
-- upper bound <Size>-1 . NegativeValue is raised
-- when <Size> is less than 0.
raises NegativeValue;
Create (Varray: VArray) returns VArray;
---Purpose: Creates an array which is the copy of the given
-- argument.
Resize (me : in out; Size: Integer)
raises NegativeValue;
---Purpose: Change the size of an array with lower
-- bound 0 and upper bound <Size>-1 . NegativeValue
-- is raised when <Size> is less than 0.
Assign (me: in out; Other: VArray from DBC)
---Purpose: copy the contents of <Other> into <me>.
-- <Other> and <me> must have the same dimension.
---C++: alias operator =
raises DimensionMismatch from Standard
is static;
SetValue (me : in out; Index: Integer; Value: Item)
---Purpose: Sets the <Index>th element of the array
-- to <Value>.
raises OutOfRange
is static ;
Value (me; Index: Integer) returns Item
---Purpose: Returns the value of the <Index>th element
-- of the array.
---C++: alias operator ()
---C++: return &
raises OutOfRange
is static;
Destroy(me : in out);
---C++: alias ~
end VArray ;

View File

@ -1,288 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <Standard_OutOfRange.hxx>
#include <Standard_NegativeValue.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_NotImplemented.hxx>
#ifdef OBJS
#include <Standard_Persistent.hxx>
// taille a partir de laquelle la tableau cre son propre container
//
#define DBC_TAILLE_PLAFOND_CREATION_SEGMENT 10000
#include <StandardOBJS_PersistentMacro.hxx>
#include <StandardOBJS_PrimitiveTypes.hxx>
// just use for internal generic identifiaction of Item
//
static PStandard_ArrayNode DBC_tmpItem;
#endif
#ifdef OBJS
#include <StandardOBJS_PersistentMacro.hxx>
#endif
DBC_VArray::DBC_VArray() : DBC_BaseArray()
{
#ifdef CSFDB
myData = 0L;
#endif
}
DBC_VArray::DBC_VArray(const Standard_Integer Size) : DBC_BaseArray(Size)
{
if(Size > 0) {
#ifdef CSFDB
myData = (DBC_VArrayTNode*)Standard::Allocate(Size * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for (int i = 0; i < Size; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
ptrtmp++;
}
// myData = new DBC_VArrayTNode[Size];
#endif
#ifdef OBJS
Standard_Integer i;
myData = new (os_segment::of(this),DBC_VArrayNode::get_os_typespec(),Size) DBC_VArrayNode[Size];
#endif
} else {
#ifdef CSFDB
myData = 0L;
#endif
#ifdef OBJS
myData = NULL;
#endif
}
}
DBC_VArray::DBC_VArray(const DBC_VArray& Varray) : DBC_BaseArray(Varray)
{
#ifdef CSFDB
//myData = new DBC_VArrayTNode[mySize];
myData = (DBC_VArrayTNode*)Standard::Allocate(mySize * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for(Standard_Integer i=0; i<mySize; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
((DBC_VArrayTNode*)myData)[i] = ((DBC_VArrayTNode*)Varray.myData)[i];
ptrtmp++;
}
#endif
#ifdef OBJS
myData = new (os_segment::of(this),DBC_VArrayNode::get_os_typespec(),mySize) DBC_VArrayNode[mySize] ;
const DBC_VArrayNode* otherArray = (DBC_VArrayNode*)Varray.myData;
for(Standard_Integer i=0; i<mySize; i++) {
((DBC_VArrayNode*)myData)[i].SetValue(*((Item*)(otherArray[i].Value())));
}
#endif
}
// --------------------------------------------------------------------
// Resize
// --------------------------------------------------------------------
void DBC_VArray::Resize (const Standard_Integer NewSize)
{
Standard_NegativeValue_Raise_if((NewSize < 0),
"DBC_VArray::Resize with a bad size");
#ifdef OBJY
myData.resize((unsigned int)NewSize) ;
#endif
#ifdef OBJSold
Item *newData;
Standard_Integer borne;
INTERNAL_MODE_OODB_START {
os_segment *seg = Storage_CurrentContainer();
newData = Standard_PersistentAllocation(DBC_tmpItem, NewSize);
if ( NewSize < mySize ) {
borne = NewSize;
}
else {
borne = mySize;
}
for( Standard_Integer i=0; i<borne;i++ ) {
newData[i] = myData[i];
}
if ( myData )
delete (PStandard_ArrayNode*) myData;
myData = newData;
Storage_CurrentContainer() = seg;
}
INTERNAL_MODE_OODB_END;
#endif
#ifdef OBJS
if (NewSize > mySize) {
Standard_Integer i;
DBC_VArrayNode* ptr = new (os_segment::of(this),DBC_VArrayNode::get_os_typespec(),NewSize) DBC_VArrayNode[NewSize] ;
for(i = 0; i < mySize; i++) {
((DBC_VArrayNode*)ptr)[i].SetValue(*((Item*)(((DBC_VArrayNode*)myData)[i].Value())));
}
if (myData) delete [] myData; // free old area.
myData = ptr;
}
#endif
#ifdef CSFDB
if(NewSize > mySize || !NewSize){
Standard_Integer i;
DBC_VArrayTNode* ptr = 0L;
if(NewSize) {
ptr = (DBC_VArrayTNode*)Standard::Allocate(NewSize * sizeof(DBC_VArrayTNode));
}
DBC_VArrayTNode* ptrtmp = ptr;
if (mySize > 0) {
if(NewSize) {
for(i = 0; i < mySize; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
ptr[i].SetValue(*((Item *)((DBC_VArrayTNode*)myData)[i].Value()));
ptrtmp++;
}
}
ptrtmp = (DBC_VArrayTNode*)myData;
for(i = 0; i < mySize; i++) {
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
ptrtmp++;
}
Standard::Free(myData);
} else {
for(i = 0; i < NewSize; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
ptrtmp++;
}
}
myData = ptr;
}
#endif
mySize = NewSize;
}
// --------------------------------------------------------------------
//
// --------------------------------------------------------------------
Item& DBC_VArray::Value( const Standard_Integer Index) const
{
Standard_OutOfRange_Raise_if((Index < 0 || Index >= mySize),
"Index out of range in VArray::Value");
#ifdef OBJY
Handle(DBC_VArrayNode) theNode = Handle(DBC_VArrayNode)::DownCast(myData.elem((unsigned int)Index));
return *((Item *)theNode->Value());
#endif
#ifdef OBJSold
return myData[Index];
#endif
#ifdef OBJS
return *((Item*)(((DBC_VArrayNode*)myData)[Index].Value()));
#endif
#ifdef CSFDB
return *((Item *)((DBC_VArrayTNode*)myData)[Index].Value());
#endif
}
void DBC_VArray::Assign (const DBC_VArray& Right)
{
#ifdef OBJY
myData.operator=(Right.myData);
#endif
#ifdef OBJS
INTERNAL_MODE_OODB_START {
for(Standard_Integer i=0; i< mySize; i++){
((DBC_VArrayNode*)myData)[i].SetValue(*((Item*)(((DBC_VArrayNode*)Right.myData)[i].Value())));
}
}
INTERNAL_MODE_OODB_END;
#endif
#ifdef CSFDB
Standard_Integer i;
for(i = 0; i < mySize; i++) {
((DBC_VArrayTNode*)myData)[i].SetValue(*((Item *)((DBC_VArrayTNode*)Right.myData)[i].Value()));
}
#endif
}
// --------------------------------------------------------------------
// SetValue
// --------------------------------------------------------------------
void DBC_VArray::SetValue(const Standard_Integer Index, const Item& Value)
{
Standard_OutOfRange_Raise_if((Index < 0 || Index >= mySize),
"Index out of range in VArray::SetValue");
#ifdef OBJY
if (myData.elem((unsigned int)Index).IsNull())
{
Handle(DBC_VArrayNode) theNode = new DBC_VArrayNode;
myData.elem((unsigned int)Index) = theNode;
theNode->SetValue(Value);
}
else
{
Handle(DBC_VArrayNode) theNode = Handle(DBC_VArrayNode)::DownCast(myData.elem((unsigned int)Index));
theNode->SetValue(Value);
}
#endif
#ifdef OBJSold
INTERNAL_MODE_OODB_START {
myData[Index] = Value;
}
INTERNAL_MODE_OODB_END;
#endif
#ifdef OBJS
((DBC_VArrayNode*)myData)[Index].SetValue(Value);
#endif
#ifdef CSFDB
((DBC_VArrayTNode*)myData)[Index].SetValue(Value);
#endif
}
void DBC_VArray::Destroy()
{
#ifdef CSFDB
if (myData && mySize > 0) {
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for(Standard_Integer i = 0; i < mySize; i++) {
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
ptrtmp++;
}
Standard::Free(myData);
myData = 0L;
}
#endif
}

View File

@ -1,34 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <DBC_BaseArray.hxx>
DBC_VArrayNode::DBC_VArrayNode()
{
}
DBC_VArrayNode::DBC_VArrayNode(const Item& aValue)
{
myValue = aValue;
}
void DBC_VArrayNode::SetValue(const Item& aValue)
{
myValue = aValue;
}
Standard_Address DBC_VArrayNode::Value() const
{
return (Standard_Address)&myValue;
}

View File

@ -1,16 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <DBC_BaseArray.hxx>

View File

@ -1,32 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
inline DBC_VArrayTNode::DBC_VArrayTNode()
{
}
inline DBC_VArrayTNode::DBC_VArrayTNode(const Item& aValue)
{
myValue = aValue;
}
inline void DBC_VArrayTNode::SetValue(const Item& aValue)
{
myValue = aValue;
}
inline Standard_Address DBC_VArrayTNode::Value() const
{
return (Standard_Address)&myValue;
}

View File

@ -1,26 +0,0 @@
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
@ifnotdefined(%DBC_WOKSteps_EDL) then
@set %DBC_WOKSteps_EDL = "";
@if ( %DBMS == "OBJS" ) then
@string %WOKSteps_XcppGroup += " xcpp.copy ";
@set %WOKSteps_xcpp_copy = "DBC_Copy(xcpp.header)";
@endif;
@endif;

View File

@ -1,5 +0,0 @@
DBC_BaseArray_objs.hxx
DBC_DBVArray.cxx
DBC_DBVArray.hxx
DBC_Copy.tcl
DBC_WOKSteps.edl

View File

@ -1,176 +0,0 @@
-- Created by: DAUTRY Philippe
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- ---------
---Version: 0.0
--Version Date Purpose
-- 0.0 Mar 13 1997 Creation
package MDF
---Purpose: This package provides classes and methods to
-- translate a transient DF into a persistent one and
-- vice versa.
--
-- Driver
--
-- A driver is a tool used to translate a transient
-- attribute into a persistent one and vice versa.
--
-- Relocation Table
--
-- A relocation table is a tool who provides services
-- to relocate transient objects into persistent ones
-- (or vice versa). It uses a map system to keep the
-- sharing. This service is used by the drivers.
--
-- Driver Table
--
-- A driver table is an object building links between
-- object types and object drivers. In the
-- translation process, a driver table is asked to
-- give a translation driver for each current object
-- to be translated.
uses
Standard,
MMgt,
TCollection,
TColStd,
PColStd,
PTColStd,
TDF,
CDM,
PDF
is
---Category: Classes
-- =============================================================
deferred class ASDriver; -- Attribute Storage Driver.
deferred class ARDriver; -- Attribute Retrieval Driver.
generic class RelocationTable; -- Relocation Table.
generic class DriverTable,
DriverList,
TypeDriverListMap; -- Driver Table.
class Tool from MDF;
---Category: Storage and Retrieval attributes drivers
-- ========================================
class TagSourceStorageDriver;
class TagSourceRetrievalDriver;
class ReferenceStorageDriver;
class ReferenceRetrievalDriver;
---Category: Instantiations
-- =============================================================
class ASDriverSequence instantiates Sequence from TCollection
(ASDriver from MDF);
class ASDriverHSequence instantiates HSequence from TCollection
(ASDriver from MDF,
ASDriverSequence from MDF);
class ARDriverSequence instantiates Sequence from TCollection
(ARDriver from MDF);
class ARDriverHSequence instantiates HSequence from TCollection
(ARDriver from MDF,
ARDriverSequence from MDF);
-- Storage Relocation Table (Transient->Persistent)
class SRelocationTable instantiates RelocationTable from MDF
(Attribute from TDF,
Attribute from PDF,
Transient from Standard,
Persistent from Standard,
TransientPersistentMap from PTColStd);
-- Retrieval Relocation Table (Persistent->Transient)
class RRelocationTable instantiates RelocationTable from MDF
(Attribute from PDF,
Attribute from TDF,
Persistent from Standard,
Transient from Standard,
PersistentTransientMap from PTColStd);
-- Map (Type, ASDriver)
class TypeASDriverMap instantiates DataMap from TCollection
(Type from Standard,
ASDriver from MDF,
MapTransientHasher from TColStd);
-- Map (Type, ARDriver)
class TypeARDriverMap instantiates DataMap from TCollection
(Type from Standard,
ARDriver from MDF,
MapTransientHasher from TColStd);
-- Attribute Storage Driver Table.
class ASDriverTable instantiates DriverTable from MDF
(ASDriver from MDF,
ASDriverHSequence from MDF,
TypeASDriverMap from MDF);
-- Attribute Retrieval Driver Table.
class ARDriverTable instantiates DriverTable from MDF
(ARDriver from MDF,
ARDriverHSequence from MDF,
TypeARDriverMap from MDF);
-- From Source To Target Object...
-- ===============================
FromTo(aSource : Data from TDF;
aTarget : in out Data from PDF;
aDriverTable : ASDriverTable from MDF;
aReloc : SRelocationTable from MDF;
aVersion : Integer from Standard = 0);
---Purpose: Translates a transient <aSource> into a persistent
-- <aTarget>.
FromTo(aSource : Data from PDF;
aTarget : in out Data from TDF;
aDriverTable : ARDriverTable from MDF;
aReloc : RRelocationTable from MDF);
---Purpose: Translates a persistent <aSource> into a transient
-- <aTarget>.
AddStorageDrivers(aDriverSeq : ASDriverHSequence from MDF; theMessageDriver : MessageDriver from CDM);
---Purpose: Adds the attribute storage drivers to <aDriverSeq>.
AddRetrievalDrivers(aDriverSeq : ARDriverHSequence from MDF; theMessageDriver : MessageDriver from CDM);
---Purpose: Adds the attribute retrieval drivers to <aDriverSeq>.
end MDF;

View File

@ -1,121 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// ---------
// Version: 0.0
//Version Date Purpose
// 0.0 Mar 13 1997 Creation
#include <MDF.ixx>
#include <TDF_Attribute.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <MDF_RRelocationTable.hxx>
#include <MDF_SRelocationTable.hxx>
#include <MDF_Tool.hxx>
#include <MDF_TypeARDriverMap.hxx>
#include <MDF_TypeASDriverMap.hxx>
#include <PDF_Attribute.hxx>
#include <PDF_HAttributeArray1.hxx>
#include <PColStd_HArray1OfInteger.hxx>
#include <PTColStd_TransientPersistentMap.hxx>
#include <MDF_TagSourceStorageDriver.hxx>
#include <MDF_TagSourceRetrievalDriver.hxx>
#include <MDF_ReferenceStorageDriver.hxx>
#include <MDF_ReferenceRetrievalDriver.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : FromTo
//purpose : From TRANSIENT to PERSISTENT.
//=======================================================================
void MDF::FromTo
(const Handle(TDF_Data)& aSource,
Handle(PDF_Data)& aTarget,
const Handle(MDF_ASDriverTable)& aDriverTable,
const Handle(MDF_SRelocationTable)& aReloc,
const Standard_Integer aVersion)
{
// Into Data.
aTarget = new PDF_Data(aVersion);
// Extraction of the driver subset.
const MDF_TypeASDriverMap& driverMap =
aDriverTable->GetDrivers(aVersion);
// Translation.
MDF_Tool::WriteLabels(aSource, aTarget, driverMap, aReloc);
MDF_Tool::WriteAttributes(driverMap, aReloc);
}
//=======================================================================
//function : FromTo
//purpose : From PERSISTENT to TRANSIENT.
//=======================================================================
void MDF::FromTo
(const Handle(PDF_Data)& aSource,
Handle(TDF_Data)& aTarget,
const Handle(MDF_ARDriverTable)& aDriverTable,
const Handle(MDF_RRelocationTable)& aReloc)
{
// Version number.
Standard_Integer version = aSource->VersionNumber();
// Extraction of the driver subset.
const MDF_TypeARDriverMap& driverMap =
aDriverTable->GetDrivers(version);
// Translation.
MDF_Tool::ReadLabels(aSource, aTarget, driverMap, aReloc);
MDF_Tool::ReadAttributes(driverMap, aReloc);
}
//=======================================================================
//function : AddStorageDriver
//purpose :
//=======================================================================
void MDF::AddStorageDrivers
(const Handle(MDF_ASDriverHSequence)& theDriverSeq,const Handle(CDM_MessageDriver)& theMsgDriver)
{
theDriverSeq->Append(new MDF_TagSourceStorageDriver(theMsgDriver));
theDriverSeq->Append(new MDF_ReferenceStorageDriver(theMsgDriver));
}
//=======================================================================
//function : AddRetrievalDriver
//purpose :
//=======================================================================
void MDF::AddRetrievalDrivers
(const Handle(MDF_ARDriverHSequence)& theDriverSeq, const Handle(CDM_MessageDriver)& theMsgDriver)
{
theDriverSeq->Append(new MDF_TagSourceRetrievalDriver(theMsgDriver));
theDriverSeq->Append(new MDF_ReferenceRetrievalDriver(theMsgDriver));
}

View File

@ -1,71 +0,0 @@
-- Created by: DAUTRY Philippe
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- ----------------
---Version: 0.0
--Version Date Purpose
-- 0.0 Apr 4 1997 Creation
deferred class ARDriver from MDF
inherits TShared from MMgt
---Purpose: Attribute Retrieval Driver.
uses
Attribute from TDF,
Attribute from PDF,
RRelocationTable from MDF,
MessageDriver from CDM,
ExtendedString from TCollection
-- raises
is
Initialize (theMessageDriver : MessageDriver from CDM);
VersionNumber(me) returns Integer from Standard
is deferred;
---Purpose: Returns the version number from which the driver
-- is available.
SourceType(me) returns Type from Standard
is deferred;
---Purpose: Returns the type of source object, inheriting from
-- Attribute from PDF.
NewEmpty(me)
returns Attribute from TDF
is deferred;
---Purpose: Creates a new attribute from PDF.
Paste(me;
aSource : Attribute from PDF;
aTarget : Attribute from TDF;
aRelocTable : RRelocationTable from MDF)
is deferred;
---Purpose: Translate the contents of <aSource> and put it
-- into <aTarget>, using the relocation table
-- <aRelocTable> to keep the sharings.
WriteMessage (me; theMessage : ExtendedString from TCollection);
---Purpose: To send message to Application (if MessageDriver defined)
fields
myMessageDriver : MessageDriver from CDM;
end ARDriver;

View File

@ -1,42 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// ----------------
// Version: 0.0
//Version Date Purpose
// 0.0 Apr 28 1997 Creation
#include <MDF_ARDriver.ixx>
#include <TCollection_ExtendedString.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDF_ARDriver
//purpose :
//=======================================================================
MDF_ARDriver::MDF_ARDriver (const Handle(CDM_MessageDriver)& theMsgDriver)
: myMessageDriver (theMsgDriver) {}
//=======================================================================
//function : WriteMessage
//purpose :
//=======================================================================
void MDF_ARDriver::WriteMessage(const TCollection_ExtendedString& theMessage) const {
myMessageDriver->Write (theMessage.ToExtString());
}

View File

@ -1,72 +0,0 @@
-- Created by: DAUTRY Philippe
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- ----------------
---Version: 0.0
--Version Date Purpose
-- 0.0 Apr 4 1997 Creation
deferred class ASDriver from MDF
inherits TShared from MMgt
---Purpose: Attribute Storage Driver.
uses
Attribute from TDF,
Attribute from PDF,
SRelocationTable from MDF,
MessageDriver from CDM,
ExtendedString from TCollection
-- raises
is
Initialize (theMessageDriver : MessageDriver from CDM);
VersionNumber(me) returns Integer from Standard
is deferred;
---Purpose: Returns the version number from which the driver
-- is available.
SourceType(me) returns Type from Standard
is deferred;
---Purpose: Returns the type of source object, inheriting from
-- Attribute from TDF.
NewEmpty(me)
returns Attribute from PDF
is deferred;
---Purpose: Creates a new attribute from PDF.
Paste(me;
aSource : Attribute from TDF;
aTarget : Attribute from PDF;
aRelocTable : SRelocationTable from MDF)
is deferred;
---Purpose: Translate the contents of <aSource> and put it
-- into <aTarget>, using the relocation table
-- <aRelocTable> to keep the sharings.
WriteMessage (me; theMessage : ExtendedString from TCollection);
---Purpose: To send message to Application (if MessageDriver defined)
fields
myMessageDriver : MessageDriver from CDM;
end ASDriver;

View File

@ -1,42 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// ----------------
// Version: 0.0
//Version Date Purpose
// 0.0 Apr 28 1997 Creation
#include <MDF_ASDriver.ixx>
#include <TCollection_ExtendedString.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDF_ASDriver
//purpose :
//=======================================================================
MDF_ASDriver::MDF_ASDriver (const Handle(CDM_MessageDriver)& theMsgDriver)
: myMessageDriver (theMsgDriver) {}
//=======================================================================
//function : WriteMessage
//purpose :
//=======================================================================
void MDF_ASDriver::WriteMessage(const TCollection_ExtendedString& theMessage) const {
myMessageDriver->Write (theMessage.ToExtString());
}

View File

@ -1,98 +0,0 @@
-- Created by: DAUTRY Philippe
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- -------------------
---Version: 0.0
--Version Date Purpose
-- 0.0 May 6 1997 Creation
generic class DriverTable from MDF
(TheHDriver as Transient from Standard;
TheDriverHSeq as Transient from Standard;
TheTypeDriverMap as any)
inherits TShared from MMgt
---Purpose: A driver table is an object building links between
-- object types and object drivers. In the
-- translation process, a driver table is asked to
-- give a translation driver for each current object
-- to be translated.
--
-- Validity range of a driver: a driver is available
-- from its version number till the next upper
-- version number.
uses
Type from Standard,
MapTransientHasher from TColStd
-- raises
class DriverList instantiates List from TCollection
(TheHDriver);
class TypeDriverListMap instantiates DataMap from TCollection
(Type from Standard,
DriverList,
MapTransientHasher from TColStd);
is
Create returns DriverTable from MDF;
---Purpose: Creates a mutable DriverTable from MDF.
SetDriver(me : mutable;
anHDriver : TheHDriver);
---Purpose: Sets a translation driver: <aDriver>.
SetDrivers(me : mutable;
aDriverHSeq : TheDriverHSeq);
---Purpose: Sets translation drivers.
GetDrivers(me : mutable;
aVersion : Integer from Standard = 0)
returns TheTypeDriverMap;
---Purpose: Gets a map of drivers available for <aVersion>.
--
-- If <aVersion> is not given or is null, the highest
-- version number driver is returned.
--
---C++: return const &
GetDriver(me;
aType : Type from Standard;
anHDriver : in out TheHDriver;
aVersion : Integer from Standard = 0)
returns Boolean from Standard;
---Purpose: Gets a driver <aDriver> according to <aType> and
-- <aVersion>.
--
-- If <aVersion> is not given or is null, the highest
-- version number driver is returned.
--
-- Returns True if a driver is found; false otherwise.
fields
myVersion : Integer from Standard;
myMap : TheTypeDriverMap; -- available for myVersion.
myMapOfLst : TypeDriverListMap;
end DriverTable;

View File

@ -1,149 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// -------------------
// Version: 0.0
//Version Date Purpose
// 0.0 May 6 1997 Creation
#include TheHDriver_hxx
#include MDF_DataMapIteratorOfTypeDriverListMap_hxx
#include MDF_DriverList_hxx
//=======================================================================
//function : MDF_DriverTable
//purpose :
//=======================================================================
MDF_DriverTable::MDF_DriverTable() :
myVersion(-1)
{}
//=======================================================================
//function : SetDriver
//purpose : Sets a driver in its List,
// in decreasing version number order
//=======================================================================
void MDF_DriverTable::SetDriver
(const Handle(TheHDriver)& anHDriver)
{
const Handle(Standard_Type)& type = anHDriver->SourceType();
if (myMapOfLst.IsBound(type)) {
MDF_DriverList& lst = myMapOfLst.ChangeFind(type);
if (lst.IsEmpty()) {
lst.Append(anHDriver);
}
else {
Standard_Integer driverVersion = anHDriver->VersionNumber();
Standard_Integer currentVersion;
for (MDF_ListIteratorOfDriverList itr(lst); itr.More(); itr.Next()) {
const Handle(TheHDriver)& driver = itr.Value();
currentVersion = driver->VersionNumber();
if (driverVersion == currentVersion) {
lst.Remove(itr);
if (lst.IsEmpty()) lst.Append(anHDriver);
else lst.InsertBefore(anHDriver,itr);
break;
}
else if (driverVersion > currentVersion) {
lst.InsertAfter(anHDriver,itr);
break;
}
}
}
}
else {
MDF_DriverList lst;
lst.Append(anHDriver);
myMapOfLst.Bind(type,lst);
}
myMap.Clear();
}
//=======================================================================
//function : SetDrivers
//purpose :
//=======================================================================
void MDF_DriverTable::SetDrivers
(const Handle(TheDriverHSeq)& aDriverHSeq)
{
const Standard_Integer upper = aDriverHSeq->Length();
for (Standard_Integer i = 1; i <= upper; ++i)
SetDriver(aDriverHSeq->Value(i));
}
//=======================================================================
//function : GetDrivers
//purpose :
//=======================================================================
const TheTypeDriverMap& MDF_DriverTable::GetDrivers
(const Standard_Integer aVersion)
{
if ((myMap.IsEmpty()) || (myVersion != aVersion)) {
// Rebuild the map.
Handle(TheHDriver) driver;
MDF_DataMapIteratorOfTypeDriverListMap itr(myMapOfLst);
for ( ; itr.More(); itr.Next()) {
const Handle(Standard_Type)& type = itr.Key();
if (MDF_DriverTable::GetDriver(type, driver, aVersion))
myMap.Bind(type, driver);
}
myVersion = aVersion;
}
return myMap;
}
//=======================================================================
//function : GetDriver
//purpose :
//=======================================================================
Standard_Boolean MDF_DriverTable::GetDriver
(const Handle(Standard_Type)& aType,
Handle(TheHDriver)& anHDriver,
const Standard_Integer aVersion) const
{
Standard_Boolean found = Standard_False;
if (myMapOfLst.IsBound(aType)) {
const MDF_DriverList& lst = myMapOfLst.Find(aType);
if ( (aVersion == 0) && !lst.IsEmpty() ) {
found = Standard_True;
anHDriver = lst.First();
}
else {
for (MDF_ListIteratorOfDriverList itr(lst); itr.More(); itr.Next()) {
const Handle(TheHDriver)& driver = itr.Value();
if (driver->VersionNumber() >= aVersion) {
found = Standard_True;
anHDriver = driver;
break;
}
}
}
}
return found;
}

View File

@ -1,49 +0,0 @@
-- Created on: 1997-08-07
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class ReferenceRetrievalDriver from MDF inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns ReferenceRetrievalDriver from MDF;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Reference from PDF.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ReferenceRetrievalDriver;

View File

@ -1,58 +0,0 @@
// Copyright (c) 1999-2014 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 <MDF_ReferenceRetrievalDriver.ixx>
#include <PCollection_HAsciiString.hxx>
#include <PDF_Reference.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TCollection_AsciiString.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TDF_Reference.hxx>
#include <CDM_MessageDriver.hxx>
#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
#define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
#define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
MDF_ReferenceRetrievalDriver::MDF_ReferenceRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
Standard_Integer MDF_ReferenceRetrievalDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDF_ReferenceRetrievalDriver::SourceType() const
{ return STANDARD_TYPE (PDF_Reference); }
Handle(TDF_Attribute) MDF_ReferenceRetrievalDriver::NewEmpty() const
{ return new TDF_Reference; }
void MDF_ReferenceRetrievalDriver::Paste (
const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
// const Handle(MDF_RRelocationTable)& RelocTable) const
const Handle(MDF_RRelocationTable)& ) const
{
DeclareAndSpeedCast(Source,PDF_Reference,S);
DeclareAndSpeedCast(Target,TDF_Reference,T);
TDF_Label tLab; // Null label.
Handle(PCollection_HAsciiString) pEntry = S->ReferencedLabel();
if (!pEntry.IsNull()) {
TCollection_AsciiString entry = pEntry->Convert();
TDF_Tool::Label(T->Label().Data(),entry,tLab,Standard_True);
}
T->Set(tLab);
}

View File

@ -1,51 +0,0 @@
-- Created on: 1997-08-07
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class ReferenceStorageDriver from MDF inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ReferenceStorageDriver from MDF;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDF.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end ReferenceStorageDriver;

View File

@ -1,64 +0,0 @@
// Copyright (c) 1999-2014 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 <MDF_ReferenceStorageDriver.ixx>
#include <PCollection_HAsciiString.hxx>
#include <PDF_Reference.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TCollection_AsciiString.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TDF_Reference.hxx>
#include <CDM_MessageDriver.hxx>
#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
#define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
#define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
MDF_ReferenceStorageDriver::MDF_ReferenceStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
Standard_Integer MDF_ReferenceStorageDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDF_ReferenceStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDF_Reference); }
Handle(PDF_Attribute) MDF_ReferenceStorageDriver::NewEmpty() const
{ return new PDF_Reference; }
void MDF_ReferenceStorageDriver::Paste (
const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
// const Handle(MDF_SRelocationTable)& RelocTable) const
const Handle(MDF_SRelocationTable)& ) const
{
DeclareAndSpeedCast(Source,TDF_Reference,S);
DeclareAndSpeedCast(Target,PDF_Reference,T);
Handle(PCollection_HAsciiString) pEntry; // Null handle.
if (!S.IsNull()) {
const TDF_Label& lab = S->Label();
const TDF_Label& refLab = S->Get();
if (!lab.IsNull() && !refLab.IsNull()) {
if (lab.IsDescendant(refLab.Root())) {
// Ref. interne.
TCollection_AsciiString entry;
TDF_Tool::Entry(refLab,entry);
pEntry = new PCollection_HAsciiString(entry);
}
}
}
T->ReferencedLabel(pEntry);
}

View File

@ -1,120 +0,0 @@
-- Created by: DAUTRY Philippe
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- -----------------------
---Version: 0.0
--Version Date Purpose
-- 0.0 May 7 1997 Creation
generic class RelocationTable from MDF
(TheSourceType as any;
TheTargetType as any;
TheOtherSourceType as any;
TheOtherTargetType as any;
TheMapType as any)
inherits TShared from MMgt
---Purpose: Storage Relocation Table
-- (Transient->Persistent). It is a relocation
-- dictionnary.
uses
Tool from MDF
-- raises
is
Create(theSelfRelocation : Boolean from Standard = Standard_False)
returns RelocationTable from MDF;
---Purpose: Creates a relocation table.
-- <theSelfRelocation> status says that the relocation table allows self relocation.
SetSelfRelocation(me : mutable; theStatus : Boolean from Standard = Standard_True);
---Purpose: Sets self relocation status.
IsSelfRelocation(me)
---Purpose: Returns true if the self relocation status is set.
returns Boolean from Standard;
-- Attribute relocation methods.
-- ---------
SetRelocation(me : mutable;
aSourceAttribute : TheSourceType;
aTargetAttribute : TheTargetType);
---Purpose: Sets the relocation value of <aSourceAttribute> to
-- <aTargetAttribute>.
HasRelocation(me : mutable;
aSourceAttribute : TheSourceType;
aTargetAttribute : in out TheTargetType)
returns Boolean from Standard;
---Purpose: Finds the relocation value of <aSourceAttribute>
-- and returns it into <aTargetAttribute>.
--
-- If a value is found, returns True; False otherwise.
-- Transient other types object relocation methods.
-- ---------------------
SetOtherRelocation(me : mutable;
aSource : TheOtherSourceType;
aTarget : TheOtherTargetType);
---Purpose: Sets the relocation value of <aSourceTransient> to
-- <aTargetTransient>.
HasOtherRelocation(me : mutable;
aSource : TheOtherSourceType;
aTarget : in out TheOtherTargetType)
returns Boolean from Standard;
---Purpose: Finds the relocation value of <aSource>
-- and returns it into <aTarget>.
--
-- If a value is found, returns True; False otherwise.
-- Try not to use the following methods...
AttributeTable(me : mutable)
returns TheMapType;
---Purpose: Returns <myAttributeTable> to be read or
-- updated. Please, for a better security, avoid to
-- use this method.
--
---C++: return &
OtherTable(me : mutable)
returns TheMapType;
---Purpose: Returns <myOtherTable> to be read or
-- updated. Please, for a better security, avoid to
-- use this method.
--
---C++: return &
fields
myAttributeTable : TheMapType;
myOtherTable : TheMapType;
mySelfRelocation : Boolean from Standard;
end RelocationTable;

View File

@ -1,128 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// -----------------------
// Version: 0.0
//Version Date Purpose
// 0.0 May 7 1997 Creation
#include TheSourceType_hxx
#include TheTargetType_hxx
#include TheOtherSourceType_hxx
#include TheOtherTargetType_hxx
//=======================================================================
//function : MDF_RelocationTable
//purpose :
//=======================================================================
MDF_RelocationTable::MDF_RelocationTable(const Standard_Boolean theSelfRelocation):mySelfRelocation(theSelfRelocation) {}
//=======================================================================
//function : SetSelfRelocation
//purpose :
//=======================================================================
void MDF_RelocationTable::SetSelfRelocation(const Standard_Boolean theStatus) {
mySelfRelocation = theStatus;
}
//=======================================================================
//function : IsSelfRelocation
//purpose :
//=======================================================================
Standard_Boolean MDF_RelocationTable::IsSelfRelocation() const {
return mySelfRelocation;
}
//=======================================================================
//function : SetRelocation
//purpose :
//=======================================================================
void MDF_RelocationTable::SetRelocation
(const TheSourceType& aSourceAttribute,
const TheTargetType& aTargetAttribute)
{ myAttributeTable.Bind (aSourceAttribute, aTargetAttribute); }
//=======================================================================
//function : HasRelocation
//purpose :
//=======================================================================
Standard_Boolean MDF_RelocationTable::HasRelocation
(const TheSourceType& aSourceAttribute,
TheTargetType& aTargetAttribute)
{
Standard_Boolean isFound = myAttributeTable.IsBound (aSourceAttribute);
if (isFound) aTargetAttribute = TheTargetType::DownCast(myAttributeTable.Find(aSourceAttribute));
else if (mySelfRelocation) isFound = Standard_True;
return isFound;
}
//=======================================================================
//function : SetOtherRelocation
//purpose :
//=======================================================================
void MDF_RelocationTable::SetOtherRelocation
(const TheOtherSourceType& aSource,
const TheOtherTargetType& aTarget)
{ myOtherTable.Bind (aSource, aTarget); }
//=======================================================================
//function : HasOtherRelocation
//purpose :
//=======================================================================
Standard_Boolean MDF_RelocationTable::HasOtherRelocation
(const TheOtherSourceType& aSource,
TheOtherTargetType& aTarget)
{
Standard_Boolean isFound = myOtherTable.IsBound (aSource);
if (isFound) aTarget = myOtherTable.Find (aSource);
else if (mySelfRelocation) isFound = Standard_True;
return isFound;
}
//=======================================================================
//function : AttributeTable
//purpose :
//=======================================================================
TheMapType& MDF_RelocationTable::AttributeTable()
{ return myAttributeTable; }
//=======================================================================
//function : OtherTable
//purpose :
//=======================================================================
TheMapType& MDF_RelocationTable::OtherTable()
{ return myOtherTable; }

View File

@ -1,49 +0,0 @@
-- Created on: 1997-08-07
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class TagSourceRetrievalDriver from MDF inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create (theMessageDriver : MessageDriver from CDM) -- Version 0
returns TagSourceRetrievalDriver from MDF;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: TagSource from PDF.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end TagSourceRetrievalDriver;

View File

@ -1,39 +0,0 @@
// Copyright (c) 1999-2014 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 <MDF_TagSourceRetrievalDriver.ixx>
#include <PDF_TagSource.hxx>
#include <TDF_TagSource.hxx>
#include <CDM_MessageDriver.hxx>
MDF_TagSourceRetrievalDriver::MDF_TagSourceRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
Standard_Integer MDF_TagSourceRetrievalDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDF_TagSourceRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDF_TagSource); }
Handle(TDF_Attribute) MDF_TagSourceRetrievalDriver::NewEmpty() const
{ return new TDF_TagSource; }
//void MDF_TagSourceRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& RelocTable) const
void MDF_TagSourceRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDF_TagSource) S = Handle(PDF_TagSource)::DownCast (Source);
Handle(TDF_TagSource) T = Handle(TDF_TagSource)::DownCast (Target);
T->Set (S->Get ());
}

View File

@ -1,50 +0,0 @@
-- Created on: 1997-08-07
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class TagSourceStorageDriver from MDF inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns TagSourceStorageDriver from MDF;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDF.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end TagSourceStorageDriver;

View File

@ -1,39 +0,0 @@
// Copyright (c) 1999-2014 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 <MDF_TagSourceStorageDriver.ixx>
#include <PDF_TagSource.hxx>
#include <TDF_TagSource.hxx>
#include <CDM_MessageDriver.hxx>
MDF_TagSourceStorageDriver::MDF_TagSourceStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
Standard_Integer MDF_TagSourceStorageDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDF_TagSourceStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDF_TagSource); }
Handle(PDF_Attribute) MDF_TagSourceStorageDriver::NewEmpty() const
{ return new PDF_TagSource (); }
//void MDF_TagSourceStorageDriver::Paste(const Handle(TDF_Attribute)& Source,const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& RelocTable) const
void MDF_TagSourceStorageDriver::Paste(const Handle(TDF_Attribute)& Source,const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDF_TagSource) S = Handle(TDF_TagSource)::DownCast (Source);
Handle(PDF_TagSource) T = Handle(PDF_TagSource)::DownCast (Target);
T->Set (S->Get ());
}

View File

@ -1,93 +0,0 @@
-- Created by: DAUTRY Philippe
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- --------------
---Version: 0.0
--Version Date Purpose
-- 0.0 Mar 13 1997 Creation
class Tool from MDF
---Purpose: A tool to translate...
uses
Label from TDF,
Data from TDF,
Data from PDF,
HAttributeArray1 from PDF,
TypeARDriverMap from MDF,
TypeASDriverMap from MDF,
ARDriverTable from MDF,
ASDriverTable from MDF,
RRelocationTable from MDF,
SRelocationTable from MDF,
Integer from Standard,
HArray1OfInteger from PColStd,
TransientPersistentMap from PTColStd
-- raises
is
WriteLabels(myclass;
aSource : Data from TDF;
aTarget : Data from PDF;
aDriverMap : TypeASDriverMap from MDF;
aReloc : SRelocationTable from MDF);
---Purpose: Writes the labels with empty attributes.
WriteLabels(myclass;
aSourceLab : Label from TDF;
theLabels : HArray1OfInteger from PColStd;
theAttributes : HAttributeArray1 from PDF;
aDriverMap : TypeASDriverMap from MDF;
aReloc : SRelocationTable from MDF;
labAlloc : in out Integer from Standard;
attAlloc : in out Integer from Standard);
---Purpose: Used for recursivity.
WriteAttributes(myclass;
aDriverMap : TypeASDriverMap from MDF;
aReloc : SRelocationTable from MDF);
---Purpose: Writes attributes content.
ReadLabels(myclass;
aSource : Data from PDF;
aTarget : Data from TDF;
aDriverMap : TypeARDriverMap from MDF;
aReloc : RRelocationTable from MDF);
---Purpose: Reads the labels abd adds empty attributes to them.
ReadLabels(myclass;
anIns : in out Label from TDF;
theLabels : HArray1OfInteger from PColStd;
theAttributes : HAttributeArray1 from PDF;
aDriverMap : TypeARDriverMap from MDF;
aReloc : RRelocationTable from MDF;
labRead : in out Integer from Standard;
attRead : in out Integer from Standard);
---Purpose: Used for recursivity.
ReadAttributes(myclass;
aDriverMap : TypeARDriverMap from MDF;
aReloc : RRelocationTable from MDF);
---Purpose: Reads attributes content and paste them.
end Tool;

View File

@ -1,456 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// --------------
// Version: 0.0
//Version Date Purpose
// 0.0 Mar 13 1997 Creation
#include <MDF_Tool.ixx>
#include <MDF_ARDriver.hxx>
#include <MDF_ASDriver.hxx>
#include <MDF_RRelocationTable.hxx>
#include <MDF_SRelocationTable.hxx>
#include <PDF_Attribute.hxx>
#include <PDF_HAttributeArray1.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_AttributeIterator.hxx>
#include <TDF_ListIteratorOfAttributeList.hxx>
#include <TDF_AttributeList.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <PTColStd_DataMapIteratorOfPersistentTransientMap.hxx>
#include <PTColStd_DataMapIteratorOfTransientPersistentMap.hxx>
#include <PTColStd_PersistentTransientMap.hxx>
#include <PTColStd_TransientPersistentMap.hxx>
#include <Standard_GUID.hxx>
#ifdef OCCT_DEBUG
#include <Standard_ConstructionError.hxx>
#endif
#define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
#define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
#define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
#include <NCollection_List.hxx>
typedef struct {
Handle(PDF_Attribute) pAtt;
Handle(TDF_Attribute) tAtt;
} ATTR;
typedef NCollection_List<ATTR> MDF_AttributeList;
typedef MDF_AttributeList::Iterator MDF_ListIteratorOfAttributeList;
#undef DEB_MDF_TOOL
// Persistent structure:
//
// Label Array Item
//
// (Tag; NbOfAttributes; NbOfChildren)
//
// The attributes are stored sequencially in the Attribute Array.
// The children of a label are stored recursively after the label item itself.
// W W RRRRR III TTTTT EEEEE
// W W R R I T E
// W W R R I T E
// W W W RRRRR I T EEE
// WW WW R R I T E
// W W R R III T EEEEE
//=======================================================================
//function : MDF_NbAttributesWithDriver
//purpose :
//=======================================================================
static Standard_Integer MDF_NbAttributesWithDriver
(const TDF_Label& aLabel,
const MDF_TypeASDriverMap& aDriverMap)
{
Standard_Integer n = 0;
for (TDF_AttributeIterator itr1(aLabel); itr1.More(); itr1.Next())
if (aDriverMap.IsBound(itr1.Value()->DynamicType())) ++n;
for (TDF_ChildIterator itr2(aLabel); itr2.More(); itr2.Next())
n += MDF_NbAttributesWithDriver(itr2.Value(),aDriverMap);
return n;
}
//=======================================================================
//function : WriteLabels
//purpose : TRANSIENT -> PERSISTENT;
// writes the arrays contents with empty attributes.
//=======================================================================
void MDF_Tool::WriteLabels
(const Handle(TDF_Data)& aSource,
const Handle(PDF_Data)& aTarget,
const MDF_TypeASDriverMap& aDriverMap,
const Handle(MDF_SRelocationTable)& aReloc)
{
TDF_Label aSourceLab = aSource->Root();
// Label array sizing.
Handle(PColStd_HArray1OfInteger) theLabels;
Standard_Integer nbLab = TDF_Tool::NbLabels(aSourceLab);
if (nbLab) {
theLabels = new PColStd_HArray1OfInteger(1,nbLab*3);
aTarget->Labels(theLabels);
}
// In fact, some labels whithout attributes attached to themselves
// nor to their descendants will not be kept.
// Attribute array sizing.
Handle(PDF_HAttributeArray1) theAttributes;
Standard_Integer nbAtt = 0;
if (nbLab) {
nbAtt = MDF_NbAttributesWithDriver(aSourceLab,aDriverMap);
if (nbAtt) {
theAttributes = new PDF_HAttributeArray1(1,nbAtt);
aTarget->Attributes(theAttributes);
}
// In fact, some attributes will not be kept by the filter.
}
if (nbLab && nbAtt) {
// labAlloc & attAlloc content the last used cell address.
Standard_Integer labAlloc = 0;
Standard_Integer attAlloc = 0;
MDF_Tool::WriteLabels(aSourceLab, aTarget->Labels(), aTarget->Attributes(),
aDriverMap, aReloc, labAlloc, attAlloc);
// Label array REsizing.
if (labAlloc < theLabels->Upper()) {
#ifdef OCCT_DEBUG
cout<<"MDF_Tool::WriteLabels LABEL array resizing from "<<theLabels->Upper()<<" to "<<labAlloc<<endl;
#endif
Handle(PColStd_HArray1OfInteger) newLabels =
new PColStd_HArray1OfInteger(1,labAlloc);
for (Standard_Integer i = 1; i <= labAlloc; ++i)
newLabels->SetValue(i,theLabels->Value(i));
aTarget->Labels(newLabels);
}
// Attribute array REsizing.
if (attAlloc < theAttributes->Upper()) {
#ifdef OCCT_DEBUG
cout<<"MDF_Tool::WriteLabels ATTRIBUTES array resizing from "<<theAttributes->Upper()<<" to "<<attAlloc<<endl;
#endif
Handle(PDF_HAttributeArray1) newAttributes =
new PDF_HAttributeArray1(1,attAlloc);
for (Standard_Integer i = 1; i <= attAlloc; ++i)
newAttributes->SetValue(i,theAttributes->Value(i));
aTarget->Attributes(newAttributes);
}
}
}
//=======================================================================
//function : WriteLabels
//purpose : TRANSIENT -> PERSISTENT;
// writes the arrays contents with empty attributes.
//=======================================================================
void MDF_Tool::WriteLabels
(const TDF_Label& aSourceLab,
const Handle(PColStd_HArray1OfInteger)& theLabels,
const Handle(PDF_HAttributeArray1)& theAttributes,
const MDF_TypeASDriverMap& aDriverMap,
const Handle(MDF_SRelocationTable)& aReloc,
Standard_Integer& labAlloc,
Standard_Integer& attAlloc)
{
// Cells allocation.
Standard_Integer labIndex = labAlloc;
labAlloc += 3;
Standard_Integer attIndex = attAlloc; // Backup the value.
// Tag.
theLabels->SetValue(++labIndex,aSourceLab.Tag());
Standard_Integer count = 0;
// Attributes.
Handle(PDF_Attribute) pAtt;
TDF_AttributeIterator itr1(aSourceLab);
for ( ; itr1.More(); itr1.Next()) {
const Handle(TDF_Attribute)& tAtt = itr1.Value();
const Handle(Standard_Type)& type = tAtt->DynamicType();
if (aDriverMap.IsBound(type)) {
++count;
const Handle(MDF_ASDriver)& driver = aDriverMap.Find(type);
pAtt = driver->NewEmpty();
theAttributes->SetValue(++attAlloc,pAtt);
aReloc->SetRelocation(tAtt,pAtt);
}
}
theLabels->SetValue(++labIndex,count); // Nb Attributes.
count = 0;
// Label Children.
Standard_Integer childLabIndex;
TDF_ChildIterator itr2(aSourceLab);
for ( ; itr2.More(); itr2.Next()) {
childLabIndex = labAlloc;
const TDF_Label& label = itr2.Value();
MDF_Tool::WriteLabels(label, theLabels, theAttributes,
aDriverMap, aReloc, labAlloc, attAlloc);
if (childLabIndex < labAlloc) ++count;
}
#ifdef OCCT_DEBUG_MDF_TOOL
aSourceLab.EntryDump(cout);
cout<<" Count="<<count<<" attIndex="<<attIndex<<" attAlloc="<<attAlloc;
#endif
if (attIndex < attAlloc) { // At least one attribute has been stored.
theLabels->SetValue(++labIndex,count); // Nb Children.
}
else {
labAlloc -= 2;
theLabels->SetValue(labAlloc--,0); // To clean the tag value.
#ifdef OCCT_DEBUG_MDF_TOOL
cout<<" <== Cleared";
#endif
}
#ifdef OCCT_DEBUG_MDF_TOOL
cout<<endl;
#endif
}
//=======================================================================
//function : WriteAttributes
//purpose : TRANSIENT -> PERSISTENT
// writes the persistent attributes content.
//=======================================================================
void MDF_Tool::WriteAttributes
(const MDF_TypeASDriverMap& aDriverMap,
const Handle(MDF_SRelocationTable)& aReloc)
{
// Iterer sur la map pour traduire si target.IsNull().
const PTColStd_TransientPersistentMap& attMap = aReloc->AttributeTable();
PTColStd_DataMapIteratorOfTransientPersistentMap itr(attMap);
Handle(PDF_Attribute) pAtt;
for ( ; itr.More(); itr.Next()) {
DeclareConstAndSpeedCast(itr.Key(),TDF_Attribute,tAtt);
const Handle(Standard_Type)& type = tAtt->DynamicType();
if (aDriverMap.IsBound(type)) {
SpeedCast(itr.Value(),PDF_Attribute,pAtt);
const Handle(MDF_ASDriver)& driver = aDriverMap.Find(type);
driver->Paste(tAtt, pAtt, aReloc);
}
}
}
// RRRRR EEEEE A DDDD
// R R E A A D D
// R R E A A D D
// RRRRR EEE AAAAA D D
// R R E A A D D
// R R EEEEE A A DDDD
//=======================================================================
//function : ReadLabels
//purpose : PERSISTENT -> TRANSIENT;
// reads the arrays contents and build the objects
// with empty attributes.
//=======================================================================
void MDF_Tool::ReadLabels
(const Handle(PDF_Data)& aSource,
const Handle(TDF_Data)& aTarget,
const MDF_TypeARDriverMap& aDriverMap,
const Handle(MDF_RRelocationTable)& aReloc)
{
// Root label creation.
//TDF_Insertor ins(aTarget->Root());
TDF_Label ins = aTarget->Root();
// labAlloc & attAlloc content the last used cell address.
Standard_Integer labRead = 1; // Root already used above.
Standard_Integer attRead = 0;
MDF_Tool::ReadLabels(ins, aSource->Labels(), aSource->Attributes(),
aDriverMap, aReloc, labRead, attRead);
}
//=======================================================================
//function : ReadLabels
//purpose : PERSISTENT -> TRANSIENT;
// Reads the arrays contents and build the objects
// with empty attributes.
//=======================================================================
void MDF_Tool::ReadLabels
(TDF_Label& anIns,
const Handle(PColStd_HArray1OfInteger)& theLabels,
const Handle(PDF_HAttributeArray1)& theAttributes,
const MDF_TypeARDriverMap& aDriverMap,
const Handle(MDF_RRelocationTable)& aReloc,
Standard_Integer& labRead,
Standard_Integer& attRead)
{
// Empty attributes creation.
Handle(TDF_Attribute) tAtt;
// Number of attributes.
Standard_Integer nbAtt = theLabels->Value(++labRead);
for (Standard_Integer iAtt = 1 ; iAtt <= nbAtt; iAtt++) {
const Handle(PDF_Attribute)& pAtt = theAttributes->Value(++attRead);
if (pAtt.IsNull()) {
// This case occurs only if somebody modified manually the file.
tAtt.Nullify();
}
else {
const Standard_GUID anEmptyID;
Handle(MDF_RRelocationTable) anEmptyRelocaTable = new MDF_RRelocationTable(Standard_True);
const Handle(Standard_Type)& type = pAtt->DynamicType();
if (aDriverMap.IsBound(type)) {
const Handle(MDF_ARDriver)& driver = aDriverMap.Find(type);
tAtt = driver->NewEmpty();
if (tAtt->ID() == anEmptyID) driver->Paste(pAtt, tAtt, anEmptyRelocaTable);
anIns.AddAttribute(tAtt);
}
aReloc->SetRelocation(pAtt,tAtt);
}
}
// Label Children creation.
Standard_Integer tag;
// Number of labels.
Standard_Integer nbLab = theLabels->Value(++labRead);
for (Standard_Integer iLab = 1 ; iLab <= nbLab; iLab++) {
// Label creation.
tag = theLabels->Value(++labRead);
//TDF_Insertor ins(anIns,tag);
TDF_Label ins = anIns.FindChild(tag,Standard_True);
MDF_Tool::ReadLabels(ins, theLabels, theAttributes,
aDriverMap, aReloc, labRead, attRead);
}
}
//=======================================================================
//function : ReadAttributes
//purpose : PERSISTENT -> TRANSIENT
// Reads the persistent attributes content.
//=======================================================================
//#define DEB_ORIENT
void MDF_Tool::ReadAttributes
(const MDF_TypeARDriverMap& aDriverMap,
const Handle(MDF_RRelocationTable)& aReloc)
{
// cout<<"MDF_Tool::ReadAttributes ..."<<endl;
// Iterer sur la map pour traduire si target.IsNull().
const PTColStd_PersistentTransientMap& attMap = aReloc->AttributeTable();
PTColStd_DataMapIteratorOfPersistentTransientMap itr(attMap);
Handle(TDF_Attribute) tAtt;
MDF_AttributeList attNList;
Standard_Boolean isName1(Standard_False);
ATTR pairAtt;
for ( ; itr.More(); itr.Next()) {
DeclareConstAndSpeedCast(itr.Key(),PDF_Attribute,pAtt);
if (!pAtt.IsNull()) { // See above...
const Handle(Standard_Type)& type = pAtt->DynamicType();
if(!strcmp (type->Name(), "PNaming_Naming_1") ) {
#ifdef OCCT_DEBUG_ORIENT
cout << "TYPE = " << type->Name() << endl;
#endif
isName1 = Standard_True;
} else isName1 = Standard_False;
if (aDriverMap.IsBound(type)) {
SpeedCast(itr.Value(),TDF_Attribute,tAtt);
const Handle(MDF_ARDriver)& driver = aDriverMap.Find(type);
if(isName1) {
pairAtt.pAtt = pAtt;
pairAtt.tAtt = tAtt;
attNList.Append(pairAtt);
}
else
driver->Paste(pAtt, tAtt, aReloc);
}
}
}
// post processing for compartibiliy with previous versions (24.07.2013)
if(attNList.Extent()) {
MDF_ListIteratorOfAttributeList listIt(attNList);
for(;listIt.More();listIt.Next()) {
const Handle(PDF_Attribute)& pAtt = listIt.Value().pAtt;
if (!pAtt.IsNull()) {
const Handle(Standard_Type)& type = pAtt->DynamicType();
if (aDriverMap.IsBound(type)) {
const Handle(MDF_ARDriver)& driver = aDriverMap.Find(type);
driver->Paste(pAtt, listIt.Value().tAtt, aReloc);
}
}
}
}
//
TDF_AttributeList attList;
for (itr.Initialize(attMap); itr.More(); itr.Next()) {
SpeedCast(itr.Value(),TDF_Attribute,tAtt);
attList.Append(tAtt);
}
TDF_ListIteratorOfAttributeList itr2;
Standard_Boolean noDeadLock = Standard_True;
Standard_Integer nbAtt = attList.Extent();
while (noDeadLock && (nbAtt != 0)) {
itr2.Initialize(attList);
while (itr2.More()) {
if (!itr2.Value()->AfterRetrieval())
itr2.Next();
else
attList.Remove(itr2);
}
noDeadLock = (nbAtt > attList.Extent());
nbAtt = attList.Extent();
}
if (!noDeadLock) {
#ifdef OCCT_DEBUG
cout<<"AfterRetrieval(): dead lock between these attributes:"<<endl;
for (itr2.Initialize(attList); itr2.More(); itr2.Next())
cout<<"Attribute type = "<<itr2.Value()->DynamicType()->Name()<<endl;;
Standard_ConstructionError::Raise("AfterRetrieval: dead lock.");
#endif
for (itr2.Initialize(attList); itr2.More(); itr2.Next())
itr2.Value()->AfterRetrieval(Standard_True);
}
}

View File

@ -1,155 +0,0 @@
-- Created on: 1997-08-07
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
-- modified Sergey Zaritchny
package MDataStd
---Purpose: Storage and Retrieval drivers for modelling
-- attributes. Transient attributes are defined in
-- package TDataStd and persistent one are defined in
-- package PDataStd
uses TDF,
PDF,
MDF,
CDM,
TDataStd
is
---Category: Storage drivers for TDataStd attributes
-- =======================================
class DirectoryStorageDriver;
class UAttributeStorageDriver;
class NameStorageDriver;
class CommentStorageDriver;
class IntegerStorageDriver;
class IntegerArrayStorageDriver;
class RealStorageDriver;
class RealArrayStorageDriver;
class ExtStringArrayStorageDriver;
class VariableStorageDriver;
class ExpressionStorageDriver;
class RelationStorageDriver;
class NoteBookStorageDriver;
class TreeNodeStorageDriver;
--Extension
class TickStorageDriver;
class IntegerListStorageDriver;
class RealListStorageDriver;
class ExtStringListStorageDriver;
class BooleanListStorageDriver;
class ReferenceListStorageDriver;
class BooleanArrayStorageDriver;
class ReferenceArrayStorageDriver;
class ByteArrayStorageDriver;
class NamedDataStorageDriver;
class AsciiStringStorageDriver;
class IntPackedMapStorageDriver;
---Category: Retrieval drivers for PDataStd attributes
-- =========================================
class DirectoryRetrievalDriver;
class UAttributeRetrievalDriver;
class NameRetrievalDriver;
class CommentRetrievalDriver;
class IntegerRetrievalDriver;
class IntegerArrayRetrievalDriver;
class IntegerArrayRetrievalDriver_1;
class RealRetrievalDriver;
class RealArrayRetrievalDriver;
class RealArrayRetrievalDriver_1;
class ExtStringArrayRetrievalDriver;
class ExtStringArrayRetrievalDriver_1;
class VariableRetrievalDriver;
class ExpressionRetrievalDriver;
class RelationRetrievalDriver;
class NoteBookRetrievalDriver;
class TreeNodeRetrievalDriver;
-- Extension
class TickRetrievalDriver;
class IntegerListRetrievalDriver;
class RealListRetrievalDriver;
class ExtStringListRetrievalDriver;
class BooleanListRetrievalDriver;
class ReferenceListRetrievalDriver;
class BooleanArrayRetrievalDriver;
class ReferenceArrayRetrievalDriver;
class ByteArrayRetrievalDriver;
class ByteArrayRetrievalDriver_1;
class NamedDataRetrievalDriver;
class AsciiStringRetrievalDriver;
class IntPackedMapRetrievalDriver;
class IntPackedMapRetrievalDriver_1;
AddStorageDrivers(aDriverSeq : ASDriverHSequence from MDF; theMessageDriver : MessageDriver from CDM);
---Purpose: Adds the attribute storage drivers to <aDriverSeq>.
AddRetrievalDrivers(aDriverSeq : ARDriverHSequence from MDF; theMessageDriver : MessageDriver from CDM);
---Purpose: Adds the attribute retrieval drivers to <aDriverSeq>.
---Purpose: Translation of TDataStd enumerations to integer
-- ===============================================
RealDimensionToInteger (e : RealEnum from TDataStd)
returns Integer from Standard;
IntegerToRealDimension (i : Integer from Standard)
returns RealEnum from TDataStd;
end MDataStd;

View File

@ -1,213 +0,0 @@
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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.
// ------------
// modified Sergey Zaritchny
// Version: 0.0
//Version Date Purpose
// 0.0 Aug 4 1997 Creation
#include <MDataStd.ixx>
#include <MDF_ASDriverTable.hxx>
#include <MDF_ARDriverTable.hxx>
#include <CDM_MessageDriver.hxx>
// Storage
#include <MDataStd_DirectoryStorageDriver.hxx>
#include <MDataStd_UAttributeStorageDriver.hxx>
#include <MDataStd_IntegerArrayStorageDriver.hxx>
#include <MDataStd_RealArrayStorageDriver.hxx>
#include <MDataStd_ExtStringArrayStorageDriver.hxx>
#include <MDataStd_NameStorageDriver.hxx>
#include <MDataStd_CommentStorageDriver.hxx>
#include <MDataStd_IntegerStorageDriver.hxx>
#include <MDataStd_RealStorageDriver.hxx>
#include <MDataStd_VariableStorageDriver.hxx>
#include <MDataStd_ExpressionStorageDriver.hxx>
#include <MDataStd_RelationStorageDriver.hxx>
#include <MDataStd_NoteBookStorageDriver.hxx>
#include <MDataStd_TreeNodeStorageDriver.hxx>
#include <MDataStd_TickStorageDriver.hxx>
#include <MDataStd_IntegerListStorageDriver.hxx>
#include <MDataStd_RealListStorageDriver.hxx>
#include <MDataStd_ExtStringListStorageDriver.hxx>
#include <MDataStd_BooleanListStorageDriver.hxx>
#include <MDataStd_ReferenceListStorageDriver.hxx>
#include <MDataStd_BooleanArrayStorageDriver.hxx>
#include <MDataStd_ReferenceArrayStorageDriver.hxx>
#include <MDataStd_ByteArrayStorageDriver.hxx>
#include <MDataStd_NamedDataStorageDriver.hxx>
#include <MDataStd_AsciiStringStorageDriver.hxx>
#include <MDataStd_IntPackedMapStorageDriver.hxx>
// Retrieval
#include <MDataStd_DirectoryRetrievalDriver.hxx>
#include <MDataStd_RealArrayRetrievalDriver.hxx>
#include <MDataStd_ExtStringArrayRetrievalDriver.hxx>
#include <MDataStd_UAttributeRetrievalDriver.hxx>
#include <MDataStd_IntegerArrayRetrievalDriver.hxx>
#include <MDataStd_NameRetrievalDriver.hxx>
#include <MDataStd_CommentRetrievalDriver.hxx>
#include <MDataStd_IntegerRetrievalDriver.hxx>
#include <MDataStd_RealRetrievalDriver.hxx>
#include <MDataStd_VariableRetrievalDriver.hxx>
#include <MDataStd_ExpressionRetrievalDriver.hxx>
#include <MDataStd_RelationRetrievalDriver.hxx>
#include <MDataStd_NoteBookRetrievalDriver.hxx>
#include <MDataStd_TreeNodeRetrievalDriver.hxx>
#include <MDataStd_TickRetrievalDriver.hxx>
#include <MDataStd_IntegerListRetrievalDriver.hxx>
#include <MDataStd_RealListRetrievalDriver.hxx>
#include <MDataStd_ExtStringListRetrievalDriver.hxx>
#include <MDataStd_BooleanListRetrievalDriver.hxx>
#include <MDataStd_ReferenceListRetrievalDriver.hxx>
#include <MDataStd_BooleanArrayRetrievalDriver.hxx>
#include <MDataStd_ReferenceArrayRetrievalDriver.hxx>
#include <MDataStd_ByteArrayRetrievalDriver.hxx>
#include <MDataStd_NamedDataRetrievalDriver.hxx>
#include <MDataStd_AsciiStringRetrievalDriver.hxx>
#include <MDataStd_IntPackedMapRetrievalDriver.hxx>
#include <MDataStd_ByteArrayRetrievalDriver_1.hxx>
#include <MDataStd_IntegerArrayRetrievalDriver_1.hxx>
#include <MDataStd_RealArrayRetrievalDriver_1.hxx>
#include <MDataStd_ExtStringArrayRetrievalDriver_1.hxx>
#include <MDataStd_IntPackedMapRetrievalDriver_1.hxx>
// enums
#include <TDataStd_RealEnum.hxx>
#include <Standard_DomainError.hxx>
//=======================================================================
//function : AddStorageDriver
//purpose :
//=======================================================================
void MDataStd::AddStorageDrivers
(const Handle(MDF_ASDriverHSequence)& aDriverSeq, const Handle(CDM_MessageDriver)& theMsgDriver)
{
aDriverSeq->Append(new MDataStd_DirectoryStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerArrayStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealArrayStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_UAttributeStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_NameStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_CommentStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_VariableStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExpressionStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RelationStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_NoteBookStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_TreeNodeStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExtStringArrayStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_TickStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerListStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealListStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExtStringListStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_BooleanListStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ReferenceListStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_BooleanArrayStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ReferenceArrayStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ByteArrayStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_NamedDataStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_AsciiStringStorageDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntPackedMapStorageDriver(theMsgDriver));
}
//=======================================================================
//function : AddRetrievalDriver
//purpose :
//=======================================================================
void MDataStd::AddRetrievalDrivers
(const Handle(MDF_ARDriverHSequence)& aDriverSeq,const Handle(CDM_MessageDriver)& theMsgDriver)
{
aDriverSeq->Append(new MDataStd_DirectoryRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerArrayRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealArrayRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_UAttributeRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_NameRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_CommentRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_VariableRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExpressionRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RelationRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_NoteBookRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_TreeNodeRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExtStringArrayRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_TickRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerListRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealListRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExtStringListRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_BooleanListRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ReferenceListRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_BooleanArrayRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ReferenceArrayRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ByteArrayRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_NamedDataRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_AsciiStringRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntPackedMapRetrievalDriver(theMsgDriver));
aDriverSeq->Append(new MDataStd_ByteArrayRetrievalDriver_1(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntegerArrayRetrievalDriver_1(theMsgDriver));
aDriverSeq->Append(new MDataStd_RealArrayRetrievalDriver_1(theMsgDriver));
aDriverSeq->Append(new MDataStd_ExtStringArrayRetrievalDriver_1(theMsgDriver));
aDriverSeq->Append(new MDataStd_IntPackedMapRetrievalDriver_1(theMsgDriver));
}
//=======================================================================
//function : RealDimensionToInteger
//purpose :
//=======================================================================
Standard_Integer MDataStd::RealDimensionToInteger(const TDataStd_RealEnum e)
{
switch (e) {
case TDataStd_SCALAR : return 0;
case TDataStd_LENGTH : return 1;
case TDataStd_ANGULAR : return 2;
default:
Standard_DomainError::Raise("TDataStd_RealEnum; enum term unknown");
}
return 0;
}
//=======================================================================
//function : IntegerToRealDimension
//purpose :
//=======================================================================
TDataStd_RealEnum MDataStd::IntegerToRealDimension(const Standard_Integer i)
{
switch(i)
{
// planar constraints
case 0 : return TDataStd_SCALAR;
case 1 : return TDataStd_LENGTH;
case 2 : return TDataStd_ANGULAR;
default :
Standard_DomainError::Raise("TDataStd_RealEnum; enum term unknown ");
}
return TDataStd_SCALAR;
}

View File

@ -1,47 +0,0 @@
-- Created on: 2007-08-23
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2007-2014 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.
class AsciiStringRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose: Retrieval driver of AsciiString attribute
uses
RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns AsciiStringRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: AsciiString from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end AsciiStringRetrievalDriver;

View File

@ -1,68 +0,0 @@
// Created on: 2007-08-23
// Created by: Sergey ZARITCHNY
// Copyright (c) 2007-2014 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 <MDataStd_AsciiStringRetrievalDriver.ixx>
#include <PDataStd_AsciiString.hxx>
#include <TDataStd_AsciiString.hxx>
#include <TCollection_AsciiString.hxx>
#include <PCollection_HAsciiString.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_AsciiStringRetrievalDriver
//purpose : Constructor
//=======================================================================
MDataStd_AsciiStringRetrievalDriver::MDataStd_AsciiStringRetrievalDriver
(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_AsciiStringRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_AsciiStringRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDataStd_AsciiString); }
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_AsciiStringRetrievalDriver::NewEmpty() const
{ return new TDataStd_AsciiString (); }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_AsciiStringRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_AsciiString) S = Handle(PDataStd_AsciiString)::DownCast (Source);
Handle(TDataStd_AsciiString) T = Handle(TDataStd_AsciiString)::DownCast (Target);
if(!S.IsNull() && !T.IsNull()) {
if(!S->Get().IsNull()) {
TCollection_AsciiString aString((S->Get())->Convert ());
T->Set (aString);
}
}
}

View File

@ -1,47 +0,0 @@
-- Created on: 2007-08-22
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2007-2014 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.
class AsciiStringStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose: Storage driver for AsciiString attribute
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create (theMessageDriver : MessageDriver from CDM)
returns AsciiStringStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end AsciiStringStorageDriver;

View File

@ -1,67 +0,0 @@
// Created on: 2007-08-22
// Created by: Sergey ZARITCHNY
// Copyright (c) 2007-2014 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 <MDataStd_AsciiStringStorageDriver.ixx>
#include <PDataStd_AsciiString.hxx>
#include <TDataStd_AsciiString.hxx>
#include <TCollection_AsciiString.hxx>
#include <PCollection_HAsciiString.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_AsciiStringStorageDriver
//purpose : Constructor
//=======================================================================
MDataStd_AsciiStringStorageDriver::MDataStd_AsciiStringStorageDriver
(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_AsciiStringStorageDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_AsciiStringStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDataStd_AsciiString);}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_AsciiStringStorageDriver::NewEmpty() const
{ return new PDataStd_AsciiString; }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_AsciiStringStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDataStd_AsciiString) S = Handle(TDataStd_AsciiString)::DownCast (Source);
Handle(PDataStd_AsciiString) T = Handle(PDataStd_AsciiString)::DownCast (Target);
if(!S.IsNull() && !T.IsNull()) {
if(S->Get().Length() != 0) {
Handle(PCollection_HAsciiString) aString = new PCollection_HAsciiString (S->Get());
T->Set (aString);
}
}
}

View File

@ -1,41 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class BooleanArrayRetrievalDriver from MDataStd inherits ARDriver from MDF
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns BooleanArrayRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
SourceType(me) returns Type from Standard;
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end BooleanArrayRetrievalDriver;

View File

@ -1,85 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_BooleanArrayRetrievalDriver.ixx>
#include <PDataStd_BooleanArray.hxx>
#include <TDataStd_BooleanArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <PColStd_HArray1OfInteger.hxx>
//=======================================================================
//function : MDataStd_BooleanArrayRetrievalDriver
//purpose :
//=======================================================================
MDataStd_BooleanArrayRetrievalDriver::MDataStd_BooleanArrayRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_BooleanArrayRetrievalDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_BooleanArrayRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_BooleanArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_BooleanArrayRetrievalDriver::NewEmpty () const
{
return new TDataStd_BooleanArray();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_BooleanArrayRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_BooleanArray) S = Handle(PDataStd_BooleanArray)::DownCast (Source);
Handle(TDataStd_BooleanArray) T = Handle(TDataStd_BooleanArray)::DownCast (Target);
if (S->Upper() >= S->Lower())
{
T->Init(S->Lower(), S->Upper());
const Handle(PColStd_HArray1OfInteger)& pvalues = S->Get();
Handle(TColStd_HArray1OfByte) tvalues = new TColStd_HArray1OfByte(pvalues->Lower(), pvalues->Upper());
Standard_Integer i = pvalues->Lower(), upper = pvalues->Upper();
for (; i <= upper; i++)
{
Standard_Byte pvalue = (Standard_Byte) pvalues->Value(i);
tvalues->SetValue(i, pvalue);
}
T->SetInternalArray(tvalues);
}
}

View File

@ -1,44 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class BooleanArrayStorageDriver from MDataStd inherits ASDriver from MDF
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns BooleanArrayStorageDriver from MDataStd;
VersionNumber(me)
returns Integer from Standard;
SourceType(me)
returns Type from Standard;
NewEmpty (me)
returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end BooleanArrayStorageDriver;

View File

@ -1,86 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_BooleanArrayStorageDriver.ixx>
#include <PDataStd_BooleanArray.hxx>
#include <TDataStd_BooleanArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <PColStd_HArray1OfInteger.hxx>
//=======================================================================
//function : MDataStd_BooleanArrayStorageDriver
//purpose :
//=======================================================================
MDataStd_BooleanArrayStorageDriver::MDataStd_BooleanArrayStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_BooleanArrayStorageDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_BooleanArrayStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_BooleanArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_BooleanArrayStorageDriver::NewEmpty() const
{
return new PDataStd_BooleanArray();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_BooleanArrayStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDataStd_BooleanArray) S = Handle(TDataStd_BooleanArray)::DownCast (Source);
Handle(PDataStd_BooleanArray) T = Handle(PDataStd_BooleanArray)::DownCast (Target);
if (S->Upper() >= S->Lower())
{
T->SetLower(S->Lower());
T->SetUpper(S->Upper());
const Handle(TColStd_HArray1OfByte)& tvalues = S->InternalArray();
Handle(PColStd_HArray1OfInteger) pvalues = new PColStd_HArray1OfInteger(tvalues->Lower(), tvalues->Upper());
Standard_Integer i = tvalues->Lower(), upper = tvalues->Upper();
for (; i <= upper; i++)
{
pvalues->SetValue(i, tvalues->Value(i));
}
T->Set(pvalues);
}
}

View File

@ -1,41 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class BooleanListRetrievalDriver from MDataStd inherits ARDriver from MDF
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns BooleanListRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
SourceType(me) returns Type from Standard;
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end BooleanListRetrievalDriver;

View File

@ -1,76 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_BooleanListRetrievalDriver.ixx>
#include <PDataStd_BooleanList.hxx>
#include <TDataStd_BooleanList.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_BooleanListRetrievalDriver
//purpose :
//=======================================================================
MDataStd_BooleanListRetrievalDriver::MDataStd_BooleanListRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_BooleanListRetrievalDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_BooleanListRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_BooleanList);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_BooleanListRetrievalDriver::NewEmpty () const
{
return new TDataStd_BooleanList();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_BooleanListRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
const Handle(PDataStd_BooleanList) S = Handle(PDataStd_BooleanList)::DownCast (Source);
const Handle(TDataStd_BooleanList) T = Handle(TDataStd_BooleanList)::DownCast (Target);
if(!S.IsNull()) {
Standard_Integer i, lower = S->Lower(), upper = S->Upper();
if(upper > 0)
for (i = lower; i <= upper; i++) {
T->Append(S->Value(i));
}
}
}

View File

@ -1,44 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class BooleanListStorageDriver from MDataStd inherits ASDriver from MDF
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns BooleanListStorageDriver from MDataStd;
VersionNumber(me)
returns Integer from Standard;
SourceType(me)
returns Type from Standard;
NewEmpty (me)
returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end BooleanListStorageDriver;

View File

@ -1,85 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_BooleanListStorageDriver.ixx>
#include <PDataStd_BooleanList.hxx>
#include <TDataStd_BooleanList.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TDataStd_ListIteratorOfListOfByte.hxx>
//=======================================================================
//function : MDataStd_BooleanListStorageDriver
//purpose :
//=======================================================================
MDataStd_BooleanListStorageDriver::MDataStd_BooleanListStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_BooleanListStorageDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_BooleanListStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_BooleanList);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_BooleanListStorageDriver::NewEmpty() const
{
return new PDataStd_BooleanList();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_BooleanListStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
{
const Handle(TDataStd_BooleanList) S = Handle(TDataStd_BooleanList)::DownCast (Source);
const Handle(PDataStd_BooleanList) T = Handle(PDataStd_BooleanList)::DownCast (Target);
Standard_Integer lower(1), upper = S->Extent();
if(upper == 0) {
lower = 0;
T->Init(lower, upper);
}
else if (upper >= lower)
{
T->Init(lower, upper);
TDataStd_ListIteratorOfListOfByte itr(S->List());
for (Standard_Integer i = lower; itr.More(); itr.Next(), i++) {
T->SetValue(i, itr.Value());
}
}
}

View File

@ -1,41 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class ByteArrayRetrievalDriver from MDataStd inherits ARDriver from MDF
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ByteArrayRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
SourceType(me) returns Type from Standard;
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ByteArrayRetrievalDriver;

View File

@ -1,84 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_ByteArrayRetrievalDriver.ixx>
#include <PDataStd_ByteArray.hxx>
#include <TDataStd_ByteArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <PColStd_HArray1OfInteger.hxx>
//=======================================================================
//function : MDataStd_ByteArrayRetrievalDriver
//purpose :
//=======================================================================
MDataStd_ByteArrayRetrievalDriver::MDataStd_ByteArrayRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ByteArrayRetrievalDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ByteArrayRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_ByteArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_ByteArrayRetrievalDriver::NewEmpty () const
{
return new TDataStd_ByteArray();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ByteArrayRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_ByteArray) S = Handle(PDataStd_ByteArray)::DownCast (Source);
Handle(TDataStd_ByteArray) T = Handle(TDataStd_ByteArray)::DownCast (Target);
if (!S->Get().IsNull())
{
const Handle(PColStd_HArray1OfInteger)& pvalues = S->Get();
Handle(TColStd_HArray1OfByte) tvalues = new TColStd_HArray1OfByte(pvalues->Lower(), pvalues->Upper());
Standard_Integer i = pvalues->Lower(), upper = pvalues->Upper();
for (; i <= upper; i++)
{
Standard_Byte pvalue = (Standard_Byte) pvalues->Value(i);
tvalues->SetValue(i, pvalue);
}
T->ChangeArray(tvalues, Standard_False);
}
}

View File

@ -1,45 +0,0 @@
-- Created on: 2008-03-27
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2008-2014 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.
class ByteArrayRetrievalDriver_1 from MDataStd inherits ARDriver from MDF
---Purpose: Retrieval driver of ByteArray attribute supporting
-- delta mechanism by default
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ByteArrayRetrievalDriver_1 from MDataStd;
VersionNumber(me) returns Integer from Standard;
SourceType(me) returns Type from Standard;
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ByteArrayRetrievalDriver_1;

View File

@ -1,86 +0,0 @@
// Created on: 2008-03-27
// Created by: Sergey ZARITCHNY
// Copyright (c) 2008-2014 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 <MDataStd_ByteArrayRetrievalDriver_1.ixx>
#include <PDataStd_ByteArray.hxx>
#include <PDataStd_ByteArray_1.hxx>
#include <TDataStd_ByteArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <PColStd_HArray1OfInteger.hxx>
//=======================================================================
//function : MDataStd_ByteArrayRetrievalDriver_1
//purpose :
//=======================================================================
MDataStd_ByteArrayRetrievalDriver_1::MDataStd_ByteArrayRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ByteArrayRetrievalDriver_1::VersionNumber() const
{
return 1;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ByteArrayRetrievalDriver_1::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_ByteArray_1);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_ByteArrayRetrievalDriver_1::NewEmpty () const
{
return new TDataStd_ByteArray();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ByteArrayRetrievalDriver_1::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_ByteArray_1) S = Handle(PDataStd_ByteArray_1)::DownCast (Source);
Handle(TDataStd_ByteArray) T = Handle(TDataStd_ByteArray)::DownCast (Target);
if (!S->Get().IsNull()) {
const Handle(PColStd_HArray1OfInteger)& pvalues = S->Get();
Handle(TColStd_HArray1OfByte) tvalues =
new TColStd_HArray1OfByte(pvalues->Lower(), pvalues->Upper());
Standard_Integer i = pvalues->Lower(), upper = pvalues->Upper();
for (; i <= upper; i++) {
Standard_Byte pvalue = (Standard_Byte) pvalues->Value(i);
tvalues->SetValue(i, pvalue);
}
T->ChangeArray(tvalues, Standard_False);
T->SetDelta(S->GetDelta());
}
}

View File

@ -1,44 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class ByteArrayStorageDriver from MDataStd inherits ASDriver from MDF
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ByteArrayStorageDriver from MDataStd;
VersionNumber(me)
returns Integer from Standard;
SourceType(me)
returns Type from Standard;
NewEmpty (me)
returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end ByteArrayStorageDriver;

View File

@ -1,85 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_ByteArrayStorageDriver.ixx>
#include <PDataStd_ByteArray.hxx>
#include <PDataStd_ByteArray_1.hxx>
#include <TDataStd_ByteArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <PColStd_HArray1OfInteger.hxx>
//=======================================================================
//function : MDataStd_ByteArrayStorageDriver
//purpose :
//=======================================================================
MDataStd_ByteArrayStorageDriver::MDataStd_ByteArrayStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ByteArrayStorageDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ByteArrayStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_ByteArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_ByteArrayStorageDriver::NewEmpty() const
{
return new PDataStd_ByteArray_1();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ByteArrayStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDataStd_ByteArray) S = Handle(TDataStd_ByteArray)::DownCast (Source);
Handle(PDataStd_ByteArray_1) T = Handle(PDataStd_ByteArray_1)::DownCast (Target);
const Handle(TColStd_HArray1OfByte)& tvalues = S->InternalArray();
if (tvalues.IsNull())
return;
Handle(PColStd_HArray1OfInteger) pvalues = new PColStd_HArray1OfInteger(tvalues->Lower(), tvalues->Upper());
Standard_Integer i = tvalues->Lower(), upper = tvalues->Upper();
for (; i <= upper; i++)
{
pvalues->SetValue(i, tvalues->Value(i));
}
T->Set(pvalues);
T->SetDelta(S->GetDelta());
}

View File

@ -1,48 +0,0 @@
-- Created on: 1998-01-15
-- Created by: Denis PASCAL
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class CommentRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns CommentRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Comment from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end CommentRetrievalDriver;

View File

@ -1,46 +0,0 @@
// Created on: 1998-01-15
// Created by: Denis PASCAL
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <MDataStd_CommentRetrievalDriver.ixx>
#include <PDataStd_Comment.hxx>
#include <TDataStd_Comment.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
#include <CDM_MessageDriver.hxx>
MDataStd_CommentRetrievalDriver::MDataStd_CommentRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
Standard_Integer MDataStd_CommentRetrievalDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDataStd_CommentRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDataStd_Comment); }
Handle(TDF_Attribute) MDataStd_CommentRetrievalDriver::NewEmpty() const
{ return new TDataStd_Comment (); }
//void MDataStd_CommentRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& RelocTable) const
void MDataStd_CommentRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_Comment) S = Handle(PDataStd_Comment)::DownCast (Source);
Handle(TDataStd_Comment) T = Handle(TDataStd_Comment)::DownCast (Target);
TCollection_ExtendedString Comment = (S->Get())->Convert ();
T->Set (Comment);
}

View File

@ -1,51 +0,0 @@
-- Created on: 1998-01-15
-- Created by: Denis PASCAL
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class CommentStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns CommentStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end CommentStorageDriver;

View File

@ -1,47 +0,0 @@
// Created on: 1998-01-15
// Created by: Denis PASCAL
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <MDataStd_CommentStorageDriver.ixx>
#include <PDataStd_Comment.hxx>
#include <TDataStd_Comment.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
#include <CDM_MessageDriver.hxx>
MDataStd_CommentStorageDriver::MDataStd_CommentStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
Standard_Integer MDataStd_CommentStorageDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDataStd_CommentStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDataStd_Comment);}
Handle(PDF_Attribute) MDataStd_CommentStorageDriver::NewEmpty() const
{ return new PDataStd_Comment; }
//void MDataStd_CommentStorageDriver::Paste(const Handle(TDF_Attribute)& Source,const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& RelocTable) const
void MDataStd_CommentStorageDriver::Paste(const Handle(TDF_Attribute)& Source,const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDataStd_Comment) S = Handle(TDataStd_Comment)::DownCast (Source);
Handle(PDataStd_Comment) T = Handle(PDataStd_Comment)::DownCast (Target);
Handle(PCollection_HExtendedString) Comment = new PCollection_HExtendedString (S->Get());
T->Set (Comment);
}

View File

@ -1,48 +0,0 @@
-- Created on: 1999-06-25
-- Created by: Sergey RUIN
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class DirectoryRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns DirectoryRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Directory from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end DirectoryRetrievalDriver;

View File

@ -1,36 +0,0 @@
// Copyright (c) 1999-2014 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 <MDataStd_DirectoryRetrievalDriver.ixx>
#include <PDataStd_Directory.hxx>
#include <TDataStd_Directory.hxx>
#include <CDM_MessageDriver.hxx>
MDataStd_DirectoryRetrievalDriver::MDataStd_DirectoryRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{}
Standard_Integer MDataStd_DirectoryRetrievalDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDataStd_DirectoryRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDataStd_Directory); }
Handle(TDF_Attribute) MDataStd_DirectoryRetrievalDriver::NewEmpty() const
{ return new TDataStd_Directory; }
void MDataStd_DirectoryRetrievalDriver::Paste(const Handle(PDF_Attribute)&,
const Handle(TDF_Attribute)& ,
const Handle(MDF_RRelocationTable)&) const
{
}

View File

@ -1,50 +0,0 @@
-- Created on: 1999-06-25
-- Created by: Sergey RUIN
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class DirectoryStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create (theMessageDriver : MessageDriver from CDM)
returns DirectoryStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end DirectoryStorageDriver;

View File

@ -1,36 +0,0 @@
// Copyright (c) 1999-2014 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 <MDataStd_DirectoryStorageDriver.ixx>
#include <PDataStd_Directory.hxx>
#include <TDataStd_Directory.hxx>
#include <CDM_MessageDriver.hxx>
MDataStd_DirectoryStorageDriver::MDataStd_DirectoryStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
Standard_Integer MDataStd_DirectoryStorageDriver::VersionNumber() const
{ return 0; }
Handle(Standard_Type) MDataStd_DirectoryStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDataStd_Directory); }
Handle(PDF_Attribute) MDataStd_DirectoryStorageDriver::NewEmpty() const
{ return new PDataStd_Directory; }
//void MDataStd_DirectoryStorageDriver::Paste(const Handle(TDF_Attribute)& Source,const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& RelocTable) const
void MDataStd_DirectoryStorageDriver::Paste(const Handle(TDF_Attribute)& ,const Handle(PDF_Attribute)& ,const Handle(MDF_SRelocationTable)& ) const
{
}

View File

@ -1,48 +0,0 @@
-- Created on: 1997-08-07
-- Created by: PASCAL Denis
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class ExpressionRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns ExpressionRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Expression from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ExpressionRetrievalDriver;

View File

@ -1,84 +0,0 @@
// Copyright (c) 1999-2014 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 <MDataStd_ExpressionRetrievalDriver.ixx>
#include <PDataStd_Expression.hxx>
#include <TDataStd_Expression.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
#include <TDF_ListIteratorOfAttributeList.hxx>
#include <PDF_HAttributeArray1.hxx>
#include <Standard_NoSuchObject.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_ExpressionRetrievalDriver
//purpose :
//=======================================================================
MDataStd_ExpressionRetrievalDriver::MDataStd_ExpressionRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExpressionRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExpressionRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDataStd_Expression); }
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_ExpressionRetrievalDriver::NewEmpty() const
{ return new TDataStd_Expression (); }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExpressionRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& RelocTable) const
{
Handle(PDataStd_Expression) S = Handle(PDataStd_Expression)::DownCast (Source);
Handle(TDataStd_Expression) T = Handle(TDataStd_Expression)::DownCast (Target);
TCollection_ExtendedString Expression = (S->GetName())->Convert ();
T->SetExpression (Expression);
Handle(PDF_Attribute) PV;
Handle(TDF_Attribute) TV;
Handle(PDF_HAttributeArray1) PVARS = S->GetVariables ();
if (PVARS.IsNull()) return;
for (Standard_Integer i = 1; i <= PVARS->Length (); i++) {
PV = PVARS->Value (i);
if (!PV.IsNull ()) {
Handle(TDF_Attribute) TV;
if (!RelocTable->HasRelocation (PV, TV)) {
Standard_NoSuchObject::Raise("MDataStd_ConstraintRetrievalDriver::Paste");
}
T->GetVariables().Append(TV);
}
}
}

View File

@ -1,49 +0,0 @@
-- Created on: 1997-08-07
-- Created by: PASCAL Denis
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class ExpressionStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ExpressionStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me; Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end ExpressionStorageDriver;

View File

@ -1,88 +0,0 @@
// Copyright (c) 1999-2014 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 <MDataStd_ExpressionStorageDriver.ixx>
#include <PDataStd_Expression.hxx>
#include <TDataStd_Expression.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
#include <TDF_ListIteratorOfAttributeList.hxx>
#include <PDF_HAttributeArray1.hxx>
#include <Standard_NoSuchObject.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_ExpressionStorageDriver
//purpose :
//=======================================================================
MDataStd_ExpressionStorageDriver::MDataStd_ExpressionStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExpressionStorageDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExpressionStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDataStd_Expression);}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_ExpressionStorageDriver::NewEmpty() const
{ return new PDataStd_Expression; }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExpressionStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& RelocTable) const
{
Handle(TDataStd_Expression) S = Handle(TDataStd_Expression)::DownCast (Source);
Handle(PDataStd_Expression) T = Handle(PDataStd_Expression)::DownCast (Target);
Handle(PCollection_HExtendedString) Expression = new PCollection_HExtendedString (S->Name());
T->SetName (Expression);
Handle(TDF_Attribute) TV;
Handle(PDF_Attribute) PV;
Standard_Integer nbvar = S->GetVariables().Extent();
if (nbvar <= 0) return;
Handle(PDF_HAttributeArray1) PVARS = new PDF_HAttributeArray1 (1, nbvar);
TDF_ListIteratorOfAttributeList it;
Standard_Integer index = 0;
for (it.Initialize(S->GetVariables());it.More();it.Next()) {
index++;
TV = it.Value();
if(!RelocTable->HasRelocation (TV, PV)) {
Standard_NoSuchObject::Raise("MDataStd_ExpressionStorageDriver::Paste");
}
PVARS->SetValue (index,PV);
}
T->SetVariables (PVARS);
}

View File

@ -1,46 +0,0 @@
-- Created on: 2004-09-27
-- Created by: Pavel TELKOV
-- Copyright (c) 2004-2014 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.
class ExtStringArrayRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns ExtStringArrayRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: ExtStringArray from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ExtStringArrayRetrievalDriver;

View File

@ -1,90 +0,0 @@
// Created on: 2004-09-27
// Created by: Pavel TELKOV
// Copyright (c) 2004-2014 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 <MDataStd_ExtStringArrayRetrievalDriver.ixx>
#include <CDM_MessageDriver.hxx>
#include <MDataStd.hxx>
#include <PCollection_HExtendedString.hxx>
#include <PDataStd_ExtStringArray.hxx>
#include <TDataStd_ExtStringArray.hxx>
//=======================================================================
//function : MDataStd_ExtStringArrayRetrievalDriver
//purpose : Constructor
//=======================================================================
MDataStd_ExtStringArrayRetrievalDriver::MDataStd_ExtStringArrayRetrievalDriver
( const Handle(CDM_MessageDriver)& theMsgDriver )
:MDF_ARDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExtStringArrayRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExtStringArrayRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_ExtStringArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_ExtStringArrayRetrievalDriver::NewEmpty() const
{
return new TDataStd_ExtStringArray ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExtStringArrayRetrievalDriver::Paste
( const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_ExtStringArray) S = Handle(PDataStd_ExtStringArray)::DownCast (Source);
Handle(TDataStd_ExtStringArray) T = Handle(TDataStd_ExtStringArray)::DownCast (Target);
Standard_Integer i, lower = S->Lower() , upper = S->Upper();
T->Init(lower, upper);
for(i = lower; i<=upper; i++)
{
Handle(PCollection_HExtendedString) aPExtStr = S->Value( i );
if ( !aPExtStr.IsNull() )
T->SetValue( i, aPExtStr->Convert() );
}
}

View File

@ -1,49 +0,0 @@
-- Created on: 2008-03-28
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2008-2014 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.
class ExtStringArrayRetrievalDriver_1 from MDataStd inherits ARDriver from MDF
---Purpose: Retrieval driver of ExtStringArray attribute supporting
-- delta mechanism by default
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ExtStringArrayRetrievalDriver_1 from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 1.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: ExtStringArray from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ExtStringArrayRetrievalDriver_1;

View File

@ -1,94 +0,0 @@
// Created on: 2008-03-28
// Created by: Sergey ZARITCHNY
// Copyright (c) 2008-2014 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 <MDataStd_ExtStringArrayRetrievalDriver_1.ixx>
#include <CDM_MessageDriver.hxx>
#include <MDataStd.hxx>
#include <PCollection_HExtendedString.hxx>
#include <PDataStd_ExtStringArray.hxx>
#include <PDataStd_ExtStringArray_1.hxx>
#include <TDataStd_ExtStringArray.hxx>
//=======================================================================
//function : MDataStd_ExtStringArrayRetrievalDriver_1
//purpose : Constructor
//=======================================================================
MDataStd_ExtStringArrayRetrievalDriver_1::MDataStd_ExtStringArrayRetrievalDriver_1
( const Handle(CDM_MessageDriver)& theMsgDriver )
:MDF_ARDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExtStringArrayRetrievalDriver_1::VersionNumber() const
{ return 1; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExtStringArrayRetrievalDriver_1::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_ExtStringArray_1);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_ExtStringArrayRetrievalDriver_1::NewEmpty() const
{
return new TDataStd_ExtStringArray ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExtStringArrayRetrievalDriver_1::Paste
( const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_ExtStringArray_1) S =
Handle(PDataStd_ExtStringArray_1)::DownCast (Source);
Handle(TDataStd_ExtStringArray) T =
Handle(TDataStd_ExtStringArray)::DownCast (Target);
Standard_Integer i, lower = S->Lower(), upper = S->Upper();
T->Init(lower, upper);
for(i = lower; i<=upper; i++)
{
Handle(PCollection_HExtendedString) aPExtStr = S->Value( i );
if ( !aPExtStr.IsNull() )
T->SetValue( i, aPExtStr->Convert() );
}
T->SetDelta(S->GetDelta());
}

View File

@ -1,46 +0,0 @@
-- Created on: 2004-09-27
-- Created by: Pavel TELKOV
-- Copyright (c) 2004-2014 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.
class ExtStringArrayStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns ExtStringArrayStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: ExtStringArray from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end ExtStringArrayStorageDriver;

View File

@ -1,92 +0,0 @@
// Created on: 2004-09-27
// Created by: Pavel TELKOV
// Copyright (c) 2004-2014 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 <MDataStd_ExtStringArrayStorageDriver.ixx>
#include <CDM_MessageDriver.hxx>
#include <MDataStd.hxx>
#include <PCollection_HExtendedString.hxx>
#include <PDataStd_ExtStringArray.hxx>
#include <PDataStd_ExtStringArray_1.hxx>
#include <TDataStd_ExtStringArray.hxx>
//=======================================================================
//function : MDataStd_ExtStringArrayStorageDriver
//purpose : Constructor
//=======================================================================
MDataStd_ExtStringArrayStorageDriver::MDataStd_ExtStringArrayStorageDriver
( const Handle(CDM_MessageDriver)& theMsgDriver )
:MDF_ASDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExtStringArrayStorageDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExtStringArrayStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_ExtStringArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_ExtStringArrayStorageDriver::NewEmpty() const
{
return new PDataStd_ExtStringArray_1 ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExtStringArrayStorageDriver::Paste (
const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDataStd_ExtStringArray) S =
Handle(TDataStd_ExtStringArray)::DownCast (Source);
Handle(PDataStd_ExtStringArray_1) T =
Handle(PDataStd_ExtStringArray_1)::DownCast (Target);
Standard_Integer i, lower = S->Lower(), upper = S->Upper();
T->Init(lower, upper);
for(i = lower; i<=upper; i++)
{
Handle(PCollection_HExtendedString) aPExtStr =
new PCollection_HExtendedString( S->Value( i ) );
T->SetValue( i, aPExtStr );
}
T->SetDelta(S->GetDelta());
}

View File

@ -1,42 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class ExtStringListRetrievalDriver from MDataStd inherits ARDriver from MDF
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ExtStringListRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
SourceType(me) returns Type from Standard;
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end ExtStringListRetrievalDriver;

View File

@ -1,80 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_ExtStringListRetrievalDriver.ixx>
#include <PDataStd_ExtStringList.hxx>
#include <TDataStd_ExtStringList.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
//=======================================================================
//function : MDataStd_ExtStringListRetrievalDriver
//purpose :
//=======================================================================
MDataStd_ExtStringListRetrievalDriver::MDataStd_ExtStringListRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExtStringListRetrievalDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExtStringListRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_ExtStringList);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_ExtStringListRetrievalDriver::NewEmpty () const
{
return new TDataStd_ExtStringList();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExtStringListRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
const Handle(PDataStd_ExtStringList) S = Handle(PDataStd_ExtStringList)::DownCast (Source);
const Handle(TDataStd_ExtStringList) T = Handle(TDataStd_ExtStringList)::DownCast (Target);
if(S.IsNull()) return;
Standard_Integer i, lower = S->Lower(), upper = S->Upper();
if(upper > 0)
for (i = lower; i <= upper; i++)
{
const Handle(PCollection_HExtendedString)& pvalue = S->Value(i);
TCollection_ExtendedString tvalue = pvalue->Convert();
T->Append(tvalue);
}
}

View File

@ -1,44 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class ExtStringListStorageDriver from MDataStd inherits ASDriver from MDF
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns ExtStringListStorageDriver from MDataStd;
VersionNumber(me)
returns Integer from Standard;
SourceType(me)
returns Type from Standard;
NewEmpty (me)
returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end ExtStringListStorageDriver;

View File

@ -1,89 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_ExtStringListStorageDriver.ixx>
#include <PDataStd_ExtStringList.hxx>
#include <TDataStd_ExtStringList.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
//=======================================================================
//function : MDataStd_ExtStringListStorageDriver
//purpose :
//=======================================================================
MDataStd_ExtStringListStorageDriver::MDataStd_ExtStringListStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_ExtStringListStorageDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_ExtStringListStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_ExtStringList);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_ExtStringListStorageDriver::NewEmpty() const
{
return new PDataStd_ExtStringList();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_ExtStringListStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
{
const Handle(TDataStd_ExtStringList) S = Handle(TDataStd_ExtStringList)::DownCast (Source);
const Handle(PDataStd_ExtStringList) T = Handle(PDataStd_ExtStringList)::DownCast (Target);
if(S.IsNull()) return;
Standard_Integer lower(1), upper = S->Extent();
if(upper == 0) {
lower = 0;
T->Init(lower, upper);
}
else if (upper >= lower)
{
T->Init(lower, upper);
TDataStd_ListIteratorOfListOfExtendedString itr(S->List());
for (Standard_Integer i = lower; itr.More(); itr.Next(), i++)
{
const TCollection_ExtendedString& tvalue = itr.Value();
const Handle(PCollection_HExtendedString)& pvalue = new PCollection_HExtendedString(tvalue);
T->SetValue(i, pvalue);
}
}
}

View File

@ -1,46 +0,0 @@
-- Created on: 2007-08-23
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2007-2014 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.
class IntPackedMapRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose: Retrieval driver of IntPackedMap attribute
uses
RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns IntPackedMapRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: IntPackedMap from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end IntPackedMapRetrievalDriver;

View File

@ -1,77 +0,0 @@
// Created on: 2007-08-27
// Created by: Sergey ZARITCHNY
// Copyright (c) 2007-2014 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 <MDataStd_IntPackedMapRetrievalDriver.ixx>
#include <PDataStd_IntPackedMap.hxx>
#include <TDataStd_IntPackedMap.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HPackedMapOfInteger.hxx>
#include <TCollection_ExtendedString.hxx>
//=======================================================================
//function : MDataStd_IntPackedMapRetrievalDriver
//purpose : Constructor
//=======================================================================
MDataStd_IntPackedMapRetrievalDriver::MDataStd_IntPackedMapRetrievalDriver
(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntPackedMapRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntPackedMapRetrievalDriver::SourceType() const
{ return STANDARD_TYPE(PDataStd_IntPackedMap); }
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_IntPackedMapRetrievalDriver::NewEmpty() const
{ return new TDataStd_IntPackedMap (); }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntPackedMapRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_IntPackedMap) aS = Handle(PDataStd_IntPackedMap)::DownCast (Source);
Handle(TDataStd_IntPackedMap) aT = Handle(TDataStd_IntPackedMap)::DownCast (Target);
if(!aS.IsNull() && !aT.IsNull()) {
if(!aS->IsEmpty()) {
Handle(TColStd_HPackedMapOfInteger) aHMap = new TColStd_HPackedMapOfInteger ();
Standard_Integer aKey;
for(Standard_Integer i = aS->Lower(); i<= aS->Upper() ; i++) {
aKey = aS->GetValue(i);
if(!aHMap->ChangeMap().Add( aKey )) {
WriteMessage(
TCollection_ExtendedString("error retrieving integer mamaber of the attribute TDataStd_IntPackedMap"));
return;
}
}
aT->ChangeMap(aHMap);
}
} else
WriteMessage(TCollection_ExtendedString("error retrieving attribute TDataStd_IntPackedMap"));
}

View File

@ -1,49 +0,0 @@
-- Created on: 2008-03-28
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2008-2014 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.
class IntPackedMapRetrievalDriver_1 from MDataStd inherits ARDriver from MDF
---Purpose: Retrieval driver of IntPackedMap attribute supporting
-- delta mechanism by default
uses
RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns IntPackedMapRetrievalDriver_1 from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 1.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: IntPackedMap_1 from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end IntPackedMapRetrievalDriver_1;

View File

@ -1,83 +0,0 @@
// Created on: 2008-03-28
// Created by: Sergey ZARITCHNY
// Copyright (c) 2008-2014 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 <MDataStd_IntPackedMapRetrievalDriver_1.ixx>
#include <PDataStd_IntPackedMap.hxx>
#include <PDataStd_IntPackedMap_1.hxx>
#include <TDataStd_IntPackedMap.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_HPackedMapOfInteger.hxx>
#include <TCollection_ExtendedString.hxx>
//=======================================================================
//function : MDataStd_IntPackedMapRetrievalDriver_1
//purpose : Constructor
//=======================================================================
MDataStd_IntPackedMapRetrievalDriver_1::MDataStd_IntPackedMapRetrievalDriver_1
(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntPackedMapRetrievalDriver_1::VersionNumber() const
{ return 1; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntPackedMapRetrievalDriver_1::SourceType() const
{ return STANDARD_TYPE(PDataStd_IntPackedMap_1); }
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_IntPackedMapRetrievalDriver_1::NewEmpty() const
{ return new TDataStd_IntPackedMap (); }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntPackedMapRetrievalDriver_1::Paste(
const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_IntPackedMap_1) aS =
Handle(PDataStd_IntPackedMap_1)::DownCast (Source);
Handle(TDataStd_IntPackedMap) aT =
Handle(TDataStd_IntPackedMap)::DownCast (Target);
if(!aS.IsNull() && !aT.IsNull()) {
if(!aS->IsEmpty()) {
Handle(TColStd_HPackedMapOfInteger) aHMap = new TColStd_HPackedMapOfInteger ();
Standard_Integer aKey;
for(Standard_Integer i = aS->Lower(); i<= aS->Upper() ; i++) {
aKey = aS->GetValue(i);
if(!aHMap->ChangeMap().Add( aKey )) {
WriteMessage(
TCollection_ExtendedString("error retrieving integer mamaber of the attribute TDataStd_IntPackedMap"));
return;
}
}
aT->ChangeMap(aHMap);
}
aT->SetDelta(aS->GetDelta());
} else
WriteMessage(TCollection_ExtendedString("error retrieving attribute TDataStd_IntPackedMap"));
}

View File

@ -1,46 +0,0 @@
-- Created on: 2007-08-23
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2007-2014 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.
class IntPackedMapStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose: Storage driver for IntPackedMap attribute
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create (theMessageDriver : MessageDriver from CDM)
returns IntPackedMapStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end IntPackedMapStorageDriver;

View File

@ -1,77 +0,0 @@
// Created on: 2007-08-23
// Created by: Sergey ZARITCHNY
// Copyright (c) 2007-2014 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 <MDataStd_IntPackedMapStorageDriver.ixx>
#include <PDataStd_IntPackedMap.hxx>
#include <PDataStd_IntPackedMap_1.hxx>
#include <TDataStd_IntPackedMap.hxx>
#include <PColStd_HArray1OfInteger.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
#include <TCollection_ExtendedString.hxx>
//=======================================================================
//function : MDataStd_IntPackedMapStorageDriver
//purpose : Constructor
//=======================================================================
MDataStd_IntPackedMapStorageDriver::MDataStd_IntPackedMapStorageDriver
(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntPackedMapStorageDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntPackedMapStorageDriver::SourceType() const
{ return STANDARD_TYPE(TDataStd_IntPackedMap);}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_IntPackedMapStorageDriver::NewEmpty() const
{ return new PDataStd_IntPackedMap_1; }
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntPackedMapStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,const Handle(MDF_SRelocationTable)& ) const
{
Handle(TDataStd_IntPackedMap) aS =
Handle(TDataStd_IntPackedMap)::DownCast (Source);
Handle(PDataStd_IntPackedMap_1) aT =
Handle(PDataStd_IntPackedMap_1)::DownCast (Target);
if(!aS.IsNull() && !aT.IsNull()) {
Standard_Integer aSize = (aS->IsEmpty()) ? 0 : aS->Extent();
if(aSize) {
aT->Init (1, aSize);
TColStd_MapIteratorOfPackedMapOfInteger anIt(aS->GetMap());
for(Standard_Integer i = 1;anIt.More();anIt.Next(),i++)
aT->SetValue(i, anIt.Key());
}
aT->SetDelta(aS->GetDelta());
} else
WriteMessage(TCollection_ExtendedString ("error storing attribute TDataStd_IntPackedMap"));
}

View File

@ -1,49 +0,0 @@
-- Created on: 1999-06-15
-- Created by: Sergey RUIN
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class IntegerArrayRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose:
uses RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns IntegerArrayRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: IntegerArray from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end IntegerArrayRetrievalDriver;

View File

@ -1,82 +0,0 @@
// Created on: 1999-06-15
// Created by: Sergey RUIN
// Copyright (c) 1999-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <MDataStd_IntegerArrayRetrievalDriver.ixx>
#include <PDataStd_IntegerArray.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_IntegerArrayRetrievalDriver
//purpose :
//=======================================================================
MDataStd_IntegerArrayRetrievalDriver::MDataStd_IntegerArrayRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntegerArrayRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntegerArrayRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_IntegerArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_IntegerArrayRetrievalDriver::NewEmpty () const {
return new TDataStd_IntegerArray ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntegerArrayRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
// const Handle(MDF_RRelocationTable)& RelocTable) const
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_IntegerArray) S = Handle(PDataStd_IntegerArray)::DownCast (Source);
Handle(TDataStd_IntegerArray) T = Handle(TDataStd_IntegerArray)::DownCast (Target);
Standard_Integer i, lower = S->Lower() , upper = S->Upper();
T->Init(lower, upper);
for(i = lower; i<=upper; i++) T->SetValue( i, S->Value(i) );
}

View File

@ -1,52 +0,0 @@
-- Created on: 2008-03-27
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 2008-2014 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.
class IntegerArrayRetrievalDriver_1 from MDataStd inherits ARDriver from MDF
---Purpose: Retrieval driver of IntegerArray attribute supporting
-- delta mechanism by default
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns IntegerArrayRetrievalDriver_1 from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 1.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: IntegerArray from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end IntegerArrayRetrievalDriver_1;

View File

@ -1,82 +0,0 @@
// Created on: 2008-03-27
// Created by: Sergey ZARITCHNY
// Copyright (c) 2008-2014 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 <MDataStd_IntegerArrayRetrievalDriver_1.ixx>
#include <PDataStd_IntegerArray.hxx>
#include <PDataStd_IntegerArray_1.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_IntegerArrayRetrievalDriver_1
//purpose :
//=======================================================================
MDataStd_IntegerArrayRetrievalDriver_1::MDataStd_IntegerArrayRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntegerArrayRetrievalDriver_1::VersionNumber() const
{ return 1; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntegerArrayRetrievalDriver_1::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_IntegerArray_1);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_IntegerArrayRetrievalDriver_1::NewEmpty () const {
return new TDataStd_IntegerArray ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntegerArrayRetrievalDriver_1::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_IntegerArray_1) S = Handle(PDataStd_IntegerArray_1)::DownCast (Source);
Handle(TDataStd_IntegerArray) T = Handle(TDataStd_IntegerArray)::DownCast (Target);
Standard_Integer i, lower = S->Lower() , upper = S->Upper();
T->Init(lower, upper);
for(i = lower; i<=upper; i++) T->SetValue( i, S->Value(i) );
T->SetDelta(S->GetDelta());
}

View File

@ -1,48 +0,0 @@
-- Created on: 1999-06-15
-- Created by: Sergey RUIN
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class IntegerArrayStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns IntegerArrayStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: IntegerArray from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end IntegerArrayStorageDriver;

View File

@ -1,84 +0,0 @@
// Created on: 1999-06-11
// Created by: Sergey RUIN
// Copyright (c) 1999-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <MDataStd_IntegerArrayStorageDriver.ixx>
#include <PDataStd_IntegerArray.hxx>
#include <PDataStd_IntegerArray_1.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_IntegerArrayStorageDriver
//purpose :
//=======================================================================
MDataStd_IntegerArrayStorageDriver::MDataStd_IntegerArrayStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntegerArrayStorageDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntegerArrayStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_IntegerArray);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_IntegerArrayStorageDriver::NewEmpty () const {
return new PDataStd_IntegerArray_1 ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntegerArrayStorageDriver::Paste (
const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
{
Handle(TDataStd_IntegerArray) S = Handle(TDataStd_IntegerArray)::DownCast (Source);
Handle(PDataStd_IntegerArray_1) T = Handle(PDataStd_IntegerArray_1)::DownCast (Target);
Standard_Integer i, lower =S->Lower() ,upper = S->Upper() ;
T->Init(lower, upper);
for(i = lower; i<=upper; i++) T->SetValue( i, S->Value(i) );
T->SetDelta(S->GetDelta());
}

View File

@ -1,42 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class IntegerListRetrievalDriver from MDataStd inherits ARDriver from MDF
uses
RRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns IntegerListRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
SourceType(me) returns Type from Standard;
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end IntegerListRetrievalDriver;

View File

@ -1,75 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_IntegerListRetrievalDriver.ixx>
#include <PDataStd_IntegerList.hxx>
#include <TDataStd_IntegerList.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_IntegerListRetrievalDriver
//purpose :
//=======================================================================
MDataStd_IntegerListRetrievalDriver::MDataStd_IntegerListRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntegerListRetrievalDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntegerListRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_IntegerList);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_IntegerListRetrievalDriver::NewEmpty () const
{
return new TDataStd_IntegerList();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntegerListRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& ) const
{
const Handle(PDataStd_IntegerList) S = Handle(PDataStd_IntegerList)::DownCast (Source);
const Handle(TDataStd_IntegerList) T = Handle(TDataStd_IntegerList)::DownCast (Target);
Standard_Integer i, lower = S->Lower(), upper = S->Upper();
if(upper > 0)
for (i = lower; i <= upper; i++) {
T->Append(S->Value(i));
}
}

View File

@ -1,44 +0,0 @@
-- Created on: 2007-05-29
-- Created by: Vlad Romashko
-- Copyright (c) 2007-2014 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.
class IntegerListStorageDriver from MDataStd inherits ASDriver from MDF
uses
SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM)
returns IntegerListStorageDriver from MDataStd;
VersionNumber(me)
returns Integer from Standard;
SourceType(me)
returns Type from Standard;
NewEmpty (me)
returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end IntegerListStorageDriver;

View File

@ -1,85 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 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 <MDataStd_IntegerListStorageDriver.ixx>
#include <PDataStd_IntegerList.hxx>
#include <TDataStd_IntegerList.hxx>
#include <MDataStd.hxx>
#include <CDM_MessageDriver.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
//=======================================================================
//function : MDataStd_IntegerListStorageDriver
//purpose :
//=======================================================================
MDataStd_IntegerListStorageDriver::MDataStd_IntegerListStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
{
}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntegerListStorageDriver::VersionNumber() const
{
return 0;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntegerListStorageDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(TDataStd_IntegerList);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(PDF_Attribute) MDataStd_IntegerListStorageDriver::NewEmpty() const
{
return new PDataStd_IntegerList();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntegerListStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
const Handle(PDF_Attribute)& Target,
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
{
const Handle(TDataStd_IntegerList) S = Handle(TDataStd_IntegerList)::DownCast (Source);
const Handle(PDataStd_IntegerList) T = Handle(PDataStd_IntegerList)::DownCast (Target);
Standard_Integer lower(1), upper = S->Extent(), i = lower;
if(upper == 0) {
lower = 0;
T->Init(lower, upper);
}
else if (upper >= lower)
{
T->Init(lower, upper);
TColStd_ListIteratorOfListOfInteger itr(S->List());
for (; itr.More(); itr.Next(), i++) {
T->SetValue(i, itr.Value());
}
}
}

View File

@ -1,47 +0,0 @@
-- Created on: 1997-04-09
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class IntegerRetrievalDriver from MDataStd inherits ARDriver from MDF
---Purpose:
uses
RRelocationTable from MDF,
Attribute from PDF,
Attribute from TDF,
MessageDriver from CDM
is
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
returns IntegerRetrievalDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from PDataStd.
NewEmpty (me) returns Attribute from TDF;
Paste(me;
Source : Attribute from PDF;
Target : Attribute from TDF;
RelocTable : RRelocationTable from MDF);
end IntegerRetrievalDriver;

View File

@ -1,82 +0,0 @@
// Created on: 1997-04-10
// Created by: VAUTHIER Jean-Claude
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 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 <MDataStd_IntegerRetrievalDriver.ixx>
#include <TDataStd_Integer.hxx>
#include <PDataStd_Integer.hxx>
#include <TDF_Label.hxx>
#include <PCollection_HAsciiString.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MDataStd_IntegerRetrievalDriver
//purpose :
//=======================================================================
MDataStd_IntegerRetrievalDriver::MDataStd_IntegerRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MDataStd_IntegerRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MDataStd_IntegerRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_Integer);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MDataStd_IntegerRetrievalDriver::NewEmpty () const {
return new TDataStd_Integer ();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MDataStd_IntegerRetrievalDriver::Paste (
const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
// const Handle(MDF_RRelocationTable)& RelocTable) const
const Handle(MDF_RRelocationTable)& ) const
{
Handle(PDataStd_Integer) S = Handle(PDataStd_Integer)::DownCast (Source);
Handle(TDataStd_Integer) T = Handle(TDataStd_Integer)::DownCast (Target);
T->Set (S->Get ());
}

View File

@ -1,49 +0,0 @@
-- Created on: 1997-04-09
-- Created by: VAUTHIER Jean-Claude
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 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.
class IntegerStorageDriver from MDataStd inherits ASDriver from MDF
---Purpose:
uses SRelocationTable from MDF,
Attribute from TDF,
Attribute from PDF,
MessageDriver from CDM
is
Create (theMessageDriver : MessageDriver from CDM) -- Version 0
returns IntegerStorageDriver from MDataStd;
VersionNumber(me) returns Integer from Standard;
---Purpose: Returns the version number from which the driver
-- is available: 0.
SourceType(me) returns Type from Standard;
---Purpose: Returns the type: Integer from TDataStd.
NewEmpty (me) returns Attribute from PDF;
Paste(me;
Source : Attribute from TDF;
Target : Attribute from PDF;
RelocTable : SRelocationTable from MDF);
end IntegerStorageDriver;

Some files were not shown because too many files have changed in this diff Show More