-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2024 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// KERNEL includes
#include <utilities.h>
#include <Basics_Utils.hxx>
+#include <Basics_OCCTVersion.hxx>
// GEOM includes
#include "GEOM_Function.hxx"
// OOCT includes
#include <IFSelect_ReturnStatus.hxx>
#include <STEPControl_Writer.hxx>
+#include <StepData_StepModel.hxx>
+#include <UnitsMethods.hxx>
#include <Interface_Static.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Shape.hxx>
//function : Execute
//purpose :
//=======================================================================
-Standard_Integer STEPPlugin_ExportDriver::Execute(Handle(TFunction_Logbook)& log) const
+Standard_Integer STEPPlugin_ExportDriver::Execute(Handle(TFunction_Logbook)& /*log*/) const
{
if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
// Set "C" numeric locale to save numbers correctly
Kernel_Utils::Localizer loc;
- IFSelect_ReturnStatus status ;
- //VRV: OCC 4.0 migration
+#if OCC_VERSION_LARGE < 0x07070000
STEPControl_Writer aWriter;
Interface_Static::SetCVal("xstep.cascade.unit","M");
Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString());
Interface_Static::SetIVal("write.step.nonmanifold", 1);
- status = aWriter.Transfer( aShape, STEPControl_AsIs );
- //VRV: OCC 4.0 migration
+#elif OCC_VERSION_LARGE < 0x07080000
+ STEPControl_Writer aWriterTmp;
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString());
+ Interface_Static::SetIVal("write.step.nonmanifold", 1);
+ STEPControl_Writer aWriter;
+#else
+ STEPControl_Writer aWriter;
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString());
+ Interface_Static::SetIVal("write.step.nonmanifold", 1);
+ Handle(StepData_StepModel) aModel = aWriter.Model();
+ aModel->InternalParameters.InitFromStatic();
+ Standard_Integer aWriteUnitInt = Interface_Static::IVal("write.step.unit");
+ Standard_Real aWriteUnitReal = UnitsMethods::GetLengthFactorValue(aWriteUnitInt);
+ aModel->SetWriteLengthUnit(aWriteUnitReal);
+#endif
+
+ IFSelect_ReturnStatus status = aWriter.Transfer( aShape, STEPControl_AsIs );
if( status == IFSelect_RetDone )
status = aWriter.Write( aFileName.ToCString() );
if( status == IFSelect_RetDone )
return 1;
}
- catch (Standard_Failure)
+ catch (Standard_Failure&)
{
- //THROW_SALOME_CORBA_EXCEPTION("Exception caught in STEPExport", SALOME::BAD_PARAM);
+ //THROW_SALOME_CORBA_EXCEPTION("Exception caught in STEPExport", SALOME::BAD_PARAM);
}
return 0;
}
*/
//================================================================================
bool STEPPlugin_ExportDriver::
-GetCreationInformation( std::string& theOperationName,
- std::vector<GEOM_Param>& theParams )
+GetCreationInformation( std::string& /*theOperationName*/,
+ std::vector<GEOM_Param>& /*theParams*/ )
{
return false;
}
-IMPLEMENT_STANDARD_RTTIEXT( STEPPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( STEPPlugin_ExportDriver,GEOM_BaseDriver )