0031313: Foundation Classes - Dump improvement for classes
[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
42cf5bc1 20#include <Aspect_TypeOfLine.hxx>
5b111128 21#include <Graphic3d_AspectLine3d.hxx>
4e1bc39a 22#include <Prs3d_BasicAspect.hxx>
23#include <Quantity_Color.hxx>
42cf5bc1 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.
33class Prs3d_LineAspect : public Prs3d_BasicAspect
34{
4e1bc39a 35 DEFINE_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
42cf5bc1 36public:
42cf5bc1 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.
4e1bc39a 43 Standard_EXPORT Prs3d_LineAspect (const Quantity_Color& theColor, const Aspect_TypeOfLine theType, const Standard_Real theWidth);
42cf5bc1 44
4e1bc39a 45 Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect) : myAspect (theAspect) {}
46
42cf5bc1 47 //! Sets the line color defined at the time of construction.
48 //! Default value: Quantity_NOC_YELLOW
87432b82 49 void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
50
42cf5bc1 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
4e1bc39a 54 void SetTypeOfLine (const Aspect_TypeOfLine theType) { myAspect->SetType (theType); }
42cf5bc1 55
56 //! Sets the line width defined at the time of construction.
57 //! Default value: 1.
4e1bc39a 58 void SetWidth (const Standard_Real theWidth) { myAspect->SetWidth (theWidth); }
59
42cf5bc1 60 //! Returns the line aspect. This is defined as the set of
61 //! color, type and thickness attributes.
4e1bc39a 62 const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myAspect; }
42cf5bc1 63
4e1bc39a 64 void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myAspect = theAspect; }
42cf5bc1 65
0904aa63 66 //! Dumps the content of me into the stream
bc73b006 67 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0904aa63 68
42cf5bc1 69protected:
70
42cf5bc1 71 Handle(Graphic3d_AspectLine3d) myAspect;
72
42cf5bc1 73};
74
4e1bc39a 75DEFINE_STANDARD_HANDLE(Prs3d_LineAspect, Prs3d_BasicAspect)
42cf5bc1 76
77#endif // _Prs3d_LineAspect_HeaderFile