Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2011-09-20
0002 // Created by: Sergey ZERCHANINOV
0003 // Copyright (c) 2011-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef OpenGl_LineAttributes_HeaderFile
0017 #define OpenGl_LineAttributes_HeaderFile
0018 
0019 #include <OpenGl_Resource.hxx>
0020 
0021 #include <Graphic3d_HatchStyle.hxx>
0022 #include <NCollection_DataMap.hxx>
0023 
0024 typedef NCollection_DataMap<Handle(Graphic3d_HatchStyle), unsigned int> OpenGl_MapOfHatchStylesAndIds;
0025 
0026 class OpenGl_Context;
0027 
0028 DEFINE_STANDARD_HANDLE(OpenGl_LineAttributes, OpenGl_Resource)
0029 
0030 //! Utility class to manage OpenGL resources of polygon hatching styles.
0031 //! @note the implementation is not supported by Core Profile and by ES version.
0032 class OpenGl_LineAttributes : public OpenGl_Resource
0033 {
0034   DEFINE_STANDARD_RTTIEXT(OpenGl_LineAttributes, OpenGl_Resource)
0035 public:
0036 
0037   //! Default constructor.
0038   Standard_EXPORT OpenGl_LineAttributes();
0039 
0040   //! Default destructor.
0041   Standard_EXPORT virtual ~OpenGl_LineAttributes();
0042 
0043   //! Release GL resources.
0044   Standard_EXPORT virtual void Release (OpenGl_Context* theGlCtx) Standard_OVERRIDE;
0045 
0046   //! Returns estimated GPU memory usage - not implemented.
0047   virtual Standard_Size EstimatedDataSize() const Standard_OVERRIDE { return 0; }
0048 
0049   //! Sets type of the hatch.
0050   Standard_EXPORT bool SetTypeOfHatch (const OpenGl_Context*               theGlCtx,
0051                                        const Handle(Graphic3d_HatchStyle)& theStyle);
0052 
0053 private:
0054 
0055   unsigned int init (const OpenGl_Context* theGlCtx,
0056                      const Handle(Graphic3d_HatchStyle)& theStyle);
0057 
0058 protected:
0059 
0060   OpenGl_MapOfHatchStylesAndIds myStyles; //!< Hatch patterns
0061 
0062 };
0063 
0064 #endif // _OpenGl_LineAttributes_Header