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.
15 #include <IFSelect_ContextModif.hxx>
16 #include <IGESData_BasicEditor.hxx>
17 #include <IGESData_IGESEntity.hxx>
18 #include <IGESData_IGESModel.hxx>
19 #include <IGESData_Protocol.hxx>
20 #include <IGESSelect_AutoCorrect.hxx>
21 #include <Interface_Check.hxx>
22 #include <Interface_CopyTool.hxx>
23 #include <Interface_Macros.hxx>
24 #include <Standard_Type.hxx>
25 #include <TCollection_AsciiString.hxx>
27 IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_AutoCorrect,IGESSelect_ModelModifier)
29 IGESSelect_AutoCorrect::IGESSelect_AutoCorrect ()
30 : IGESSelect_ModelModifier (Standard_False) { }
32 void IGESSelect_AutoCorrect::Performing
33 (IFSelect_ContextModif& ctx,
34 const Handle(IGESData_IGESModel)& target,
35 Interface_CopyTool& ) const
37 DeclareAndCast(IGESData_Protocol,protocol,ctx.Protocol());
38 if (protocol.IsNull()) {
39 ctx.CCheck()->AddFail("IGES Auto Correct, not called with Protocol");
43 IGESData_BasicEditor corrector (target,protocol);
44 for (ctx.Start(); ctx.More(); ctx.Next()) {
45 DeclareAndCast(IGESData_IGESEntity,ent,ctx.ValueResult());
46 Standard_Boolean done = corrector.AutoCorrect (ent);
47 if (done) ctx.Trace();
52 TCollection_AsciiString IGESSelect_AutoCorrect::Label () const
54 return TCollection_AsciiString ("Auto-Correction of IGES Entities");