24 #include <osgDB/ReaderWriter>
28 #include <tbb/spin_rw_mutex.h>
31 #include <unordered_map>
36 class GraphicsContext;
44 class DtMeifConverter;
45 class DtMetaFileManager;
46 class DtOsgShaderManager;
47 class DtOsgShaderFilesCache;
48 class DtEffectControllerFactory;
49 class DtReadFileCallback;
50 class DtModelDefinition;
69 virtual void initSingletonDependencies();
78 virtual void releaseResources(osg::State* state);
86 static void optimizeNodeGeometry(osg::Node* node);
91 osg::Node* readNodeFile(
const std::string& inputFilename,
92 const LoadFileOptions& loadFileOptions);
98 return ts_findNodeFile(inputFilename);
104 osg::Image* readImageFile(
const std::string& inputFilename,
105 const LoadFileOptions& loadFileOptions);
109 virtual osg::Texture* getTextureInstance(
const std::string& filePath,
110 osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter,
111 osg::Texture::WrapMode s, osg::Texture::WrapMode t,
112 const LoadFileOptions& loadFileOptions);
117 virtual void ts_getTextureInstance(
const std::string& filePath,
118 osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter,
119 osg::Texture::WrapMode s, osg::Texture::WrapMode t,
130 virtual void runMergeDuplicateTextureVisitor(osg::Node& node);
133 virtual void encodeOptionsString(
const LoadFileOptions& loadFileOptions,
134 osgDB::ReaderWriter::Options& options)
const;
137 virtual void decodeOptions(
const osgDB::ReaderWriter::Options& options,
138 LoadFileOptions& loadFileOptions)
const;
146 void cleanDataFilePathList(FilePathList& fileList);
152 boost::signalslib::signal<void (osg::Node*,
const std::string& origFileName,
159 boost::signalslib::signal<void (
osg::Image*,
const std::string& origFileName,
166 boost::signalslib::signal<void(osg::Object*,
const std::string& origFileName,
172 boost::signalslib::signal<void (
const std::string&
filename,
173 osgDB::ReaderWriter::ReadResult&,
const osgDB::ReaderWriter::Options*)>
179 boost::signalslib::signal<void (
const std::string&
filename,
180 osgDB::ReaderWriter::ReadResult&,
const osgDB::ReaderWriter::Options*)>
186 boost::signalslib::signal<void(
const std::string&
filename,
187 osgDB::ReaderWriter::ReadResult&,
const osgDB::ReaderWriter::Options*)>
196 virtual const std::string& loadShaderSource(
const std::string& shaderFile)
const;
200 virtual std::string ts_getTextureFilePathAndSetNameIfNotSet(
const osg::Texture* baseTexture)
const;
206 virtual void ts_setEffectTextureFilterAndHardwareMipMapGen(osg::Texture* effectTexture, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter,
bool hardwareMipMapGen)
const;
209 virtual void ts_compareAndSwapIgnoreHint(osg::Texture* effectTexture,
bool oldVal,
bool newVal)
const;
215 virtual bool ts_checkAndSetIgnoreHint(osg::Object* obj,
bool val,
const char* hint)
const;
219 virtual bool ts_ignore(osg::Object* obj,
const char* hint)
const;
225 virtual void setNumActivePagerThreads(
int active);
228 virtual int numActivePagerThreads()
const;
231 virtual int numImageProcessingTasks()
const;
234 virtual void setNumDiguyWorkerThreads(
int num);
238 virtual void incrementNumSleepingPagerThreads();
241 virtual void decrementNumSleepingPagerThreads();
250 virtual void ts_flushInstancingCache(
bool multipass,
251 bool flushNodes,
bool flushTextures,
bool flushImages);
254 virtual int numNodes()
const;
257 virtual int numTextures()
const;
260 virtual int numImages()
const;
267 const LoadFileOptions& loadFileOptions,
const osg::UserDataContainer *optionsUserData);
271 const LoadFileOptions& loadFileOptions,
const osg::UserDataContainer *optionsUserData);
279 const osg::UserDataContainer* optionsUserData =0L);
284 const osg::UserDataContainer* optionsUserData = 0L);
288 const std::string&
filename,
const osgDB::ReaderWriter::Options* options);
291 void ts_encryptImage(
const std::string& inputFileName,
292 const std::string& outputFilename,
const osgDB::ReaderWriter::Options* options,
bool printToConsole);
295 bool ts_resolveRelativeFilename(
const LoadFileOptions& loadFileOptions,
296 std::string& absoluteInputFilename );
299 virtual void ts_clearInstancingCache();
303 virtual void applyEffectTexture(osg::Node* node,
const std::string& extension,
304 bool isCdb, osgDB::ReaderWriter::Options* option);
311 virtual bool save(
const std::string& origFilename,
312 const std::string& cachedFilename,
bool optimize);
315 bool saveToAcceleratedFile(
const std::string& origFileName,
316 osg::Node* nodeRef,
const std::string& cachedFilename,
317 bool writeExternalReferences);
320 virtual void addMetaFlightOptions(std::string& optionsString);
323 virtual bool needsShaderGeneration(
const std::string& extension,
const LoadFileOptions& options)
const;
326 virtual void updateGlobalOptions();
329 virtual void slot_onDdsFlipChanged(
bool flip);
332 virtual void slot_instancingChanged(
bool enabled);
335 virtual bool getAttrFromLocalCache(
const std::string&
filename, osg::Object** attrData);
345 virtual void squishImage(
const std::string& fileToLoad,
const std::string& acceleratedFilename,
DtCVMarkerSeries& objectCreation,
352 virtual void saveImageFilename(
const std::string& absoluteInputFilename,
osg::Image* image);
364 typedef std::map< std::string, osg::ref_ptr<osg::Object> >
AttrCacheMap;
411 #include <vrvOsg/DtOsgReferencedCollection.inl>
tbb::spin_rw_mutex myRelativePathMutex
Definition: DtOsgFileCache.h:367
RelativePathCache myRelativePathCache
Definition: DtOsgFileCache.h:368
Contains makVrv::DtTextureCollection class.
virtual void releaseResources()
Release all rendering resources.
Definition: DtOsgFileCache.h:72
std::map< std::string, osg::ref_ptr< osg::Object > > AttrCacheMap
Definition: DtOsgFileCache.h:364
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Class responsible for converting images into MAK encrypted image files.
Definition: DtMeifConverter.h:25
AttrCacheMap myAttrCacheMap
Definition: DtOsgFileCache.h:365
DtOsgReferencedCollection< osg::Node > myNodeCollection
Definition: DtOsgFileCache.h:361
Creates a series/span line in the CV tool.
Definition: DtConcurrencyViewerMacros.h:27
The abstract creator for the abstract DtFileCache class.
Definition: DtFileCache.h:266
brief DtEffectControllerShaderCache is a cache for shaders used by effect texture controller ...
Definition: DtEffectControllerShaderCache.h:26
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtTextureInterface.h:24
osg::ref_ptr< osg::Node > findNodeFile(const std::string &inputFilename)
Find a node file. If the file was already cached then a copy will be returned.
Definition: DtOsgFileCache.h:96
class for holding loader shader files, so that they are not repeatedly loaded from disk ...
Definition: DtOsgShaderFilesCache.h:27
boost::signalslib::signal< void(const std::string &filename, osgDB::ReaderWriter::ReadResult &, const osgDB::ReaderWriter::Options *)> signal_readObjectCallback
Signaled emitted when osg calls readObject. This signal is emitted every time read object is called r...
Definition: DtOsgFileCache.h:188
The DtOsgFileCache creator..
Definition: DtOsgFileCache.h:399
boost::signalslib::signal< void(const std::string &filename, osgDB::ReaderWriter::ReadResult &, const osgDB::ReaderWriter::Options *)> signal_readNodeCallback
Signaled emitted when osg calls readNodeFile. This signal is emitted every time read image is called ...
Definition: DtOsgFileCache.h:174
int myNumActivePagerThreads
Definition: DtOsgFileCache.h:383
std::atomic< int > myNumDiguyWorkerThreads
Definition: DtOsgFileCache.h:385
Contains makVrv::DtFileCache class.
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive's for quicker load ti...
Definition: DtOsgFileCache.h:56
DtOsgReferencedCollection< osg::Image > myImageCollection
Definition: DtOsgFileCache.h:363
boost::signalslib::signal< void(const std::string &filename, osgDB::ReaderWriter::ReadResult &, const osgDB::ReaderWriter::Options *)> signal_readImageCallback
Signaled emitted when osg calls readImageFile. This signal is emitted every time read image is called...
Definition: DtOsgFileCache.h:181
std::atomic< int > myNumSleepingPagerThreads
Definition: DtOsgFileCache.h:384
osgDB::ReaderWriter * myFltCdbDriver
Definition: DtOsgFileCache.h:389
osgDB::ReaderWriter * myFltDriver
Definition: DtOsgFileCache.h:388
Contains the DtEffectControllerShaderCache class declaration.
DtOsgShaderManager & myShaderManager
Definition: DtOsgFileCache.h:372
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
boost::signalslib::signal< void(osg::Node *, const std::string &origFileName, const std::string &actualFileName)> signal_nodeFileLoaded
Signal emitted whenever a Node file is loaded from disk. When instancing is enabled then each file wi...
Definition: DtOsgFileCache.h:153
DtOsgShaderFilesCache & myShaderFilesCache
Definition: DtOsgFileCache.h:373
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtEffectControllerShaderCache myEffectControllerShaderCache
Definition: DtOsgFileCache.h:377
DtMetaFileManager * myMetaFileManager
Definition: DtOsgFileCache.h:370
Definition: DtFileCache.h:45
osg::ref_ptr< DtReadFileCallback > myReadFileCallback
Definition: DtOsgFileCache.h:379
DtOsgShaderManager injects custom shaders into the scenes, and keeps their uniform parameters set to ...
Definition: DtOsgShaderManager.h:41
Record for the settings associated with the VRV caching.
Definition: DtCacheSettingsRecord.h:17
Definition: DtReadFileCallback.h:22
DtEffectControllerFactory & myEffectControllerFactory
Definition: DtOsgFileCache.h:374
boost::signalslib::signal< void(osg::Image *, const std::string &origFileName, const std::string &actualFileName)> signal_imageFileLoaded
Signal emitted whenever an image file is loaded from disk. When instancing is enabled then each file ...
Definition: DtOsgFileCache.h:160
The scene object creators are registered with the scene object factory for accessing DtSceneObjectCre...
Definition: DtEffectControllerFactory.h:31
DtMeifConverter * myImageCompressor
Definition: DtOsgFileCache.h:369
osgDB::ReaderWriter * myMedfDriver
Definition: DtOsgFileCache.h:390
Contains DLL export macros.
osgDB::ReaderWriter * myRgbDriver
Definition: DtOsgFileCache.h:392
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
boost::signalslib::signal< void(osg::Object *, const std::string &origFileName, const std::string &actualFileName)> signal_objectFileLoaded
Signal emitted whenever an object file is loaded from disk. When instancing is enabled then each file...
Definition: DtOsgFileCache.h:167
osgDB::ReaderWriter * myMeifDriver
Definition: DtOsgFileCache.h:393
Contains makVrv::DtOsgReferencedCollection class.
Contains the DtCVMarkerSeries and DtCVMarkerSeries class declarations responsible for wrapping up to ...
Handles the caching of files. Includes functions for excluding files with certain extensions from bei...
Definition: DtFileCache.h:37
DtOsgReferencedCollection< DtTextureCollection > myTextureCollection
Definition: DtOsgFileCache.h:362
DtSignalConnectionManager myConnections
Definition: DtOsgFileCache.h:380
osgDB::ReaderWriter * myCDBZipDriver
Definition: DtOsgFileCache.h:394
Contains the DtEffectControllerContainer class.
std::unordered_map< std::string, std::string > RelativePathCache
Definition: DtOsgFileCache.h:359