42cf5bc1 |
1 | // Created on: 1993-07-28 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IFSelect_Functions_HeaderFile |
18 | #define _IFSelect_Functions_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_CString.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <TColStd_HSequenceOfTransient.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | class Standard_Transient; |
29 | class IFSelect_WorkSession; |
30 | class IFSelect_Dispatch; |
31 | |
32 | |
33 | //! Functions gives access to all the actions which can be |
34 | //! commanded with the resources provided by IFSelect : especially |
35 | //! WorkSession and various types of Selections and Dispatches |
36 | //! |
37 | //! It works by adding functions by method Init |
38 | class IFSelect_Functions |
39 | { |
40 | public: |
41 | |
42 | DEFINE_STANDARD_ALLOC |
43 | |
44 | |
45 | //! Takes the name of an entity, either as argument, or (if <name> |
46 | //! is empty) on keybord, and returns the entity |
47 | //! name can be a label or a number (in alphanumeric), it is |
48 | //! searched by NumberFromLabel from WorkSession. |
49 | //! If <name> doesn't match en entity, a Null Handle is returned |
50 | Standard_EXPORT static Handle(Standard_Transient) GiveEntity (const Handle(IFSelect_WorkSession)& WS, const Standard_CString name = ""); |
51 | |
52 | //! Same as GetEntity, but returns the number in the model of the |
53 | //! entity. Returns 0 for null handle |
54 | Standard_EXPORT static Standard_Integer GiveEntityNumber (const Handle(IFSelect_WorkSession)& WS, const Standard_CString name = ""); |
55 | |
56 | //! Computes a List of entities from a WorkSession and two idents, |
57 | //! first and second, as follows : |
58 | //! if <first> is a Number or Label of an entity : this entity |
59 | //! if <first> is the name of a Selection in <WS>, and <second> |
60 | //! not defined, the standard result of this Selection |
61 | //! if <first> is for a Selection and <second> is defined, the |
62 | //! standard result of this selection from the list computed |
63 | //! with <second> (an entity or a selection) |
64 | //! If <second> is erroneous, it is ignored |
65 | Standard_EXPORT static Handle(TColStd_HSequenceOfTransient) GiveList (const Handle(IFSelect_WorkSession)& WS, const Standard_CString first = "", const Standard_CString second = ""); |
66 | |
67 | //! Evaluates and returns a Dispatch, from data of a WorkSession |
68 | //! if <mode> is False, searches for exact name of Dispatch in WS |
69 | //! Else (D), allows a parameter between brackets : |
70 | //! ex.: dispatch_name(parameter) |
71 | //! The parameter can be: an integer for DispPerCount or DispPerFiles |
72 | //! or the name of a Signature for DispPerSignature |
73 | //! Returns Null Handle if not found not well evaluated |
74 | Standard_EXPORT static Handle(IFSelect_Dispatch) GiveDispatch (const Handle(IFSelect_WorkSession)& WS, const Standard_CString name, const Standard_Boolean mode = Standard_True); |
75 | |
76 | //! Defines and loads all basic functions (as ActFunc) |
77 | Standard_EXPORT static void Init(); |
78 | |
79 | |
80 | |
81 | |
82 | protected: |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | private: |
89 | |
90 | |
91 | |
92 | |
93 | |
94 | }; |
95 | |
96 | |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | #endif // _IFSelect_Functions_HeaderFile |