From d7a28edad2489665b15c94d194b5e6359e64f0fc Mon Sep 17 00:00:00 2001 From: abv Date: Tue, 15 Aug 2017 17:46:38 +0300 Subject: [PATCH] 0028225: MFC sample on OCAF uses old-style definition of a Handle-class Obsolete approach to definition of OCCT RTTI in sample classes generated by WOK from CDL is replaced by usage of standard macros --- .../standard/01_Geometry/src/GeoAlgo_Sol.hxx | 2 +- .../06_Ocaf/adm/win/vc10/Ocaf.vcxproj | 8 +- .../06_Ocaf/adm/win/vc10/Ocaf.vcxproj.filters | 8 +- .../06_Ocaf/src/OCAFSample_CommonDriver.cxx | 3 + .../06_Ocaf/src/OCAFSample_CommonDriver.hxx | 80 ++--------------- .../06_Ocaf/src/OCAFSample_Driver.hxx | 87 +++---------------- .../06_Ocaf/src/OCAFSample_Driver.ixx | 68 --------------- .../06_Ocaf/src/OCAFSample_Driver.jxx | 9 -- samples/mfc/standard/06_Ocaf/src/OcafApp.h | 1 - .../06_Ocaf/src/TOcafFunction_BoxDriver.cxx | 31 +------ .../06_Ocaf/src/TOcafFunction_BoxDriver.hxx | 73 ++-------------- .../06_Ocaf/src/TOcafFunction_CutDriver.cxx | 31 +------ .../06_Ocaf/src/TOcafFunction_CutDriver.hxx | 73 ++-------------- .../06_Ocaf/src/TOcafFunction_CylDriver.cxx | 30 +------ .../06_Ocaf/src/TOcafFunction_CylDriver.hxx | 73 ++-------------- .../06_Ocaf/src/TOcaf_Application.cxx | 4 +- .../06_Ocaf/src/TOcaf_Application.hxx | 46 ++-------- .../06_Ocaf/src/TOcaf_Application.ixx | 45 ---------- .../06_Ocaf/src/TOcaf_Application.jxx | 9 -- 19 files changed, 73 insertions(+), 608 deletions(-) delete mode 100755 samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.ixx delete mode 100755 samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.jxx delete mode 100755 samples/mfc/standard/06_Ocaf/src/TOcaf_Application.ixx delete mode 100755 samples/mfc/standard/06_Ocaf/src/TOcaf_Application.jxx diff --git a/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx b/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx index 16d57a2d63..4fb5ee5fdb 100755 --- a/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx +++ b/samples/mfc/standard/01_Geometry/src/GeoAlgo_Sol.hxx @@ -15,7 +15,7 @@ #ifndef _GeoAlgo_Sol_HeaderFile #define _GeoAlgo_Sol_HeaderFile -#ifndef _Handle_Geom_BSplineSurface_HeaderFile +#ifndef _Geom_BSplineSurface_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile diff --git a/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj b/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj index d385aa58bf..a68e892151 100644 --- a/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj +++ b/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj @@ -462,10 +462,10 @@ - - - - + + + + diff --git a/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj.filters b/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj.filters index 1d3ba64324..976b07f05b 100644 --- a/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj.filters +++ b/samples/mfc/standard/06_Ocaf/adm/win/vc10/Ocaf.vcxproj.filters @@ -58,16 +58,16 @@ - + Header Files - + Header Files - + Header Files - + Header Files diff --git a/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.cxx b/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.cxx index 07d1ac9381..6658540682 100755 --- a/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.cxx +++ b/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.cxx @@ -34,6 +34,9 @@ #define OPERATION_NOT_DONE 8 #define NULL_OPERATION 9 +// OCCT RTTI +IMPLEMENT_STANDARD_RTTIEXT (OCAFSample_CommonDriver, OCAFSample_Driver) + //======================================================================= //function : Constructor //purpose : diff --git a/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.hxx b/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.hxx index b5d983af9e..cc88a0a3b4 100755 --- a/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.hxx +++ b/samples/mfc/standard/06_Ocaf/src/OCAFSample_CommonDriver.hxx @@ -16,84 +16,22 @@ #ifndef _OCAFSample_CommonDriver_HeaderFile #define _OCAFSample_CommonDriver_HeaderFile -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_OCAFSample_CommonDriver_HeaderFile -#endif - -#ifndef _OCAFSample_Driver_HeaderFile +#include #include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif + class TFunction_Logbook; -class OCAFSample_CommonDriver : public OCAFSample_Driver { - +class OCAFSample_CommonDriver : public OCAFSample_Driver +{ public: - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT OCAFSample_CommonDriver(); -Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& theLogbook) const; -Standard_EXPORT ~OCAFSample_CommonDriver(); - - - - - // Type management - // - Standard_EXPORT friend Handle(Standard_Type)& OCAFSample_CommonDriver_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - + Standard_EXPORT OCAFSample_CommonDriver (); + Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& theLogbook) const; + Standard_EXPORT ~OCAFSample_CommonDriver (); + // OCCT RTTI + DEFINE_STANDARD_RTTIEXT (OCAFSample_CommonDriver, OCAFSample_Driver) }; - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - #endif diff --git a/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.hxx b/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.hxx index ffeea09a7d..fc6d35edc0 100755 --- a/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.hxx +++ b/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.hxx @@ -16,92 +16,29 @@ #ifndef _OCAFSample_Driver_HeaderFile #define _OCAFSample_Driver_HeaderFile -#ifndef _Standard_HeaderFile #include -#endif -#ifndef _Handle_OCAFSample_Driver_HeaderFile -#endif - -#ifndef _TFunction_Driver_HeaderFile #include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif -class TFunction_Logbook; #include +class TFunction_Logbook; -class OCAFSample_Driver : public TFunction_Driver { - +class OCAFSample_Driver : public TFunction_Driver +{ public: - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT void Validate(TFunction_Logbook& log) const; -Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Boolean Arguments(TDF_LabelMap& theArgs) const; -Standard_EXPORT virtual Standard_Boolean Results(TDF_LabelMap& theRes) const; -Standard_EXPORT ~OCAFSample_Driver(); + Standard_EXPORT void Validate (TFunction_Logbook& log) const; + Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Boolean Arguments (TDF_LabelMap& theArgs) const; + Standard_EXPORT virtual Standard_Boolean Results (TDF_LabelMap& theRes) const; + Standard_EXPORT ~OCAFSample_Driver (); - - - - // Type management - // - Standard_EXPORT friend Handle(Standard_Type)& OCAFSample_Driver_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + // OCCT RTTI + DEFINE_STANDARD_RTTIEXT(OCAFSample_Driver,TFunction_Driver) protected: - // Methods PROTECTED - // -Standard_EXPORT OCAFSample_Driver(); - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - + Standard_EXPORT OCAFSample_Driver (); }; - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - #endif diff --git a/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.ixx b/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.ixx deleted file mode 100755 index 68b904ce88..0000000000 --- a/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.ixx +++ /dev/null @@ -1,68 +0,0 @@ -// File generated by CPPExt (Transient) -// Copyright (C) 1991,1995 by -// -// MATRA DATAVISION, FRANCE -// -// This software is furnished in accordance with the terms and conditions -// of the contract and with the inclusion of the above copyright notice. -// This software or any other copy thereof may not be provided or otherwise -// be made available to any other person. No title to an ownership of the -// software is hereby transferred. -// -// At the termination of the contract, the software and all copies of this -// software must be deleted. -// -#include - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -OCAFSample_Driver::~OCAFSample_Driver() {} - - - -Standard_EXPORT Handle_Standard_Type& OCAFSample_Driver_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); - static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient); - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("OCAFSample_Driver", - sizeof(OCAFSample_Driver), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(OCAFSample_Driver) Handle(OCAFSample_Driver)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(OCAFSample_Driver) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(OCAFSample_Driver))) { - _anOtherObject = Handle(OCAFSample_Driver)((Handle(OCAFSample_Driver)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& OCAFSample_Driver::DynamicType() const -{ - return STANDARD_TYPE(OCAFSample_Driver) ; -} -Standard_Boolean OCAFSample_Driver::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(OCAFSample_Driver) == AType || TFunction_Driver::IsKind(AType)); -} -Handle_OCAFSample_Driver::~Handle_OCAFSample_Driver() {} - diff --git a/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.jxx b/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.jxx deleted file mode 100755 index 56c9bd3944..0000000000 --- a/samples/mfc/standard/06_Ocaf/src/OCAFSample_Driver.jxx +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _TFunction_Logbook_HeaderFile -#include -#endif -#ifndef _TDF_LabelMap_HeaderFile -#include -#endif -#ifndef _OCAFSample_Driver_HeaderFile -#include -#endif diff --git a/samples/mfc/standard/06_Ocaf/src/OcafApp.h b/samples/mfc/standard/06_Ocaf/src/OcafApp.h index bf1ad3f7d5..37588967b9 100755 --- a/samples/mfc/standard/06_Ocaf/src/OcafApp.h +++ b/samples/mfc/standard/06_Ocaf/src/OcafApp.h @@ -10,7 +10,6 @@ #include #include "OcafDoc.h" -#include "TOCAF_Application.hxx" #include diff --git a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.cxx b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.cxx index 09f0069268..40979bf567 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.cxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.cxx @@ -12,6 +12,8 @@ #include "BRepPrimAPI_MakeBox.hxx" #include "TNaming_Builder.hxx" +IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_BoxDriver, TFunction_Driver) + //======================================================================= //function : GetID //purpose : @@ -118,32 +120,3 @@ Standard_Integer TOcafFunction_BoxDriver::Execute(Handle(TFunction_Logbook)& /*l // If there are no any mistakes we return 0: return 0; } - -TOcafFunction_BoxDriver::~TOcafFunction_BoxDriver() {} - -// DownCast method -// allow safe downcasting -// -const Handle(TOcafFunction_BoxDriver) TOcafFunction_BoxDriver::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(TOcafFunction_BoxDriver) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_BoxDriver))) { - _anOtherObject = Handle(TOcafFunction_BoxDriver)::DownCast (AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& TOcafFunction_BoxDriver::DynamicType() const -{ - return STANDARD_TYPE(TOcafFunction_BoxDriver) ; -} -Standard_Boolean TOcafFunction_BoxDriver::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(TOcafFunction_BoxDriver) == AType || TFunction_Driver::IsKind(AType)); -} - - - diff --git a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.hxx b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.hxx index d249ad91fc..8a772e7289 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.hxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_BoxDriver.hxx @@ -31,74 +31,19 @@ #endif class TFunction_Logbook; - -class TOcafFunction_BoxDriver : public TFunction_Driver { - +class TOcafFunction_BoxDriver : public TFunction_Driver +{ public: - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT TOcafFunction_BoxDriver(); -Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT ~TOcafFunction_BoxDriver(); - - - - - // Type management - // - //Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_BoxDriver_Type_(); - Standard_EXPORT const Handle(TOcafFunction_BoxDriver) DownCast(const Handle(Standard_Transient)& AnObject); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - + Standard_EXPORT static const Standard_GUID& GetID (); + Standard_EXPORT TOcafFunction_BoxDriver (); + Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const; + // OCCT RTTI + DEFINE_STANDARD_RTTIEXT(TOcafFunction_BoxDriver,TFunction_Driver) }; - - - -// other inline functions and methods (like "C++: function call" methods) -// - - #endif diff --git a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.cxx b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.cxx index a39a86d690..caff0608cd 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.cxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.cxx @@ -17,6 +17,8 @@ #include "TFunction_Logbook.hxx" #include "TDF_Reference.hxx" +IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_CutDriver, TFunction_Driver) + //======================================================================= //function : GetID //purpose : @@ -139,32 +141,3 @@ Standard_Integer TOcafFunction_CutDriver::Execute(Handle(TFunction_Logbook)& /*l // If there are no any mistakes we return 0: return 0; } - -TOcafFunction_CutDriver::~TOcafFunction_CutDriver() {} - -// DownCast method -// allow safe downcasting -// -const Handle(TOcafFunction_CutDriver) TOcafFunction_CutDriver::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(TOcafFunction_CutDriver) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_CutDriver))) { - _anOtherObject = Handle(TOcafFunction_CutDriver)::DownCast (AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& TOcafFunction_CutDriver::DynamicType() const -{ - return STANDARD_TYPE(TOcafFunction_CutDriver) ; -} -Standard_Boolean TOcafFunction_CutDriver::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(TOcafFunction_CutDriver) == AType || TFunction_Driver::IsKind(AType)); -} - - - diff --git a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.hxx b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.hxx index da01087dc8..ae07f6a7e6 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.hxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CutDriver.hxx @@ -32,73 +32,18 @@ class TFunction_Logbook; -class TOcafFunction_CutDriver : public TFunction_Driver { - +class TOcafFunction_CutDriver : public TFunction_Driver +{ public: - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT TOcafFunction_CutDriver(); -Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT ~TOcafFunction_CutDriver(); - - - - - // Type management - // - //Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_CutDriver_Type_(); - Standard_EXPORT const Handle(TOcafFunction_CutDriver) DownCast(const Handle(Standard_Transient)& AnObject); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - + Standard_EXPORT static const Standard_GUID& GetID() ; + Standard_EXPORT TOcafFunction_CutDriver (); + Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const; + // OCCT RTTI + DEFINE_STANDARD_RTTIEXT(TOcafFunction_CutDriver,TFunction_Driver) }; - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - #endif diff --git a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.cxx b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.cxx index fb2ef18813..44595ed01c 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.cxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.cxx @@ -13,6 +13,7 @@ #include "TDataStd_Real.hxx" #include "TNaming_Builder.hxx" +IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_CylDriver, TFunction_Driver) //======================================================================= //function : GetID @@ -113,32 +114,3 @@ Standard_Integer TOcafFunction_CylDriver::Execute(Handle(TFunction_Logbook)& /*l // If there are no any mistakes we return 0: return 0; } - -TOcafFunction_CylDriver::~TOcafFunction_CylDriver() {} - -// DownCast method -// allow safe downcasting -// -const Handle(TOcafFunction_CylDriver) TOcafFunction_CylDriver::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(TOcafFunction_CylDriver) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_CylDriver))) { - _anOtherObject = Handle(TOcafFunction_CylDriver)::DownCast (AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& TOcafFunction_CylDriver::DynamicType() const -{ - return STANDARD_TYPE(TOcafFunction_CylDriver) ; -} -Standard_Boolean TOcafFunction_CylDriver::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(TOcafFunction_CylDriver) == AType || TFunction_Driver::IsKind(AType)); -} - - - diff --git a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.hxx b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.hxx index 6b656e0ca5..27ef1f14f2 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.hxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcafFunction_CylDriver.hxx @@ -32,73 +32,18 @@ class TFunction_Logbook; -class TOcafFunction_CylDriver : public TFunction_Driver { - +class TOcafFunction_CylDriver : public TFunction_Driver +{ public: - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT TOcafFunction_CylDriver(); -Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const; -Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const; -Standard_EXPORT ~TOcafFunction_CylDriver(); - - - - - // Type management - // - //Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_CylDriver_Type_(); - Standard_EXPORT const Handle(TOcafFunction_CylDriver) DownCast(const Handle(Standard_Transient)& AnObject); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - + Standard_EXPORT static const Standard_GUID& GetID (); + Standard_EXPORT TOcafFunction_CylDriver (); + Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const; + Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const; + // OCCT RTTI + DEFINE_STANDARD_RTTIEXT(TOcafFunction_CylDriver,TFunction_Driver) }; - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - #endif diff --git a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.cxx b/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.cxx index 26da43527d..60a3835d84 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.cxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.cxx @@ -5,7 +5,7 @@ //Modified by Sergey RUIN (An instanciation of the drivers) #include -#include +#include #include #include #include @@ -15,6 +15,8 @@ #include "TOcafFunction_CylDriver.hxx" #include "TOcafFunction_CutDriver.hxx" +IMPLEMENT_STANDARD_RTTIEXT (TOcaf_Application, TDocStd_Application) + //======================================================================= //function : TOcaf_Application //purpose : diff --git a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.hxx b/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.hxx index 2efd45809b..c719daa1e8 100755 --- a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.hxx +++ b/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.hxx @@ -26,49 +26,13 @@ class TDocStd_Document; -class TOcaf_Application : public TDocStd_Application { - +class TOcaf_Application : public TDocStd_Application +{ public: + Standard_EXPORT TOcaf_Application (); - // Methods PUBLIC - // -Standard_EXPORT TOcaf_Application(); - - // Type management - // - //Standard_EXPORT friend Handle(Standard_Type)& TOcaf_Application_Type_(); - Standard_EXPORT const Handle(TOcaf_Application) DownCast(const Handle(Standard_Transient)& AnObject); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - + // OCCT RTTI + DEFINE_STANDARD_RTTIEXT (TOcaf_Application, TDocStd_Application) }; - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - #endif diff --git a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.ixx b/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.ixx deleted file mode 100755 index 5fec9994d9..0000000000 --- a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.ixx +++ /dev/null @@ -1,45 +0,0 @@ -// File generated by CPPExt (Transient) -// Copyright (C) 1991,1995 by -// -// MATRA DATAVISION, FRANCE -// -// This software is furnished in accordance with the terms and conditions -// of the contract and with the inclusion of the above copyright notice. -// This software or any other copy thereof may not be provided or otherwise -// be made available to any other person. No title to an ownership of the -// software is hereby transferred. -// -// At the termination of the contract, the software and all copies of this -// software must be deleted. -// -#include - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -// DownCast method -// allow safe downcasting -// -const Handle(TOcaf_Application) TOcaf_Application::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(TOcaf_Application) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(TOcaf_Application))) { - _anOtherObject = Handle(TOcaf_Application)((Handle(TOcaf_Application)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& TOcaf_Application::DynamicType() const -{ - return STANDARD_TYPE(TOcaf_Application) ; -} -Standard_Boolean TOcaf_Application::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(TOcaf_Application) == AType || TDocStd_Application::IsKind(AType)); -} - - diff --git a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.jxx b/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.jxx deleted file mode 100755 index 56c7e2155a..0000000000 --- a/samples/mfc/standard/06_Ocaf/src/TOcaf_Application.jxx +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _TColStd_SequenceOfExtendedString_HeaderFile -#include -#endif -#ifndef _TDocStd_Document_HeaderFile -#include -#endif -#ifndef _TOcaf_Application_HeaderFile -#include -#endif