void
MultiAgentEnvironment::initialize( const char* base_path, const char* environment_instance_name, const char* config_filename )
{
#ifdef TRACE
    cout << "> Loading Environment '" << m_EnvironmentInstanceName.c_str() << "' ..." << endl;
#endif
    m_BasePath = base_path;

    qDebug() << "Base path:" << getBasePath();

    m_PcMAE.setParent( this );
    if (m_PcMAE.load( "EnvironmentInstance", environment_instance_name ))
    {
        m_MultiAgentEnvironment = reinterpret_cast<AbstractMultiAgentEnvironmentInstance*>(m_PcMAE.get());
        m_MultiAgentEnvironment->setParentEnvironment( this );

        m_Name = m_MultiAgentEnvironment->getName();
    }

    if (m_MultiAgentEnvironment)
    {
//        cout << "Init env with config file: " << config_filename << endl;
        m_MultiAgentEnvironment->initialize( config_filename );
        onInitialize();

        loadParameters();
    }
}
void OrthoViewControllerCustom::initialize( DisplayContext* context, rviz::RenderPanel* panel )
{
    //ROS_INFO("INITIALIZE");
    bool initialized = false;
    if(context != NULL)
        context_ = context;
    else
        initialized = true;

    panel_ = panel;

    if(!camera_)
        camera_ = panel_->getCamera();

    setValue( formatClassId( getClassId() ));
    setReadOnly( true );

    // Do subclass initialization.
    if(!initialized)
        onInitialize();

    /*cursor_ = getDefaultCursor();

    standard_cursors_[Default] = getDefaultCursor();
    standard_cursors_[Rotate2D] = makeIconCursor( "package://rviz/icons/rotate.svg" );
    standard_cursors_[Rotate3D] = makeIconCursor( "package://rviz/icons/rotate_cam.svg" );
    standard_cursors_[MoveXY] = makeIconCursor( "package://rviz/icons/move2d.svg" );
    standard_cursors_[MoveZ] = makeIconCursor( "package://rviz/icons/move_z.svg" );
    standard_cursors_[Zoom] = makeIconCursor( "package://rviz/icons/zoom.svg" );
    standard_cursors_[Crosshair] = makeIconCursor( "package://rviz/icons/crosshair.svg" );

    updateNearClipDistance();*/
}
void ViewController::initialize( DisplayContext* context )
{
  context_ = context;

  std::stringstream ss;
  static int count = 0;
  ss << "ViewControllerCamera" << count++;
  camera_ = context_->getSceneManager()->createCamera( ss.str() );
  context_->getSceneManager()->getRootSceneNode()->attachObject( camera_ );

  setValue( formatClassId( getClassId() ));
  setReadOnly( true );

  // Do subclass initialization.
  onInitialize();

  cursor_ = getDefaultCursor();

  standard_cursors_[Default] = getDefaultCursor();
  standard_cursors_[Rotate2D] = makeIconCursor( "package://rviz/icons/rotate.svg" );
  standard_cursors_[Rotate3D] = makeIconCursor( "package://rviz/icons/rotate_cam.svg" );
  standard_cursors_[MoveXY] = makeIconCursor( "package://rviz/icons/move2d.svg" );
  standard_cursors_[MoveZ] = makeIconCursor( "package://rviz/icons/move_z.svg" );
  standard_cursors_[Zoom] = makeIconCursor( "package://rviz/icons/zoom.svg" );
  standard_cursors_[Crosshair] = makeIconCursor( "package://rviz/icons/crosshair.svg" );

  updateNearClipDistance();
  updateStereoProperties();

  if (!RenderSystem::get()->isStereoSupported())
  {
    stereo_enable_->setBool(false);
    stereo_enable_->hide();
  }
}
Exemple #4
0
void Tool::initialize( DisplayContext* context )
{
  context_ = context;
  scene_manager_ = context_->getSceneManager();  

  // Let subclasses do initialization if they want.
  onInitialize();
}
Exemple #5
0
void Acceptor::block() throw ( ConfigError, RuntimeError )
{
  m_stop = false;
  onConfigure( m_settings );
  onInitialize( m_settings );

  startThread(this);
}
/**
 * Method is used to initialize particle system.
 */
void ParticleSystem::initializeEffect()
{
	Particle* p = firstParticle;
	while(p)
	{
		onInitialize(p);
		p = p->next;
	}
}
Exemple #7
0
void HttpServer::start() throw ( ConfigError, RuntimeError )
{
  m_stop = false;
  onConfigure( m_settings );
  onInitialize( m_settings );

  if( !thread_spawn( &startThread, this, m_threadid ) )
    throw RuntimeError("Unable to spawn thread");
}
void QtOpenGLWindowBase::initialize()
{
    m_context->makeCurrent(this);

    onInitialize();

    m_context->doneCurrent();

    m_initialized = true;
}
Exemple #9
0
void Acceptor::block() throw ( ConfigError, RuntimeError )
{   QF_STACK_PUSH( Acceptor::start )

    m_stop = false;
    onConfigure( m_settings );
    onInitialize( m_settings );

    startThread(this);

    QF_STACK_POP
}
void StaticLayer::reset()
{
  if (first_map_only_)
  {
    has_updated_data_ = true;
  }
  else
  {
    onInitialize();
  }
}
	bool ClipmapRenderer::initialize( GeometryClipmaps* geoClipmaps )
	{
		if( !geoClipmaps )
		{
			return false;
		}
		shutdown();

		geoClipmaps_ = geoClipmaps;

		return onInitialize( geoClipmaps );
	}
