Salome HOME
updated copyright message
[modules/geom.git] / src / IGESPlugin / IGESPlugin_ExportDriver.cxx
index 4e679fcf64f6ba10d95e9182cac3095a2ce1abb1..433e59bf5b68a3f053d8b4852eec00e47849c889 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -24,6 +24,7 @@
 // KERNEL includes
 #include <utilities.h>
 #include <Basics_Utils.hxx>
+#include <Basics_OCCTVersion.hxx>
 
 // GEOM includes
 #include "GEOM_Function.hxx"
 // OOCT includes
 #include <IGESControl_Controller.hxx>
 #include <IGESControl_Writer.hxx>
+#include <IGESData_IGESModel.hxx>
 #include <Interface_Static.hxx>
 
+#include <XSAlgo.hxx>
+#include <XSAlgo_AlgoContainer.hxx>
+
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Iterator.hxx>
 
+#include <UnitsMethods.hxx>
+
 //=============================================================================
 /*!
  *  KindOfBRep
@@ -115,7 +122,7 @@ IGESPlugin_ExportDriver::IGESPlugin_ExportDriver()
 //function : Execute
 //purpose  :
 //=======================================================================
-Standard_Integer IGESPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+Standard_Integer IGESPlugin_ExportDriver::Execute(Handle(TFunction_Logbook)& /*log*/) const
 {
   if (Label().IsNull()) return 0;
   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
@@ -161,6 +168,13 @@ Standard_Integer IGESPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons
   IGESControl_Writer ICW( "M", aBrepMode ); // export explicitly in meters
   Interface_Static::SetCVal( "xstep.cascade.unit", "M" );
 
+#if OCC_VERSION_LARGE >= 0x07070000
+  Interface_Static::SetCVal("write.iges.unit", "M");
+  XSAlgo::AlgoContainer()->PrepareForTransfer(); // update unit info
+  Standard_Real aScaleFactorMM = UnitsMethods::GetCasCadeLengthUnit();
+  ICW.Model()->ChangeGlobalSection().SetCascadeUnit(aScaleFactorMM);
+#endif
+
   // 09.03.2010 skl for bug 0020726
   // change default value "Average" to "Max"
   Interface_Static::SetCVal( "write.precision.mode", "Max" );
@@ -173,26 +187,16 @@ Standard_Integer IGESPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons
   return 0;
 }
 
-//=======================================================================
-//function : MustExecute
-//purpose  :
-//=======================================================================
-Standard_Boolean IGESPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
-{
-  return Standard_True;
-}
-
 //================================================================================
 /*!
  * \brief Returns a name of creation operation and names and values of creation parameters
  */
 //================================================================================
 bool IGESPlugin_ExportDriver::
-GetCreationInformation( std::string&             theOperationName,
-                        std::vector<GEOM_Param>& theParams )
+GetCreationInformation( std::string&             /*theOperationName*/,
+                        std::vector<GEOM_Param>& /*theParams*/ )
 {
   return false;
 }
 
-IMPLEMENT_STANDARD_HANDLE( IGESPlugin_ExportDriver,GEOM_BaseDriver );
-IMPLEMENT_STANDARD_RTTIEXT( IGESPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( IGESPlugin_ExportDriver,GEOM_BaseDriver )