1 // Created on: 2000-08-11
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2000-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 <XCAFPrs_Style.hxx>
18 #include <Standard_Dump.hxx>
20 //=======================================================================
21 //function : XCAFPrs_Style
23 //=======================================================================
24 XCAFPrs_Style::XCAFPrs_Style()
25 : myHasColorSurf(Standard_False),
26 myHasColorCurv(Standard_False),
27 myIsVisible (Standard_True)
32 //=======================================================================
33 //function : SetColorSurf
35 //=======================================================================
36 void XCAFPrs_Style::SetColorSurf (const Quantity_ColorRGBA& theColor)
38 myColorSurf = theColor;
39 myHasColorSurf = Standard_True;
42 //=======================================================================
43 //function : UnSetColorSurf
45 //=======================================================================
46 void XCAFPrs_Style::UnSetColorSurf()
48 myHasColorSurf = Standard_False;
49 myColorSurf.ChangeRGB().SetValues (Quantity_NOC_YELLOW);
50 myColorSurf.SetAlpha (1.0f);
53 //=======================================================================
54 //function : SetColorCurv
56 //=======================================================================
57 void XCAFPrs_Style::SetColorCurv (const Quantity_Color& theColor)
59 myColorCurv = theColor;
60 myHasColorCurv = Standard_True;
63 //=======================================================================
64 //function : UnSetColorCurv
66 //=======================================================================
67 void XCAFPrs_Style::UnSetColorCurv()
69 myHasColorCurv = Standard_False;
70 myColorCurv.SetValues (Quantity_NOC_YELLOW);
73 //=======================================================================
76 //=======================================================================
77 void XCAFPrs_Style::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
79 DUMP_CLASS_BEGIN (theOStream, XCAFPrs_Style);
81 DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColorSurf);
82 DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColorCurv);
84 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasColorSurf);
85 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasColorCurv);
86 DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsVisible);