Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2021 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Graphic3d_GraphicDriverFactory_HeaderFile
0015 #define _Graphic3d_GraphicDriverFactory_HeaderFile
0016 
0017 #include <NCollection_List.hxx>
0018 #include <Standard_Type.hxx>
0019 #include <TCollection_AsciiString.hxx>
0020 
0021 class Aspect_DisplayConnection;
0022 class Graphic3d_GraphicDriver;
0023 class Graphic3d_GraphicDriverFactory;
0024 typedef NCollection_List<Handle(Graphic3d_GraphicDriverFactory)> Graphic3d_GraphicDriverFactoryList;
0025 
0026 //! This class for creation of Graphic3d_GraphicDriver.
0027 class Graphic3d_GraphicDriverFactory : public Standard_Transient
0028 {
0029   DEFINE_STANDARD_RTTIEXT(Graphic3d_GraphicDriverFactory, Standard_Transient)
0030 public:
0031 
0032   //! Registers factory.
0033   //! @param theFactory     [in] factory to register
0034   //! @param theIsPreferred [in] add to the beginning of the list when TRUE, or add to the end otherwise
0035   Standard_EXPORT static void RegisterFactory (const Handle(Graphic3d_GraphicDriverFactory)& theFactory,
0036                                                bool theIsPreferred = false);
0037 
0038   //! Unregisters factory.
0039   Standard_EXPORT static void UnregisterFactory (const TCollection_AsciiString& theName);
0040 
0041   //! Return default driver factory or NULL if no one was registered.
0042   Standard_EXPORT static Handle(Graphic3d_GraphicDriverFactory) DefaultDriverFactory();
0043 
0044   //! Return the global map of registered driver factories.
0045   Standard_EXPORT static const Graphic3d_GraphicDriverFactoryList& DriverFactories();
0046 
0047 public:
0048 
0049   //! Creates new empty graphic driver.
0050   virtual Handle(Graphic3d_GraphicDriver) CreateDriver (const Handle(Aspect_DisplayConnection)& theDisp) = 0;
0051 
0052   //! Return driver factory name.
0053   const TCollection_AsciiString& Name() const { return myName; }
0054 
0055 protected:
0056 
0057   //! Empty constructor.
0058   Standard_EXPORT Graphic3d_GraphicDriverFactory (const TCollection_AsciiString& theName);
0059 
0060 protected:
0061 
0062   TCollection_AsciiString myName;
0063 
0064 };
0065 
0066 #endif // _Graphic3d_GraphicDriverFactory_HeaderFile