VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOsgTexturizer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <osg/Matrix>
14 #include <osg/BoundingBox>
15 #include <osg/Texture>
16 #include <osg/TexEnv>
17 #include <osgDB/ReaderWriter>
18 
19 namespace osg
20 {
21  class Node;
22  class Image;
23 }
24 
25 namespace makVrv
26 {
27  class DtDe;
28 
32  {
33  public:
34 
35  DtOsgTexturizer( DtDe& de );
36 
40  virtual void drapeTexture(osg::Node* node, const std::string& definition, int textureunit = 0);
41 
45  virtual void drapeTexture(osg::Node* node, const std::string& definition,
46  std::vector<double> scale, std::vector<double> offset,
47  osg::TexEnv::Mode blendmode = osg::TexEnv::MODULATE,
48  osg::Texture::WrapMode wrapMode = osg::Texture::REPEAT, int textureunit = 0);
49 
54  virtual void colorizeByElevation(osg::Node* node,
55  const std::string& definition, int textureunit = 0);
56 
61  virtual void drawContours(osg::Node* node, const std::string& definition,
62  int textureunit = 0);
63 
70  virtual void enableAutoTexturing(osg::Node* node);
71 
74  virtual void blankMaterial(osg::Node* node, int minunit=0, int maxunit=3);
75 
77  virtual void defaultDrapeParameters(osg::Node* node,
78  const std::string& definition, double& xScale, double& yScale,
79  double& xOffset, double& yOffset, osg::Texture::WrapMode& wrapMode,
80  osg::TexEnv::Mode& blendMode);
81 
83  virtual void reset(osg::Node* node, int minunit=0, int maxunit=3);
84 
86  virtual void resetUnit(osg::Node* node, int unit);
87 
88  protected:
89 
90  //Create a gradient image.
91  osg::Image* createGradientImageRGBA(const std::string& def, int resolution = 256);
92 
94  virtual void graphBoundingBox(const osg::Node* node,
95  osg::BoundingBox &bbox) const;
96 
99  virtual void project2dTexture(osg::Node* node, const std::string& texdef,
100  osg::Matrix mat, osg::Texture::WrapMode wrapmode,
101  osg::TexEnv::Mode blendmode, unsigned int texunit);
102 
105  virtual osgDB::ReaderWriter::Options* setupTerrainReadImageOptions();
106 
109  virtual void project1dTexture(osg::Node* node, const std::string& texdef,
110  osg::Matrix mat, osg::Texture::WrapMode wrapmode,
111  osg::TexEnv::Mode blendmode, unsigned int texunit);
112 
115  virtual void rescaleTexture(osg::Node* node, osg::Matrix mat,
116  osg::TexEnv::Mode blendmode, unsigned int texunit);
117 
120  virtual bool isNameTextureExempt(const std::string& name) const;
121 
123  virtual osg::Image* convertImageToRGBA(osg::Image* img);
124 
126  };
127 }
128 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)