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