Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Prs3d_LineAspect.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1993-04-26
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Prs3d_LineAspect_HeaderFile
0018 #define _Prs3d_LineAspect_HeaderFile
0019 
0020 #include <Graphic3d_AspectLine3d.hxx>
0021 #include <Prs3d_BasicAspect.hxx>
0022 #include <Quantity_Color.hxx>
0023 
0024 //! A framework for defining how a line will be displayed
0025 //! in a presentation. Aspects of line display include
0026 //! width, color and type of line.
0027 //! The definition set by this class is then passed to the
0028 //! attribute manager Prs3d_Drawer.
0029 //! Any object which requires a value for line aspect as
0030 //! an argument may then be given the attribute manager
0031 //! as a substitute argument in the form of a field such as myDrawer for example.
0032 class Prs3d_LineAspect : public Prs3d_BasicAspect
0033 {
0034   DEFINE_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
0035 public:
0036   //! Constructs a framework for line aspect defined by
0037   //! -   the color aColor
0038   //! -   the type of line aType and
0039   //! -   the line thickness aWidth.
0040   //! Type of line refers to whether the line is solid or dotted, for example.
0041   Standard_EXPORT Prs3d_LineAspect(const Quantity_Color&   theColor,
0042                                    const Aspect_TypeOfLine theType,
0043                                    const double            theWidth);
0044 
0045   Prs3d_LineAspect(const occ::handle<Graphic3d_AspectLine3d>& theAspect)
0046       : myAspect(theAspect)
0047   {
0048   }
0049 
0050   //! Sets the line color defined at the time of construction.
0051   //! Default value: Quantity_NOC_YELLOW
0052   void SetColor(const Quantity_Color& theColor) { myAspect->SetColor(theColor); }
0053 
0054   //! Sets the type of line defined at the time of construction.
0055   //! This could, for example, be solid, dotted or made up of dashes.
0056   //! Default value: Aspect_TOL_SOLID
0057   void SetTypeOfLine(const Aspect_TypeOfLine theType) { myAspect->SetType(theType); }
0058 
0059   //! Sets the line width defined at the time of construction.
0060   //! Default value: 1.
0061   void SetWidth(const double theWidth) { myAspect->SetWidth(theWidth); }
0062 
0063   //! Returns the line aspect. This is defined as the set of
0064   //! color, type and thickness attributes.
0065   const occ::handle<Graphic3d_AspectLine3d>& Aspect() const { return myAspect; }
0066 
0067   void SetAspect(const occ::handle<Graphic3d_AspectLine3d>& theAspect) { myAspect = theAspect; }
0068 
0069   //! Dumps the content of me into the stream
0070   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0071 
0072 protected:
0073   occ::handle<Graphic3d_AspectLine3d> myAspect;
0074 };
0075 
0076 #endif // _Prs3d_LineAspect_HeaderFile