0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / HatchGen / HatchGen_Domain.cxx
CommitLineData
b311480e 1// Created on: 1993-11-10
2// Created by: Jean Marc LACHAUME
3// Copyright (c) 1993-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
42cf5bc1 17
18#include <HatchGen_Domain.hxx>
19#include <HatchGen_PointOnHatching.hxx>
20#include <Standard_DomainError.hxx>
7fd59977 21#include <Standard_Stream.hxx>
7fd59977 22
23//=======================================================================
24// Function : HatchGen_Domain
25// Purpose : Constructor.
26//=======================================================================
7fd59977 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{
04232180 74 std::cout << "=== Domain " ;
7fd59977 75 if (Index > 0) {
04232180 76 std::cout << "# " << std::setw(3) << Index << " " ;
7fd59977 77 } else {
04232180 78 std::cout << "======" ;
7fd59977 79 }
04232180 80 std::cout << "=============================" << std::endl ;
7fd59977 81
82 if (myHasFirstPoint) {
83 myFirstPoint.Dump (1) ;
84 } else {
04232180 85 std::cout << " Has not a first point" << std::endl ;
7fd59977 86 }
87
88 if (myHasSecondPoint) {
89 mySecondPoint.Dump (2) ;
90 } else {
04232180 91 std::cout << " Has not a second point" << std::endl ;
7fd59977 92 }
93
04232180 94 std::cout << "==============================================" << std::endl ;
7fd59977 95}