b8d12a4937c914ad60e56f163176c877bdd368be
[occt.git] / src / Graphic3d / Graphic3d_Aspects.cxx
1 // Copyright (c) 2019 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <Graphic3d_Aspects.hxx>
15
16 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
17
18 // =======================================================================
19 // function : Graphic3d_Aspects
20 // purpose  :
21 // =======================================================================
22 Graphic3d_Aspects::Graphic3d_Aspects()
23 : myInteriorColor       (Quantity_NOC_CYAN1),
24   myBackInteriorColor   (Quantity_NOC_CYAN1),
25   myEdgeColor           (Quantity_NOC_WHITE),
26   myInteriorStyle       (Aspect_IS_SOLID),
27   myShadingModel        (Graphic3d_TOSM_DEFAULT),
28   myAlphaMode           (Graphic3d_AlphaMode_BlendAuto),
29   myAlphaCutoff         (0.5f),
30   myLineType            (Aspect_TOL_SOLID),
31   myLineWidth           (1.0f),
32   myMarkerType          (Aspect_TOM_POINT),
33   myMarkerScale         (1.0f),
34   myTextStyle           (Aspect_TOST_NORMAL),
35   myTextDisplayType     (Aspect_TODT_NORMAL),
36   myTextFontAspect      (Font_FontAspect_Regular),
37   myTextAngle           (0.0f),
38   myToSkipFirstEdge     (false),
39   myToDistinguishMaterials (false),
40   myToDrawEdges         (false),
41   myToDrawSilhouette    (false),
42   myToSuppressBackFaces (true),
43   myToMapTexture        (false),
44   myIsTextZoomable      (false)
45 {
46   //
47 }
48
49 // =======================================================================
50 // function : SetTextureMap
51 // purpose  :
52 // =======================================================================
53 void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture)
54 {
55   if (theTexture.IsNull())
56   {
57     myTextureSet.Nullify();
58     return;
59   }
60
61   myTextureSet = new Graphic3d_TextureSet (theTexture);
62 }