7fd59977 |
1 | |
2 | // File Aspect_AspectLine.cxx |
3 | // Created Mars 1992 |
4 | // Author NW,JPB,CAL |
5 | |
6 | //-Copyright MatraDatavision 1991,1992 |
7 | |
8 | //-Version |
9 | |
10 | //-Design Declaration des variables specifiques au contexte |
11 | // de trace de lignes |
12 | |
13 | //-Warning Un contexte de trace de ligne est defini par : |
14 | // - la couleur |
15 | // - le type de trait |
16 | // - l'epaisseur |
17 | |
18 | //-References |
19 | |
20 | //-Language C++ 2.0 |
21 | |
22 | //-Declarations |
23 | |
24 | // for the class |
25 | #include <Aspect_AspectLine.ixx> |
26 | |
27 | //-Aliases |
28 | |
29 | //-Global data definitions |
30 | |
31 | // -- la couleur |
32 | // MyColor : Color; |
33 | |
34 | // -- le type de trait |
35 | // MyType : TypeOfLine; |
36 | |
37 | // -- l'epaisseur |
38 | // MyWidth : Standard_Real; |
39 | |
40 | //-Constructors |
41 | |
42 | //-Destructors |
43 | |
44 | //-Methods, in order |
45 | |
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 | } |