From 3abe700dc856448fc07a14b5d1861840142b03b7 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 3 Nov 2009 12:41:00 +0100 Subject: [PATCH] Move the property expression code back to simgear. --- src/Scenery/scenery.cxx | 47 ----------------------------------------- 1 file changed, 47 deletions(-) diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx index 73c53733a..cfa0eb72a 100644 --- a/src/Scenery/scenery.cxx +++ b/src/Scenery/scenery.cxx @@ -33,9 +33,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -253,47 +250,3 @@ SceneryPager* FGScenery::getPagerSingleton() return pager.get(); } -// Effect initialization stuff - -class PropertyExpression : public SGExpression -{ -public: - PropertyExpression(SGPropertyNode* pnode) : _pnode(pnode) {} - - void eval(bool& value, const expression::Binding*) const - { - value = _pnode->getValue(); - } -protected: - SGPropertyNode_ptr _pnode; -}; - -class EffectPropertyListener : public SGPropertyChangeListener -{ -public: - EffectPropertyListener(Technique* tniq) : _tniq(tniq) {} - - void valueChanged(SGPropertyNode* node) - { - _tniq->refreshValidity(); - } -protected: - osg::ref_ptr _tniq; -}; - -Expression* propertyExpressionParser(const SGPropertyNode* exp, - expression::Parser* parser) -{ - SGPropertyNode_ptr pnode = fgGetNode(exp->getStringValue(), true); - PropertyExpression* pexp = new PropertyExpression(pnode); - TechniquePredParser* predParser - = dynamic_cast(parser); - if (predParser) - pnode->addChangeListener(new EffectPropertyListener(predParser - ->getTechnique())); - return pexp; -} - -expression::ExpParserRegistrar propertyRegistrar("property", - propertyExpressionParser); -