Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Prs3d / Prs3d_PointAspect.cxx
1 #define GER61351                //GG_171199     Enable to set an object RGB color
2 //                                                instead a restricted object NameOfColor.
3
4 #include <Prs3d_PointAspect.ixx>
5
6 #ifdef GER61351
7 Prs3d_PointAspect::Prs3d_PointAspect (const Aspect_TypeOfMarker aType,
8                                   const Quantity_Color &aColor,
9                                   const Standard_Real aScale) {
10   myAspect = new Graphic3d_AspectMarker3d(aType,aColor,aScale);
11 }
12 #endif
13
14 Prs3d_PointAspect::Prs3d_PointAspect (const Aspect_TypeOfMarker aType,
15                                   const Quantity_NameOfColor aColor,
16                                   const Standard_Real aScale) {
17   myAspect = new Graphic3d_AspectMarker3d
18     (aType,Quantity_Color(aColor),aScale);
19 }
20
21 Prs3d_PointAspect::Prs3d_PointAspect (const Quantity_Color &aColor,
22                                       const Standard_Real anId,
23                                       const Standard_Integer aWidth,
24                                       const Standard_Integer aHeight,
25                                       const Handle(TColStd_HArray1OfByte)& aTexture
26                                       ) 
27 {
28   myAspect = new Graphic3d_AspectMarker3d
29     (Aspect_TOM_USERDEFINED,aColor,anId,aWidth,aHeight,aTexture);
30 }
31
32 #ifdef GER61351
33 void Prs3d_PointAspect::SetColor(const Quantity_Color &aColor) {
34   myAspect->SetColor(aColor);
35 }
36 #endif
37
38 void Prs3d_PointAspect::SetColor(const Quantity_NameOfColor aColor) {
39   myAspect->SetColor(Quantity_Color(aColor));
40 }
41
42 void Prs3d_PointAspect::SetTypeOfMarker(const Aspect_TypeOfMarker aType){
43   myAspect->SetType(aType);
44 }
45
46 void Prs3d_PointAspect::SetScale(const Standard_Real aScale){
47   myAspect->SetScale(aScale);
48 }
49
50 Handle (Graphic3d_AspectMarker3d) Prs3d_PointAspect::Aspect () const {
51   return myAspect;
52 }
53 void Prs3d_PointAspect::Print (Standard_OStream& s) const {
54
55   Quantity_Color C;
56   Aspect_TypeOfMarker T;
57   Standard_Real S;
58   myAspect->Values(C,T,S);
59   switch (T) {
60   case Aspect_TOM_POINT:
61     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " POINT " << S;
62     break;
63   case Aspect_TOM_PLUS:
64     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " PLUS " << S;
65     break;
66   case Aspect_TOM_STAR:
67     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " STAR " << S;
68     break;
69   case Aspect_TOM_O:
70     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " O " << S;
71     break;
72   case Aspect_TOM_X:
73     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " X " << S;
74     break;
75   case Aspect_TOM_O_POINT:
76     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " O_POINT " << S;
77     break;
78   case Aspect_TOM_O_PLUS:
79     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " O_PLUS " << S;
80     break;
81   case Aspect_TOM_O_STAR:
82     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " O_STAR " << S;
83     break;
84   case Aspect_TOM_O_X:
85     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " O_X " << S;
86     break;
87   case Aspect_TOM_BALL:
88     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " BALL " << S;
89     break;
90   case Aspect_TOM_RING1:
91     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " RING1 " << S;
92     break;
93   case Aspect_TOM_RING2:
94     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " RING2 " << S;
95     break;
96   case Aspect_TOM_RING3:
97     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " RING3 " << S;
98     break;
99   case Aspect_TOM_USERDEFINED:
100     s << "PointAspect: " << Quantity_Color::StringName(C.Name()) << " USERDEFINED " << S;
101     break;
102   default:
103     break;
104   }
105 }
106 void Prs3d_PointAspect::GetTextureSize(Standard_Integer& AWidth, Standard_Integer& AHeight)
107 {
108   myAspect->GetTextureSize( AWidth, AHeight);
109 }
110
111 const Handle(TColStd_HArray1OfByte)& Prs3d_PointAspect::GetTexture()
112 {
113   return myAspect->GetTexture();
114 }