1 // Created on: 1997-10-22
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
24 #include <TopOpeBRep_traceSIFF.hxx>
26 TopOpeBRep_traceSIFF::TopOpeBRep_traceSIFF()
31 void TopOpeBRep_traceSIFF::Reset()
36 myopen = Standard_False;
39 void TopOpeBRep_traceSIFF::Set(const Standard_Boolean b,
43 if (n < 3 || !b || a == NULL) {
52 void TopOpeBRep_traceSIFF::Set(const TCollection_AsciiString& brep1,
53 const TCollection_AsciiString& brep2,
54 const TCollection_AsciiString& filename)
58 myfilename = filename;
61 TCollection_AsciiString TopOpeBRep_traceSIFF::Name1(const Standard_Integer I) const
63 TCollection_AsciiString s = mybrep1 + "_" + I;
67 TCollection_AsciiString TopOpeBRep_traceSIFF::Name2(const Standard_Integer I) const
69 TCollection_AsciiString s = mybrep2 + "_" + I;
73 const TCollection_AsciiString& TopOpeBRep_traceSIFF::File() const
78 Standard_Boolean TopOpeBRep_traceSIFF::Start(const TCollection_AsciiString& s,
81 Standard_CString cs = myfilename.ToCString();
82 myopen = Standard_True;
83 if (!myfilebuf.open(cs,ios::out)) {
84 myopen = Standard_False;
89 ostream osfic(&myfilebuf); osfic.precision(15);
91 OS<<s<<myfilename<<endl;
96 void TopOpeBRep_traceSIFF::Add(const Standard_Integer I1,
97 const Standard_Integer I2)
102 TCollection_AsciiString n1 = Name1(I1);
103 TCollection_AsciiString n2 = Name2(I2);
104 ostream osfic(&myfilebuf);
105 osfic<<n1<<" "<<n2<<"\n";
108 void TopOpeBRep_traceSIFF::End(const TCollection_AsciiString& s,
109 Standard_OStream& OS)
115 OS<<s<<myfilename<<endl;
117 myopen = Standard_False;
119 //////////////////////////////////////////////////////////////////////////
121 Standard_EXPORT TopOpeBRep_traceSIFF SIFF;
123 Standard_EXPORT void TopOpeBRep_SettraceSIFF(const Standard_Boolean b,
124 Standard_Integer n,char**a)
129 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSIFF()
131 Standard_Boolean b = (SIFF.File().Length() != 0);