Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/TDataStd_ReferenceArray.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 2007-05-29
0002 // Created by: Vlad Romashko
0003 // Copyright (c) 2007-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TDataStd_ReferenceArray_HeaderFile
0017 #define _TDataStd_ReferenceArray_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <TDF_Label.hxx>
0022 #include <NCollection_Array1.hxx>
0023 #include <NCollection_HArray1.hxx>
0024 #include <TDF_Attribute.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_OStream.hxx>
0027 #include <Standard_GUID.hxx>
0028 
0029 class TDF_RelocationTable;
0030 class TDF_DataSet;
0031 
0032 //! Contains an array of references to the labels.
0033 class TDataStd_ReferenceArray : public TDF_Attribute
0034 {
0035 
0036 public:
0037   //! Static methods
0038   //! ==============
0039   //! Returns the ID of the array of references (labels) attribute.
0040   Standard_EXPORT static const Standard_GUID& GetID();
0041 
0042   //! Finds or creates an array of reference values (labels) attribute.
0043   Standard_EXPORT static occ::handle<TDataStd_ReferenceArray> Set(const TDF_Label& label,
0044                                                                   const int        lower,
0045                                                                   const int        upper);
0046 
0047   //! Finds or creates an array of reference values (labels) attribute with explicit user defined
0048   //! <guid>.
0049   Standard_EXPORT static occ::handle<TDataStd_ReferenceArray> Set(const TDF_Label&     label,
0050                                                                   const Standard_GUID& theGuid,
0051                                                                   const int            lower,
0052                                                                   const int            upper);
0053 
0054   //! Initialize the inner array with bounds from <lower> to <upper>
0055   Standard_EXPORT void Init(const int lower, const int upper);
0056 
0057   //! Sets the <Index>th element of the array to <Value>
0058   //! OutOfRange exception is raised if <Index> doesn't respect Lower and Upper bounds of the
0059   //! internal array.
0060   Standard_EXPORT void SetValue(const int index, const TDF_Label& value);
0061 
0062   //! Sets the explicit GUID (user defined) for the attribute.
0063   Standard_EXPORT void SetID(const Standard_GUID& theGuid) override;
0064 
0065   //! Sets default GUID for the attribute.
0066   Standard_EXPORT void SetID() override;
0067 
0068   //! Returns the value of the <Index>th element of the array.
0069   Standard_EXPORT TDF_Label Value(const int Index) const;
0070 
0071   TDF_Label operator()(const int Index) const { return Value(Index); }
0072 
0073   //! Returns the lower boundary of the array.
0074   Standard_EXPORT int Lower() const;
0075 
0076   //! Returns the upper boundary of the array.
0077   Standard_EXPORT int Upper() const;
0078 
0079   //! Returns the number of elements in the array.
0080   Standard_EXPORT int Length() const;
0081 
0082   Standard_EXPORT const occ::handle<NCollection_HArray1<TDF_Label>>& InternalArray() const;
0083 
0084   Standard_EXPORT void SetInternalArray(const occ::handle<NCollection_HArray1<TDF_Label>>& values,
0085                                         const bool isCheckItems = true);
0086 
0087   Standard_EXPORT TDataStd_ReferenceArray();
0088 
0089   Standard_EXPORT const Standard_GUID& ID() const override;
0090 
0091   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& With) override;
0092 
0093   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0094 
0095   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       Into,
0096                              const occ::handle<TDF_RelocationTable>& RT) const override;
0097 
0098   Standard_EXPORT void References(const occ::handle<TDF_DataSet>& DS) const override;
0099 
0100   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0101 
0102   //! Dumps the content of me into the stream
0103   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0104 
0105   DEFINE_STANDARD_RTTIEXT(TDataStd_ReferenceArray, TDF_Attribute)
0106 
0107 private:
0108   occ::handle<NCollection_HArray1<TDF_Label>> myArray;
0109   Standard_GUID                               myID;
0110 };
0111 
0112 #endif // _TDataStd_ReferenceArray_HeaderFile