summaryrefslogtreecommitdiff
path: root/src/HatchGen/HatchGen_Domain.cxx
blob: fef06a4f47fa4512c6b7293f0d4a3b59c30c2332 (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
// File:	HatchGen_Domain.cxx
// Created:	Wed Nov 10 15:33:27 1993
// Author:	Jean Marc LACHAUME
//		<jml@sdsun1>

#include <Standard_Stream.hxx>
#include <HatchGen_Domain.ixx>

//=======================================================================
// Function : HatchGen_Domain
// Purpose  : Constructor.
//=======================================================================

HatchGen_Domain::HatchGen_Domain () :
       myHasFirstPoint  (Standard_False) ,
       myHasSecondPoint (Standard_False)
{
}

//=======================================================================
// Function : HatchGen_Domain
// Purpose  : Constructor.
//=======================================================================

HatchGen_Domain::HatchGen_Domain (const HatchGen_PointOnHatching& P1,
				  const HatchGen_PointOnHatching& P2) :
       myHasFirstPoint  (Standard_True) ,
       myFirstPoint     (P1),
       myHasSecondPoint (Standard_True) ,
       mySecondPoint    (P2)
{
}

//=======================================================================
// Function : HatchGen_Domain
// Purpose  : Constructor.
//=======================================================================

HatchGen_Domain::HatchGen_Domain (const HatchGen_PointOnHatching& P,
				  const Standard_Boolean First)
{
  if (First) {
    myHasFirstPoint  = Standard_True ;
    myHasSecondPoint = Standard_False ;
    myFirstPoint     = P ;
  } else {
    myHasFirstPoint  = Standard_False ;
    myHasSecondPoint = Standard_True ;
    mySecondPoint    = P ;
  }
}


//=======================================================================
// Function : Dump
// Purpose  : Dump of the domain.
//=======================================================================

void HatchGen_Domain::Dump (const Standard_Integer Index) const
{
  cout << "=== Domain " ;
  if (Index > 0) {
    cout << "# " << setw(3) << Index << " " ;
  } else {
    cout << "======" ;
  }
  cout << "=============================" << endl ;

  if (myHasFirstPoint) {
    myFirstPoint.Dump (1) ;
  } else {
    cout << "    Has not a first point" << endl ;
  }

  if (myHasSecondPoint) {
    mySecondPoint.Dump (2) ;
  } else {
    cout << "    Has not a second point" << endl ;
  }

  cout << "==============================================" << endl ;
}