Exemple #12
0
bool Acceptor::poll( double timeout ) throw ( ConfigError, RuntimeError )
{
  if( m_firstPoll )
  {
    m_stop = false;
    onConfigure( m_settings );
    onInitialize( m_settings );
    m_firstPoll = false;
  }

  return onPoll( timeout );
}
void Display::initialize( DisplayContext* context )
{
  context_ = context;
  scene_manager_ = context_->getSceneManager();
  scene_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode();
  
  update_nh_.setCallbackQueue( context_->getUpdateQueue() );
  threaded_nh_.setCallbackQueue( context_->getThreadedQueue() );
  fixed_frame_ = context_->getFixedFrame();

  onInitialize();

  initialized_ = true;
}
Exemple #14
0
void Acceptor::start() throw ( ConfigError, RuntimeError )
{   QF_STACK_PUSH( Acceptor::start )

    m_stop = false;
    onConfigure( m_settings );
    onInitialize( m_settings );

    HttpServer::startGlobal( m_settings );

    if( !thread_spawn( &startThread, this, m_threadid ) )
        throw RuntimeError("Unable to spawn thread");

    QF_STACK_POP
}
Exemple #15
0
    Status tick()
    {
        if (m_eStatus != BH_RUNNING)
        {
            onInitialize();
        }

        m_eStatus = update();

        if (m_eStatus != BH_RUNNING)
        {
            onTerminate(m_eStatus);
        }
        return m_eStatus;
    }
		Status tick()
		{
			if (status != RUNNING)
			{
				onInitialize();
			}

			status = update();

			if (status != RUNNING)
			{
				onTerminate(status);
			}
			return status;
		}
        //-----------------------------------------------------------------------------------------------------------
        bool AndroidApplication::initialize()
        {
                state_ = Platform::state_;

                if(state_ == nullptr)
                        return false;

                state_->userData = this;
                state_->onAppCmd = commandProcessingCallback;
                state_->onInputEvent = inputProcessingCallback;

                if(!onInitialize())
                        return false;

                isInitialized_ = true;
                return true;
        }
