summaryrefslogtreecommitdiff
path: root/src/Prs3d/Prs3d_LineAspect.cxx
blob: faa6c607c49fb5a53c7a99051a9d0b17f3bc033b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#define GER61351		//GG_171199     Enable to set an object RGB color
//						  instead a restricted object NameOfColor.

#include <Prs3d_LineAspect.ixx>

#ifdef GER61351
Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_Color &aColor,
				const Aspect_TypeOfLine aType,
				const Standard_Real aWidth) {
  myAspect = new Graphic3d_AspectLine3d(aColor,aType,aWidth);
}
#endif

Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_NameOfColor aColor,
				const Aspect_TypeOfLine aType,
				const Standard_Real aWidth) {

  myAspect = new Graphic3d_AspectLine3d
    (Quantity_Color(aColor),aType,aWidth);
}

#ifdef GER61351
void Prs3d_LineAspect::SetColor(const Quantity_Color &aColor) {
 myAspect->SetColor(aColor);
}
#endif

void Prs3d_LineAspect::SetColor(const Quantity_NameOfColor aColor) {
  myAspect->SetColor(Quantity_Color(aColor));
}

void Prs3d_LineAspect::SetTypeOfLine(const Aspect_TypeOfLine aType){
  myAspect->SetType(aType);
}

void Prs3d_LineAspect::SetWidth(const Standard_Real aWidth){
  myAspect->SetWidth(aWidth);
}

Handle (Graphic3d_AspectLine3d) Prs3d_LineAspect::Aspect () const {
  return myAspect;
}

void Prs3d_LineAspect::Print (Standard_OStream& s) const {

  Quantity_Color C;
  Aspect_TypeOfLine T;
  Standard_Real W;
  myAspect->Values(C,T,W);
  switch (T) {
  case Aspect_TOL_SOLID:
    s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << "  SOLID  " << W;
    break;
  case Aspect_TOL_DASH:
    s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << "  DASH  " << W;
    break;
  case Aspect_TOL_DOT:
    s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << "  DOT  " << W;
    break;
  case Aspect_TOL_DOTDASH:
    s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << "  DOTDASH  " << W;
    break;
  case Aspect_TOL_USERDEFINED:
    s << "LineAspect: " << Quantity_Color::StringName(C.Name()) << "  USERDEFINED  " << W;
    break;
  }
}