VR-Forces 4.3 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 
21 #include <string>
22 
23 
24 namespace makVrv
25 {
26 
30  {
31  public:
32 
33  DtOsgTexturizer( DtDe& de );
34 
38  virtual void drapeTexture(osg::Node* node, const std::string& definition, int textureunit = 0);
39 
43  virtual void drapeTexture(osg::Node* node, const std::string& definition,
44  std::vector<double> scale, std::vector<double> offset,
45  osg::TexEnv::Mode blendmode = osg::TexEnv::MODULATE,
46  osg::Texture::WrapMode wrapMode = osg::Texture::REPEAT, int textureunit = 0);
47 
52  virtual void colorizeByElevation(osg::Node* node,
53  const std::string& definition, int textureunit = 0);
54 
59  virtual void drawContours(osg::Node* node, const std::string& definition,
60  int textureunit = 0);
61 
68  virtual void enableAutoTexturing(osg::Node* node);
69 
72  virtual void blankMaterial(osg::Node* node, int minunit=0, int maxunit=3);
73 
75  virtual void defaultDrapeParameters(osg::Node* node,
76  const std::string& definition, double& xScale, double& yScale,
77  double& xOffset, double& yOffset, osg::Texture::WrapMode& wrapMode,
78  osg::TexEnv::Mode& blendMode);
79 
81  virtual void reset(osg::Node* node, int minunit=0, int maxunit=3);
82 
84  virtual void resetUnit(osg::Node* node, int unit);
85 
86  protected:
87 
88  //Create a gradient image.
89  osg::Image* createGradientImageRGBA(const std::string& def, int resolution = 256);
90 
92  virtual void graphBoundingBox(const osg::Node* node,
93  osg::BoundingBox &bbox) const;
94 
97  virtual void project2dTexture(osg::Node* node, const std::string& texdef,
98  osg::Matrix mat, osg::Texture::WrapMode wrapmode,
99  osg::TexEnv::Mode blendmode, unsigned int texunit);
100 
103  virtual void project1dTexture(osg::Node* node, const std::string& texdef,
104  osg::Matrix mat, osg::Texture::WrapMode wrapmode,
105  osg::TexEnv::Mode blendmode, unsigned int texunit);
106 
109  virtual void rescaleTexture(osg::Node* node, osg::Matrix mat,
110  osg::TexEnv::Mode blendmode, unsigned int texunit);
111 
114  virtual bool isNameTextureExempt(const std::string& name) const;
115 
117  virtual osg::Image* convertImageToRGBA(osg::Image* img);
118 
120  };
121 }
122 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)