0030554: Coding - ChFiDS_CommonPoint uninitialized member traarc
[occt.git] / src / ChFiDS / ChFiDS_CommonPoint.cxx
1 // Created on: 1993-11-30
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1993-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_CommonPoint.hxx>
19 #include <gp_Pnt.hxx>
20 #include <gp_Vec.hxx>
21 #include <Standard_DomainError.hxx>
22 #include <Standard_TypeMismatch.hxx>
23 #include <TopoDS_Edge.hxx>
24 #include <TopoDS_Vertex.hxx>
25
26 //=======================================================================
27 //function : ChFiDS_CommonPoint
28 //purpose  : 
29 //=======================================================================
30 ChFiDS_CommonPoint::ChFiDS_CommonPoint()
31 : tol (0.0),
32   prmarc (0.0),
33   prmtg  (0.0),
34   traarc (TopAbs_FORWARD),
35   isonarc(Standard_False),
36   isvtx (Standard_False),
37   hasvector (Standard_False)
38 {
39 }
40
41
42 //=======================================================================
43 //function : Reset
44 //purpose  : 
45 //=======================================================================
46
47 void ChFiDS_CommonPoint::Reset()
48 {
49   tol = 0.;
50   isvtx  = Standard_False;
51   isonarc = Standard_False;
52   hasvector = Standard_False;
53 }
54
55
56 //=======================================================================
57 //function : SetArc
58 //purpose  : 
59 // 30/09/1997 : PMN On n'ecrabouille plus la tolerance
60 //=======================================================================
61
62 void  ChFiDS_CommonPoint::SetArc(const Standard_Real Tol, 
63                                 const TopoDS_Edge& A, 
64                                 const Standard_Real Param, 
65                                 const TopAbs_Orientation TArc)
66 {
67   isonarc = Standard_True;
68   if (Tol > tol) tol = Tol;
69   arc     = A;
70   prmarc     = Param;
71   traarc  = TArc;
72 }
73
74 //=======================================================================
75 //function : SetParameter
76 //purpose  : 
77 //=======================================================================
78
79 void  ChFiDS_CommonPoint::SetParameter(const Standard_Real Param)
80 {
81   prmtg     = Param;
82 }
83
84 //=======================================================================
85 //function : Arc
86 //purpose  : 
87 //=======================================================================
88
89 const TopoDS_Edge&  ChFiDS_CommonPoint::Arc()const 
90 {
91   if (!isonarc){
92     throw Standard_DomainError("CommonPoint not on Arc");
93   }
94   return arc;
95 }
96
97
98 //=======================================================================
99 //function : TransitionOnArc
100 //purpose  : 
101 //=======================================================================
102
103 TopAbs_Orientation  ChFiDS_CommonPoint::TransitionOnArc()const 
104 {
105   if (!isonarc){
106     throw Standard_DomainError("CommonPoint not on Arc");
107   }
108   return traarc;
109 }
110
111
112 //=======================================================================
113 //function : ParameterOnArc
114 //purpose  : 
115 //=======================================================================
116
117 Standard_Real  ChFiDS_CommonPoint::ParameterOnArc()const 
118 {
119   if (!isonarc){
120     throw Standard_DomainError("CommonPoint not on Arc");
121   }
122   return prmarc;
123 }
124
125 //=======================================================================
126 //function : Parameter
127 //purpose  : 
128 //=======================================================================
129
130 Standard_Real  ChFiDS_CommonPoint::Parameter()const 
131 {
132   return prmtg;
133 }
134
135