0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / HatchGen / HatchGen_Domain.cxx
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_Stream.hxx>
21
22 //=======================================================================
23 // Function : HatchGen_Domain
24 // Purpose  : Constructor.
25 //=======================================================================
26 HatchGen_Domain::HatchGen_Domain () :
27        myHasFirstPoint  (Standard_False) ,
28        myHasSecondPoint (Standard_False)
29 {
30 }
31
32 //=======================================================================
33 // Function : HatchGen_Domain
34 // Purpose  : Constructor.
35 //=======================================================================
36
37 HatchGen_Domain::HatchGen_Domain (const HatchGen_PointOnHatching& P1,
38                                   const HatchGen_PointOnHatching& P2) :
39        myHasFirstPoint  (Standard_True) ,
40        myFirstPoint     (P1),
41        myHasSecondPoint (Standard_True) ,
42        mySecondPoint    (P2)
43 {
44 }
45
46 //=======================================================================
47 // Function : HatchGen_Domain
48 // Purpose  : Constructor.
49 //=======================================================================
50
51 HatchGen_Domain::HatchGen_Domain (const HatchGen_PointOnHatching& P,
52                                   const Standard_Boolean First)
53 {
54   if (First) {
55     myHasFirstPoint  = Standard_True ;
56     myHasSecondPoint = Standard_False ;
57     myFirstPoint     = P ;
58   } else {
59     myHasFirstPoint  = Standard_False ;
60     myHasSecondPoint = Standard_True ;
61     mySecondPoint    = P ;
62   }
63 }
64
65
66 //=======================================================================
67 // Function : Dump
68 // Purpose  : Dump of the domain.
69 //=======================================================================
70
71 void HatchGen_Domain::Dump (const Standard_Integer Index) const
72 {
73   std::cout << "=== Domain " ;
74   if (Index > 0) {
75     std::cout << "# " << std::setw(3) << Index << " " ;
76   } else {
77     std::cout << "======" ;
78   }
79   std::cout << "=============================" << std::endl ;
80
81   if (myHasFirstPoint) {
82     myFirstPoint.Dump (1) ;
83   } else {
84     std::cout << "    Has not a first point" << std::endl ;
85   }
86
87   if (myHasSecondPoint) {
88     mySecondPoint.Dump (2) ;
89   } else {
90     std::cout << "    Has not a second point" << std::endl ;
91   }
92
93   std::cout << "==============================================" << std::endl ;
94 }