0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / StepData / StepData_FreeFormEntity.hxx
1 // Created on: 1997-01-03
2 // Created by: Christian CAILLET
3 // Copyright (c) 1997-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 _StepData_FreeFormEntity_HeaderFile
18 #define _StepData_FreeFormEntity_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TCollection_AsciiString.hxx>
24 #include <StepData_HArray1OfField.hxx>
25 #include <MMgt_TShared.hxx>
26 #include <Standard_CString.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <TColStd_HSequenceOfAsciiString.hxx>
29 #include <Standard_Integer.hxx>
30 class StepData_Field;
31
32
33 class StepData_FreeFormEntity;
34 DEFINE_STANDARD_HANDLE(StepData_FreeFormEntity, MMgt_TShared)
35
36 //! A Free Form Entity allows to record any kind of STEP
37 //! parameters, in any way of typing
38 //! It is implemented with an array of fields
39 //! A Complex entity can be defined, as a chain of FreeFormEntity
40 //! (see Next and As)
41 class StepData_FreeFormEntity : public MMgt_TShared
42 {
43
44 public:
45
46   
47   //! Creates a FreeFormEntity, with no field, no type
48   Standard_EXPORT StepData_FreeFormEntity();
49   
50   //! Sets the type of an entity
51   //! For a complex one, the type of this member
52   Standard_EXPORT void SetStepType (const Standard_CString typenam);
53   
54   //! Returns the recorded StepType
55   //! For a complex one, the type of this member
56   Standard_EXPORT Standard_CString StepType() const;
57   
58   //! Sets a next member, in order to define or complete a Complex
59   //! entity
60   //! If <last> is True (D), this next will be set as last of list
61   //! Else, it is inserted just as next of <me>
62   //! If <next> is Null, Next is cleared
63   Standard_EXPORT void SetNext (const Handle(StepData_FreeFormEntity)& next, const Standard_Boolean last = Standard_True);
64   
65   //! Returns the next member of a Complex entity
66   //! (remark : the last member has none)
67   Standard_EXPORT Handle(StepData_FreeFormEntity) Next() const;
68   
69   //! Returns True if a FreeFormEntity is Complex (i.e. has Next)
70   Standard_EXPORT Standard_Boolean IsComplex() const;
71   
72   //! Returns the member of a FreeFormEntity of which the type name
73   //! is given (exact match, no sub-type)
74   Standard_EXPORT Handle(StepData_FreeFormEntity) Typed (const Standard_CString typenam) const;
75   
76   //! Returns the list of types (one type for a simple entity),
77   //! as is (non reordered)
78   Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) TypeList() const;
79   
80   //! Reorders a Complex entity if required, i.e. if member types
81   //! are not in alphabetic order
82   //! Returns False if nothing done (order was OK or simple entity),
83   //! True plus modified <ent> if <ent> has been reordered
84   Standard_EXPORT static Standard_Boolean Reorder (Handle(StepData_FreeFormEntity)& ent);
85   
86   //! Sets a count of Fields, from scratch
87   Standard_EXPORT void SetNbFields (const Standard_Integer nb);
88   
89   //! Returns the count of fields
90   Standard_EXPORT Standard_Integer NbFields() const;
91   
92   //! Returns a field from its rank, for read-only use
93   Standard_EXPORT const StepData_Field& Field (const Standard_Integer num) const;
94   
95   //! Returns a field from its rank, in order to modify it
96   Standard_EXPORT StepData_Field& CField (const Standard_Integer num);
97
98
99
100
101   DEFINE_STANDARD_RTTIEXT(StepData_FreeFormEntity,MMgt_TShared)
102
103 protected:
104
105
106
107
108 private:
109
110
111   TCollection_AsciiString thetype;
112   Handle(StepData_HArray1OfField) thefields;
113   Handle(StepData_FreeFormEntity) thenext;
114
115
116 };
117
118
119
120
121
122
123
124 #endif // _StepData_FreeFormEntity_HeaderFile