From ef0ce54b75e412f217260de5f7113a23c23660ff Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 24 Feb 2016 17:02:59 +0300 Subject: [PATCH] Migration to OCCT 7.0 --- adm_local/cmake_files/FindXT.cmake | 33 ++++++++++++++++++++++-------- src/XTPlugin_IOperations_i.cc | 2 +- src/XTPlugin_ImportDriver.cxx | 20 +++++++----------- src/XTPlugin_ImportDriver.hxx | 13 ++++-------- 4 files changed, 36 insertions(+), 32 deletions(-) diff --git a/adm_local/cmake_files/FindXT.cmake b/adm_local/cmake_files/FindXT.cmake index 4fbc894..a7d247c 100644 --- a/adm_local/cmake_files/FindXT.cmake +++ b/adm_local/cmake_files/FindXT.cmake @@ -41,15 +41,30 @@ IF(OCCLICENSE_ROOT_DIR) LIST(APPEND CMAKE_PREFIX_PATH "${OCCLICENSE_ROOT_DIR}") ENDIF(OCCLICENSE_ROOT_DIR) -FIND_PATH(XT_INCLUDE_DIRS XtData.hxx PATH_SUFFIXES inc) -FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES inc) -IF(OCCTLICENSE_INCLUDE_DIRS) - LIST(APPEND XT_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) -ENDIF(OCCTLICENSE_INCLUDE_DIRS) - -FIND_LIBRARY(XT_TKXDEXT NAMES TKXDEXT) -FIND_LIBRARY(XT_TKXT NAMES TKXT) -FIND_LIBRARY(XT_TKOCCLicense NAMES TKOCCLicense) +FIND_PATH(XT_INCLUDE_DIRS XtData.hxx PATH_SUFFIXES include/opencascade) +IF(XT_INCLUDE_DIRS) + SET(XT_UPCOUNT 2) +ELSE(XT_INCLUDE_DIRS) + FIND_PATH(XT_INCLUDE_DIRS XtData.hxx PATH_SUFFIXES include inc) +ENDIF(XT_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(XT_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) + FILE(TO_NATIVE_PATH ${XT_INCLUDE_DIRS} _xt_dir) + FILE(TO_NATIVE_PATH ${OCCTLICENSE_INCLUDE_DIRS} _lic_dir) + STRING(COMPARE NOTEQUAL ${_xt_dir} ${_lic_dir} _diff_dir) + IF(_diff_dir) + LIST(APPEND XT_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) + ENDIF() +ENDIF(XT_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) + +FIND_LIBRARY(XT_TKXDEXT NAMES TKXDEXT PATH_SUFFIXES lib lin64/gcc/lib bin) +FIND_LIBRARY(XT_TKXT NAMES TKXT PATH_SUFFIXES lib lin64/gcc/lib bin) +FIND_LIBRARY(XT_TKOCCLicense NAMES TKOCCLicense PATH_SUFFIXES lib lin64/gcc/lib bin) SET(XT_LIBRARIES ${XT_TKXT} diff --git a/src/XTPlugin_IOperations_i.cc b/src/XTPlugin_IOperations_i.cc index c743ac6..b3c651a 100644 --- a/src/XTPlugin_IOperations_i.cc +++ b/src/XTPlugin_IOperations_i.cc @@ -73,7 +73,7 @@ GEOM::ListOfGO* XTPlugin_IOperations_i::ImportXT( 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/XTPlugin_ImportDriver.cxx b/src/XTPlugin_ImportDriver.cxx index 5ce3c92..33a8c36 100644 --- a/src/XTPlugin_ImportDriver.cxx +++ b/src/XTPlugin_ImportDriver.cxx @@ -87,7 +87,7 @@ XTPlugin_ImportDriver::XTPlugin_ImportDriver() //function : Execute //purpose : //======================================================================= -Standard_Integer XTPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const +Standard_Integer XTPlugin_ImportDriver::Execute( LOGBOOK& log ) const { if( Label().IsNull() ) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() ); @@ -220,20 +220,15 @@ Standard_Integer XTPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const 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 XTPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const -{ - return Standard_True; -} - //================================================================================ /*! * \brief Returns a name of creation operation and names and values of creation parameters @@ -262,5 +257,4 @@ GetCreationInformation( std::string& theOperationName, return true; } -IMPLEMENT_STANDARD_HANDLE( XTPlugin_ImportDriver, GEOM_BaseDriver ); -IMPLEMENT_STANDARD_RTTIEXT( XTPlugin_ImportDriver, GEOM_BaseDriver ); +OCCT_IMPLEMENT_STANDARD_RTTIEXT( XTPlugin_ImportDriver, GEOM_BaseDriver ); diff --git a/src/XTPlugin_ImportDriver.hxx b/src/XTPlugin_ImportDriver.hxx index d3ed5a2..57c9a96 100644 --- a/src/XTPlugin_ImportDriver.hxx +++ b/src/XTPlugin_ImportDriver.hxx @@ -23,11 +23,6 @@ // GEOM includes #include -// OCCT includes -#ifndef _TFunction_Logbook_HeaderFile -#include -#endif - DEFINE_STANDARD_HANDLE( XTPlugin_ImportDriver, GEOM_BaseDriver ); class XTPlugin_ImportDriver : public GEOM_BaseDriver @@ -37,14 +32,14 @@ public: ~XTPlugin_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( XTPlugin_ImportDriver ) +OCCT_DEFINE_STANDARD_RTTIEXT( XTPlugin_ImportDriver, GEOM_BaseDriver ) }; #endif // _XTPlugin_ImportDriver_HXX -- 2.39.2