0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / Graphic3d / Graphic3d_AspectText3d.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_AspectText3d.hxx>
17
18 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Standard_Transient)
19
20 // =======================================================================
21 // function : Graphic3d_AspectText3d
22 // purpose  :
23 // =======================================================================
24 Graphic3d_AspectText3d::Graphic3d_AspectText3d()
25 : myFont   (Font_NOF_ASCII_MONO),
26   myColor  (Quantity_NOC_YELLOW),
27   myFactor (1.0),
28   mySpace  (0.0),
29   myStyle  (Aspect_TOST_NORMAL),
30   myDisplayType   (Aspect_TODT_NORMAL),
31   myColorSubTitle (Quantity_NOC_WHITE),
32   myTextZoomable  (false),
33   myTextAngle     (0.0),
34   myTextFontAspect(Font_FA_Regular)
35 {
36   //
37 }
38
39 // =======================================================================
40 // function : Graphic3d_AspectText3d
41 // purpose  :
42 // =======================================================================
43 Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color&  theColor,
44                                                 const Standard_CString theFont,
45                                                 const Standard_Real    theExpansionFactor,
46                                                 const Standard_Real    theSpace,
47                                                 const Aspect_TypeOfStyleText   theStyle,
48                                                 const Aspect_TypeOfDisplayText theDisplayType)
49 : myFont   (theFont),
50   myColor  (theColor),
51   myFactor (theExpansionFactor),
52   mySpace  (theSpace),
53   myStyle  (theStyle),
54   myDisplayType   (theDisplayType),
55   myColorSubTitle (Quantity_NOC_WHITE),
56   myTextZoomable  (false),
57   myTextAngle     (0.0),
58   myTextFontAspect(Font_FA_Regular)
59 {
60   if (myFont.IsEmpty())
61   {
62     myFont = Font_NOF_ASCII_MONO;
63   }
64
65   if (theExpansionFactor <= 0.0)
66   {
67     throw Graphic3d_AspectTextDefinitionError("Bad value for TextScaleFactor");
68   }
69 }