0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / Prs3d / Prs3d_LineAspect.hxx
1 // Created on: 1993-04-26
2 // Created by: Jean-Louis Frenkel
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Prs3d_LineAspect_HeaderFile
18 #define _Prs3d_LineAspect_HeaderFile
19
20 #include <Aspect_TypeOfLine.hxx>
21 #include <Graphic3d_AspectLine3d.hxx>
22 #include <Prs3d_BasicAspect.hxx>
23 #include <Quantity_Color.hxx>
24
25 //! A framework for defining how a line will be displayed
26 //! in a presentation. Aspects of line display include
27 //! width, color and type of line.
28 //! The definition set by this class is then passed to the
29 //! attribute manager Prs3d_Drawer.
30 //! Any object which requires a value for line aspect as
31 //! an argument may then be given the attribute manager
32 //! as a substitute argument in the form of a field such as myDrawer for example.
33 class Prs3d_LineAspect : public Prs3d_BasicAspect
34 {
35   DEFINE_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
36 public:
37   
38   //! Constructs a framework for line aspect defined by
39   //! -   the color aColor
40   //! -   the type of line aType and
41   //! -   the line thickness aWidth.
42   //! Type of line refers to whether the line is solid or dotted, for example.
43   Standard_EXPORT Prs3d_LineAspect (const Quantity_Color& theColor, const Aspect_TypeOfLine theType, const Standard_Real theWidth);
44   
45   Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect) : myAspect (theAspect) {}
46
47   //! Sets the line color defined at the time of construction.
48   //! Default value: Quantity_NOC_YELLOW
49   void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
50
51   //! Sets the type of line defined at the time of construction.
52   //! This could, for example, be solid, dotted or made up of dashes.
53   //! Default value: Aspect_TOL_SOLID
54   void SetTypeOfLine (const Aspect_TypeOfLine theType) { myAspect->SetType (theType); }
55   
56   //! Sets the line width defined at the time of construction.
57   //! Default value: 1.
58   void SetWidth (const Standard_Real theWidth) { myAspect->SetWidth (theWidth); }
59
60   //! Returns the line aspect. This is defined as the set of
61   //! color, type and thickness attributes.
62   const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myAspect; }
63   
64   void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myAspect = theAspect; }
65
66 protected:
67
68   Handle(Graphic3d_AspectLine3d) myAspect;
69
70 };
71
72 DEFINE_STANDARD_HANDLE(Prs3d_LineAspect, Prs3d_BasicAspect)
73
74 #endif // _Prs3d_LineAspect_HeaderFile