Commit c888b219 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix : Coding Rules Format Roughing

parent 3a83de21
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandShipControl.h"
......@@ -7,9 +6,7 @@
using namespace OpenViBESSVEP;
CCommandShipControl::CCommandShipControl(CShooterApplication* poApplication)
: ICommandVRPNButton(poApplication, "SSVEP_VRPN_ShipControl")
{
}
: ICommandVRPNButton(poApplication, "SSVEP_VRPN_ShipControl") {}
void CCommandShipControl::execute(int iButton, int iState)
{
......@@ -21,12 +18,12 @@ void CCommandShipControl::execute(int iButton, int iState)
l_poShooterApplication->getShip()->shoot();
break;
case 1:
l_poShooterApplication->getShip()->rotate( -6 );
l_poShooterApplication->getShip()->rotate(-6);
break;
case 2:
l_poShooterApplication->getShip()->rotate( 6 );
l_poShooterApplication->getShip()->rotate(6);
break;
}
}
#endif
\ No newline at end of file
#endif
......@@ -9,12 +9,11 @@ namespace OpenViBESSVEP
class CCommandShipControl : public ICommandVRPNButton
{
public:
CCommandShipControl(CShooterApplication* poApplication);
~CCommandShipControl() {};
void execute(int iButton, int iState);
public:
CCommandShipControl(CShooterApplication* poApplication);
~CCommandShipControl() {};
void execute(int iButton, int iState);
};
}
......
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCCommandTargetControl.h"
......@@ -10,7 +9,7 @@ using namespace OpenViBE::Kernel;
CCommandTargetControl::CCommandTargetControl(CShooterApplication* poApplication)
: ICommandVRPNButton(poApplication, "SSVEP_VRPN_ShooterTarget")
{
m_poVRPNServer = CVRPNServer::getInstance( poApplication );
m_poVRPNServer = CVRPNServer::getInstance(poApplication);
m_poVRPNServer->addButton("SSVEP_VRPN_TargetRequest", 1);
}
......@@ -43,4 +42,4 @@ void CCommandTargetControl::execute(int iButton, int iState)
}
}
#endif
\ No newline at end of file
#endif
......@@ -10,16 +10,15 @@ namespace OpenViBESSVEP
class CCommandTargetControl : public ICommandVRPNButton
{
public:
CCommandTargetControl(CShooterApplication* poApplication);
~CCommandTargetControl() {};
public:
CCommandTargetControl(CShooterApplication* poApplication);
~CCommandTargetControl() {};
void execute(int iButton, int iState);
void processFrame();
private:
CVRPNServer* m_poVRPNServer;
void execute(int iButton, int iState);
void processFrame();
private:
CVRPNServer* m_poVRPNServer;
};
}
......
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCShooterApplication.h"
......@@ -22,10 +21,8 @@ namespace CEGUI
CShooterApplication::CShooterApplication()
: CApplication(),
m_bTargetRequest( false ),
m_poShip( NULL )
{
}
m_bTargetRequest(false),
m_poShip(NULL) {}
CShooterApplication::~CShooterApplication()
{
......@@ -39,49 +36,49 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
{
// If setup failed, logmanager may be in an unusable state, use cout
std::cout << "Error: Base application setup failed\n";
return false;
return false;
}
// Create the StarShip object
(*m_poLogManager) << LogLevel_Debug << "+ m_poShip = new CStarShip(...)\n";
m_poShip = new CStarShip( this, m_poSceneNode, 0.3f, &m_oFrequencies );
m_poShip = new CStarShip(this, m_poSceneNode, 0.3f, &m_oFrequencies);
// Initialize the Target class
CShooterTarget::initialize( m_poPainter, m_poSceneNode );
CShooterTarget::initialize(m_poPainter, m_poSceneNode);
// draw the initial text
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR >= 8)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image","InstructionsReady");
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "InstructionsReady");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image");
#endif
m_poInstructionsReady->setProperty("FrameEnabled","False");
m_poInstructionsReady->setProperty("BackgroundEnabled","False");
m_poInstructionsReady->setProperty("FrameEnabled", "False");
m_poInstructionsReady->setProperty("BackgroundEnabled", "False");
m_poInstructionsReady->setVisible(true);
// Create commands
(*m_poLogManager) << LogLevel_Debug << "+ addCommand(new CCommandStartStop(...)\n";
this->addCommand(new CCommandStartStop( this ));
this->addCommand(new CCommandStartStop(this));
(*m_poLogManager) << LogLevel_Debug << "+ addCommand(new CCommandStimulatorControl(...))\n";
this->addCommand(new CCommandStimulatorControl( this ));
this->addCommand(new CCommandStimulatorControl(this));
(*m_poLogManager) << LogLevel_Debug << "+ addCommand(new CCommandTargetControl(...)\n";
this->addCommand(new CCommandTargetControl( this ));
this->addCommand(new CCommandTargetControl(this));
(*m_poLogManager) << LogLevel_Debug << "+ addCommand(new CCommandShipControl(...))\n";
this->addCommand(new CCommandShipControl( this ));
this->addCommand(new CCommandShipControl(this));
return true;
}
......@@ -89,7 +86,7 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
void CShooterApplication::processFrame(uint32_t ui32CurrentFrame)
{
CApplication::processFrame(ui32CurrentFrame);
m_poShip->processFrame( ui32CurrentFrame );
m_poShip->processFrame(ui32CurrentFrame);
if (m_poShip->isShooting())
{
......@@ -108,7 +105,7 @@ void CShooterApplication::processFrame(uint32_t ui32CurrentFrame)
void CShooterApplication::addTarget(uint32_t ui32TargetPosition)
{
m_oTargets.push_back( CShooterTarget::createTarget( Ogre::Radian( Math::PI * 2 / 360 * 45 * ui32TargetPosition ) ) );
m_oTargets.push_back(CShooterTarget::createTarget(Ogre::Radian(Math::PI * 2 / 360 * 45 * ui32TargetPosition)));
}
void CShooterApplication::startExperiment()
......@@ -116,7 +113,7 @@ void CShooterApplication::startExperiment()
m_bTargetRequest = true;
CApplication::startExperiment();
m_poInstructionsReady->setVisible( false );
m_poInstructionsReady->setVisible(false);
}
#endif
\ No newline at end of file
#endif
......@@ -13,36 +13,34 @@
namespace OpenViBESSVEP
{
class CShooterApplication : public CApplication
{
public:
CShooterApplication();
~CShooterApplication();
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext);
CStarShip* getShip()
{
return m_poShip;
}
void startExperiment();
void addTarget(uint32_t ui32TargetPosition);
bool m_bTargetRequest;
private:
bool m_bActive;
void processFrame(uint32_t ui32CurrentFrame);
CEGUI::Window* m_poInstructionsReady;
CStarShip* m_poShip;
std::vector<CShooterTarget*> m_oTargets;
public:
CShooterApplication();
~CShooterApplication();
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext);
CStarShip* getShip()
{
return m_poShip;
}
void startExperiment();
void addTarget(uint32_t ui32TargetPosition);
bool m_bTargetRequest;
private:
bool m_bActive;
void processFrame(uint32_t ui32CurrentFrame);
CEGUI::Window* m_poInstructionsReady;
CStarShip* m_poShip;
std::vector<CShooterTarget*> m_oTargets;
};
}
......
#if defined(TARGET_HAS_ThirdPartyOgre3D)
#include "ovassvepCShooterTarget.h"
......@@ -8,40 +7,39 @@ using namespace OpenViBESSVEP;
Ogre::SceneNode* CShooterTarget::m_poParentNode = nullptr;
CBasicPainter* CShooterTarget::m_poPainter = nullptr;
void CShooterTarget::initialize( CBasicPainter* poPainter, Ogre::SceneNode* poParentNode )
void CShooterTarget::initialize(CBasicPainter* poPainter, Ogre::SceneNode* poParentNode)
{
m_poPainter = poPainter;
m_poParentNode = poParentNode;
}
CShooterTarget* CShooterTarget::createTarget( Ogre::Radian rAngle )
CShooterTarget* CShooterTarget::createTarget(Ogre::Radian rAngle)
{
if ( m_poPainter == NULL )
if (m_poPainter == NULL)
{
std::cerr << "The CShooterTarget was not initialized" << std::endl;
return NULL;
}
return new CShooterTarget( rAngle );
return new CShooterTarget(rAngle);
}
CShooterTarget::CShooterTarget( Ogre::Radian rAngle )
CShooterTarget::CShooterTarget(Ogre::Radian rAngle)
{
m_poTargetNode = m_poParentNode->createChildSceneNode();
Ogre::MovableObject* l_poTargetObject = m_poPainter->paintCircle(0.0f, 1.0f - 1.0f * SSVEP_SHOOTER_TARGET_SIZE, SSVEP_SHOOTER_TARGET_SIZE, Ogre::ColourValue(1.0f, 1.0f, 1.0f));
l_poTargetObject->setVisible( true );
m_poTargetNode->attachObject( l_poTargetObject );
m_poTargetNode->roll( rAngle );
l_poTargetObject->setVisible(true);
m_poTargetNode->attachObject(l_poTargetObject);
m_poTargetNode->roll(rAngle);
}
CShooterTarget::~CShooterTarget()
{
m_poTargetNode->removeAndDestroyAllChildren();
m_poTargetNode->getCreator()->destroySceneNode( m_poTargetNode );
m_poTargetNode->getCreator()->destroySceneNode(m_poTargetNode);
}
bool CShooterTarget::collidesWith(std::pair<Ogre::Real, Ogre::Real> pPoint)
......@@ -55,4 +53,4 @@ bool CShooterTarget::collidesWith(std::pair<Ogre::Real, Ogre::Real> pPoint)
return l_rDistance <= SSVEP_SHOOTER_TARGET_SIZE;
}
#endif
\ No newline at end of file
#endif
......@@ -12,21 +12,20 @@ namespace OpenViBESSVEP
{
class CShooterTarget
{
public:
static CShooterTarget* createTarget( Ogre::Radian rAngle );
static void initialize( CBasicPainter* poPainter, Ogre::SceneNode* poParentNode );
~CShooterTarget();
public:
static CShooterTarget* createTarget(Ogre::Radian rAngle);
static void initialize(CBasicPainter* poPainter, Ogre::SceneNode* poParentNode);
~CShooterTarget();
bool collidesWith(std::pair<Ogre::Real, Ogre::Real>);
bool collidesWith(std::pair<Ogre::Real, Ogre::Real>);
private:
static Ogre::SceneNode* m_poParentNode;
static CBasicPainter* m_poPainter;
private:
static Ogre::SceneNode* m_poParentNode;