0024023: Revamp the OCCT Handle -- ambiguity
[occt.git] / src / Aspect / Aspect_AspectLine.cxx
CommitLineData
b311480e 1// Created by: NW,JPB,CAL
2// Copyright (c) 1991-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16//-Version
17
0d969553
Y
18//-Design Declaration of variables specific to the context
19// of line tracing
7fd59977 20
0d969553
Y
21//-Warning A context of line tracing is defined by :
22// - the color
23// - the type of line
24// - the thickness
7fd59977 25
26//-References
27
28//-Language C++ 2.0
29
30//-Declarations
31
32// for the class
33#include <Aspect_AspectLine.ixx>
34
35//-Aliases
36
37//-Global data definitions
38
0d969553 39// -- color
7fd59977 40// MyColor : Color;
41
0d969553 42// -- type of line
7fd59977 43// MyType : TypeOfLine;
44
0d969553 45// -- thickness
7fd59977 46// MyWidth : Standard_Real;
47
48//-Constructors
49
50//-Destructors
51
52//-Methods, in order
53
54Aspect_AspectLine::Aspect_AspectLine () {
55
56 MyColor = Quantity_NOC_YELLOW;
57 MyType = Aspect_TOL_SOLID;
58 MyWidth = 1.0;
59
60}
61
62Aspect_AspectLine::Aspect_AspectLine (const Quantity_Color& AColor, const Aspect_TypeOfLine AType, const Standard_Real AWidth) {
63
64 if (AWidth <= 0.0)
65 Aspect_AspectLineDefinitionError::Raise
66 ("Bad value for LineWidth");
67
68 MyColor = AColor;
69 MyType = AType;
70 MyWidth = AWidth;
71
72}
73
74void Aspect_AspectLine::SetColor (const Quantity_Color& AColor) {
75
76 MyColor = AColor;
77
78}
79
80void Aspect_AspectLine::SetType (const Aspect_TypeOfLine AType) {
81
82 MyType = AType;
83
84}
85
86void Aspect_AspectLine::SetWidth (const Standard_Real AWidth) {
87
88 if (AWidth <= 0.0)
89 Aspect_AspectLineDefinitionError::Raise
90 ("Bad value for LineWidth");
91
92 MyWidth = AWidth;
93
94}
95
96void Aspect_AspectLine::Values (Quantity_Color& AColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
97
98 AColor = MyColor;
99 AType = MyType;
100 AWidth = MyWidth;
101
102}