summaryrefslogtreecommitdiff
path: root/inc/IntPatch_GLine.lxx
blob: 48d15c653f65288b5f35995f4e7ef8b2f87b1b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// File:	IntPatch_GLine.lxx
// Created:	Mon Apr  6 11:17:45 1992
// Author:	Jacques GOUSSARD
// Copyright:	OPEN CASCADE 1992

#include <Standard_DomainError.hxx>

#include <gp_Lin.hxx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
#include <gp_Parab.hxx>
#include <gp_Hypr.hxx>

#include <Precision.hxx>


inline void IntPatch_GLine::SetFirstPoint (const Standard_Integer IndFirst)
{
  fipt = Standard_True;
  indf = IndFirst;
}


inline void IntPatch_GLine::SetLastPoint (const Standard_Integer IndLast)
{
  lapt = Standard_True;
  indl = IndLast;
}


inline gp_Lin IntPatch_GLine::Line () const
{
  if (typ != IntPatch_Lin) {Standard_DomainError::Raise();}
  return gp_Lin(pos.Axis());
}


inline gp_Circ IntPatch_GLine::Circle () const
{
  if (typ != IntPatch_Circle) {Standard_DomainError::Raise();}
  return gp_Circ(pos,par1);
}


inline gp_Elips IntPatch_GLine::Ellipse () const
{
  if (typ != IntPatch_Ellipse) {Standard_DomainError::Raise();}
  return gp_Elips(pos,par1,par2);
}


inline gp_Parab IntPatch_GLine::Parabola () const
{
  if (typ != IntPatch_Parabola) {Standard_DomainError::Raise();}
  return gp_Parab(pos,par1);
}


inline gp_Hypr IntPatch_GLine::Hyperbola () const
{
  if (typ != IntPatch_Hyperbola) {Standard_DomainError::Raise();}
  return gp_Hypr(pos,par1,par2);
}


inline Standard_Boolean IntPatch_GLine::HasFirstPoint () const
{
  return fipt;
}


inline Standard_Boolean IntPatch_GLine::HasLastPoint () const
{
  return lapt;
}


inline const IntPatch_Point& IntPatch_GLine::FirstPoint () const
{
  if (!fipt) {Standard_DomainError::Raise();}
  return svtx(indf);
}


inline const IntPatch_Point& IntPatch_GLine::LastPoint () const
{
  if (!lapt) {Standard_DomainError::Raise();}
  return svtx(indl);
}


inline Standard_Integer IntPatch_GLine::NbVertex () const
{
  return svtx.Length();
}


inline const IntPatch_Point& IntPatch_GLine::Vertex (const Standard_Integer Index) const
{
  return svtx(Index);
}