From da9b8b50200e975723c84d1bc722e637c54be39f Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 24 Feb 2016 16:48:10 +0300 Subject: [PATCH] Migration to OCCT 7.0 --- adm_local/cmake_files/FindACIS.cmake | 34 ++++++++++++++++++++-------- src/ACISPlugin_ExportDriver.cxx | 14 ++---------- src/ACISPlugin_ExportDriver.hxx | 13 ++++------- src/ACISPlugin_IOperations_i.cc | 2 +- src/ACISPlugin_ImportDriver.cxx | 20 ++++++---------- src/ACISPlugin_ImportDriver.hxx | 13 ++++------- 6 files changed, 44 insertions(+), 52 deletions(-) diff --git a/adm_local/cmake_files/FindACIS.cmake b/adm_local/cmake_files/FindACIS.cmake index 9556ab8..f93f8e0 100644 --- a/adm_local/cmake_files/FindACIS.cmake +++ b/adm_local/cmake_files/FindACIS.cmake @@ -36,20 +36,36 @@ SET(OCCLICENSE_ROOT_DIR $ENV{OCCLICENSE_ROOT_DIR}) IF(ACIS_ROOT_DIR) LIST(APPEND CMAKE_PREFIX_PATH "${ACIS_ROOT_DIR}") ENDIF(ACIS_ROOT_DIR) + IF(OCCLICENSE_ROOT_DIR) LIST(APPEND CMAKE_PREFIX_PATH "${OCCLICENSE_ROOT_DIR}") ENDIF(OCCLICENSE_ROOT_DIR) -FIND_PATH(ACIS_INCLUDE_DIRS AcisGeom.hxx PATH_SUFFIXES inc) -FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES inc) -IF(OCCTLICENSE_INCLUDE_DIRS) - LIST(APPEND ACIS_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) -ENDIF(OCCTLICENSE_INCLUDE_DIRS) +FIND_PATH(ACIS_INCLUDE_DIRS AcisGeom.hxx PATH_SUFFIXES include/opencascade) +IF(ACIS_INCLUDE_DIRS) + SET(ACIS_UPCOUNT 2) +ELSE(ACIS_INCLUDE_DIRS) + FIND_PATH(ACIS_INCLUDE_DIRS AcisGeom.hxx PATH_SUFFIXES include inc) +ENDIF(ACIS_INCLUDE_DIRS) + +FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES include/opencascade) +IF(NOT OCCTLICENSE_INCLUDE_DIRS) + FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES include inc) +ENDIF(NOT OCCTLICENSE_INCLUDE_DIRS) + +IF(ACIS_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) + FILE(TO_NATIVE_PATH ${ACIS_INCLUDE_DIRS} _acis_dir) + FILE(TO_NATIVE_PATH ${OCCTLICENSE_INCLUDE_DIRS} _lic_dir) + STRING(COMPARE NOTEQUAL ${_acis_dir} ${_lic_dir} _diff_dir) + IF(_diff_dir) + LIST(APPEND ACIS_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) + ENDIF() +ENDIF(ACIS_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) -FIND_LIBRARY(ACIS_TKACIS NAMES TKACIS) -FIND_LIBRARY(ACIS_TKSAT NAMES TKSAT) -FIND_LIBRARY(ACIS_TKXDESAT NAMES TKXDESAT) -FIND_LIBRARY(ACIS_TKOCCLicense NAMES TKOCCLicense) +FIND_LIBRARY(ACIS_TKACIS NAMES TKACIS PATH_SUFFIXES lib lin64/gcc/lib bin) +FIND_LIBRARY(ACIS_TKSAT NAMES TKSAT PATH_SUFFIXES lib lin64/gcc/lib bin) +FIND_LIBRARY(ACIS_TKXDESAT NAMES TKXDESAT PATH_SUFFIXES lib lin64/gcc/lib bin) +FIND_LIBRARY(ACIS_TKOCCLicense NAMES TKOCCLicense PATH_SUFFIXES lib lin64/gcc/lib bin) SET(ACIS_LIBRARIES ${ACIS_TKACIS} diff --git a/src/ACISPlugin_ExportDriver.cxx b/src/ACISPlugin_ExportDriver.cxx index 6c9b382..7259200 100644 --- a/src/ACISPlugin_ExportDriver.cxx +++ b/src/ACISPlugin_ExportDriver.cxx @@ -64,7 +64,7 @@ ACISPlugin_ExportDriver::ACISPlugin_ExportDriver() //function : Execute //purpose : //======================================================================= -Standard_Integer ACISPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const +Standard_Integer ACISPlugin_ExportDriver::Execute( LOGBOOK& log ) const { #ifdef ACIS_HASLICENSE try { @@ -108,15 +108,6 @@ Standard_Integer ACISPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons return 0; } -//======================================================================= -//function : MustExecute -//purpose : -//======================================================================= -Standard_Boolean ACISPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const -{ - return Standard_True; -} - //================================================================================ /*! * \brief Returns a name of creation operation and names and values of creation parameters @@ -129,5 +120,4 @@ GetCreationInformation( std::string& theOperationName, return false; } -IMPLEMENT_STANDARD_HANDLE( ACISPlugin_ExportDriver,GEOM_BaseDriver ); -IMPLEMENT_STANDARD_RTTIEXT( ACISPlugin_ExportDriver,GEOM_BaseDriver ); +OCCT_IMPLEMENT_STANDARD_RTTIEXT( ACISPlugin_ExportDriver,GEOM_BaseDriver ); diff --git a/src/ACISPlugin_ExportDriver.hxx b/src/ACISPlugin_ExportDriver.hxx index 5bfb3d6..b26445a 100644 --- a/src/ACISPlugin_ExportDriver.hxx +++ b/src/ACISPlugin_ExportDriver.hxx @@ -23,9 +23,6 @@ // GEOM includes #include -// OCCT includes -#include - DEFINE_STANDARD_HANDLE( ACISPlugin_ExportDriver, GEOM_BaseDriver ); class ACISPlugin_ExportDriver : public GEOM_BaseDriver @@ -35,14 +32,14 @@ public: ~ACISPlugin_ExportDriver() {}; static const Standard_GUID& GetID(); - virtual Standard_Integer Execute( TFunction_Logbook& log ) const; - Standard_Boolean MustExecute( const TFunction_Logbook& ) const; - virtual void Validate( TFunction_Logbook& ) const {} + virtual Standard_Integer Execute( LOGBOOK& log ) const; + Standard_Boolean MustExecute( const LOGBOOK& ) const { return Standard_True; } + virtual void Validate( LOGBOOK& ) const {} - virtual bool GetCreationInformation( std::string& heOperationName, + virtual bool GetCreationInformation( std::string& theOperationName, std::vector& params ); -DEFINE_STANDARD_RTTI( ACISPlugin_ExportDriver ) +OCCT_DEFINE_STANDARD_RTTIEXT( ACISPlugin_ExportDriver, GEOM_BaseDriver ) }; #endif // _ACISPlugin_ExportDriver_HXX diff --git a/src/ACISPlugin_IOperations_i.cc b/src/ACISPlugin_IOperations_i.cc index 70c797e..f2b1606 100644 --- a/src/ACISPlugin_IOperations_i.cc +++ b/src/ACISPlugin_IOperations_i.cc @@ -97,7 +97,7 @@ GEOM::ListOfGO* ACISPlugin_IOperations_i::ImportACIS( const char* theFileName ) Standard_Integer aLength = aHSeq->Length(); aSeq->length( aLength ); for( Standard_Integer i = 1; i <= aLength; i++ ) - aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) ); + aSeq[i-1] = GetObject( HANDLE_NAMESPACE(GEOM_Object)::DownCast( aHSeq->Value(i) ) ); return aSeq._retn(); } diff --git a/src/ACISPlugin_ImportDriver.cxx b/src/ACISPlugin_ImportDriver.cxx index 8279129..21262fc 100644 --- a/src/ACISPlugin_ImportDriver.cxx +++ b/src/ACISPlugin_ImportDriver.cxx @@ -78,7 +78,7 @@ ACISPlugin_ImportDriver::ACISPlugin_ImportDriver() //function : Execute //purpose : //======================================================================= -Standard_Integer ACISPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const +Standard_Integer ACISPlugin_ImportDriver::Execute( LOGBOOK& log ) const { if( Label().IsNull() ) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() ); @@ -161,20 +161,15 @@ Standard_Integer ACISPlugin_ImportDriver::Execute( TFunction_Logbook& log ) cons aFunction->SetValue( aResShape ); - log.SetTouched( Label() ); +#if OCC_VERSION_MAJOR < 7 + log.SetTouched(Label()); +#else + log->SetTouched(Label()); +#endif return 1; } -//======================================================================= -//function : MustExecute -//purpose : -//======================================================================= -Standard_Boolean ACISPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const -{ - return Standard_True; -} - //================================================================================ /*! * \brief Returns a name of creation operation and names and values of creation parameters @@ -203,5 +198,4 @@ GetCreationInformation( std::string& theOperationName, return true; } -IMPLEMENT_STANDARD_HANDLE( ACISPlugin_ImportDriver, GEOM_BaseDriver ); -IMPLEMENT_STANDARD_RTTIEXT( ACISPlugin_ImportDriver, GEOM_BaseDriver ); +OCCT_IMPLEMENT_STANDARD_RTTIEXT( ACISPlugin_ImportDriver, GEOM_BaseDriver ); diff --git a/src/ACISPlugin_ImportDriver.hxx b/src/ACISPlugin_ImportDriver.hxx index da09aaa..e5d5f7f 100644 --- a/src/ACISPlugin_ImportDriver.hxx +++ b/src/ACISPlugin_ImportDriver.hxx @@ -23,11 +23,6 @@ // GEOM includes #include -// OCCT includes -#ifndef _TFunction_Logbook_HeaderFile -#include -#endif - DEFINE_STANDARD_HANDLE( ACISPlugin_ImportDriver, GEOM_BaseDriver ); class ACISPlugin_ImportDriver : public GEOM_BaseDriver @@ -37,14 +32,14 @@ public: ~ACISPlugin_ImportDriver() {}; static const Standard_GUID& GetID(); - virtual Standard_Integer Execute( TFunction_Logbook& log ) const; - Standard_Boolean MustExecute( const TFunction_Logbook& ) const; - virtual void Validate( TFunction_Logbook& ) const {} + virtual Standard_Integer Execute( LOGBOOK& log ) const; + Standard_Boolean MustExecute( const LOGBOOK& ) const { return Standard_True; } + virtual void Validate( LOGBOOK& ) const {} virtual bool GetCreationInformation( std::string& theOperationName, std::vector& params ); -DEFINE_STANDARD_RTTI( ACISPlugin_ImportDriver ) +OCCT_DEFINE_STANDARD_RTTIEXT( ACISPlugin_ImportDriver, GEOM_BaseDriver ) }; #endif // _ACISPlugin_ImportDriver_HXX -- 2.39.2