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 <IFSelect_Act.ixx>
15 #include <TCollection_AsciiString.hxx>
17 static TCollection_AsciiString thedefgr, thedefil;
21 IFSelect_Act::IFSelect_Act
22 (const Standard_CString name, const Standard_CString help,
23 const IFSelect_ActFunc func)
24 : thename (name) , thehelp (help) , thefunc (func) { }
26 IFSelect_ReturnStatus IFSelect_Act::Do
27 (const Standard_Integer, const Handle(IFSelect_SessionPilot)& pilot)
29 if (!thefunc) return IFSelect_RetVoid;
30 return thefunc (pilot);
33 Standard_CString IFSelect_Act::Help (const Standard_Integer) const
34 { return thehelp.ToCString(); }
37 void IFSelect_Act::SetGroup
38 (const Standard_CString group, const Standard_CString file)
39 { thedefgr.Clear(); if (group[0] != '\0') thedefgr.AssignCat(group);
40 thedefil.Clear(); if (file [0] != '\0') thedefil.AssignCat(file); }
42 void IFSelect_Act::AddFunc
43 (const Standard_CString name, const Standard_CString help,
44 const IFSelect_ActFunc func)
46 Handle(IFSelect_Act) act = new IFSelect_Act (name,help,func);
47 if (thedefgr.Length() > 0) act->SetForGroup (thedefgr.ToCString());
51 void IFSelect_Act::AddFSet
52 (const Standard_CString name, const Standard_CString help,
53 const IFSelect_ActFunc func)
55 Handle(IFSelect_Act) act = new IFSelect_Act (name,help,func);
56 if (thedefgr.Length() > 0)
57 act->SetForGroup (thedefgr.ToCString(),thedefil.ToCString());