26 #include <osg/Referenced>
28 #include <osg/Texture2D>
29 #include <osg/MatrixTransform>
30 #include <osg/Projection>
31 #include <osg/StateSet>
32 #include <osg/PositionAttitudeTransform>
34 #include <osg/Material>
35 #include <osgShadow/ShadowedScene>
36 #include <osgShadow/ShadowTechnique>
37 #include <osg/LightSource>
38 #include <osg/Geometry>
72 SceneDecorator(
int windowSizeX,
int windowSizeY,
int enabledLights = LIGHT0 | LIGHT1 );
75 void setEnableShadows(
bool flag );
78 bool getEnableShadows()
const;
81 void setEnable(
bool flag );
84 bool getEnable()
const;
87 bool isEnabled()
const;
102 void setLogoLocation( LogoLocation l );
105 LogoLocation getLogoLocation()
const;
111 void setLogoPosition(
float x,
float y);
114 void setEnableLogo(
bool flag );
117 bool getEnableLogo()
const;
120 bool setLogoFile(
const std::string& filename,
float density = 1.0);
129 void setEnableShaderState(
bool flag,
bool lock=
false );
132 bool getEnableShaderState( )
const;
140 bool setBaseTexture(
const std::string& imagePath);
156 void setMaximumLogoDimension(
float x,
float y);
161 static osg::Vec2 getDefaultLogoPosition();
169 osg::MatrixTransform*
getHud() {
return m_hudRoot.get(); }
172 virtual bool insertChild(
unsigned int index, osg::Node *child ) {
return m_currentRoot->insertChild(index, child); }
173 virtual bool addChild(osg::Node *child) {
return m_currentRoot->addChild(child); }
174 inline bool removeChild( osg::Node *child ) {
return m_currentRoot->removeChild(child); }
175 inline bool removeChild(
unsigned int pos,
unsigned int numChildrenToRemove=1 ) {
return m_currentRoot->removeChild(pos, numChildrenToRemove); }
176 virtual bool replaceChild( osg::Node *origChild, osg::Node* newChild ) {
return m_currentRoot->replaceChild(origChild, newChild); }
177 virtual bool setChild(
unsigned int i, osg::Node* node ) {
return m_currentRoot->setChild(i, node); }
178 virtual bool removeChildren(
unsigned int pos,
unsigned int numChildrenToRemove) {
return m_currentRoot->removeChildren(pos, numChildrenToRemove); }
184 void calculateLightPositions(osg::Node* bound_node =
nullptr);
186 void calculateLightPositions(
const osg::BoundingBox& boundingBox );
188 void calculateLightPositions(
const osg::BoundingSphere& boundingSphere );
191 std::string getFontName()
const;
194 void setFontName(
const std::string& fontName);
197 void updateWindowSize(
int sizeX,
int sizeY);
200 void setScreenPixelScale(
float scale);
203 float getFontSize()
const;
206 void setFontSize(
const float& fontSize);
209 osg::LightSource* getShadowLightSource();
215 ALL = LIGHT0 | LIGHT1 | LIGHT2
219 static size_t lightToIndex(Lights l);
221 void setEnableCalculateLightPositions( Lights l,
bool f );
223 bool getEnableCalculateLightPositions(Lights l)
const;
226 bool setShadowLightSource( Lights l);
230 osg::LightSource* getOSGLight(Lights l);
246 void setShadowMethod(ShadowMethod m);
252 void setBackgroundColor(
const agx::Vec4f& color);
272 void setBackgroundColor(
agx::Vec3 color);
294 void setEnableLights(
int lightMask = ALL);
300 void setEnableRenderedCursor(
bool enable );
301 bool getEnableRenderedCursor()
const;
302 void updateCursorPosition(
float x,
float y );
304 osg::Texture2D* getLogo();
307 void setLogo(osg::Texture2D* logo,
float density = 1.0);
315 osg::Group* getShadowedScene()
const;
320 osg::Group* getNonShadowedScene()
const;
322 static const osg::Material* getDefaultDecoratorMaterial();
332 void createBackground();
375 void createDecoratorState();
379 bool m_calculateLightPosition[3];