VR-Forces 4.3.1 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 <vrvCore/DtDe.h>
14 
15 #include <osg/Node>
16 #include <osg/BoundingBox>
17 #include <osg/Matrix>
18 #include <osg/Texture>
19 #include <osg/TexEnv>
20 #include <osgDB/WriteFile>
21 
22 #include <string>
23 
24 
25 namespace makVrv
26 {
27 
31  {
32  public:
33 
34  DtOsgTexturizer( DtDe& de );
35 
39  virtual void drapeTexture(osg::Node* node, const std::string& definition, int textureunit = 0);
40 
44  virtual void drapeTexture(osg::Node* node, const std::string& definition,
45  std::vector<double> scale, std::vector<double> offset,
46  osg::TexEnv::Mode blendmode = osg::TexEnv::MODULATE,
47  osg::Texture::WrapMode wrapMode = osg::Texture::REPEAT, int textureunit = 0);
48 
53  virtual void colorizeByElevation(osg::Node* node,
54  const std::string& definition, int textureunit = 0);
55 
60  virtual void drawContours(osg::Node* node, const std::string& definition,
61  int textureunit = 0);
62 
69  virtual void enableAutoTexturing(osg::Node* node);
70 
73  virtual void blankMaterial(osg::Node* node, int minunit=0, int maxunit=3);
74 
76  virtual void defaultDrapeParameters(osg::Node* node,
77  const std::string& definition, double& xScale, double& yScale,
78  double& xOffset, double& yOffset, osg::Texture::WrapMode& wrapMode,
79  osg::TexEnv::Mode& blendMode);
80 
82  virtual void reset(osg::Node* node, int minunit=0, int maxunit=3);
83 
85  virtual void resetUnit(osg::Node* node, int unit);
86 
87  protected:
88 
89  //Create a gradient image.
90  osg::Image* createGradientImageRGBA(const std::string& def, int resolution = 256);
91 
93  virtual void graphBoundingBox(const osg::Node* node,
94  osg::BoundingBox &bbox) const;
95 
98  virtual void project2dTexture(osg::Node* node, const std::string& texdef,
99  osg::Matrix mat, osg::Texture::WrapMode wrapmode,
100  osg::TexEnv::Mode blendmode, unsigned int texunit);
101 
104  virtual osgDB::ReaderWriter::Options* setupTerrainReadImageOptions();
105 
108  virtual void project1dTexture(osg::Node* node, const std::string& texdef,
109  osg::Matrix mat, osg::Texture::WrapMode wrapmode,
110  osg::TexEnv::Mode blendmode, unsigned int texunit);
111 
114  virtual void rescaleTexture(osg::Node* node, osg::Matrix mat,
115  osg::TexEnv::Mode blendmode, unsigned int texunit);
116 
119  virtual bool isNameTextureExempt(const std::string& name) const;
120 
122  virtual osg::Image* convertImageToRGBA(osg::Image* img);
123 
125  };
126 }
127 

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)