Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:03

0001 // Created on: 1994-06-01
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-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 _IGESSelect_FloatFormat_HeaderFile
0018 #define _IGESSelect_FloatFormat_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TCollection_AsciiString.hxx>
0024 #include <IGESSelect_FileModifier.hxx>
0025 #include <Standard_Integer.hxx>
0026 class IFSelect_ContextWrite;
0027 class IGESData_IGESWriter;
0028 
0029 
0030 class IGESSelect_FloatFormat;
0031 DEFINE_STANDARD_HANDLE(IGESSelect_FloatFormat, IGESSelect_FileModifier)
0032 
0033 //! This class gives control out format for floatting values :
0034 //! ZeroSuppress or no, Main Format, Format in Range (for values
0035 //! around 1.), as IGESWriter allows to manage it.
0036 //! Formats are given under C-printf form
0037 class IGESSelect_FloatFormat : public IGESSelect_FileModifier
0038 {
0039 
0040 public:
0041 
0042   
0043   //! Creates a new FloatFormat, with standard options :
0044   //! ZeroSuppress, Main Format = %E,
0045   //! Format between 0.001 and 1000. = %f
0046   Standard_EXPORT IGESSelect_FloatFormat();
0047   
0048   //! Sets FloatFormat to default value (see Create) but if <digits>
0049   //! is given positive, it commands Formats (main and range) to
0050   //! ensure <digits> significant digits to be displayed
0051   Standard_EXPORT void SetDefault (const Standard_Integer digits = 0);
0052   
0053   //! Sets ZeroSuppress mode to a new value
0054   Standard_EXPORT void SetZeroSuppress (const Standard_Boolean mode);
0055   
0056   //! Sets Main Format to a new value
0057   //! Remark : SetFormat, SetZeroSuppress and SetFormatForRange are
0058   //! independent
0059   Standard_EXPORT void SetFormat (const Standard_CString format = "%E");
0060   
0061   //! Sets Format for Range to a new value with its range of
0062   //! application.
0063   //! To cancel it, give format as "" (empty string)
0064   //! Remark that if the condition (0. < Rmin < Rmax)  is not
0065   //! verified, this secondary format will be ignored.
0066   //! Moreover, this secondary format is intended to be used in a
0067   //! range around 1.
0068   Standard_EXPORT void SetFormatForRange (const Standard_CString format = "%f", const Standard_Real Rmin = 0.1, const Standard_Real Rmax = 1000.0);
0069   
0070   //! Returns all recorded parameters :
0071   //! zerosup  : ZeroSuppress status
0072   //! mainform : Main Format (which applies out of the range, or
0073   //! for every real if no range is set)
0074   //! hasrange : True if a FormatInRange is set, False else
0075   //! (following parameters do not apply if it is False)
0076   //! forminrange : Secondary Format (it applies inside the range)
0077   //! rangemin, rangemax : the range in which the secondary format
0078   //! applies
0079   Standard_EXPORT void Format (Standard_Boolean& zerosup, TCollection_AsciiString& mainform, Standard_Boolean& hasrange, TCollection_AsciiString& forminrange, Standard_Real& rangemin, Standard_Real& rangemax) const;
0080   
0081   //! Sets the Floatting Formats of IGESWriter to the recorded
0082   //! parameters
0083   Standard_EXPORT void Perform (IFSelect_ContextWrite& ctx, IGESData_IGESWriter& writer) const Standard_OVERRIDE;
0084   
0085   //! Returns specific Label : for instance,
0086   //! "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]"
0087   Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
0088 
0089 
0090 
0091 
0092   DEFINE_STANDARD_RTTIEXT(IGESSelect_FloatFormat,IGESSelect_FileModifier)
0093 
0094 protected:
0095 
0096 
0097 
0098 
0099 private:
0100 
0101 
0102   Standard_Boolean thezerosup;
0103   TCollection_AsciiString themainform;
0104   TCollection_AsciiString theformrange;
0105   Standard_Real therangemin;
0106   Standard_Real therangemax;
0107 
0108 
0109 };
0110 
0111 
0112 
0113 
0114 
0115 
0116 
0117 #endif // _IGESSelect_FloatFormat_HeaderFile