Commit | Line | Data |
---|---|---|
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 | |
0d969553 Y |
17 | //-Design Declaration of variables specific to the context |
18 | // of line tracing | |
0d969553 Y |
19 | //-Warning A context of line tracing is defined by : |
20 | // - the color | |
21 | // - the type of line | |
22 | // - the thickness | |
7fd59977 | 23 | //-References |
7fd59977 | 24 | //-Language C++ 2.0 |
7fd59977 | 25 | //-Declarations |
7fd59977 | 26 | // for the class |
7fd59977 | 27 | |
42cf5bc1 | 28 | #include <Aspect_AspectLine.hxx> |
29 | #include <Aspect_AspectLineDefinitionError.hxx> | |
30 | #include <Quantity_Color.hxx> | |
31 | #include <Standard_Type.hxx> | |
7fd59977 | 32 | |
92efcf78 | 33 | IMPLEMENT_STANDARD_RTTIEXT(Aspect_AspectLine,MMgt_TShared) |
34 | ||
42cf5bc1 | 35 | //-Aliases |
7fd59977 | 36 | //-Global data definitions |
0d969553 | 37 | // -- color |
7fd59977 | 38 | // MyColor : Color; |
0d969553 | 39 | // -- type of line |
7fd59977 | 40 | // MyType : TypeOfLine; |
0d969553 | 41 | // -- thickness |
7fd59977 | 42 | // MyWidth : Standard_Real; |
7fd59977 | 43 | //-Constructors |
7fd59977 | 44 | //-Destructors |
7fd59977 | 45 | //-Methods, in order |
7fd59977 | 46 | Aspect_AspectLine::Aspect_AspectLine () { |
47 | ||
48 | MyColor = Quantity_NOC_YELLOW; | |
49 | MyType = Aspect_TOL_SOLID; | |
50 | MyWidth = 1.0; | |
51 | ||
52 | } | |
53 | ||
54 | Aspect_AspectLine::Aspect_AspectLine (const Quantity_Color& AColor, const Aspect_TypeOfLine AType, const Standard_Real AWidth) { | |
55 | ||
56 | if (AWidth <= 0.0) | |
57 | Aspect_AspectLineDefinitionError::Raise | |
58 | ("Bad value for LineWidth"); | |
59 | ||
60 | MyColor = AColor; | |
61 | MyType = AType; | |
62 | MyWidth = AWidth; | |
63 | ||
64 | } | |
65 | ||
66 | void Aspect_AspectLine::SetColor (const Quantity_Color& AColor) { | |
67 | ||
68 | MyColor = AColor; | |
69 | ||
70 | } | |
71 | ||
72 | void Aspect_AspectLine::SetType (const Aspect_TypeOfLine AType) { | |
73 | ||
74 | MyType = AType; | |
75 | ||
76 | } | |
77 | ||
78 | void Aspect_AspectLine::SetWidth (const Standard_Real AWidth) { | |
79 | ||
80 | if (AWidth <= 0.0) | |
81 | Aspect_AspectLineDefinitionError::Raise | |
82 | ("Bad value for LineWidth"); | |
83 | ||
84 | MyWidth = AWidth; | |
85 | ||
86 | } | |
87 | ||
88 | void Aspect_AspectLine::Values (Quantity_Color& AColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const { | |
89 | ||
90 | AColor = MyColor; | |
91 | AType = MyType; | |
92 | AWidth = MyWidth; | |
93 | ||
94 | } |