Commit 3a83de21 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix: Coding Rules useless OpenViBE types

parent 2e1d7425
......@@ -86,7 +86,7 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
return true;
}
void CShooterApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
void CShooterApplication::processFrame(uint32_t ui32CurrentFrame)
{
CApplication::processFrame(ui32CurrentFrame);
m_poShip->processFrame( ui32CurrentFrame );
......@@ -106,7 +106,7 @@ void CShooterApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
}
}
void CShooterApplication::addTarget(OpenViBE::uint32 ui32TargetPosition)
void CShooterApplication::addTarget(uint32_t ui32TargetPosition)
{
m_oTargets.push_back( CShooterTarget::createTarget( Ogre::Radian( Math::PI * 2 / 360 * 45 * ui32TargetPosition ) ) );
}
......
......@@ -30,14 +30,14 @@ namespace OpenViBESSVEP
void startExperiment();
void addTarget(OpenViBE::uint32 ui32TargetPosition);
void addTarget(uint32_t ui32TargetPosition);
bool m_bTargetRequest;
private:
bool m_bActive;
void processFrame(OpenViBE::uint32 ui32CurrentFrame);
void processFrame(uint32_t ui32CurrentFrame);
CEGUI::Window* m_poInstructionsReady;
......
......@@ -12,7 +12,7 @@
using namespace OpenViBESSVEP;
using namespace Ogre;
CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> >* pFrequencies) :
CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<uint32_t, uint32_t> >* pFrequencies) :
m_rCurrentAngle( 0 ),
m_iCurrentRotationCount( 0 ),
m_bIsShooting( false )
......@@ -130,7 +130,7 @@ CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode,
}
void CStarShip::processFrame( OpenViBE::uint32 ui32CurrentFrame )
void CStarShip::processFrame( uint32_t ui32CurrentFrame )
{
m_poShipCannon->processFrame();
m_poShipLeftWing->processFrame();
......
......@@ -14,8 +14,8 @@ namespace OpenViBESSVEP
class CStarShip
{
public:
CStarShip( CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> >* pFrequencies);
void processFrame( OpenViBE::uint32 ui32CurrentFrame );
CStarShip( CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<uint32_t, uint32_t> >* pFrequencies);
void processFrame( uint32_t ui32CurrentFrame );
void rotate( int iRotationCount );
......
......@@ -41,9 +41,9 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
// paint targets
OpenViBE::uint32 l_ui32TargetCount = (OpenViBE::uint32)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
uint32_t l_ui32TargetCount = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
for (OpenViBE::uint32 i = 0; i < l_ui32TargetCount; i++)
for (uint32_t i = 0; i < l_ui32TargetCount; i++)
{
this->addObject(CTrainerFlickeringObject::createTrainerFlickeringObject(i));
}
......@@ -85,7 +85,7 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
}
void CTrainerApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
void CTrainerApplication::processFrame(uint32_t ui32CurrentFrame)
{
CApplication::processFrame(ui32CurrentFrame);
......@@ -94,7 +94,7 @@ void CTrainerApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
return;
}
for (OpenViBE::uint32 i = 0; i < m_oObjects.size(); i++)
for (uint32_t i = 0; i < m_oObjects.size(); i++)
{
m_oObjects[i]->processFrame();
}
......@@ -106,12 +106,12 @@ void CTrainerApplication::addObject(CTrainerFlickeringObject* poObject)
poObject->setVisible( true );
}
void CTrainerApplication::setTarget(OpenViBE::int32 i32Target)
void CTrainerApplication::setTarget(int32_t i32Target)
{
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::int32)(time(NULL) - m_ttStartTime);
uint32_t l_ui32CurrentTime = (int32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Target set to " << i32Target << "\n";
for (OpenViBE::int32 i = 0; i < int(m_oObjects.size()); i++)
for (int32_t i = 0; i < int(m_oObjects.size()); i++)
{
m_oObjects[i]->setTarget( i32Target == i );
}
......@@ -129,18 +129,18 @@ void CTrainerApplication::startExperiment()
void CTrainerApplication::startFlickering()
{
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::uint32)(time(NULL) - m_ttStartTime);
uint32_t l_ui32CurrentTime = (uint32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Starting Visual Stimulation\n";
m_bActive = true;
}
void CTrainerApplication::stopFlickering()
{
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::uint32)(time(NULL) - m_ttStartTime);
uint32_t l_ui32CurrentTime = (uint32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Stopping Visual Stimulation\n";
m_bActive = false;
for (OpenViBE::uint32 i = 0; i < m_oObjects.size(); i++)
for (uint32_t i = 0; i < m_oObjects.size(); i++)
{
m_oObjects[i]->setVisible(true);
}
......
......@@ -17,7 +17,7 @@ namespace OpenViBESSVEP
~CTrainerApplication() {};
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext);
void setTarget(OpenViBE::int32 i32Target);
void setTarget(int32_t i32Target);
void startExperiment();
void startFlickering();
......@@ -26,7 +26,7 @@ namespace OpenViBESSVEP
private:
bool m_bActive;
void processFrame(OpenViBE::uint32 ui32CurrentFrame);
void processFrame(uint32_t ui32CurrentFrame);
void addObject(CTrainerFlickeringObject *target);
std::vector<CTrainerFlickeringObject*> m_oObjects;
......
......@@ -11,8 +11,8 @@ SceneNode* CTrainerFlickeringObject::m_poParentNode = nullptr;
CBasicPainter* CTrainerFlickeringObject::m_poPainter = nullptr;
ColourValue CTrainerFlickeringObject::m_oLightColour = ColourValue(1.0f, 1.0f, 1.0f);
ColourValue CTrainerFlickeringObject::m_oDarkColour = ColourValue(0.0f, 0.0f, 0.0f);
OpenViBE::float32 CTrainerFlickeringObject::m_f32TargetWidth = 0.2f;
OpenViBE::float32 CTrainerFlickeringObject::m_f32TargetHeight = 0.2f;
float CTrainerFlickeringObject::m_f32TargetWidth = 0.2f;
float CTrainerFlickeringObject::m_f32TargetHeight = 0.2f;
CTrainerApplication* CTrainerFlickeringObject::m_poApplication = nullptr;
void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication )
......@@ -23,8 +23,8 @@ void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication )
m_poPainter = poApplication->getPainter();
m_poParentNode = poApplication->getSceneNode();
m_f32TargetWidth = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}"));
m_f32TargetHeight = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}"));
m_f32TargetWidth = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}"));
m_f32TargetHeight = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}"));
m_oLightColour = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")),
......@@ -38,7 +38,7 @@ void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication )
}
CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject( OpenViBE::uint32 l_i32TargetId )
CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject( uint32_t l_i32TargetId )
{
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_poApplication->getConfigurationManager();
......@@ -51,10 +51,10 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
OpenViBE::CIdentifier l_oTargetId = l_poConfigurationManager->createConfigurationToken("SSVEPTarget_Id", OpenViBE::CString(l_sTargetIdString));
OpenViBE::float32 l_f32TargetX = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_X_${SSVEPTarget_Id}}"));
OpenViBE::float32 l_f32TargetY = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_Y_${SSVEPTarget_Id}}"));
OpenViBE::uint32 l_ui32FramesL = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].first;
OpenViBE::uint32 l_ui32FramesD = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].second;
float l_f32TargetX = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_X_${SSVEPTarget_Id}}"));
float l_f32TargetY = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_Y_${SSVEPTarget_Id}}"));
uint32_t l_ui32FramesL = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].first;
uint32_t l_ui32FramesD = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].second;
m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n";
......@@ -69,7 +69,7 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
}
}
CTrainerFlickeringObject::CTrainerFlickeringObject( OpenViBE::float32 f32PosX, OpenViBE::float32 f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, OpenViBE::uint8 ui8DarkFrames ) :
CTrainerFlickeringObject::CTrainerFlickeringObject( float f32PosX, float f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames ) :
CSSVEPFlickeringObject( NULL, ui8LitFrames, ui8DarkFrames )
{
Ogre::SceneNode* l_poPointerNode;
......
......@@ -17,13 +17,13 @@ namespace OpenViBESSVEP
class CTrainerFlickeringObject : public CSSVEPFlickeringObject
{
public:
static CTrainerFlickeringObject* createTrainerFlickeringObject( OpenViBE::uint32 );
static CTrainerFlickeringObject* createTrainerFlickeringObject( uint32_t );
static void initialize( CTrainerApplication* poApplication );
void connectToNode( Ogre::SceneNode* poSceneNode );
void setTarget( OpenViBE::boolean bIsTarget );
void setTarget( bool bIsTarget );
OpenViBE::boolean isTarget()
bool isTarget()
{
return m_poPointer->getVisible();
}
......@@ -32,12 +32,12 @@ namespace OpenViBESSVEP
static CTrainerApplication* m_poApplication;
static Ogre::SceneNode* m_poParentNode;
static CBasicPainter* m_poPainter;
static OpenViBE::float32 m_f32TargetWidth;
static OpenViBE::float32 m_f32TargetHeight;
static float m_f32TargetWidth;
static float m_f32TargetHeight;
static Ogre::ColourValue m_oLightColour;
static Ogre::ColourValue m_oDarkColour;
CTrainerFlickeringObject( OpenViBE::float32 f32PosX, OpenViBE::float32 f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, OpenViBE::uint8 ui8DarkFrames );
CTrainerFlickeringObject( float f32PosX, float f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames );
Ogre::SceneNode* m_poElementNode;
......
......@@ -129,26 +129,26 @@ bool CApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext)
// create the vector of stimulation frequencies
m_f64ScreenRefreshRate = (OpenViBE::uint32)(l_poConfigurationManager->expandAsUInteger("${SSVEP_ScreenRefreshRate}"));
m_f64ScreenRefreshRate = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_ScreenRefreshRate}"));
(*m_poLogManager) << LogLevel_Info << "Specified screen refresh rate :" << m_f64ScreenRefreshRate << "Hz\n";
OpenViBE::uint32 i = 1;
uint32_t i = 1;
char l_sFrequencyString[32] = "1";
CIdentifier l_oFrequencyId = l_poConfigurationManager->createConfigurationToken("SSVEP_FrequencyId", CString(l_sFrequencyString));
m_oFrequencies.push_back(std::pair<OpenViBE::uint32, OpenViBE::uint32>(30, 30));
m_oFrequencies.push_back(std::pair<uint32_t, uint32_t>(30, 30));
while (l_poConfigurationManager->lookUpConfigurationTokenIdentifier(l_poConfigurationManager->expand("SSVEP_Frequency_${SSVEP_FrequencyId}")) != OV_UndefinedIdentifier)
{
std::pair<OpenViBE::uint32, OpenViBE::uint32> l_oFrequency;
std::pair<uint32_t, uint32_t> l_oFrequency;
OpenViBE::float64 l_f64CurrentFrequency;
OpenViBE::float64 l_f64ApproximatedFrameCount;
double l_f64CurrentFrequency;
double l_f64ApproximatedFrameCount;
l_f64CurrentFrequency = (OpenViBE::float64)(l_poConfigurationManager->expandAsFloat("${SSVEP_Frequency_${SSVEP_FrequencyId}}"));
l_f64CurrentFrequency = (double)(l_poConfigurationManager->expandAsFloat("${SSVEP_Frequency_${SSVEP_FrequencyId}}"));
l_f64ApproximatedFrameCount= m_f64ScreenRefreshRate / l_f64CurrentFrequency;
......@@ -248,7 +248,7 @@ void CApplication::resizeViewport()
);
}
void CApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
void CApplication::processFrame(uint32_t ui32CurrentFrame)
{
if (m_ui32WindowWidth != m_poWindow->getWidth() || m_ui32WindowHeight != m_poWindow->getHeight())
{
......@@ -283,7 +283,7 @@ bool CApplication::frameStarted(const Ogre::FrameEvent &evt)
this->processFrame(m_ui32CurrentFrame);
for (OpenViBE::uint32 i = 0; i < m_oCommands.size(); i++)
for (uint32_t i = 0; i < m_oCommands.size(); i++)
{
m_oCommands[i]->processFrame();
}
......
......@@ -70,7 +70,7 @@ namespace OpenViBESSVEP
return &(m_poKernelContext->getConfigurationManager());
}
std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> >* getFrequencies()
std::vector<std::pair<uint32_t, uint32_t> >* getFrequencies()
{
return &m_oFrequencies;
}
......@@ -82,11 +82,11 @@ namespace OpenViBESSVEP
OpenViBE::Kernel::IKernelContext* m_poKernelContext;
OpenViBE::Kernel::ILogManager* m_poLogManager;
OpenViBE::float64 m_f64ScreenRefreshRate;
double m_f64ScreenRefreshRate;
CBasicPainter* m_poPainter;
bool m_bContinueRendering;
OpenViBE::uint32 m_ui32CurrentFrame;
uint32_t m_ui32CurrentFrame;
Ogre::Root* m_poRoot;
Ogre::SceneManager* m_poSceneManager;
......@@ -99,11 +99,11 @@ namespace OpenViBESSVEP
CEGUI::WindowManager* m_poGUIWindowManager;
CEGUI::Window* m_poSheet;
std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> > m_oFrequencies;
std::vector<std::pair<uint32_t, uint32_t> > m_oFrequencies;
std::vector<ICommand*> m_oCommands;
virtual void processFrame(OpenViBE::uint32 ui32CurrentFrame);
virtual void processFrame(uint32_t ui32CurrentFrame);
bool frameRenderingQueued(const Ogre::FrameEvent &evt);
bool frameStarted(const Ogre::FrameEvent &evt);
......
......@@ -6,7 +6,7 @@
using namespace OpenViBESSVEP;
CSSVEPFlickeringObject::CSSVEPFlickeringObject(Ogre::SceneNode* poObjectNode, OpenViBE::uint32 ui32LitFrames, OpenViBE::uint32 ui32DarkFrames) :
CSSVEPFlickeringObject::CSSVEPFlickeringObject(Ogre::SceneNode* poObjectNode, uint32_t ui32LitFrames, uint32_t ui32DarkFrames) :
m_poObjectNode( poObjectNode ),
m_ui32CurrentFrame( 0 ),
m_ui32LitFrames( ui32LitFrames ),
......
......@@ -10,21 +10,21 @@ namespace OpenViBESSVEP
class CSSVEPFlickeringObject
{
public:
CSSVEPFlickeringObject( Ogre::SceneNode* poObjectNode, OpenViBE::uint32 ui32LitFrames, OpenViBE::uint32 ui32DarkFrames );
CSSVEPFlickeringObject( Ogre::SceneNode* poObjectNode, uint32_t ui32LitFrames, uint32_t ui32DarkFrames );
~CSSVEPFlickeringObject() {};
virtual void setVisible( OpenViBE::boolean bVisibility );
virtual void setVisible( bool bVisibility );
virtual void processFrame( );
protected:
Ogre::SceneNode* m_poObjectNode;
OpenViBE::uint32 m_ui32CurrentFrame;
OpenViBE::uint32 m_ui32LitFrames;
OpenViBE::uint32 m_ui32DarkFrames;
uint32_t m_ui32CurrentFrame;
uint32_t m_ui32LitFrames;
uint32_t m_ui32DarkFrames;
private:
OpenViBE::boolean m_bVisible;
bool m_bVisible;
};
}
......
......@@ -17,7 +17,7 @@ CVRPNServer::CVRPNServer(CApplication* poApplication)
{
m_poApplication = poApplication;
int l_iPort = (OpenViBE::int32)(m_poApplication->getConfigurationManager()->expandAsInteger("${VRPN_ExternalServerPort}"));
int l_iPort = (int32_t)(m_poApplication->getConfigurationManager()->expandAsInteger("${VRPN_ExternalServerPort}"));
m_poApplication->getLogManager() << LogLevel_Debug << "VRPN SERVER PORT :" << l_iPort << "\n";
m_poConnection = vrpn_create_server_connection(l_iPort);
......
......@@ -73,7 +73,7 @@ void ICommandOIS::processFrame()
bool ICommandOIS::keyPressed( const OIS::KeyEvent &oEvent )
{
for (OpenViBE::uint32 i = 0; i < m_oInstances.size(); i++)
for (uint32_t i = 0; i < m_oInstances.size(); i++)
{
m_oInstances[i]->receiveKeyPressedEvent( oEvent.key );
}
......@@ -83,7 +83,7 @@ bool ICommandOIS::keyPressed( const OIS::KeyEvent &oEvent )
bool ICommandOIS::keyReleased( const OIS::KeyEvent &oEvent )
{
for (OpenViBE::uint32 i = 0; i < m_oInstances.size(); i++)
for (uint32_t i = 0; i < m_oInstances.size(); i++)
{
m_oInstances[i]->receiveKeyReleasedEvent( oEvent.key );
}
......
......@@ -49,9 +49,9 @@ bool CGenericStimulatorApplication::setup(OpenViBE::Kernel::IKernelContext* poKe
// paint targets
OpenViBE::uint32 l_ui32TargetCount = (OpenViBE::uint32)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
uint32_t l_ui32TargetCount = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
for (OpenViBE::uint32 i = 0; i < l_ui32TargetCount; i++)
for (uint32_t i = 0; i < l_ui32TargetCount; i++)
{
this->addObject(CGenericStimulatorFlickeringObject::createGenericFlickeringObject(i));
}
......@@ -92,7 +92,7 @@ bool CGenericStimulatorApplication::setup(OpenViBE::Kernel::IKernelContext* poKe
}
void CGenericStimulatorApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
void CGenericStimulatorApplication::processFrame(uint32_t ui32CurrentFrame)
{
CApplication::processFrame(ui32CurrentFrame);
......@@ -101,7 +101,7 @@ void CGenericStimulatorApplication::processFrame(OpenViBE::uint32 ui32CurrentFra
return;
}
for (OpenViBE::uint32 i = 0; i < m_oObjects.size(); i++)
for (uint32_t i = 0; i < m_oObjects.size(); i++)
{
m_oObjects[i]->processFrame();
}
......@@ -113,12 +113,12 @@ void CGenericStimulatorApplication::addObject(CGenericStimulatorFlickeringObject
poObject->setVisible( true );
}
void CGenericStimulatorApplication::setTarget(OpenViBE::int32 i32Target)
void CGenericStimulatorApplication::setTarget(int32_t i32Target)
{
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::int32)(time(NULL) - m_ttStartTime);
uint32_t l_ui32CurrentTime = (int32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Target set to " << i32Target << "\n";
for (OpenViBE::int32 i = 0; i < int(m_oObjects.size()); i++)
for (int32_t i = 0; i < int(m_oObjects.size()); i++)
{
m_oObjects