-// Copyright (C) 2014-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2016 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
// internal includes
#include "STEPPlugin_ExportDriver.hxx"
#include "STEPPlugin_IExport.hxx"
+#include "STEPPlugin_IOperations.hxx"
// KERNEL includes
#include <utilities.h>
//function : Execute
//purpose :
//=======================================================================
-Standard_Integer STEPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+Standard_Integer STEPPlugin_ExportDriver::Execute(LOGBOOK& log) const
{
if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
aFunction->SetValue( aShape );
TCollection_AsciiString aFileName = aData.GetFileName();
+ Standard_Integer anUnit = aData.GetUnit();
+ TCollection_AsciiString aWriteUnit;
+
+ switch (anUnit) {
+ case STEPPlugin_IOperations::LengthUnit_Inch:
+ aWriteUnit = "INCH";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Millimeter:
+ aWriteUnit = "MM";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Foot:
+ aWriteUnit = "FT";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Mile:
+ aWriteUnit = "MI";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Meter:
+ aWriteUnit = "M";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Kilometer:
+ aWriteUnit = "KM";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Milliinch:
+ aWriteUnit = "MIL";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Micrometer:
+ aWriteUnit = "UM";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Centimeter:
+ aWriteUnit = "CM";
+ break;
+ case STEPPlugin_IOperations::LengthUnit_Microinch:
+ aWriteUnit = "UIN";
+ break;
+ default:
+ return 0;
+ }
MESSAGE("Export STEP into file " << aFileName.ToCString());
//VRV: OCC 4.0 migration
STEPControl_Writer aWriter;
Interface_Static::SetCVal("xstep.cascade.unit","M");
- Interface_Static::SetCVal("write.step.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
return 0;
}
-//=======================================================================
-//function : MustExecute
-//purpose :
-//=======================================================================
-Standard_Boolean STEPPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
-{
- return Standard_True;
-}
-
//================================================================================
/*!
* \brief Returns a name of creation operation and names and values of creation parameters
return false;
}
-IMPLEMENT_STANDARD_HANDLE( STEPPlugin_ExportDriver,GEOM_BaseDriver );
-IMPLEMENT_STANDARD_RTTIEXT( STEPPlugin_ExportDriver,GEOM_BaseDriver );
+OCCT_IMPLEMENT_STANDARD_RTTIEXT( STEPPlugin_ExportDriver,GEOM_BaseDriver );