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 myEdgeType (Aspect_TOL_SOLID),
32 myHatchStyle (Handle(Graphic3d_HatchStyle)()),
33 myToDistinguishMaterials (false),
34 myToDrawEdges (false),
35 myToSuppressBackFaces (true),
36 myToMapTexture (false)
41 // =======================================================================
42 // function : Graphic3d_AspectFillArea3d
44 // =======================================================================
45 Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle theInteriorStyle,
46 const Quantity_Color& theInteriorColor,
47 const Quantity_Color& theEdgeColor,
48 const Aspect_TypeOfLine theEdgeLineType,
49 const Standard_Real theEdgeLineWidth,
50 const Graphic3d_MaterialAspect& theFrontMaterial,
51 const Graphic3d_MaterialAspect& theBackMaterial)
52 : myFrontMaterial (theFrontMaterial),
53 myBackMaterial (theBackMaterial),
54 myInteriorColor (theInteriorColor),
55 myBackInteriorColor (theInteriorColor),
56 myEdgeColor (theEdgeColor),
57 myInteriorStyle (theInteriorStyle),
58 myShadingModel (Graphic3d_TOSM_DEFAULT),
59 myEdgeType (theEdgeLineType),
60 myEdgeWidth ((float )theEdgeLineWidth),
61 myHatchStyle (Handle(Graphic3d_HatchStyle)()),
62 myToDistinguishMaterials (false),
63 myToDrawEdges (false),
64 myToSuppressBackFaces (true),
65 myToMapTexture (false)
67 if (theEdgeLineWidth <= 0.0)
69 throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
73 // =======================================================================
74 // function : Graphic3d_AspectFillArea3d
76 // =======================================================================
77 void Graphic3d_AspectFillArea3d::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture)
79 if (theTexture.IsNull())
81 myTextureSet.Nullify();
85 myTextureSet = new Graphic3d_TextureSet (theTexture);