X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSTLPlugin%2FSTLPlugin_ExportDriver.cxx;h=0bb1352cae673afb3643b827239cde885510c18a;hb=HEAD;hp=3f269f304a1a6cc2901891ea608b46f4ea93a503;hpb=ec168c32f86cab8199030ec4e8e2b1cbd5e42670;p=modules%2Fgeom.git diff --git a/src/STLPlugin/STLPlugin_ExportDriver.cxx b/src/STLPlugin/STLPlugin_ExportDriver.cxx index 3f269f304..0bb1352ca 100644 --- a/src/STLPlugin/STLPlugin_ExportDriver.cxx +++ b/src/STLPlugin/STLPlugin_ExportDriver.cxx @@ -1,4 +1,4 @@ -// 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 @@ -24,7 +24,6 @@ // KERNEL includes #include #include -#include // GEOM includes #include "GEOM_Function.hxx" @@ -63,7 +62,7 @@ STLPlugin_ExportDriver::STLPlugin_ExportDriver() //function : Execute //purpose : //======================================================================= -Standard_Integer STLPlugin_ExportDriver::Execute(LOGBOOK& log) const +Standard_Integer STLPlugin_ExportDriver::Execute(Handle(TFunction_Logbook)& log) const { if (Label().IsNull()) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() ); @@ -97,36 +96,24 @@ Standard_Integer STLPlugin_ExportDriver::Execute(LOGBOOK& log) const TopoDS_Shape aCopyShape = aCopy.Shape(); // ASCII mode aWriter.ASCIIMode() = anIsASCII; -#if OCC_VERSION_LARGE > 0x06080000 if ( anIsRelative ) { Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; Bnd_Box bndBox; BRepBndLib::Add( aShape, bndBox ); bndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); aDeflection = MAX3( aXmax-aXmin, aYmax-aYmin, aZmax-aZmin ) * aDeflection; + aDeflection = MAX2( aDeflection, Precision::Confusion() ); } //Compute triangulation BRepTools::Clean( aCopyShape ); BRepMesh_IncrementalMesh aMesh( aCopyShape, aDeflection ); -#else - // set relative mode on false for using custom deflection coefficient - aWriter.RelativeMode( ) = anIsRelative; - if( anIsRelative ) - aWriter.SetCoefficient( aDeflection ); - else - aWriter.SetDeflection( aDeflection ); -#endif aWriter.Write( aCopyShape, aFileName.ToCString() ); -#if OCC_VERSION_MAJOR < 7 - log.SetTouched(Label()); -#else log->SetTouched(Label()); -#endif return 1; } - catch( Standard_Failure ) + catch( Standard_Failure& ) { - //THROW_SALOME_CORBA_EXCEPTION("Exception catched in ExportSTL", SALOME::BAD_PARAM); + //THROW_SALOME_CORBA_EXCEPTION("Exception caught in ExportSTL", SALOME::BAD_PARAM); } return 0; } @@ -137,10 +124,10 @@ Standard_Integer STLPlugin_ExportDriver::Execute(LOGBOOK& log) const */ //================================================================================ bool STLPlugin_ExportDriver:: -GetCreationInformation( std::string& theOperationName, - std::vector& theParams ) +GetCreationInformation( std::string& /*theOperationName*/, + std::vector& /*theParams*/ ) { return false; } -OCCT_IMPLEMENT_STANDARD_RTTIEXT( STLPlugin_ExportDriver,GEOM_BaseDriver ); +IMPLEMENT_STANDARD_RTTIEXT( STLPlugin_ExportDriver,GEOM_BaseDriver )