7fd59977 |
1 | #define GER61351 //GG_171199 Enable to set an object RGB color |
2 | // instead a restricted object NameOfColor. |
3 | |
4 | #include <Prs3d_LineAspect.ixx> |
5 | |
6 | #ifdef GER61351 |
7 | Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_Color &aColor, |
8 | const Aspect_TypeOfLine aType, |
9 | const Standard_Real aWidth) { |
10 | myAspect = new Graphic3d_AspectLine3d(aColor,aType,aWidth); |
11 | } |
12 | #endif |
13 | |
14 | Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_NameOfColor aColor, |
15 | const Aspect_TypeOfLine aType, |
16 | const Standard_Real aWidth) { |
17 | |
18 | myAspect = new Graphic3d_AspectLine3d |
19 | (Quantity_Color(aColor),aType,aWidth); |
20 | } |
21 | |
22 | #ifdef GER61351 |
23 | void Prs3d_LineAspect::SetColor(const Quantity_Color &aColor) { |
24 | myAspect->SetColor(aColor); |
25 | } |
26 | #endif |
27 | |
28 | void Prs3d_LineAspect::SetColor(const Quantity_NameOfColor aColor) { |
29 | myAspect->SetColor(Quantity_Color(aColor)); |
30 | } |
31 | |
32 | void Prs3d_LineAspect::SetTypeOfLine(const Aspect_TypeOfLine aType){ |
33 | myAspect->SetType(aType); |
34 | } |
35 | |
36 | void Prs3d_LineAspect::SetWidth(const Standard_Real aWidth){ |
37 | myAspect->SetWidth(aWidth); |
38 | } |
39 | |
40 | Handle (Graphic3d_AspectLine3d) Prs3d_LineAspect::Aspect () const { |
41 | return myAspect; |
42 | } |
43 | |
44 | void Prs3d_LineAspect::Print (Standard_OStream& s) const { |
45 | |
46 | Quantity_Color C; |
47 | Aspect_TypeOfLine T; |
48 | Standard_Real W; |
49 | myAspect->Values(C,T,W); |
50 | switch (T) { |
51 | case Aspect_TOL_SOLID: |
52 | s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << " SOLID " << W; |
53 | break; |
54 | case Aspect_TOL_DASH: |
55 | s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << " DASH " << W; |
56 | break; |
57 | case Aspect_TOL_DOT: |
58 | s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << " DOT " << W; |
59 | break; |
60 | case Aspect_TOL_DOTDASH: |
61 | s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << " DOTDASH " << W; |
62 | break; |
63 | case Aspect_TOL_USERDEFINED: |
64 | s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << " USERDEFINED " << W; |
65 | break; |
66 | } |
67 | } |