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 <IFSelect_EditForm.hxx>
17 #include <IFSelect_ModifEditForm.hxx>
18 #include <Interface_CopyTool.hxx>
19 #include <Interface_InterfaceModel.hxx>
20 #include <Interface_Protocol.hxx>
21 #include <Standard_Type.hxx>
22 #include <TCollection_AsciiString.hxx>
24 IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModifEditForm,IFSelect_Modifier)
26 IFSelect_ModifEditForm::IFSelect_ModifEditForm
27 (const Handle(IFSelect_EditForm)& editform)
28 : IFSelect_Modifier (Standard_False) { theedit = editform; }
30 Handle(IFSelect_EditForm) IFSelect_ModifEditForm::EditForm () const
34 void IFSelect_ModifEditForm::Perform
35 (IFSelect_ContextModif& ctx,
36 const Handle(Interface_InterfaceModel)& target,
37 const Handle(Interface_Protocol)& /*protocol*/,
38 Interface_CopyTool& /*TC*/) const
40 for (ctx.Start(); ctx.More(); ctx.Next()) {
41 Standard_Boolean done = theedit->ApplyData(ctx.ValueResult(),target);
42 if (done) ctx.Trace();
43 else ctx.AddWarning (ctx.ValueResult(),"EditForm could not be applied");
47 TCollection_AsciiString IFSelect_ModifEditForm::Label () const
49 Standard_CString editlab = theedit->Label();
50 TCollection_AsciiString lab ("Apply EditForm");
51 if (editlab && editlab[0] != '\0') {
52 lab.AssignCat (" : ");
53 lab.AssignCat (editlab);