0026922: Huge performance issue writing data to the output stream
[occt.git] / src / IntRes2d / IntRes2d_Transition.cxx
1 // Created on: 1992-06-10
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <IntRes2d_Transition.hxx>
19 #include <Standard_DomainError.hxx>
20
21 IntRes2d_Transition::IntRes2d_Transition() : tangent(Standard_True),
22                                              posit(IntRes2d_Middle),
23                                              typetra(IntRes2d_Undecided),
24                                              situat(IntRes2d_Unknown),
25                                              oppos(Standard_False)
26 {
27 }
28
29
30 ostream& operator << (ostream& os, IntRes2d_Transition& Trans) {
31
32   os << "   Position : ";
33   if (Trans.PositionOnCurve()==IntRes2d_Head) {
34     os << "Debut\n";
35   }
36   else if (Trans.PositionOnCurve()==IntRes2d_Middle) {
37     os << "Milieu\n";
38   }
39   else {
40     os << "Fin\n";
41   }
42
43   os << "   Type de transition : ";
44   if (Trans.TransitionType()==IntRes2d_Undecided) {
45     os << "Indeterminee\n";
46   }
47   else {
48     if (Trans.TransitionType()==IntRes2d_In) {
49       os << "Entrante\n";
50     }
51     else if (Trans.TransitionType()==IntRes2d_Out) {
52       os << "Sortante\n";
53     }
54     else {
55       os << "Touch\n";
56       os << "     Position par rapport a l'autre courbe : ";
57       if (Trans.Situation()==IntRes2d_Inside) {
58         os << "Interieure\n";
59       }
60       else if (Trans.Situation()==IntRes2d_Outside) {
61         os << "Exterieure\n";
62       }
63       else if (Trans.Situation()==IntRes2d_Unknown) {
64         os << "Indeterminee\n";
65       }
66       os << "   Position matiere : ";
67       if (Trans.IsOpposite()) {
68         os << "Opposee\n";
69       }
70       else {
71         os << "Idem\n";
72       }
73     }
74     os << "   Cas de tangence : ";
75     if (Trans.IsTangent()) {
76       os << "Oui\n";
77     }
78     else {
79       os << "Non\n";
80     }
81   }
82   os << "\n";
83   return os;
84 }
85
86
87