// Created on: 1992-10-29 // Created by: Gilles DEBARBOUILLE // Copyright (c) 1992-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _Units_Unit_HeaderFile #define _Units_Unit_HeaderFile #include "Standard.hxx" #include "Standard_Type.hxx" #include "TCollection_HAsciiString.hxx" #include "NCollection_Sequence.hxx" #include "NCollection_HSequence.hxx" #include "Standard_Transient.hxx" #include "TCollection_AsciiString.hxx" #include "Standard_Integer.hxx" class TCollection_HAsciiString; class Units_Quantity; class Units_Token; //! This class defines an elementary word contained in //! a physical quantity. class Units_Unit : public Standard_Transient { public: //! Creates and returns a unit. is the name of //! the unit, is the usual abbreviation of the //! unit, and is the value in relation to the //! International System of Units. Standard_EXPORT Units_Unit(const char* const aname, const char* const asymbol, const double avalue, const occ::handle& aquantity); //! Creates and returns a unit. is the name of //! the unit, is the usual abbreviation of the //! unit. Standard_EXPORT Units_Unit(const char* const aname, const char* const asymbol); //! Creates and returns a unit. is the name of //! the unit. Standard_EXPORT Units_Unit(const char* const aname); //! Returns the name of the unit TCollection_AsciiString Name() const; //! Adds a new symbol attached to . Standard_EXPORT void Symbol(const char* const asymbol); //! Returns the value in relation with the International //! System of Units. double Value() const; //! Returns contained in . occ::handle Quantity() const; //! Returns the sequence of symbols occ::handle>> SymbolsSequence() const; //! Sets the value to . void Value(const double avalue); //! Sets the physical Quantity to . void Quantity(const occ::handle& aquantity); //! Starting with , returns a new Token object. Standard_EXPORT virtual occ::handle Token() const; //! Compares all the symbols linked within with the //! name of , and returns True if there is one //! symbol equal to the name, False otherwise. Standard_EXPORT bool IsEqual(const char* const astring) const; //! Useful for debugging Standard_EXPORT virtual void Dump(const int ashift, const int alevel) const; DEFINE_STANDARD_RTTIEXT(Units_Unit, Standard_Transient) protected: occ::handle>> thesymbolssequence; double thevalue; private: occ::handle thename; occ::handle thequantity; }; #include "Units_Unit.lxx" #endif // _Units_Unit_HeaderFile