VR-Forces 5.0.2 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
38  };
39 
41  {
43  bool isEffectTexture() const;
45  std::string effectTextureName;
46  };
47 
52  {
53  public:
58  DtCdbEffectTextureCode(int CS1, int CS2Min, int CS2Max);
59 
66  DtCdbEffectTextureCode(const std::string& effectSuffix);
67 
69  int CS1();
70 
72  int CS2Min();
73 
75  int CS2Max();
76 
78  bool isSupportedbyCdb();
79 
82  const std::string& effectTextureSuffix() const;
83 
87  bool match(const std::string& texName) const;
88  private:
89  int myCS1;
90  int myCS2Min;
91  int myCS2Max;
93  std::string myEffectTextureSuffix;
94  };
95 
97  {
98  public:
99  //check if the texture matches the CDBEffectTextureCode
100  static DtCdbEffectTextureTuple isEffectTexture(const osg::Texture* tex);
101 
102  static DtCdbEffectTextureTuple isEffectTexture(const std::string& textureFileName);
103 
104  private:
105  //EffectTextureType-->a list of the cdb effect texture code for backwards compatibility
106  typedef std::map<DtCdbEffectTextureType, std::vector<DtCdbEffectTextureCode> > DtCdbEffectTextureTypeCodeMap;
108  static DtCdbEffectTextureTypeCodeMap initEffectTextureTypeCodeMap();
109  };
110 }
std::map< DtCdbEffectTextureType, std::vector< DtCdbEffectTextureCode > > DtCdbEffectTextureTypeCodeMap
Definition: DtCdbEffectTextureUtils.h:106
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
std::string myEffectTextureSuffix
Definition: DtCdbEffectTextureUtils.h:93
Definition: DtCdbEffectTextureUtils.h:27
std::string effectTextureName
Definition: DtCdbEffectTextureUtils.h:45
DtCdbEffectTextureType effectTextureType
Definition: DtCdbEffectTextureUtils.h:44
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:89
Definition: DtCdbEffectTextureUtils.h:32
DtCdbEffectTextureType
Definition: DtCdbEffectTextureUtils.h:24
DtCdbEffectTextureCodeThe Component Selector for CDB Model Textures.
Definition: DtCdbEffectTextureUtils.h:51
int myCS2Min
Definition: DtCdbEffectTextureUtils.h:90
int myCS2Max
Definition: DtCdbEffectTextureUtils.h:91
Definition: DtCdbEffectTextureUtils.h:28
Definition: DtCdbEffectTextureUtils.h:33
Definition: DtCdbEffectTextureUtils.h:96
bool isSupportedbyCdb()
Return this effect texture is supported by CDB natively.
Definition: DtCdbEffectTextureUtils.h:36
Definition: DtCdbEffectTextureUtils.h:35
Definition: DtCdbEffectTextureUtils.h:37
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:92
Definition: DtCdbEffectTextureUtils.h:40
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:107
int CS1()
Gets the texture kind, represented by &quot;S&quot;.
Definition: DtCdbEffectTextureUtils.h:34

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)