0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[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
5b111128 20#include <Graphic3d_AspectLine3d.hxx>
4e1bc39a 21#include <Prs3d_BasicAspect.hxx>
22#include <Quantity_Color.hxx>
42cf5bc1 23
24//! A framework for defining how a line will be displayed
25//! in a presentation. Aspects of line display include
26//! width, color and type of line.
27//! The definition set by this class is then passed to the
28//! attribute manager Prs3d_Drawer.
29//! Any object which requires a value for line aspect as
30//! an argument may then be given the attribute manager
31//! as a substitute argument in the form of a field such as myDrawer for example.
32class Prs3d_LineAspect : public Prs3d_BasicAspect
33{
4e1bc39a 34 DEFINE_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
42cf5bc1 35public:
42cf5bc1 36
37 //! Constructs a framework for line aspect defined by
38 //! - the color aColor
39 //! - the type of line aType and
40 //! - the line thickness aWidth.
41 //! Type of line refers to whether the line is solid or dotted, for example.
4e1bc39a 42 Standard_EXPORT Prs3d_LineAspect (const Quantity_Color& theColor, const Aspect_TypeOfLine theType, const Standard_Real theWidth);
42cf5bc1 43
4e1bc39a 44 Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect) : myAspect (theAspect) {}
45
42cf5bc1 46 //! Sets the line color defined at the time of construction.
47 //! Default value: Quantity_NOC_YELLOW
87432b82 48 void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
49
42cf5bc1 50 //! Sets the type of line defined at the time of construction.
51 //! This could, for example, be solid, dotted or made up of dashes.
52 //! Default value: Aspect_TOL_SOLID
4e1bc39a 53 void SetTypeOfLine (const Aspect_TypeOfLine theType) { myAspect->SetType (theType); }
42cf5bc1 54
55 //! Sets the line width defined at the time of construction.
56 //! Default value: 1.
4e1bc39a 57 void SetWidth (const Standard_Real theWidth) { myAspect->SetWidth (theWidth); }
58
42cf5bc1 59 //! Returns the line aspect. This is defined as the set of
60 //! color, type and thickness attributes.
4e1bc39a 61 const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myAspect; }
42cf5bc1 62
4e1bc39a 63 void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myAspect = theAspect; }
42cf5bc1 64
0904aa63 65 //! Dumps the content of me into the stream
bc73b006 66 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0904aa63 67
42cf5bc1 68protected:
69
42cf5bc1 70 Handle(Graphic3d_AspectLine3d) myAspect;
71
42cf5bc1 72};
73
4e1bc39a 74DEFINE_STANDARD_HANDLE(Prs3d_LineAspect, Prs3d_BasicAspect)
42cf5bc1 75
76#endif // _Prs3d_LineAspect_HeaderFile