bf5f0ca2 |
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> |
0904aa63 |
15 | #include <Standard_Dump.hxx> |
bf5f0ca2 |
16 | |
17 | IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient) |
18 | |
19 | // ======================================================================= |
20 | // function : Graphic3d_Aspects |
21 | // purpose : |
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), |
30 | myAlphaCutoff (0.5f), |
31 | myLineType (Aspect_TOL_SOLID), |
32 | myLineWidth (1.0f), |
3f1675c9 |
33 | myLinePattern (0xFFFF), |
bf5f0ca2 |
34 | myMarkerType (Aspect_TOM_POINT), |
35 | myMarkerScale (1.0f), |
36 | myTextStyle (Aspect_TOST_NORMAL), |
37 | myTextDisplayType (Aspect_TODT_NORMAL), |
38 | myTextFontAspect (Font_FontAspect_Regular), |
39 | myTextAngle (0.0f), |
40 | myToSkipFirstEdge (false), |
41 | myToDistinguishMaterials (false), |
42 | myToDrawEdges (false), |
43 | myToDrawSilhouette (false), |
44 | myToSuppressBackFaces (true), |
45 | myToMapTexture (false), |
46 | myIsTextZoomable (false) |
47 | { |
48 | // |
49 | } |
50 | |
51 | // ======================================================================= |
52 | // function : SetTextureMap |
53 | // purpose : |
54 | // ======================================================================= |
55 | void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTexture) |
56 | { |
57 | if (theTexture.IsNull()) |
58 | { |
59 | myTextureSet.Nullify(); |
60 | return; |
61 | } |
62 | |
63 | myTextureSet = new Graphic3d_TextureSet (theTexture); |
64 | } |
0904aa63 |
65 | |
66 | //======================================================================= |
67 | //function : DumpJson |
68 | //purpose : |
69 | //======================================================================= |
bc73b006 |
70 | void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const |
0904aa63 |
71 | { |
bc73b006 |
72 | OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream) |
0904aa63 |
73 | |
bc73b006 |
74 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor) |
75 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor) |
76 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor) |
77 | OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset) |
0904aa63 |
78 | |
bc73b006 |
79 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSkipFirstEdge) |
80 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDistinguishMaterials) |
81 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawEdges) |
82 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawSilhouette) |
83 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces) |
84 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture) |
85 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable) |
86 | |
87 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaMode) |
88 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaCutoff) |
89 | |
90 | if (!myTextFont.IsNull()) |
91 | { |
92 | OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myTextFont->String()) |
93 | } |
94 | |
95 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextStyle) |
96 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextDisplayType) |
97 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextFontAspect) |
98 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextAngle) |
0904aa63 |
99 | } |