1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <IGESSelect_AutoCorrect.ixx>
15 #include <IGESData_Protocol.hxx>
16 #include <IGESData_BasicEditor.hxx>
17 #include <IGESData_IGESEntity.hxx>
18 #include <Interface_Check.hxx>
19 #include <Interface_Macros.hxx>
21 IGESSelect_AutoCorrect::IGESSelect_AutoCorrect ()
22 : IGESSelect_ModelModifier (Standard_False) { }
24 void IGESSelect_AutoCorrect::Performing
25 (IFSelect_ContextModif& ctx,
26 const Handle(IGESData_IGESModel)& target,
27 Interface_CopyTool& ) const
29 DeclareAndCast(IGESData_Protocol,protocol,ctx.Protocol());
30 if (protocol.IsNull()) {
31 ctx.CCheck()->AddFail("IGES Auto Correct, not called with Protocol");
35 IGESData_BasicEditor corrector (target,protocol);
36 for (ctx.Start(); ctx.More(); ctx.Next()) {
37 DeclareAndCast(IGESData_IGESEntity,ent,ctx.ValueResult());
38 Standard_Boolean done = corrector.AutoCorrect (ent);
39 if (done) ctx.Trace();
44 TCollection_AsciiString IGESSelect_AutoCorrect::Label () const
46 return TCollection_AsciiString ("Auto-Correction of IGES Entities");