From: mnt Date: Wed, 2 Mar 2016 13:11:45 +0000 (+0300) Subject: Migration to OCCT 7.0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c9ade5b9c2a8d5683a609800296313b63b719a7;p=plugins%2Fcanrecplugin.git Migration to OCCT 7.0 --- diff --git a/adm_local/cmake_files/FindCR.cmake b/adm_local/cmake_files/FindCR.cmake index ffc1203..b42dd48 100644 --- a/adm_local/cmake_files/FindCR.cmake +++ b/adm_local/cmake_files/FindCR.cmake @@ -40,14 +40,29 @@ IF(OCCLICENSE_ROOT_DIR) LIST(APPEND CMAKE_PREFIX_PATH "${OCCLICENSE_ROOT_DIR}") ENDIF(OCCLICENSE_ROOT_DIR) -FIND_PATH(CR_INCLUDE_DIRS ShapeConvert.hxx PATH_SUFFIXES inc) -FIND_PATH(OCCTLICENSE_INCLUDE_DIRS OCCLicense_Activate.hxx PATH_SUFFIXES inc) -IF(OCCTLICENSE_INCLUDE_DIRS) - LIST(APPEND CR_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) -ENDIF(OCCTLICENSE_INCLUDE_DIRS) - -FIND_LIBRARY(CR_TKCR NAMES TKCR) -FIND_LIBRARY(CRKOCCLicense NAMES TKOCCLicense) +FIND_PATH(CR_INCLUDE_DIRS ShapeConvert.hxx PATH_SUFFIXES include/opencascade) +IF(CR_INCLUDE_DIRS) + SET(CR_UPCOUNT 2) +ELSE(CR_INCLUDE_DIRS) + FIND_PATH(CR_INCLUDE_DIRS ShapeConvert.hxx PATH_SUFFIXES include inc) +ENDIF(CR_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(CR_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) + FILE(TO_NATIVE_PATH ${CR_INCLUDE_DIRS} _cr_dir) + FILE(TO_NATIVE_PATH ${OCCTLICENSE_INCLUDE_DIRS} _lic_dir) + STRING(COMPARE NOTEQUAL ${_cr_dir} ${_lic_dir} _diff_dir) + IF(_diff_dir) + LIST(APPEND CR_INCLUDE_DIRS ${OCCTLICENSE_INCLUDE_DIRS}) + ENDIF() +ENDIF(CR_INCLUDE_DIRS AND OCCTLICENSE_INCLUDE_DIRS) + +FIND_LIBRARY(CR_TKCR NAMES TKCR PATH_SUFFIXES lib lin64/gcc/lib bin) +FIND_LIBRARY(CRKOCCLicense NAMES TKOCCLicense PATH_SUFFIXES lib lin64/gcc/lib bin) SET(CR_LIBRARIES ${CR_TKCR} diff --git a/src/CANRECPLUGINEngine/CANRECPluginEngine_IOperations_i.cc b/src/CANRECPLUGINEngine/CANRECPluginEngine_IOperations_i.cc index e441237..23cf759 100644 --- a/src/CANRECPLUGINEngine/CANRECPluginEngine_IOperations_i.cc +++ b/src/CANRECPLUGINEngine/CANRECPluginEngine_IOperations_i.cc @@ -58,7 +58,7 @@ CANRECPluginEngine_IOperations_i::MakeCanonicalRecognition( GEOM::GEOM_Object_pt GetOperations()->SetNotDone(); // Get the reference points - Handle(GEOM_Object) anInitObject = GetObjectImpl( theObject ); + HANDLE_NAMESPACE(GEOM_Object) anInitObject = GetObjectImpl( theObject ); if ( anInitObject.IsNull() ) { return GEOM::GEOM_Object::_nil(); @@ -66,7 +66,7 @@ CANRECPluginEngine_IOperations_i::MakeCanonicalRecognition( GEOM::GEOM_Object_pt // Make Canonical Recognition Handle(TColStd_HSequenceOfInteger) aStat = new TColStd_HSequenceOfInteger; - Handle(GEOM_Object) anObject = + HANDLE_NAMESPACE(GEOM_Object) anObject = GetOperations()->MakeCanonicalRecognition(anInitObject, theMergeSurf, theMergeCurves, @@ -106,7 +106,7 @@ CORBA::Long CANRECPluginEngine_IOperations_i::GetNbCanonicalFaces GetOperations()->SetNotDone(); // Get the reference points - Handle(GEOM_Object) anInitObject = GetObjectImpl(theObject); + HANDLE_NAMESPACE(GEOM_Object) anInitObject = GetObjectImpl(theObject); if (anInitObject.IsNull()) { return -1; diff --git a/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.cxx b/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.cxx index d7ae257..a0f400a 100644 --- a/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.cxx +++ b/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.cxx @@ -103,16 +103,16 @@ CANRECPluginImpl_Driver::~CANRECPluginImpl_Driver() { } -Standard_Boolean CANRECPluginImpl_Driver::MustExecute( const TFunction_Logbook& ) const +Standard_Boolean CANRECPluginImpl_Driver::MustExecute( const LOGBOOK& ) const { return Standard_True; } -void CANRECPluginImpl_Driver::Validate( TFunction_Logbook& ) const +void CANRECPluginImpl_Driver::Validate( LOGBOOK& ) const { } -Standard_Integer CANRECPluginImpl_Driver::Execute( TFunction_Logbook& log ) const +Standard_Integer CANRECPluginImpl_Driver::Execute( LOGBOOK& log ) const { if ( Label().IsNull() ) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() ); @@ -189,7 +189,11 @@ Standard_Integer CANRECPluginImpl_Driver::Execute( TFunction_Logbook& log ) cons aFunction->SetValue( aResultingShape ); +#if OCC_VERSION_MAJOR < 7 log.SetTouched( Label() ); +#else + log->SetTouched( Label() ); +#endif return 1; } @@ -212,5 +216,4 @@ GetCreationInformation( std::string& theOperationName, return true; } -IMPLEMENT_STANDARD_HANDLE( CANRECPluginImpl_Driver, GEOM_BaseDriver ); -IMPLEMENT_STANDARD_RTTIEXT( CANRECPluginImpl_Driver, GEOM_BaseDriver ); +OCCT_IMPLEMENT_STANDARD_RTTIEXT( CANRECPluginImpl_Driver,GEOM_BaseDriver ); diff --git a/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.hxx b/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.hxx index f7ddb14..ee442d9 100644 --- a/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.hxx +++ b/src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.hxx @@ -34,14 +34,14 @@ public: static const Standard_GUID& GetID(); static Standard_Integer GetNbCanonicalFaces(const TopoDS_Shape &theShape); - virtual Standard_Integer Execute( TFunction_Logbook& ) const; - Standard_Boolean MustExecute( const TFunction_Logbook& ) const; - virtual void Validate( TFunction_Logbook& ) const; + virtual Standard_Integer Execute( LOGBOOK& ) const; + Standard_Boolean MustExecute( const LOGBOOK& ) const; + virtual void Validate( LOGBOOK& ) const; virtual bool GetCreationInformation( std::string&, std::vector& ); - DEFINE_STANDARD_RTTI( CANRECPluginImpl_Driver ); +OCCT_DEFINE_STANDARD_RTTIEXT( CANRECPluginImpl_Driver, GEOM_BaseDriver ) }; #endif // __CANRECPLUGINIMPL_DRIVER_HXX