Hi all,

I have a very simple question about “
inheritance”,  If I define a root with some StateSet features and then some “bins”(then are added to the root) with some others features… Those bin have the  features defined exactly to it or those and the roots features?..

Example:

///////////////////////////////////////////////////////////////////////////////////////////////////////

osg::MatrixTransform* rootNode =
new osg::MatrixTransform;
osg::StateSet* rootStateSet =
new osg::StateSet();
rootStateSet->FEATURE1;

rootStateSet->FEATURE2;

rootStateSet->FEATURE3;

rootNode->setStateSet(rootStateSet);


osg::MatrixTransform* dcs1 =
new osg::MatrixTransform;
osg::StateSet* modelStateSet1 =
new osg::StateSet();
modelStateSet1 ->FEATURE4;

modelStateSet1 ->FEATURE5;

modelStateSet1 ->FEATURE6;


dcs1->setStateSet(modelStateSet1);

rootNode->addChild(dcs1);


rootStateSet->FEATURE7;

rootStateSet->FEATURE8;

rootStateSet->FEATURE9;

rootNode->setStateSet(rootStateSet);


osg::MatrixTransform* dcs2 =
new osg::MatrixTransform;
osg::StateSet* modelStateSet2 =
new osg::StateSet();
modelStateSet2 ->FEATURE10;

modelStateSet2 ->FEATURE11;

modelStateSet2 ->FEATURE12;


dcs2->setStateSet(modelStateSet2);

rootNode->addChild(dcs2);



rootStateSet->FEATURE13;

rootStateSet->FEATURE14;

rootStateSet->FEATURE15;

rootNode->setStateSet(rootStateSet);



//////////////////////////////////////////////////////////////



At the end, Question1 :


rootNode had the features: FEATURE1, FEATURE2, FEATURE3, FEATURE7, FEATURE8, FEATURE9, FEATURE13, FEATURE14, FEATURE15


dcs1: FEATURE1 FEATURE2, FEATURE3, FEATURE4, FEATURE5, FEATURE6


dcs2: FEATURE1, FEATURE2, FEATURE3, FEATURE7, FEATURE8, FEATURE9, FEATURE10, FEATURE11, FEATURE12


..Correct???

Question2:  If I do NOT add any child to the rootnode in the last step( when I add the features13,14,15) do they have effect?


Thanks for all,

Maria.

_____________________________________
María Aróstegui.
Unidad de Siderurgia -- Steel Unit
LABEIN  - Tecnalia



C/Geldo - Parque Tecnológico de Bizkaia
Edifico 700
48160-Derio


Email: [EMAIL PROTECTED]
Tel: +34 94 6073300
Fax: +34 94 6073349
www.labein.es
_____________________________________

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to