1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024727: Convertation of the generic classes to the non-generic. Part 3

1) Generic class "Intf_InterferencePolyhedron" from "Intf" package converted to the non-generic class and moved to the "IntPatch" package. Name of this class was changed to "IntPatch_InterferencePolyhedron".

2) Generic class "MoniTool_Elem" from "MoniTool" package converted to the non-generic class "MoniTool_TransientElem".

3) Generic class "IntWalk_PWalking" from "IntWalk" package converted to the non-generic class. And internal class "TheInt2S" of "IntWalk_PWalking" moved from IntWalk_PWalking.cdl to IntWalk.cdl for correct building. Also several "*.cxx" files of this class merged to one ".cxx".

4) Generic class "Transfer_SimpleBinder" from "Transfer" package converted to the non-generic class and moved to the "TransferBRep" package. Name of this class was changed to "TransferBRep_BinderOfShape".

5) Generic class "Geom2dInt_CurveTool" from "Geom2dInt" package converted to the non-generic class "Geom2dInt_Geom2dCurveTool".

6) Generic class "MAT2d_BisectingLocus" from "MAT2d" package converted to the non-generic class and moved to the "BRepMAT2d" package. Name of this class was changed to "BRepMAT2d_BisectingLocus".

7) Generic class "MAT_Mat" from "MAT" package converted to the non-generic class and moved to the "MAT2d" package. Name of this class was changed to "MAT2d_Mat2d".
This commit is contained in:
dln
2014-03-12 12:09:23 +04:00
committed by bugmaster
parent ebc93ae74f
commit 47cbf13472
33 changed files with 1041 additions and 1155 deletions

View File

@@ -32,9 +32,7 @@ is
-- Element, generic Elem, and instance for Transient
class DataInfo; -- used in Elem : this one is for Transient
deferred class Element;
generic class Elem;
class TransientElem instantiates Elem
(Transient, MapTransientHasher from TColStd, DataInfo);
class TransientElem;
class ElemHasher;

View File

@@ -14,31 +14,30 @@
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
generic class Elem from MoniTool
(TheKey as any;
TheHasher as any;
TheInfo as any)
inherits Element
class TransientElem from MoniTool inherits Element
---Purpose : an Elem defines an Element for a specific input class
---Purpose : an TransientElem defines an Element for a specific input class
-- its definition includes the value of the Key to be mapped,
-- and the HashCoder associated to the class of the Key
--
-- TheKey defines the class to be keyed
-- TheHasher is the associated Hasher
-- TheInfo is an additionnal class which helps to provide
-- Transient from Standard defines the class to be keyed
-- MapTransientHasher from TColStd is the associated Hasher
-- DataInfo from MoniTool is an additionnal class which helps to provide
-- informations on the value (template : see DataInfo)
uses CString
uses CString,
Transient from Standard,
MapTransientHasher from TColStd,
DataInfo from MoniTool
is
Create (akey : any TheKey) returns mutable Elem;
---Purpose : Creates a Elem with a Value. This Value can then not be
Create (akey : any Transient from Standard) returns mutable TransientElem;
---Purpose : Creates a TransientElem with a Value. This Value can then not be
-- changed. It is used by the Hasher to compute the HashCode,
-- which will then be stored for an immediate reading.
Value (me) returns any TheKey is static;
Value (me) returns any Transient from Standard is static;
---Purpose : Returns the contained value
---C++ : return const &
@@ -57,6 +56,6 @@ is
fields
theval : TheKey;
theval : Transient from Standard;
end Elem;
end TransientElem;

View File

@@ -11,31 +11,35 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//#include <MoniTool_Elem.ixx>
#include <MoniTool_TransientElem.ixx>
#include <Standard_Integer.hxx>
#include <Standard_Transient.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <MoniTool_DataInfo.hxx>
MoniTool_Elem::MoniTool_Elem (const TheKey& akey)
MoniTool_TransientElem::MoniTool_TransientElem (const Handle(Standard_Transient)& akey)
: theval (akey)
{ SetHashCode ( TheHasher::HashCode (akey, IntegerLast() ) ); }
{ SetHashCode ( TColStd_MapTransientHasher::HashCode (akey, IntegerLast() ) ); }
const TheKey& MoniTool_Elem::Value () const
const Handle_Standard_Transient& MoniTool_TransientElem::Value () const
{ return theval; }
Standard_Boolean MoniTool_Elem::Equates
Standard_Boolean MoniTool_TransientElem::Equates
(const Handle(MoniTool_Element)& other) const
{
if (other.IsNull()) return Standard_False;
if (GetHashCode() != other->GetHashCode()) return Standard_False;
if (other->DynamicType() != DynamicType()) return Standard_False;
Handle(MoniTool_Elem) another = Handle(MoniTool_Elem)::DownCast(other);
Handle(MoniTool_TransientElem) another = Handle(MoniTool_TransientElem)::DownCast(other);
// return (theval == another->Value());
return TheHasher::IsEqual (theval,another->Value());
return TColStd_MapTransientHasher::IsEqual (theval,another->Value());
}
Handle(Standard_Type) MoniTool_Elem::ValueType () const
{ return TheInfo::Type(theval); }
Handle(Standard_Type) MoniTool_TransientElem::ValueType () const
{ return MoniTool_DataInfo::Type(theval); }
Standard_CString MoniTool_Elem::ValueTypeName () const
{ return TheInfo::TypeName(theval); }
Standard_CString MoniTool_TransientElem::ValueTypeName () const
{ return MoniTool_DataInfo::TypeName(theval); }