VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgTextureWrapper.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 #include <vrvCore/DtFileCache.h>
17 
18 #include <osg/Texture>
19 
20 namespace makVrv
21 {
22  class DtOsgFileCache;
25  {
26  public:
28  DtOsgTextureWrapper( DtDe&, osg::Texture* node );
29 
31  virtual ~DtOsgTextureWrapper();
32 
34  DtOsgTextureWrapper() = delete;
35 
37  DtOsgTextureWrapper( const DtOsgTextureWrapper& ) = delete;
38 
40  DtOsgTextureWrapper& operator=( const DtOsgTextureWrapper& ) = delete;
41 
42  public:
46  virtual bool loadTextureFromFile( const std::string& fileName ) override;
47  virtual bool loadTextureFromFile( const std::string& fileName,
48  const DtFileCache::LoadFileOptions& loadFileOptions ) override;
49 
52  virtual void setTexture( const std::string fileName, osg::Texture* texture );
53  virtual osg::Texture* texture() const;
55 
56 
58  virtual bool getStipplePattern(char** stipplePattern) override;
59 
61  virtual bool valid() const override;
62 
63  virtual void releaseGLObjects();
64 
65  virtual void setMinFilter( osg::Texture::FilterMode );
66  virtual osg::Texture::FilterMode minFilter();
67  virtual void setMagFilter( osg::Texture::FilterMode );
68  virtual osg::Texture::FilterMode magFilter();
69  virtual void setWrapModeS( osg::Texture::WrapMode );
70  virtual osg::Texture::WrapMode wrapModeS();
71  virtual void setWrapModeT( osg::Texture::WrapMode );
72  virtual osg::Texture::WrapMode wrapModeT();
73 
75  virtual bool loadTexture( const std::string& filename,
76  osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter,
77  osg::Texture::WrapMode s, osg::Texture::WrapMode t,
78  const DtFileCache::LoadFileOptions& loadFileOptions );
79 
80  virtual float textureWidth() const override;
81  virtual const std::string& filename() const override;
82 
83  virtual void scaleTexture( int w, int h ) override;
84 
86  virtual DtVector4<float> color(unsigned int x, unsigned int y) const override;
87  protected:
90 
91  std::string myFilename;
93  osg::Texture::FilterMode myMinFilter;
95  osg::Texture::FilterMode myMagFilter;
97  osg::Texture::WrapMode myWrapModeS;
99  osg::Texture::WrapMode myWrapModeT;
100 
102 
104  };
105 
107  {
108  // Override to create a DtOsgTextureWrapper
109  virtual DtTextureInterface* create( DtDe& de ) override;
110  };
111 }
Definition: DtTextureInterface.h:66
DtOsgFileCache * myOsgFileCache
Definition: DtOsgTextureWrapper.h:89
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
const char * filename
Definition: ioapi.h:38
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtTextureInterface.h:24
osg::Texture::FilterMode myMagFilter
Default LINEAR.
Definition: DtOsgTextureWrapper.h:95
Contains makVrv::DtTextureInterface class.
Contains makVrv::DtFileCache class.
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:56
Definition: DtOsgTextureWrapper.h:106
DtDe & myDe
Definition: DtOsgTextureWrapper.h:88
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOsgTextureWrapper.h:101
DtSignalConnectionManager myConnectionManager
Definition: DtOsgTextureWrapper.h:103
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
Definition: DtFileCache.h:45
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtOsgTextureWrapper.h:24
osg::Texture::FilterMode myMinFilter
Default NEAREST.
Definition: DtOsgTextureWrapper.h:93
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:76
osg::Texture::WrapMode myWrapModeT
Default REPEAT.
Definition: DtOsgTextureWrapper.h:99
std::string myFilename
Definition: DtOsgTextureWrapper.h:91
osg::Texture::WrapMode myWrapModeS
Default REPEAT.
Definition: DtOsgTextureWrapper.h:97

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)