1 // Copyright (c) 2019 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <Graphic3d_Aspects.hxx>
15 #include <Standard_Dump.hxx>
17 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
19 // =======================================================================
20 // function : Graphic3d_Aspects
22 // =======================================================================
23 Graphic3d_Aspects::Graphic3d_Aspects()
24 : myInteriorColor (Quantity_NOC_CYAN1),
25 myBackInteriorColor (Quantity_NOC_CYAN1),
26 myEdgeColor (Quantity_NOC_WHITE),
27 myInteriorStyle (Aspect_IS_SOLID),
28 myShadingModel (Graphic3d_TOSM_DEFAULT),
29 myAlphaMode (Graphic3d_AlphaMode_BlendAuto),
31 myLineType (Aspect_TOL_SOLID),
33 myMarkerType (Aspect_TOM_POINT),
35 myTextStyle (Aspect_TOST_NORMAL),
36 myTextDisplayType (Aspect_TODT_NORMAL),
37 myTextFontAspect (Font_FontAspect_Regular),
39 myToSkipFirstEdge (false),
40 myToDistinguishMaterials (false),
41 myToDrawEdges (false),
42 myToDrawSilhouette (false),
43 myToSuppressBackFaces (true),
44 myToMapTexture (false),
45 myIsTextZoomable (false)
50 // =======================================================================
51 // function : SetTextureMap
53 // =======================================================================
54 void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture)
56 if (theTexture.IsNull())
58 myTextureSet.Nullify();
62 myTextureSet = new Graphic3d_TextureSet (theTexture);
65 //=======================================================================
68 //=======================================================================
69 void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
71 DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
73 DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor);
74 DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor);
75 DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor);
76 DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset);
78 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSkipFirstEdge);
79 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDistinguishMaterials);
80 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawEdges);
81 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawSilhouette);
82 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces);
83 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture);
84 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);