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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _StepData_FreeFormEntity_HeaderFile
18 #define _StepData_FreeFormEntity_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <StepData_HArray1OfField.hxx>
25 #include <Standard_Transient.hxx>
26 #include <Standard_CString.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <TColStd_HSequenceOfAsciiString.hxx>
29 #include <Standard_Integer.hxx>
33 class StepData_FreeFormEntity;
34 DEFINE_STANDARD_HANDLE(StepData_FreeFormEntity, Standard_Transient)
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
41 class StepData_FreeFormEntity : public Standard_Transient
47 //! Creates a FreeFormEntity, with no field, no type
48 Standard_EXPORT StepData_FreeFormEntity();
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);
54 //! Returns the recorded StepType
55 //! For a complex one, the type of this member
56 Standard_EXPORT Standard_CString StepType() const;
58 //! Sets a next member, in order to define or complete a Complex
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);
65 //! Returns the next member of a Complex entity
66 //! (remark : the last member has none)
67 Standard_EXPORT Handle(StepData_FreeFormEntity) Next() const;
69 //! Returns True if a FreeFormEntity is Complex (i.e. has Next)
70 Standard_EXPORT Standard_Boolean IsComplex() const;
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;
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;
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);
86 //! Sets a count of Fields, from scratch
87 Standard_EXPORT void SetNbFields (const Standard_Integer nb);
89 //! Returns the count of fields
90 Standard_EXPORT Standard_Integer NbFields() const;
92 //! Returns a field from its rank, for read-only use
93 Standard_EXPORT const StepData_Field& Field (const Standard_Integer num) const;
95 //! Returns a field from its rank, in order to modify it
96 Standard_EXPORT StepData_Field& CField (const Standard_Integer num);
101 DEFINE_STANDARD_RTTIEXT(StepData_FreeFormEntity,Standard_Transient)
111 TCollection_AsciiString thetype;
112 Handle(StepData_HArray1OfField) thefields;
113 Handle(StepData_FreeFormEntity) thenext;
124 #endif // _StepData_FreeFormEntity_HeaderFile