Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:17:32

0001 // Created on: 1997-02-06
0002 // Created by: Denis PASCAL
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TDataStd_Real_HeaderFile
0018 #define _TDataStd_Real_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Real.hxx>
0023 #include <TDataStd_RealEnum.hxx>
0024 #include <TDF_DerivedAttribute.hxx>
0025 #include <Standard_OStream.hxx>
0026 #include <Standard_GUID.hxx>
0027 
0028 class TDF_Label;
0029 class TDF_RelocationTable;
0030 
0031 //! The basis to define a real number attribute.
0032 class TDataStd_Real : public TDF_Attribute
0033 {
0034 
0035 public:
0036   //! class methods
0037   //! =============
0038   //! Returns the default GUID for real numbers.
0039   Standard_EXPORT static const Standard_GUID& GetID();
0040 
0041   //! Finds, or creates, a Real attribute with default GUID and sets <value>.
0042   //! The Real attribute is returned. The Real dimension is Scalar by default.
0043   //! Use SetDimension to overwrite.
0044   //! Real methods
0045   //! ============
0046   Standard_EXPORT static occ::handle<TDataStd_Real> Set(const TDF_Label& label, const double value);
0047 
0048   //! Finds, or creates, a Real attribute with explicit GUID and sets <value>.
0049   //! The Real attribute is returned.
0050   //! Real methods
0051   //! ============
0052   Standard_EXPORT static occ::handle<TDataStd_Real> Set(const TDF_Label&     label,
0053                                                         const Standard_GUID& guid,
0054                                                         const double         value);
0055 
0056   Standard_EXPORT TDataStd_Real();
0057 
0058   //! Obsolete method that will be removed in next versions.
0059   //! This field is not supported in the persistence mechanism.
0060   Standard_DEPRECATED(
0061     "TDataStd_Real::SetDimension() is deprecated. Please avoid usage of this method.")
0062   Standard_EXPORT void SetDimension(const TDataStd_RealEnum DIM);
0063 
0064   //! Obsolete method that will be removed in next versions.
0065   //! This field is not supported in the persistence mechanism.
0066   Standard_DEPRECATED(
0067     "TDataStd_Real::GetDimension() is deprecated. Please avoid usage of this method.")
0068   Standard_EXPORT TDataStd_RealEnum GetDimension() const;
0069 
0070   //! Sets the real number V.
0071   Standard_EXPORT void Set(const double V);
0072 
0073   //! Sets the explicit GUID for the attribute.
0074   Standard_EXPORT void SetID(const Standard_GUID& guid) override;
0075 
0076   //! Sets default GUID for the attribute.
0077   Standard_EXPORT void SetID() override;
0078 
0079   //! Returns the real number value contained in the attribute.
0080   Standard_EXPORT double Get() const;
0081 
0082   //! Returns True if there is a reference on the same label
0083   Standard_EXPORT bool IsCaptured() const;
0084 
0085   Standard_EXPORT const Standard_GUID& ID() const override;
0086 
0087   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& With) override;
0088 
0089   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0090 
0091   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       Into,
0092                              const occ::handle<TDF_RelocationTable>& RT) const override;
0093 
0094   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0095 
0096   //! Dumps the content of me into the stream
0097   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0098 
0099   DEFINE_STANDARD_RTTIEXT(TDataStd_Real, TDF_Attribute)
0100 
0101 protected:
0102   double myValue;
0103   //! An obsolete field that will be removed in next versions.
0104   TDataStd_RealEnum myDimension;
0105   Standard_GUID     myID;
0106 };
0107 
0108 #endif // _TDataStd_Real_HeaderFile