VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVirtualProgramCache.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
16 
17 #include <osg/ref_ptr>
18 
19 #include <boost/thread/mutex.hpp>
20 
21 #include <string>
22 #include <map>
23 
24 namespace osg
25 {
26  class StateSet;
27 }
28 namespace osgEarth
29 {
30  class VirtualProgram;
31 }
32 
33 namespace makVrv
34 {
35  class DtDe;
36 
40  {
41  public:
43  virtual ~DtVirtualProgramCache();
44 
46  static DtVirtualProgramCache& instance(DtDe& de);
47 
48  protected:
51 
52  private:
54  DtVirtualProgramCache() = delete;
55 
57  DtVirtualProgramCache(const DtVirtualProgramCache& rhs) = delete;
58 
60  DtVirtualProgramCache &operator=(const DtVirtualProgramCache& rhs) = delete;
61 
62  public:
66  virtual bool findAndSetOn(const std::string& strHash, osg::StateSet* stateSet);
67 
69  virtual void cache(const std::string& strHash, osgEarth::VirtualProgram* virtualProgram);
70 
71  protected:
73  virtual void slot_reloadShaders(void);
74 
76  virtual void clear();
77 
78  protected:
80  typedef std::map<std::string, VirtualProgramRef> StringVpMap;
81 
83 
85 
86  boost::mutex myMapMutex;
87 
89  };
90 
91 }
DtSignalConnectionManager myConnections
Definition: DtVirtualProgramCache.h:88
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
boost::mutex myMapMutex
Definition: DtVirtualProgramCache.h:86
StringVpMap myMapHashesToVirtualPrograms
Definition: DtVirtualProgramCache.h:82
class to hold a hashed map of strings to equivalent virtual programs to avoid repeated, duplicate creation of a virtual programs
Definition: DtVirtualProgramCache.h:39
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
Base class to provide boost signal/slot management.
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
DtDe & myDe
Definition: DtVirtualProgramCache.h:84
std::map< std::string, VirtualProgramRef > StringVpMap
Definition: DtVirtualProgramCache.h:80
osg::ref_ptr< osgEarth::VirtualProgram > VirtualProgramRef
Definition: DtVirtualProgramCache.h:79

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)