d8c395ce2453d3d7939ef5f0a629d6a0e552cdd5
[occt.git] / src / Graphic3d / Graphic3d_AspectFillArea3d.cxx
1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <Graphic3d_AspectFillArea3d.hxx>
17
18 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillArea3d, Standard_Transient)
19
20 // =======================================================================
21 // function : Graphic3d_AspectFillArea3d
22 // purpose  :
23 // =======================================================================
24 Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d()
25 : myInteriorColor       (Quantity_NOC_CYAN1),
26   myBackInteriorColor   (Quantity_NOC_CYAN1),
27   myEdgeColor           (Quantity_NOC_WHITE),
28   myInteriorStyle       (Aspect_IS_EMPTY),
29   myEdgeType            (Aspect_TOL_SOLID),
30   myEdgeWidth           (1.0f),
31   myHatchStyle          (Handle(Graphic3d_HatchStyle)()),
32   myToDistinguishMaterials (false),
33   myToDrawEdges         (false),
34   myToSuppressBackFaces (true),
35   myToMapTexture        (false)
36 {
37   //
38 }
39
40 // =======================================================================
41 // function : Graphic3d_AspectFillArea3d
42 // purpose  :
43 // =======================================================================
44 Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle theInteriorStyle,
45                                                         const Quantity_Color&      theInteriorColor,
46                                                         const Quantity_Color&      theEdgeColor,
47                                                         const Aspect_TypeOfLine    theEdgeLineType,
48                                                         const Standard_Real        theEdgeLineWidth,
49                                                         const Graphic3d_MaterialAspect& theFrontMaterial,
50                                                         const Graphic3d_MaterialAspect& theBackMaterial)
51 : myFrontMaterial       (theFrontMaterial),
52   myBackMaterial        (theBackMaterial),
53   myInteriorColor       (theInteriorColor),
54   myBackInteriorColor   (theInteriorColor),
55   myEdgeColor           (theEdgeColor),
56   myInteriorStyle       (theInteriorStyle),
57   myEdgeType            (theEdgeLineType),
58   myEdgeWidth           ((float )theEdgeLineWidth),
59   myHatchStyle          (Handle(Graphic3d_HatchStyle)()),
60   myToDistinguishMaterials (false),
61   myToDrawEdges         (false),
62   myToSuppressBackFaces (true),
63   myToMapTexture        (false)
64 {
65   if (theEdgeLineWidth <= 0.0)
66   {
67     throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
68   }
69 }