Hello Michael,

On 03/09/2011 07:11 AM, Michael Raab wrote:
> UInt32 numFC =
> FieldContainerFactory::the()->getFieldContainerStore()->size();
>
> // Loop over all newly created field container instances
> for(UInt32 i = this->_prevNumFC; i<  numFC; ++i)
> {
>       FieldContainerPtr fc = FieldContainerFactory::the()->getContainer(i);
>               
>       if(fc != osg::NullFC&&  
> fc->getType().isDerivedFrom(osg::SHLChunk::getClassType()))
>       {
>               SHLChunkPtr shl = SHLChunkPtr::dcast(fc);
>               if( shl != NullFC )
>               {
>                       beginEditCP(shl);
>                       shl->addParameterCallback("VDTSystemTime", updateP);
>                       shl->addParameterCallback("VDTSystemTime", updateU);
>                       endEditCP(shl);
>               }
>
>               cout<<  "Found shl chunk "<<  endl;
>       }
> }
>
> this->_prevNumFC = numFC;
> Am I doing something wrong?

try naming your parameters starting with "OSG", it appears the user 
callbacks are moved to _osgParametersCallbacks at some point, but only 
if they start with "OSG" - not sure what the reason for this is/was.

> One additional thing I have discovered. If I try to attach the callbacks to 
> the very first SHLChunk I discover, I get an AccessViolation. Furthermore I 
> haven't created that SHLCHunk. Is it something like a prototype? Can I 
> somehow find out if its a prototype or something special?

yes, that is probably the prototype. If you can create the object that 
adds the callbacks above before the first real SHLChunk is created, you 
can simply init _prevNumFC when it is created to size of the container 
store at creation time.
Alternatively you can access the prototype from the containers type 
object, shl->getType().getPrototype(), and compare the pointers.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to