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_AspectFillArea3d.hxx> |
7fd59977 |
17 | |
b6472664 |
18 | IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillArea3d, Standard_Transient) |
19 | |
20 | // ======================================================================= |
21 | // function : Graphic3d_AspectFillArea3d |
22 | // purpose : |
23 | // ======================================================================= |
24 | Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d() |
25 | : myInteriorColor (Quantity_NOC_CYAN1), |
26 | myBackInteriorColor (Quantity_NOC_CYAN1), |
27 | myEdgeColor (Quantity_NOC_WHITE), |
28 | myInteriorStyle (Aspect_IS_EMPTY), |
dc89236f |
29 | myShadingModel (Graphic3d_TOSM_DEFAULT), |
c40eb6b9 |
30 | myAlphaMode (Graphic3d_AlphaMode_BlendAuto), |
31 | myAlphaCutoff (0.5f), |
b6472664 |
32 | myEdgeType (Aspect_TOL_SOLID), |
33 | myEdgeWidth (1.0f), |
640d5fe2 |
34 | myHatchStyle (Handle(Graphic3d_HatchStyle)()), |
2a332745 |
35 | myToSkipFirstEdge (false), |
b6472664 |
36 | myToDistinguishMaterials (false), |
37 | myToDrawEdges (false), |
38 | myToSuppressBackFaces (true), |
39 | myToMapTexture (false) |
63bcc448 |
40 | { |
b6472664 |
41 | // |
42 | } |
43 | |
44 | // ======================================================================= |
45 | // function : Graphic3d_AspectFillArea3d |
46 | // purpose : |
47 | // ======================================================================= |
48 | Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle theInteriorStyle, |
49 | const Quantity_Color& theInteriorColor, |
50 | const Quantity_Color& theEdgeColor, |
51 | const Aspect_TypeOfLine theEdgeLineType, |
52 | const Standard_Real theEdgeLineWidth, |
53 | const Graphic3d_MaterialAspect& theFrontMaterial, |
54 | const Graphic3d_MaterialAspect& theBackMaterial) |
55 | : myFrontMaterial (theFrontMaterial), |
56 | myBackMaterial (theBackMaterial), |
57 | myInteriorColor (theInteriorColor), |
58 | myBackInteriorColor (theInteriorColor), |
59 | myEdgeColor (theEdgeColor), |
60 | myInteriorStyle (theInteriorStyle), |
dc89236f |
61 | myShadingModel (Graphic3d_TOSM_DEFAULT), |
c40eb6b9 |
62 | myAlphaMode (Graphic3d_AlphaMode_BlendAuto), |
63 | myAlphaCutoff (0.5f), |
b6472664 |
64 | myEdgeType (theEdgeLineType), |
65 | myEdgeWidth ((float )theEdgeLineWidth), |
640d5fe2 |
66 | myHatchStyle (Handle(Graphic3d_HatchStyle)()), |
2a332745 |
67 | myToSkipFirstEdge (false), |
b6472664 |
68 | myToDistinguishMaterials (false), |
69 | myToDrawEdges (false), |
70 | myToSuppressBackFaces (true), |
71 | myToMapTexture (false) |
30f0ad28 |
72 | { |
b6472664 |
73 | if (theEdgeLineWidth <= 0.0) |
74 | { |
9775fa61 |
75 | throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth"); |
b6472664 |
76 | } |
30f0ad28 |
77 | } |
cc8cbabe |
78 | |
79 | // ======================================================================= |
80 | // function : Graphic3d_AspectFillArea3d |
81 | // purpose : |
82 | // ======================================================================= |
83 | void Graphic3d_AspectFillArea3d::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture) |
84 | { |
85 | if (theTexture.IsNull()) |
86 | { |
87 | myTextureSet.Nullify(); |
88 | return; |
89 | } |
90 | |
91 | myTextureSet = new Graphic3d_TextureSet (theTexture); |
92 | } |