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. |
b311480e |
15 | |
42cf5bc1 |
16 | #include <Graphic3d_AspectMarker3d.hxx> |
a577aaab |
17 | |
bf5f0ca2 |
18 | IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects) |
92efcf78 |
19 | |
a577aaab |
20 | // ======================================================================= |
21 | // function : Graphic3d_AspectMarker3d |
22 | // purpose : |
23 | // ======================================================================= |
24 | Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d() |
b6472664 |
25 | { |
bf5f0ca2 |
26 | myShadingModel = Graphic3d_TOSM_UNLIT; |
27 | myInteriorColor.SetRGB (Quantity_NOC_YELLOW); |
28 | myMarkerType = Aspect_TOM_X; |
29 | myMarkerScale = 1.0f; |
b6472664 |
30 | } |
a577aaab |
31 | |
32 | // ======================================================================= |
33 | // function : Graphic3d_AspectMarker3d |
34 | // purpose : |
35 | // ======================================================================= |
36 | Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker theType, |
37 | const Quantity_Color& theColor, |
38 | const Standard_Real theScale) |
b6472664 |
39 | { |
bf5f0ca2 |
40 | myShadingModel = Graphic3d_TOSM_UNLIT; |
41 | myInteriorColor.SetRGB (theColor); |
42 | myMarkerType = theType; |
43 | SetMarkerScale ((float )theScale); |
b6472664 |
44 | } |
a577aaab |
45 | |
46 | // ======================================================================= |
47 | // function : Graphic3d_AspectMarker3d |
48 | // purpose : |
49 | // ======================================================================= |
50 | Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theColor, |
51 | const Standard_Integer theWidth, |
52 | const Standard_Integer theHeight, |
53 | const Handle(TColStd_HArray1OfByte)& theTextureBitMap) |
b6472664 |
54 | { |
bf5f0ca2 |
55 | myShadingModel = Graphic3d_TOSM_UNLIT; |
56 | myMarkerImage = new Graphic3d_MarkerImage(theTextureBitMap, theWidth, theHeight); |
57 | myInteriorColor.SetRGB (theColor), |
58 | myMarkerType = Aspect_TOM_USERDEFINED; |
59 | myMarkerScale = 1.0f; |
b6472664 |
60 | } |
a577aaab |
61 | |
62 | // ======================================================================= |
63 | // function : Graphic3d_AspectMarker3d |
64 | // purpose : |
65 | // ======================================================================= |
66 | Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Handle(Image_PixMap)& theTextureImage) |
b6472664 |
67 | { |
bf5f0ca2 |
68 | myShadingModel = Graphic3d_TOSM_UNLIT; |
69 | myMarkerImage = new Graphic3d_MarkerImage (theTextureImage); |
70 | myInteriorColor.SetRGB (Quantity_NOC_YELLOW); |
71 | myMarkerType = Aspect_TOM_USERDEFINED; |
72 | myMarkerScale = 1.0f; |
b6472664 |
73 | } |
a577aaab |
74 | |
75 | // ======================================================================= |
76 | // function : GetTextureSize |
77 | // purpose : |
78 | // ======================================================================= |
79 | void Graphic3d_AspectMarker3d::GetTextureSize (Standard_Integer& theWidth, |
80 | Standard_Integer& theHeight) const |
7fd59977 |
81 | { |
a577aaab |
82 | if (!myMarkerImage.IsNull()) |
83 | { |
84 | myMarkerImage->GetTextureSize (theWidth, theHeight); |
85 | } |
86 | else |
87 | { |
88 | theWidth = 0; |
89 | theHeight = 0; |
90 | } |
7fd59977 |
91 | } |
92 | |
a577aaab |
93 | // ======================================================================= |
94 | // function : SetBitMap |
95 | // purpose : |
96 | // ======================================================================= |
97 | void Graphic3d_AspectMarker3d::SetBitMap (const Standard_Integer theWidth, |
98 | const Standard_Integer theHeight, |
99 | const Handle(TColStd_HArray1OfByte)& theTextureBitMap) |
7fd59977 |
100 | { |
a577aaab |
101 | myMarkerImage.Nullify(); |
102 | myMarkerImage = new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight); |
7fd59977 |
103 | } |