0024023: Revamp the OCCT Handle -- StepToGeom
[occt.git] / src / Prs3d / Prs3d_LineAspect.hxx
CommitLineData
42cf5bc1 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 <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Prs3d_BasicAspect.hxx>
24#include <Quantity_NameOfColor.hxx>
25#include <Aspect_TypeOfLine.hxx>
26#include <Standard_Real.hxx>
27class Graphic3d_AspectLine3d;
28class Quantity_Color;
29
30
31class Prs3d_LineAspect;
32DEFINE_STANDARD_HANDLE(Prs3d_LineAspect, Prs3d_BasicAspect)
33
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.
42class Prs3d_LineAspect : public Prs3d_BasicAspect
43{
44
45public:
46
47
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);
54
55 Standard_EXPORT Prs3d_LineAspect(const Quantity_Color& aColor, const Aspect_TypeOfLine aType, const Standard_Real aWidth);
56
57 Standard_EXPORT Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect);
58
59 Standard_EXPORT void SetColor (const Quantity_Color& aColor);
60
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);
64
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);
69
70 //! Sets the line width defined at the time of construction.
71 //! Default value: 1.
72 Standard_EXPORT void SetWidth (const Standard_Real aWidth);
73
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;
77
78 Standard_EXPORT void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect);
79
80
81
82
83 DEFINE_STANDARD_RTTI(Prs3d_LineAspect,Prs3d_BasicAspect)
84
85protected:
86
87
88
89
90private:
91
92
93 Handle(Graphic3d_AspectLine3d) myAspect;
94
95
96};
97
98
99
100
101
102
103
104#endif // _Prs3d_LineAspect_HeaderFile