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 myToSkipFirstEdge (false),
36 myToDistinguishMaterials (false),
37 myToDrawEdges (false),
38 myToDrawSilhouette (false),
39 myToSuppressBackFaces (true),
40 myToMapTexture (false)
45 // =======================================================================
46 // function : Graphic3d_AspectFillArea3d
48 // =======================================================================
49 Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle theInteriorStyle,
50 const Quantity_Color& theInteriorColor,
51 const Quantity_Color& theEdgeColor,
52 const Aspect_TypeOfLine theEdgeLineType,
53 const Standard_Real theEdgeLineWidth,
54 const Graphic3d_MaterialAspect& theFrontMaterial,
55 const Graphic3d_MaterialAspect& theBackMaterial)
56 : myFrontMaterial (theFrontMaterial),
57 myBackMaterial (theBackMaterial),
58 myInteriorColor (theInteriorColor),
59 myBackInteriorColor (theInteriorColor),
60 myEdgeColor (theEdgeColor),
61 myInteriorStyle (theInteriorStyle),
62 myShadingModel (Graphic3d_TOSM_DEFAULT),
63 myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
65 myEdgeType (theEdgeLineType),
66 myEdgeWidth ((float )theEdgeLineWidth),
67 myHatchStyle (Handle(Graphic3d_HatchStyle)()),
68 myToSkipFirstEdge (false),
69 myToDistinguishMaterials (false),
70 myToDrawEdges (false),
71 myToDrawSilhouette (false),
72 myToSuppressBackFaces (true),
73 myToMapTexture (false)
75 if (theEdgeLineWidth <= 0.0)
77 throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
81 // =======================================================================
82 // function : Graphic3d_AspectFillArea3d
84 // =======================================================================
85 void Graphic3d_AspectFillArea3d::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture)
87 if (theTexture.IsNull())
89 myTextureSet.Nullify();
93 myTextureSet = new Graphic3d_TextureSet (theTexture);