1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <Graphic3d_AspectFillArea3d.hxx>
18 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillArea3d, Standard_Transient)
20 // =======================================================================
21 // function : Graphic3d_AspectFillArea3d
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),
29 myShadingModel (Graphic3d_TOSM_DEFAULT),
30 myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
32 myEdgeType (Aspect_TOL_SOLID),
34 myHatchStyle (Handle(Graphic3d_HatchStyle)()),
35 myToDistinguishMaterials (false),
36 myToDrawEdges (false),
37 myToSuppressBackFaces (true),
38 myToMapTexture (false)
43 // =======================================================================
44 // function : Graphic3d_AspectFillArea3d
46 // =======================================================================
47 Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle theInteriorStyle,
48 const Quantity_Color& theInteriorColor,
49 const Quantity_Color& theEdgeColor,
50 const Aspect_TypeOfLine theEdgeLineType,
51 const Standard_Real theEdgeLineWidth,
52 const Graphic3d_MaterialAspect& theFrontMaterial,
53 const Graphic3d_MaterialAspect& theBackMaterial)
54 : myFrontMaterial (theFrontMaterial),
55 myBackMaterial (theBackMaterial),
56 myInteriorColor (theInteriorColor),
57 myBackInteriorColor (theInteriorColor),
58 myEdgeColor (theEdgeColor),
59 myInteriorStyle (theInteriorStyle),
60 myShadingModel (Graphic3d_TOSM_DEFAULT),
61 myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
63 myEdgeType (theEdgeLineType),
64 myEdgeWidth ((float )theEdgeLineWidth),
65 myHatchStyle (Handle(Graphic3d_HatchStyle)()),
66 myToDistinguishMaterials (false),
67 myToDrawEdges (false),
68 myToSuppressBackFaces (true),
69 myToMapTexture (false)
71 if (theEdgeLineWidth <= 0.0)
73 throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
77 // =======================================================================
78 // function : Graphic3d_AspectFillArea3d
80 // =======================================================================
81 void Graphic3d_AspectFillArea3d::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture)
83 if (theTexture.IsNull())
85 myTextureSet.Nullify();
89 myTextureSet = new Graphic3d_TextureSet (theTexture);