0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / HatchGen / HatchGen_Domain.lxx
CommitLineData
b311480e 1// Created on: 1995-01-03
2// Created by: Laurent BUCHARD
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
17#include <Standard_DomainError.hxx>
18
19//=======================================================================
20// Function : SetPoints
21// Purpose : Sets the first and the second points of the domain.
22//=======================================================================
23
24inline void HatchGen_Domain::SetPoints (const HatchGen_PointOnHatching& P1,
25 const HatchGen_PointOnHatching& P2)
26{
27 myHasFirstPoint = Standard_True ;
28 myFirstPoint = P1 ;
29 myHasSecondPoint = Standard_True ;
30 mySecondPoint = P2 ;
31}
32
33//=======================================================================
34// Function : SetPoints
35// Purpose : Sets the first and the second points of the domain at the
36// infinite.
37//=======================================================================
38
39inline void HatchGen_Domain::SetPoints ()
40{
41 myHasFirstPoint = Standard_False ;
42 myHasSecondPoint = Standard_False ;
43}
44
45//=======================================================================
46// Function : SetFirstPoint
47// Purpose : Sets the first point of the domain.
48//=======================================================================
49
50inline void HatchGen_Domain::SetFirstPoint (const HatchGen_PointOnHatching& P)
51{
52 myHasFirstPoint = Standard_True ;
53 myFirstPoint = P ;
54}
55
56//=======================================================================
57// Function : SetFirstPoint
58// Purpose : Sets the first point of the domain at the infinite.
59//=======================================================================
60
61inline void HatchGen_Domain::SetFirstPoint ()
62{
63 myHasFirstPoint = Standard_False ;
64}
65
66//=======================================================================
67// Function : SetSecondPoint
68// Purpose : Sets the second point of the domain.
69//=======================================================================
70
71inline void HatchGen_Domain::SetSecondPoint (const HatchGen_PointOnHatching& P)
72{
73 myHasSecondPoint = Standard_True ;
74 mySecondPoint = P ;
75}
76
77//=======================================================================
78// Function : SetSecondPoint
79// Purpose : Sets the second point of the domain at the infinite.
80//=======================================================================
81
82inline void HatchGen_Domain::SetSecondPoint ()
83{
84 myHasSecondPoint = Standard_False ;
85}
86
87//=======================================================================
88// Function : HasFirstPoint
89// Purpose : Returns True if the domain has a first point.
90//=======================================================================
91
92inline Standard_Boolean HatchGen_Domain::HasFirstPoint () const
93{
94 return myHasFirstPoint ;
95}
96
97//=======================================================================
98// Function : FirstPoint
99// Purpose : Returns the first point of the domain.
100//=======================================================================
101
102inline const HatchGen_PointOnHatching& HatchGen_Domain::FirstPoint () const
103{
104 Standard_DomainError_Raise_if (!myHasFirstPoint, "HatchGen_Domain::FirstPoint") ;
105 return myFirstPoint ;
106}
107
108//=======================================================================
109// Function : HasSecondPoint
110// Purpose : Returns True if the domain has a second point.
111//=======================================================================
112
113inline Standard_Boolean HatchGen_Domain::HasSecondPoint () const
114{
115 return myHasSecondPoint ;
116}
117
118//=======================================================================
119// Function : SecondPoint
120// Purpose : Returns the second of the domain.
121//=======================================================================
122
123inline const HatchGen_PointOnHatching& HatchGen_Domain::SecondPoint () const
124{
125 Standard_DomainError_Raise_if (!myHasSecondPoint, "HatchGen_Domain::SecondPoint") ;
126 return mySecondPoint ;
127}