Exemple #18
0
BootManager::BootManager() :
	m_service(0),
	m_currentState(BOOT_STATE_STARTUP),
	m_compositorAvailable(false)
{
	m_states[BOOT_STATE_STARTUP] = new BootStateStartup();
	m_states[BOOT_STATE_FIRSTUSE] = new BootStateFirstUse();
	m_states[BOOT_STATE_NORMAL] = new BootStateNormal();

	startService();

	connect(WebAppMgrProxy::instance(), SIGNAL(connectionStatusChanged()),
		this, SLOT(onWebAppMgrConnectionStatusChanged()));

	m_fileWatch.addPath("/var/luna/preferences");
	connect(&m_fileWatch, SIGNAL(directoryChanged(QString)), this, SLOT(onFileChanged(QString)));
	connect(&m_fileWatch, SIGNAL(fileChanged(QString)), this, SLOT(onFileChanged(QString)));

	QTimer::singleShot(0, this, SLOT(onInitialize()));
}
bool RfService::tick()
{
    unsigned int t = RfClock();

    if (!mIsInitialized)
    {
        if (!onInitialize())
        {
            return false;
        }

        mIsInitialized = true;
    }

    bool ret = onTick(RfClock() - mInitTime);

    mTickTime = RfClock() - t;

    return ret;
}
void StaticLayer::activate()
{
  onInitialize();
}
Exemple #21
0
void Recorder::messagePump()
{
	XnStatus nRetVal = XN_STATUS_OK;
    Message msg = { Message::MESSAGE_NO_OPERATION, 0, NULL, {NULL}, 0, 0 };

	{
		xnl::LockGuard<MessageQueue> guard(m_queue);
		nRetVal = m_queue.Pop(msg);
	}

    if (XN_STATUS_OK == nRetVal)
    {
        switch (msg.type)
        {
            case Message::MESSAGE_INITIALIZE:
                {
                    onInitialize();
                }
                break;
            case Message::MESSAGE_TERMINATE:
                {
                    onTerminate();
                    m_running = FALSE;
                }
                break;
            case Message::MESSAGE_ATTACH:
                {
                    xnl::LockGuard<AttachedStreams> streamsGuard(m_streams);
                    AttachedStreams::Iterator i = m_streams.Find(msg.pStream);
                    if (i != m_streams.End())
                    {
                        onAttach(i->Value().nodeId, msg.pStream);
                    }
                }
                break;
            case Message::MESSAGE_DETACH:
                {
                    xnl::LockGuard<AttachedStreams> streamsGuard(m_streams);
                    AttachedStreams::Iterator i = m_streams.Find(msg.pStream);
                    if (i != m_streams.End())
                    {
                        onDetach(i->Value().nodeId);
                        XN_DELETE(m_streams[msg.pStream].pCodec);
                        m_streams.Remove(msg.pStream);
                    }
                }
                break;
            case Message::MESSAGE_START:
                {
                    xnl::LockGuard<AttachedStreams> streamsGuard(m_streams);
                    for (AttachedStreams::Iterator 
                            i = m_streams.Begin(),
                            e = m_streams.End();
                        i != e; ++i)
                    {
                        onStart(i->Value().nodeId);
                    }
                    m_started = true;
                }
                break;
            case Message::MESSAGE_RECORD:
                {
                    xnl::LockGuard<AttachedStreams> streamsGuard(m_streams);
                    AttachedStreams::Iterator i = m_streams.Find(msg.pStream);
                    if (i != m_streams.End())
                    {
                        XnCodecBase* pCodec = m_streams[msg.pStream].pCodec;
                        XnUInt32 frameId    = ++m_streams[msg.pStream].frameId;
                        XnUInt64 timestamp  = 0;
                        if (frameId > 1)
                        {
                            timestamp = m_streams[msg.pStream].lastOutputTimestamp + (msg.pFrame->timestamp - m_streams[msg.pStream].lastInputTimestamp);
                        }
                        m_streams[msg.pStream].lastInputTimestamp = msg.pFrame->timestamp;
                        m_streams[msg.pStream].lastOutputTimestamp = timestamp;
                        onRecord(i->Value().nodeId, pCodec, msg.pFrame, frameId, timestamp);
                        msg.pStream->frameRelease(msg.pFrame);
                    }
                }
                break;
            case Message::MESSAGE_RECORDPROPERTY:
                {
                    xnl::LockGuard<AttachedStreams> streamsGuard(m_streams);
                    AttachedStreams::Iterator i = m_streams.Find(msg.pStream);
                    if (i != m_streams.End())
                    {
                        onRecordProperty(
                            i->Value().nodeId,
                            msg.propertyId,
                            msg.pData,
                            msg.dataSize);
                    }
                    // free the temporary buffer allocated earlier
                    xnOSFree((void*)msg.pData);
                }
                break;
            default:
                ;
        }
    }
}
        //-----------------------------------------------------------------------------------------------------------
        void AndroidApplication::processCommand(android_app* app, int32_t cmd)
        {
                if(!shouldRun_)
                        return;

                switch(cmd)
                {
                        case APP_CMD_INIT_WINDOW:
                        {
                                LOGI("***************** ON INITIALIZE WINDOW");

                                if(app->window == nullptr)
                                {
                                        shouldRun_ = false;
                                        return;
                                }

                                if(isInitialized_)
                                {
                                        if(isPaused_)
                                        {
                                                renderer_.retain();
                                                timer_.reset();
                                                isPaused_ = false;
                                        }
                                        return;
                                }

                                if(!onInitialize())
                                {
                                        shouldRun_ = false;
                                        return;
                                }

                                isInitialized_ = true;
                                break;
                        }

                        case APP_CMD_TERM_WINDOW:
                        {
                                LOGI("***************** ON TERMINATE WINDOW");

                                if(!isPaused_)
                                {
                                        isPaused_ = true;
                                        renderer_.discard();
                                }

                                break;
                        }

                        case APP_CMD_PAUSE:
                        {
                                LOGI("***************** ON PAUSE");

                                if(!isPaused_)
                                {
                                        isPaused_ = true;
                                        renderer_.discard();
                                }
                                break;
                        }

                        case APP_CMD_RESUME:
                        {
                                LOGI("***************** ON RESUME");
                                break;
                        }

                        case APP_CMD_STOP:
                        {
                                LOGI("***************** ON STOP");

                                isInitialized_ = false;
                                onDestroy();
                                renderer_.destroy();

                                break;
                        }

                        case APP_CMD_LOST_FOCUS:
                        {
                                LOGI("***************** ON LOST FOCUS");
                                break;
                        }

                        case APP_CMD_GAINED_FOCUS:
                        {
                                LOGI("***************** ON GAINED FOCUS");
                                break;
                        }
                }
        }
Exemple #23
0
	void Actor::initialize(Engine *e){
		m_Engine = e;
		onInitialize();
	}
void Painter::initialize()
{
    onInitialize();
}
void ExternalModelInterface::initialize()
{
  LOG(Trace, "initialize");
  onInitialize();
}
Exemple #26
0
void Node::initialize() {
    onInitialize();
}