Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:40

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_ShadingAspect_HeaderFile
0018 #define _Prs3d_ShadingAspect_HeaderFile
0019 
0020 #include <Aspect_TypeOfFacingModel.hxx>
0021 #include <Graphic3d_AspectFillArea3d.hxx>
0022 #include <Graphic3d_MaterialAspect.hxx>
0023 #include <Prs3d_BasicAspect.hxx>
0024 
0025 //! A framework to define the display of shading.
0026 //! The attributes which make up this definition include:
0027 //! -   fill aspect
0028 //! -   color, and
0029 //! -   material
0030 class Prs3d_ShadingAspect : public Prs3d_BasicAspect
0031 {
0032   DEFINE_STANDARD_RTTIEXT(Prs3d_ShadingAspect, Prs3d_BasicAspect)
0033 public:
0034 
0035   //! Constructs an empty framework to display shading.
0036   Standard_EXPORT Prs3d_ShadingAspect();
0037 
0038   //! Constructor with initialization.
0039   Prs3d_ShadingAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) : myAspect (theAspect) {}
0040   
0041   //! Change the polygons interior color and material ambient color.
0042   Standard_EXPORT void SetColor (const Quantity_Color& aColor, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
0043 
0044   //! Change the polygons material aspect.
0045   Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
0046 
0047   //! Change the polygons transparency value.
0048   //! Warning : aValue must be in the range 0,1. 0 is the default (NO transparent)
0049   Standard_EXPORT void SetTransparency (const Standard_Real aValue, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
0050   
0051   //! Returns the polygons color.
0052   Standard_EXPORT const Quantity_Color& Color (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
0053   
0054   //! Returns the polygons material aspect.
0055   Standard_EXPORT const Graphic3d_MaterialAspect& Material (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
0056   
0057   //! Returns the polygons transparency value.
0058   Standard_EXPORT Standard_Real Transparency (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
0059   
0060   //! Returns the polygons aspect properties.
0061   const Handle(Graphic3d_AspectFillArea3d)& Aspect() const { return myAspect; }
0062 
0063   void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myAspect = theAspect; }
0064 
0065   //! Dumps the content of me into the stream
0066   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0067 
0068 protected:
0069 
0070   Handle(Graphic3d_AspectFillArea3d) myAspect;
0071 
0072 };
0073 
0074 DEFINE_STANDARD_HANDLE(Prs3d_ShadingAspect, Prs3d_BasicAspect)
0075 
0076 #endif // _Prs3d_ShadingAspect_HeaderFile