示例#1
0
OSG_BEGIN_NAMESPACE

// Documentation for this class is emitted in the
// OSGFModSoundBase.cpp file.
// To modify it, please change the .fcd file (OSGFModSound.fcd) and
// regenerate the base file.

/***************************************************************************\
 *                           Class variables                               *
\***************************************************************************/

/***************************************************************************\
 *                           Class methods                                 *
\***************************************************************************/

void FModSound::initMethod(InitPhase ePhase)
{
    Inherited::initMethod(ePhase);

    if(ePhase == TypeObject::Static)
    {
        addPreFactoryInitFunction(boost::bind(&FModSoundManager::init));
        addPostFactoryExitFunction(boost::bind(&FModSoundManager::uninit));
    }
}
OSG_BEGIN_NAMESPACE

// Documentation for this class is emitted in the
// OSGDirectShowVideoWrapperBase.cpp file.
// To modify it, please change the .fcd file (OSGDirectShowVideoWrapper.fcd) and
// regenerate the base file.

/***************************************************************************\
 *                           Class variables                               *
\***************************************************************************/

/***************************************************************************\
 *                           Class methods                                 *
\***************************************************************************/

void DirectShowVideoWrapper::initMethod(InitPhase ePhase)
{
    Inherited::initMethod(ePhase);

    if(ePhase == TypeObject::Static)
    {
        char *c[] = {""};
        addPreFactoryInitFunction(boost::bind(&DirectShowManager::init, DirectShowManager::the(), 0, c));
        addPostFactoryExitFunction(boost::bind(&DirectShowManager::exit, DirectShowManager::the()));
    }
}
bool GeoPumpGroup::initActiveGroups(void)
{
    _activeGroups = new std::vector<GeoPumpGroup*>;

    _activeGroups->push_back(new GeoVertexArrayPumpGroup);
    _activeGroups->push_back(new GeoImmediatePumpGroup);

    addPostFactoryExitFunction(&GeoPumpGroup::terminateActiveGroups);

    return true;
}
void IntersectAction::registerLeaveDefault(const FieldContainerType &type, 
                                           const Action::Functor    &func)
{
    if(! _defaultLeaveFunctors)
    {
        _defaultLeaveFunctors = new FunctorStore;

        addPostFactoryExitFunction(&IntersectAction::terminateLeave);
    }

    while(type.getId() >= _defaultLeaveFunctors->size())
    {
        _defaultLeaveFunctors->push_back(
            &IntersectAction::_defaultLeaveFunction);
    }
    
    (*_defaultLeaveFunctors)[type.getId()] = func;
}
void
AnimBindAction::registerLeaveDefault(const FieldContainerType &type,
                                     const Action::Functor    &func )
{
    if(_defaultLeaveFunctors == NULL)
    {
        _defaultLeaveFunctors = new FunctorStore;

        addPostFactoryExitFunction(&AnimBindAction::terminateLeave);
    }

    if(type.getId() >= _defaultLeaveFunctors->size())
    {
        _defaultLeaveFunctors->resize(type.getId() + 1,
                                      &AnimBindAction::_defaultLeaveFunction);
    }

    (*_defaultLeaveFunctors)[type.getId()] = func;
}
void RenderAction::registerLeaveDefault(
    const FieldContainerType &type,
    const Action::Functor    &func)
{
    if(_vDefaultLeaveFunctors == NULL)
    {
        _vDefaultLeaveFunctors = new Action::FunctorStore;

        addPostFactoryExitFunction(&RenderAction::terminateLeave);
    }

    while(type.getId() >= _vDefaultLeaveFunctors->size())
    {
        _vDefaultLeaveFunctors->push_back(&Action::_defaultLeaveFunction);
    }

    FDEBUG_GV(("Register rendertrav leave for %s\n", type.getCName()));

    (*_vDefaultLeaveFunctors)[type.getId()] = func;
}
示例#7
0
OSG_END_NAMESPACE

/*! Constructor. The name is mandatory, the number of concurrently active slots
    is optional, default is 1. 
*/

StateChunkClass::StateChunkClass(const Char8  *name, 
                                       UInt32  numslots,
                                       UInt32  priority) : 
    _classId  (       0),
    _numSlots (numslots),
    _priority (priority),
    _className(    name)
{
    if(!_initClasses)
    {
        _initClasses = new std::vector<StateChunkClass *>;

        addPostFactoryExitFunction(&StateChunkClass::terminate); 
    }

    _initClasses->push_back(this);
}