Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:22:26

0001 // Created on: 2000-09-08
0002 // Created by: data exchange team
0003 // Copyright (c) 2000-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 _XCAFDoc_Volume_HeaderFile
0017 #define _XCAFDoc_Volume_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <TDataStd_Real.hxx>
0023 #include <Standard_OStream.hxx>
0024 class Standard_GUID;
0025 class TDF_Label;
0026 
0027 //! attribute to store volume
0028 class XCAFDoc_Volume : public TDataStd_Real
0029 {
0030 
0031 public:
0032   //! class methods
0033   //! =============
0034   Standard_EXPORT XCAFDoc_Volume();
0035 
0036   Standard_EXPORT static const Standard_GUID& GetID();
0037 
0038   Standard_EXPORT const Standard_GUID& ID() const override;
0039 
0040   //! Sets a value of volume
0041   Standard_EXPORT void Set(const double vol);
0042 
0043   //! Find, or create, an Volume attribute and set its value
0044   Standard_EXPORT static occ::handle<XCAFDoc_Volume> Set(const TDF_Label& label, const double vol);
0045 
0046   Standard_EXPORT double Get() const;
0047 
0048   //! Returns volume as argument
0049   //! returns false if no such attribute at the <label>
0050   Standard_EXPORT static bool Get(const TDF_Label& label, double& vol);
0051 
0052   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0053 
0054   //! Dumps the content of me into the stream
0055   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0056 
0057   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_Volume, TDataStd_Real)
0058 };
0059 
0060 #endif // _XCAFDoc_Volume_HeaderFile