0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / HatchGen / HatchGen_Domain.cxx
... / ...
CommitLineData
1// Created on: 1993-11-10
2// Created by: Jean Marc LACHAUME
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 <HatchGen_Domain.hxx>
19#include <HatchGen_PointOnHatching.hxx>
20#include <Standard_DomainError.hxx>
21#include <Standard_Stream.hxx>
22
23//=======================================================================
24// Function : HatchGen_Domain
25// Purpose : Constructor.
26//=======================================================================
27HatchGen_Domain::HatchGen_Domain () :
28 myHasFirstPoint (Standard_False) ,
29 myHasSecondPoint (Standard_False)
30{
31}
32
33//=======================================================================
34// Function : HatchGen_Domain
35// Purpose : Constructor.
36//=======================================================================
37
38HatchGen_Domain::HatchGen_Domain (const HatchGen_PointOnHatching& P1,
39 const HatchGen_PointOnHatching& P2) :
40 myHasFirstPoint (Standard_True) ,
41 myFirstPoint (P1),
42 myHasSecondPoint (Standard_True) ,
43 mySecondPoint (P2)
44{
45}
46
47//=======================================================================
48// Function : HatchGen_Domain
49// Purpose : Constructor.
50//=======================================================================
51
52HatchGen_Domain::HatchGen_Domain (const HatchGen_PointOnHatching& P,
53 const Standard_Boolean First)
54{
55 if (First) {
56 myHasFirstPoint = Standard_True ;
57 myHasSecondPoint = Standard_False ;
58 myFirstPoint = P ;
59 } else {
60 myHasFirstPoint = Standard_False ;
61 myHasSecondPoint = Standard_True ;
62 mySecondPoint = P ;
63 }
64}
65
66
67//=======================================================================
68// Function : Dump
69// Purpose : Dump of the domain.
70//=======================================================================
71
72void HatchGen_Domain::Dump (const Standard_Integer Index) const
73{
74 cout << "=== Domain " ;
75 if (Index > 0) {
76 cout << "# " << setw(3) << Index << " " ;
77 } else {
78 cout << "======" ;
79 }
80 cout << "=============================" << endl ;
81
82 if (myHasFirstPoint) {
83 myFirstPoint.Dump (1) ;
84 } else {
85 cout << " Has not a first point" << endl ;
86 }
87
88 if (myHasSecondPoint) {
89 mySecondPoint.Dump (2) ;
90 } else {
91 cout << " Has not a second point" << endl ;
92 }
93
94 cout << "==============================================" << endl ;
95}