1 // Created on: 1997-10-22
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 #include <TopOpeBRep_traceSIFF.hxx>
21 TopOpeBRep_traceSIFF::TopOpeBRep_traceSIFF()
26 void TopOpeBRep_traceSIFF::Reset()
31 myopen = Standard_False;
34 void TopOpeBRep_traceSIFF::Set(const Standard_Boolean b,
38 if (n < 3 || !b || a == NULL) {
47 void TopOpeBRep_traceSIFF::Set(const TCollection_AsciiString& brep1,
48 const TCollection_AsciiString& brep2,
49 const TCollection_AsciiString& filename)
53 myfilename = filename;
56 TCollection_AsciiString TopOpeBRep_traceSIFF::Name1(const Standard_Integer I) const
58 TCollection_AsciiString s = mybrep1 + "_" + I;
62 TCollection_AsciiString TopOpeBRep_traceSIFF::Name2(const Standard_Integer I) const
64 TCollection_AsciiString s = mybrep2 + "_" + I;
68 const TCollection_AsciiString& TopOpeBRep_traceSIFF::File() const
73 Standard_Boolean TopOpeBRep_traceSIFF::Start(const TCollection_AsciiString& s,
76 Standard_CString cs = myfilename.ToCString();
77 myopen = Standard_True;
78 if (!myfilebuf.open(cs,std::ios::out)) {
79 myopen = Standard_False;
84 std::ostream osfic(&myfilebuf); osfic.precision(15);
86 OS<<s<<myfilename<<std::endl;
91 void TopOpeBRep_traceSIFF::Add(const Standard_Integer I1,
92 const Standard_Integer I2)
97 TCollection_AsciiString n1 = Name1(I1);
98 TCollection_AsciiString n2 = Name2(I2);
99 std::ostream osfic(&myfilebuf);
100 osfic<<n1<<" "<<n2<<"\n";
103 void TopOpeBRep_traceSIFF::End(const TCollection_AsciiString& s,
104 Standard_OStream& OS)
110 OS<<s<<myfilename<<std::endl;
112 myopen = Standard_False;
114 //////////////////////////////////////////////////////////////////////////
116 TopOpeBRep_traceSIFF SIFF;
118 Standard_EXPORT void TopOpeBRep_SettraceSIFF(const Standard_Boolean b,
119 Standard_Integer n,char**a)
124 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSIFF()
126 Standard_Boolean b = (SIFF.File().Length() != 0);