0030554: Coding - ChFiDS_CommonPoint uninitialized member traarc
[occt.git] / src / ChFiDS / ChFiDS_CommonPoint.cxx
CommitLineData
b311480e 1// Created on: 1993-11-30
2// Created by: Isabelle GRIGNON
3// Copyright (c) 1993-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_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>
7fd59977 25
26//=======================================================================
27//function : ChFiDS_CommonPoint
28//purpose :
29//=======================================================================
ac8f1774 30ChFiDS_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)
7fd59977 38{
39}
40
41
42//=======================================================================
43//function : Reset
44//purpose :
45//=======================================================================
46
47void 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
62void 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
79void ChFiDS_CommonPoint::SetParameter(const Standard_Real Param)
80{
81 prmtg = Param;
82}
83
84//=======================================================================
85//function : Arc
86//purpose :
87//=======================================================================
88
89const TopoDS_Edge& ChFiDS_CommonPoint::Arc()const
90{
91 if (!isonarc){
9775fa61 92 throw Standard_DomainError("CommonPoint not on Arc");
7fd59977 93 }
94 return arc;
95}
96
97
98//=======================================================================
99//function : TransitionOnArc
100//purpose :
101//=======================================================================
102
103TopAbs_Orientation ChFiDS_CommonPoint::TransitionOnArc()const
104{
105 if (!isonarc){
9775fa61 106 throw Standard_DomainError("CommonPoint not on Arc");
7fd59977 107 }
108 return traarc;
109}
110
111
112//=======================================================================
113//function : ParameterOnArc
114//purpose :
115//=======================================================================
116
117Standard_Real ChFiDS_CommonPoint::ParameterOnArc()const
118{
119 if (!isonarc){
9775fa61 120 throw Standard_DomainError("CommonPoint not on Arc");
7fd59977 121 }
122 return prmarc;
123}
124
125//=======================================================================
126//function : Parameter
127//purpose :
128//=======================================================================
129
130Standard_Real ChFiDS_CommonPoint::Parameter()const
131{
132 return prmtg;
133}
134
135