]> SALOME platform Git repositories - plugins/canrecplugin.git/commitdiff
Salome HOME
Migration to OCCT 7.0
authormnt <mnt@opencascade.com>
Wed, 2 Mar 2016 13:11:45 +0000 (16:11 +0300)
committervsr <vsr@opencascade.com>
Thu, 26 May 2016 10:03:53 +0000 (13:03 +0300)
adm_local/cmake_files/FindCR.cmake
src/CANRECPLUGINEngine/CANRECPluginEngine_IOperations_i.cc
src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.cxx
src/CANRECPLUGINEngine/CANRECPluginImpl_Driver.hxx

index ffc1203958554b49794f9745eeea7c2725a51266..b42dd48bbe757d13e757c808158cb2908b9f403e 100644 (file)
@@ -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}
index e4412373a2899537a8349e1f105223de96198c4c..23cf75972789301fd235896bf0f25ae77d93360a 100644 (file)
@@ -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;
index d7ae257a553c36bb5942e6282be5985bcec2c186..a0f400a0bf5884bf5b2e4661232153db5a75f391 100644 (file)
@@ -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 );
index f7ddb1465b6c822c9b810838fb71bff3b3fb5603..ee442d9dc244f5f5f6061a3af1d312a1650e96e5 100644 (file)
@@ -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<GEOM_Param>& );
 
-  DEFINE_STANDARD_RTTI( CANRECPluginImpl_Driver );
+OCCT_DEFINE_STANDARD_RTTIEXT( CANRECPluginImpl_Driver, GEOM_BaseDriver )
 };
 
 #endif // __CANRECPLUGINIMPL_DRIVER_HXX