]> SALOME platform Git repositories - plugins/xtplugin.git/commitdiff
Salome HOME
Migration to OCCT 7.0
authormpa <mpa@opencascade.com>
Wed, 24 Feb 2016 14:02:59 +0000 (17:02 +0300)
committervsr <vsr@opencascade.com>
Thu, 26 May 2016 10:00:04 +0000 (13:00 +0300)
adm_local/cmake_files/FindXT.cmake
src/XTPlugin_IOperations_i.cc
src/XTPlugin_ImportDriver.cxx
src/XTPlugin_ImportDriver.hxx

index 4fbc894d22dfc766b9851b3f43725e2e26198541..a7d247c5f58d6b050d0ac6709bf15ff903fd4903 100644 (file)
@@ -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}
index c743ac6c7c129a2e5c13ed7c1ba8bccb772b1761..b3c651a25e0aa15a4fab05607dd5c9a739c6be5c 100644 (file)
@@ -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();
 }
index 5ce3c9211b7e3c54c3137f4266dc40b7930def7f..33a8c360900d03f700d3ca73f4d7a09aa50df3bd 100644 (file)
@@ -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 );
index d3ed5a2be3d15608e77fc4b159a0002183371822..57c9a961049e027a93ef44d54c1e1b91c4557a8b 100644 (file)
 // GEOM includes
 #include <GEOM_BaseDriver.hxx>
 
-// OCCT includes
-#ifndef _TFunction_Logbook_HeaderFile
-#include <TFunction_Logbook.hxx>
-#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<GEOM_Param>& params );
 
-DEFINE_STANDARD_RTTI( XTPlugin_ImportDriver )
+OCCT_DEFINE_STANDARD_RTTIEXT( XTPlugin_ImportDriver, GEOM_BaseDriver )
 };
 
 #endif // _XTPlugin_ImportDriver_HXX