File indexing completed on 2026-10-22 09:32:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BinTools_HeaderFile
0017 #define _BinTools_HeaderFile
0018
0019 #include <BinTools_FormatVersion.hxx>
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <Standard_Real.hxx>
0025 #include <Message_ProgressRange.hxx>
0026
0027 class TopoDS_Shape;
0028
0029
0030 class BinTools
0031 {
0032 public:
0033 DEFINE_STANDARD_ALLOC
0034
0035 Standard_EXPORT static Standard_OStream& PutReal(Standard_OStream& OS, const double& theValue);
0036
0037 Standard_EXPORT static Standard_OStream& PutShortReal(Standard_OStream& OS,
0038 const float& theValue);
0039
0040 Standard_EXPORT static Standard_OStream& PutInteger(Standard_OStream& OS, const int theValue);
0041
0042 Standard_EXPORT static Standard_OStream& PutBool(Standard_OStream& OS, const bool theValue);
0043
0044 Standard_EXPORT static Standard_OStream& PutExtChar(Standard_OStream& OS,
0045 const char16_t theValue);
0046
0047 Standard_EXPORT static Standard_IStream& GetReal(Standard_IStream& IS, double& theValue);
0048
0049 Standard_EXPORT static Standard_IStream& GetShortReal(Standard_IStream& IS, float& theValue);
0050
0051 Standard_EXPORT static Standard_IStream& GetInteger(Standard_IStream& IS, int& theValue);
0052
0053 Standard_EXPORT static Standard_IStream& GetBool(Standard_IStream& IS, bool& theValue);
0054
0055 Standard_EXPORT static Standard_IStream& GetExtChar(Standard_IStream& IS, char16_t& theValue);
0056
0057
0058
0059
0060
0061
0062 static void Write(const TopoDS_Shape& theShape,
0063 Standard_OStream& theStream,
0064 const Message_ProgressRange& theRange = Message_ProgressRange())
0065 {
0066 Write(theShape, theStream, true, false, BinTools_FormatVersion_CURRENT, theRange);
0067 }
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 Standard_EXPORT static void Write(
0081 const TopoDS_Shape& theShape,
0082 Standard_OStream& theStream,
0083 const bool theWithTriangles,
0084 const bool theWithNormals,
0085 const BinTools_FormatVersion theVersion,
0086 const Message_ProgressRange& theRange = Message_ProgressRange());
0087
0088
0089 Standard_EXPORT static void Read(TopoDS_Shape& theShape,
0090 Standard_IStream& theStream,
0091 const Message_ProgressRange& theRange = Message_ProgressRange());
0092
0093
0094
0095
0096
0097 static bool Write(const TopoDS_Shape& theShape,
0098 const char* const theFile,
0099 const Message_ProgressRange& theRange = Message_ProgressRange())
0100 {
0101 return Write(theShape, theFile, true, false, BinTools_FormatVersion_CURRENT, theRange);
0102 }
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115 Standard_EXPORT static bool Write(
0116 const TopoDS_Shape& theShape,
0117 const char* const theFile,
0118 const bool theWithTriangles,
0119 const bool theWithNormals,
0120 const BinTools_FormatVersion theVersion,
0121 const Message_ProgressRange& theRange = Message_ProgressRange());
0122
0123
0124 Standard_EXPORT static bool Read(TopoDS_Shape& theShape,
0125 const char* const theFile,
0126 const Message_ProgressRange& theRange = Message_ProgressRange());
0127 };
0128
0129 #endif