0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead...
[occt.git] / src / ChFiDS / ChFiDS_ChamfSpine.cxx
1 // Created on: 1995-04-24
2 // Created by: Modelistation
3 // Copyright (c) 1995-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 <ChFiDS_ChamfSpine.hxx>
19 #include <Standard_Type.hxx>
20 #include <TColStd_HArray1OfBoolean.hxx>
21
22 IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_ChamfSpine,ChFiDS_Spine)
23
24 //=======================================================================
25 //function : ChFiDS_ChamfSpine
26 //purpose  : 
27 //=======================================================================
28 ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(){}
29
30 ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(const Standard_Real Tol):
31 ChFiDS_Spine(Tol)
32 {}
33
34
35 //=======================================================================
36 //function : GetDist
37 //purpose  : 
38 //=======================================================================
39
40 void ChFiDS_ChamfSpine::GetDist(Standard_Real& Dis) const
41 {
42   if (mChamf != ChFiDS_Sym)   Standard_Failure::Raise("Chamfer is not symetric");
43   Dis = d1;
44 }
45
46 //=======================================================================
47 //function : SetDist
48 //purpose  : 
49 //=======================================================================
50
51 void ChFiDS_ChamfSpine::SetDist(const Standard_Real Dis)
52 {
53   //isconstant->Init(Standard_True);
54   mChamf = ChFiDS_Sym;  
55   d1     = Dis;
56 }
57
58
59
60
61 //=======================================================================
62 //function : Dists
63 //purpose  : 
64 //=======================================================================
65
66 void ChFiDS_ChamfSpine::Dists(Standard_Real& Dis1,
67                               Standard_Real& Dis2)const
68 {
69   if (mChamf != ChFiDS_TwoDist)  Standard_Failure::Raise("Chamfer is not a Two Dists Chamfer");
70   Dis1 = d1;
71   Dis2 = d2;
72 }
73
74 //=======================================================================
75 //function : SetDists
76 //purpose  : 
77 //=======================================================================
78
79 void ChFiDS_ChamfSpine::SetDists(const Standard_Real Dis1,
80                                  const Standard_Real Dis2)
81 {
82   //isconstant->Init(Standard_True);
83   mChamf = ChFiDS_TwoDist;
84   d1     = Dis1;
85   d2     = Dis2;
86 }
87
88
89 //=======================================================================
90 //function : GetDistAngle
91 //purpose  : 
92 //=======================================================================
93
94 void ChFiDS_ChamfSpine::GetDistAngle(Standard_Real& Dis,
95                                      Standard_Real& Angle,
96                                      Standard_Boolean& DisOnF1)const
97 {
98   if (mChamf != ChFiDS_DistAngle)  Standard_Failure::Raise("Chamfer is not a Two Dists Chamfer");
99   Dis     = d1;
100   Angle   = angle;
101   DisOnF1 = dison1;
102 }
103
104 //=======================================================================
105 //function : SetDistAngle
106 //purpose  : 
107 //=======================================================================
108
109 void ChFiDS_ChamfSpine::SetDistAngle(const Standard_Real Dis,
110                                      const Standard_Real Angle,
111                                      const Standard_Boolean DisOnF1)
112 {
113   //isconstant->Init(Standard_True);
114   mChamf = ChFiDS_DistAngle;
115   d1     = Dis;
116   angle  = Angle;
117   dison1 = DisOnF1;
118 }
119
120
121 //=======================================================================
122 //function : IsChamfer
123 //purpose  : 
124 //=======================================================================
125
126 ChFiDS_ChamfMethod  ChFiDS_ChamfSpine::IsChamfer() const
127 {
128
129   return mChamf;
130 }
131
132
133