VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCdbEffectTextureUtils.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <string>
14 #include <map>
15 #include <vector>
16 
17 namespace osg
18 {
19  class Texture;
20 }
21 
22 namespace makVrv
23 {
25  {
26  //The bump map and normal map is the same in CDB, they are both tangent-space normal map
40  };
41 
43  {
45  bool isEffectTexture() const;
47  std::string effectTextureName;
48  };
49 
54  {
55  public:
60  DtCdbEffectTextureCode(int CS1, int CS2Min, int CS2Max);
61 
68  DtCdbEffectTextureCode(const std::string& effectSuffix);
69 
71  int CS1();
72 
74  int CS2Min();
75 
77  int CS2Max();
78 
80  bool isSupportedbyCdb();
81 
84  const std::string& effectTextureSuffix() const;
85 
89  bool match(const std::string& texName) const;
90  private:
91  int myCS1;
92  int myCS2Min;
93  int myCS2Max;
95  std::string myEffectTextureSuffix;
96  };
97 
99  {
100  public:
101  //check if the texture matches the CDBEffectTextureCode
102  static DtCdbEffectTextureTuple isEffectTexture(const osg::Texture* tex);
103 
104  static DtCdbEffectTextureTuple isEffectTexture(const std::string& textureFileName);
105 
106  private:
107  //EffectTextureType-->a list of the cdb effect texture code for backwards compatibility
108  typedef std::map<DtCdbEffectTextureType, std::vector<DtCdbEffectTextureCode> > DtCdbEffectTextureTypeCodeMap;
110  static DtCdbEffectTextureTypeCodeMap initEffectTextureTypeCodeMap();
111  };
112 }
std::map< DtCdbEffectTextureType, std::vector< DtCdbEffectTextureCode > > DtCdbEffectTextureTypeCodeMap
Definition: DtCdbEffectTextureUtils.h:108
std::string myEffectTextureSuffix
Definition: DtCdbEffectTextureUtils.h:95
Definition: DtCdbEffectTextureUtils.h:27
std::string effectTextureName
Definition: DtCdbEffectTextureUtils.h:47
DtCdbEffectTextureType effectTextureType
Definition: DtCdbEffectTextureUtils.h:46
Definition: DtCdbEffectTextureUtils.h:31
const std::string & effectTextureSuffix() const
Return the suffix of this effect texture, only applicable if it&#39;s not supported by CDB...
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
int myCS1
Definition: DtCdbEffectTextureUtils.h:91
Definition: DtCdbEffectTextureUtils.h:32
DtCdbEffectTextureType
Definition: DtCdbEffectTextureUtils.h:24
DtCdbEffectTextureCodeThe Component Selector for CDB Model Textures.
Definition: DtCdbEffectTextureUtils.h:53
int myCS2Min
Definition: DtCdbEffectTextureUtils.h:92
int myCS2Max
Definition: DtCdbEffectTextureUtils.h:93
Definition: DtCdbEffectTextureUtils.h:28
Definition: DtCdbEffectTextureUtils.h:33
Definition: DtCdbEffectTextureUtils.h:98
bool isSupportedbyCdb()
Return this effect texture is supported by CDB natively.
Definition: DtCdbEffectTextureUtils.h:38
Definition: DtCdbEffectTextureUtils.h:35
Definition: DtCdbEffectTextureUtils.h:39
int CS2Max()
Gets the upper bound of the texture index, represented by &quot;T&quot;.
int CS2Min()
Gets the lower bound of the texture index, represented by &quot;T&quot;.
Definition: DtCdbEffectTextureUtils.h:30
bool myIsSupportedByCdb
Definition: DtCdbEffectTextureUtils.h:94
Definition: DtCdbEffectTextureUtils.h:36
Definition: DtCdbEffectTextureUtils.h:42
Definition: DtCdbEffectTextureUtils.h:29
Contains DLL export macros.
DtCdbEffectTextureCode(int CS1, int CS2Min, int CS2Max)
CTOR.
bool match(const std::string &texName) const
Check if the texture name match the Component Selector. For the effect texture CDB supports...
static const DtCdbEffectTextureTypeCodeMap myEffectTextureTypeCodeMap
Definition: DtCdbEffectTextureUtils.h:109
int CS1()
Gets the texture kind, represented by &quot;S&quot;.
Definition: DtCdbEffectTextureUtils.h:37
Definition: DtCdbEffectTextureUtils.h:34

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)