0024437: Visualization - silhouette edges based on OpenGL
[occt.git] / src / Graphic3d / Graphic3d_AspectFillArea3d.cxx
CommitLineData
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 18IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillArea3d, Standard_Transient)
19
20// =======================================================================
21// function : Graphic3d_AspectFillArea3d
22// purpose :
23// =======================================================================
24Graphic3d_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),
6ef0d6f1 38 myToDrawSilhouette (false),
b6472664 39 myToSuppressBackFaces (true),
40 myToMapTexture (false)
63bcc448 41{
b6472664 42 //
43}
44
45// =======================================================================
46// function : Graphic3d_AspectFillArea3d
47// purpose :
48// =======================================================================
49Graphic3d_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),
dc89236f 62 myShadingModel (Graphic3d_TOSM_DEFAULT),
c40eb6b9 63 myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
64 myAlphaCutoff (0.5f),
b6472664 65 myEdgeType (theEdgeLineType),
66 myEdgeWidth ((float )theEdgeLineWidth),
640d5fe2 67 myHatchStyle (Handle(Graphic3d_HatchStyle)()),
2a332745 68 myToSkipFirstEdge (false),
b6472664 69 myToDistinguishMaterials (false),
70 myToDrawEdges (false),
6ef0d6f1 71 myToDrawSilhouette (false),
b6472664 72 myToSuppressBackFaces (true),
73 myToMapTexture (false)
30f0ad28 74{
b6472664 75 if (theEdgeLineWidth <= 0.0)
76 {
9775fa61 77 throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
b6472664 78 }
30f0ad28 79}
cc8cbabe 80
81// =======================================================================
82// function : Graphic3d_AspectFillArea3d
83// purpose :
84// =======================================================================
85void Graphic3d_AspectFillArea3d::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture)
86{
87 if (theTexture.IsNull())
88 {
89 myTextureSet.Nullify();
90 return;
91 }
92
93 myTextureSet = new Graphic3d_TextureSet (theTexture);
94}