/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _ODPRCUNITSFORMATTER_H_IMPL_ #define _ODPRCUNITSFORMATTER_H_IMPL_ #include "TD_PackPush.h" #include "DbAux/PrcUnitsFormatter.h" class OdPrcFile; /** \details This class provides the default implementation for OdDbUnitsFormatter. */ class PRC_TOOLKIT OdPrcUnitsFormatterImpl : public OdPrcUnitsFormatter { public: ODRX_DECLARE_MEMBERS(OdPrcUnitsFormatterImpl); /** \details Requests the specified distance value as a string. The returned value depends on the DIMZIN, LUNITS, LUPREC, and UNITMODE system variables. \param value [in] A value to format. \returns An OdString object that contains the string representation of the specified distance value. */ virtual OdString formatLinear(double value) const; /** \details Requests a distance value from a specified string. The returned value depends on the UNITMODE system variable. \param string [in] An OdString object that contains the string representation of the distance value. \returns A double value that contains the distance. */ virtual double unformatLinear(const OdString& string) const; /** \details Requests the specified angle value as a string. The returned value depends on the ANGBASE, AUNITS, AUPREC, DIMZIN, and UNITMODE system variables. \param value [in] A double value that contains the angle to format. \returns An OdString object that contains the string representation of the specified angle value. \remarks All angles are measured in radians. */ virtual OdString formatAngle(double value) const; /** \details Requests an angle value from a specified string. The returned value depends on the ANGBASE system variable. \param string [in] An OdString object that contains the string representation of the angle value. \returns A double value that contains the angle. \remarks All angles are measured in radians. */ virtual double unformatAngle(const OdString& string) const; /** \details Requests the specified 3D point as a string. \param value [in] An OdGePoint3d object that contains the 3D point data to format. \returns An OdString object that contains the string representation of the specified 3D point data. \remarks The returned value depends on the DIMZIN, LUNITS, LUPREC, and UNITMODE system variables. */ virtual OdString formatPoint(const OdGePoint3d& value) const; /** \details Requests a 3D point object from a specified string. \param string [in] An OdString object that contains the string representation of the 3D point. \returns An OdGePoint3d object that contains the 3D point data. */ virtual OdGePoint3d unformatPoint(const OdString& string) const; /** \details Sets a database to associate with the unit formatter. \param db [in] A pointer to an associated database (a PRC file). */ void setDatabase(OdPrcFile* db); /** \details Requests the specified color value as a string. \param value [in] An OdCmColorBase object that contains the color value to format. \returns An OdString object that contains the string representation of the specified color value. */ virtual OdString formatCmColor(const OdCmColorBase& value) const; /** \details Requests a color value from a specified string. \param string [in] An OdString object that contains the string representation of the color value. \returns A shared pointer to an OdCmColorBase object that contains the color value. */ virtual OdSharedPtr unformatCmColor(const OdString& string) const; protected: OdPrcFile* m_pDb; }; #include "TD_PackPop.h" #endif // _ODPRCUNITSFORMATTER_H_IMPL_