0030554: Coding - ChFiDS_CommonPoint uninitialized member traarc
[occt.git] / src / ChFiDS / ChFiDS_ChamfSpine.cxx
CommitLineData
b311480e 1// Created on: 1995-04-24
2// Created by: Modelistation
3// Copyright (c) 1995-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17
18#include <ChFiDS_ChamfSpine.hxx>
19#include <Standard_Type.hxx>
7fd59977 20#include <TColStd_HArray1OfBoolean.hxx>
21
92efcf78 22IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_ChamfSpine,ChFiDS_Spine)
23
7fd59977 24//=======================================================================
25//function : ChFiDS_ChamfSpine
26//purpose :
27//=======================================================================
1d54b807 28ChFiDS_ChamfSpine::ChFiDS_ChamfSpine()
29{
30 myMode = ChFiDS_ClassicChamfer;
31}
7fd59977 32
33ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(const Standard_Real Tol):
34ChFiDS_Spine(Tol)
1d54b807 35{
36 myMode = ChFiDS_ClassicChamfer;
37}
7fd59977 38
39//=======================================================================
40//function : GetDist
41//purpose :
42//=======================================================================
43
44void ChFiDS_ChamfSpine::GetDist(Standard_Real& Dis) const
45{
9775fa61 46 if (mChamf != ChFiDS_Sym) throw Standard_Failure("Chamfer is not symetric");
7fd59977 47 Dis = d1;
48}
49
50//=======================================================================
51//function : SetDist
52//purpose :
53//=======================================================================
54
55void ChFiDS_ChamfSpine::SetDist(const Standard_Real Dis)
56{
57 //isconstant->Init(Standard_True);
58 mChamf = ChFiDS_Sym;
59 d1 = Dis;
60}
61
62
63
64
65//=======================================================================
66//function : Dists
67//purpose :
68//=======================================================================
69
70void ChFiDS_ChamfSpine::Dists(Standard_Real& Dis1,
71 Standard_Real& Dis2)const
72{
9775fa61 73 if (mChamf != ChFiDS_TwoDist) throw Standard_Failure("Chamfer is not a Two Dists Chamfer");
7fd59977 74 Dis1 = d1;
75 Dis2 = d2;
76}
77
78//=======================================================================
79//function : SetDists
80//purpose :
81//=======================================================================
82
83void ChFiDS_ChamfSpine::SetDists(const Standard_Real Dis1,
84 const Standard_Real Dis2)
85{
86 //isconstant->Init(Standard_True);
87 mChamf = ChFiDS_TwoDist;
88 d1 = Dis1;
89 d2 = Dis2;
90}
91
92
93//=======================================================================
94//function : GetDistAngle
95//purpose :
96//=======================================================================
97
98void ChFiDS_ChamfSpine::GetDistAngle(Standard_Real& Dis,
1d54b807 99 Standard_Real& Angle) const
100//Standard_Boolean& DisOnF1)const
7fd59977 101{
1d54b807 102 if (mChamf != ChFiDS_DistAngle)
103 throw Standard_Failure("Chamfer is not a Two Dists Chamfer");
7fd59977 104 Dis = d1;
105 Angle = angle;
1d54b807 106 //DisOnF1 = dison1;
7fd59977 107}
108
109//=======================================================================
110//function : SetDistAngle
111//purpose :
112//=======================================================================
113
114void ChFiDS_ChamfSpine::SetDistAngle(const Standard_Real Dis,
1d54b807 115 const Standard_Real Angle)
116//const Standard_Boolean DisOnF1)
7fd59977 117{
118 //isconstant->Init(Standard_True);
119 mChamf = ChFiDS_DistAngle;
120 d1 = Dis;
121 angle = Angle;
1d54b807 122 //dison1 = DisOnF1;
7fd59977 123}
124
1d54b807 125//=======================================================================
126//function : SetMode
127//purpose :
128//=======================================================================
129
130void ChFiDS_ChamfSpine::SetMode(const ChFiDS_ChamfMode theMode)
131{
132 myMode = theMode;
133}
7fd59977 134
135//=======================================================================
136//function : IsChamfer
137//purpose :
138//=======================================================================
139
140ChFiDS_ChamfMethod ChFiDS_ChamfSpine::IsChamfer() const
141{
142
143 return mChamf;
144}