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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Prs3d_LineAspect_HeaderFile
18 #define _Prs3d_LineAspect_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Prs3d_BasicAspect.hxx>
24 #include <Quantity_NameOfColor.hxx>
25 #include <Aspect_TypeOfLine.hxx>
26 #include <Standard_Real.hxx>
27 class Graphic3d_AspectLine3d;
31 class Prs3d_LineAspect;
32 DEFINE_STANDARD_HANDLE(Prs3d_LineAspect, Prs3d_BasicAspect)
34 //! A framework for defining how a line will be displayed
35 //! in a presentation. Aspects of line display include
36 //! width, color and type of line.
37 //! The definition set by this class is then passed to the
38 //! attribute manager Prs3d_Drawer.
39 //! Any object which requires a value for line aspect as
40 //! an argument may then be given the attribute manager
41 //! as a substitute argument in the form of a field such as myDrawer for example.
42 class Prs3d_LineAspect : public Prs3d_BasicAspect
48 //! Constructs a framework for line aspect defined by
49 //! - the color aColor
50 //! - the type of line aType and
51 //! - the line thickness aWidth.
52 //! Type of line refers to whether the line is solid or dotted, for example.
53 Standard_EXPORT Prs3d_LineAspect(const Quantity_NameOfColor aColor, const Aspect_TypeOfLine aType, const Standard_Real aWidth);
55 Standard_EXPORT Prs3d_LineAspect(const Quantity_Color& aColor, const Aspect_TypeOfLine aType, const Standard_Real aWidth);
57 Standard_EXPORT Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect);
59 Standard_EXPORT void SetColor (const Quantity_Color& aColor);
61 //! Sets the line color defined at the time of construction.
62 //! Default value: Quantity_NOC_YELLOW
63 Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor);
65 //! Sets the type of line defined at the time of construction.
66 //! This could, for example, be solid, dotted or made up of dashes.
67 //! Default value: Aspect_TOL_SOLID
68 Standard_EXPORT void SetTypeOfLine (const Aspect_TypeOfLine aType);
70 //! Sets the line width defined at the time of construction.
72 Standard_EXPORT void SetWidth (const Standard_Real aWidth);
74 //! Returns the line aspect. This is defined as the set of
75 //! color, type and thickness attributes.
76 Standard_EXPORT Handle(Graphic3d_AspectLine3d) Aspect() const;
78 Standard_EXPORT void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect);
83 DEFINE_STANDARD_RTTI(Prs3d_LineAspect,Prs3d_BasicAspect)
93 Handle(Graphic3d_AspectLine3d) myAspect;
104 #endif // _Prs3d_LineAspect_HeaderFile