Commit 7b6a89ed authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix: Coding Rules Useless Typedef (u)int(8|16|32|64)

parent 254ee860
......@@ -58,7 +58,7 @@ bool CShooterApplication::setup(IKernelContext* poKernelContext)
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "InstructionsReady");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
m_sheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image");
#endif
......
......@@ -11,120 +11,102 @@
using namespace OpenViBESSVEP;
using namespace Ogre;
CStarShip::CStarShip(CApplication* poApplication, SceneNode* poParentNode, Real rRadius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies) :
CStarShip::CStarShip(CApplication* poApplication, SceneNode* poParentNode, Real radius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies) :
m_rCurrentAngle(0),
m_iCurrentRotationCount(0),
m_bIsShooting(false)
{
// get configuration and controlling objects
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = poApplication->getConfigurationManager();
CBasicPainter* l_poPainter = poApplication->getPainter();
CBasicPainter* painter = poApplication->getPainter();
m_rAngularSpeed = (Real)l_poConfigurationManager->expandAsFloat("${SSVEP_ShipAngularSpeed}", Math::PI / 60.0f);
poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "Ship Angluar Speed : " << m_rAngularSpeed << "\n";
ColourValue l_oLightColour = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}", 1.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}", 1.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}", 1.0f)));
ColourValue lightColor = ColourValue(
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}", 1.0f)),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}", 1.0f)),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}", 1.0f)));
ColourValue l_oDarkColour = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}", 0.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}", 0.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}", 0.0f)));
ColourValue darkColor = ColourValue(
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}", 0.0f)),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}", 0.0f)),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}", 0.0f)));
// draw the ship scene objects
m_poShipNode = poParentNode->createChildSceneNode();
m_poShotNode = m_poShipNode->createChildSceneNode();
MovableObject* l_poShipHull;
l_poShipHull = l_poPainter->paintCircle(0.0f, 0.0f, rRadius, SSVEP_SHIP_HULL_COLOUR, false, 2);
m_poShipNode->attachObject(l_poShipHull);
l_poShipHull->setVisible(true);
MovableObject* shipHull;
shipHull = painter->paintCircle(0.0f, 0.0f, radius, SSVEP_SHIP_HULL_COLOUR, false, 2);
m_poShipNode->attachObject(shipHull);
shipHull->setVisible(true);
SceneNode* l_poDrawnObjectNode;
MovableObject* l_poDrawnObject;
// Ogre::RealRect l_oWingRectangle = { - rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f };
RealRect l_oWingRectangle(-rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f);
SceneNode* drawnObjectNode;
MovableObject* drawnObject;
// Ogre::RealRect l_oWingRectangle = { - radius * 0.4f, radius * 0.4f, radius * 0.4f, -radius * 0.4f };
RealRect wingRectangle(-radius * 0.4f, radius * 0.4f, radius * 0.4f, -radius * 0.4f);
// paint the cannon
l_poDrawnObjectNode = m_poShipNode->createChildSceneNode();
drawnObjectNode = m_poShipNode->createChildSceneNode();
l_poDrawnObject = l_poPainter->paintTriangle(
Point(0.0f, rRadius * 0.4f),
Point(- rRadius * 0.4f, -rRadius * 0.4f),
Point(rRadius * 0.4f, -rRadius * 0.4f),
l_oLightColour
);
l_poDrawnObject->setVisible(true);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
drawnObject = painter->paintTriangle(Point(0.0f, radius * 0.4f), Point(- radius * 0.4f, -radius * 0.4f), Point(radius * 0.4f, -radius * 0.4f), lightColor);
drawnObject->setVisible(true);
drawnObjectNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintTriangle(
Point(0.0f, rRadius * 0.4f),
Point(- rRadius * 0.4f, -rRadius * 0.4f),
Point(rRadius * 0.4f, -rRadius * 0.4f),
l_oDarkColour
);
l_poDrawnObject->setVisible(false);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
drawnObject = painter->paintTriangle(Point(0.0f, radius * 0.4f), Point(- radius * 0.4f, -radius * 0.4f), Point(radius * 0.4f, -radius * 0.4f), darkColor);
drawnObject->setVisible(false);
drawnObjectNode->attachObject(drawnObject);
l_poDrawnObjectNode->setPosition(0.0, rRadius, 0.0);
drawnObjectNode->setPosition(0.0, radius, 0.0);
m_poShipCannon = new CSSVEPFlickeringObject(l_poDrawnObjectNode, (*pFrequencies)[1].first, (*pFrequencies)[1].second);
m_poShipCannon = new CSSVEPFlickeringObject(drawnObjectNode, (*pFrequencies)[1].first, (*pFrequencies)[1].second);
// paint the left wing
l_poDrawnObjectNode = m_poShipNode->createChildSceneNode();
drawnObjectNode = m_poShipNode->createChildSceneNode();
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oLightColour);
l_poDrawnObject->setVisible(true);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
drawnObject = painter->paintRectangle(wingRectangle, lightColor);
drawnObject->setVisible(true);
drawnObjectNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oDarkColour);
l_poDrawnObject->setVisible(false);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
drawnObject = painter->paintRectangle(wingRectangle, darkColor);
drawnObject->setVisible(false);
drawnObjectNode->attachObject(drawnObject);
l_poDrawnObjectNode->setPosition(-rRadius * 0.875f, -rRadius * 0.875f, 0.0);
drawnObjectNode->setPosition(-radius * 0.875f, -radius * 0.875f, 0.0);
m_poShipLeftWing = new CSSVEPFlickeringObject(l_poDrawnObjectNode, (*pFrequencies)[2].first, (*pFrequencies)[2].second);
m_poShipLeftWing = new CSSVEPFlickeringObject(drawnObjectNode, (*pFrequencies)[2].first, (*pFrequencies)[2].second);
// paint the right wing
l_poDrawnObjectNode = m_poShipNode->createChildSceneNode();
drawnObjectNode = m_poShipNode->createChildSceneNode();
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oLightColour);
l_poDrawnObject->setVisible(true);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
drawnObject = painter->paintRectangle(wingRectangle, lightColor);
drawnObject->setVisible(true);
drawnObjectNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oDarkColour);
l_poDrawnObject->setVisible(false);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
drawnObject = painter->paintRectangle(wingRectangle, darkColor);
drawnObject->setVisible(false);
drawnObjectNode->attachObject(drawnObject);
l_poDrawnObjectNode->setPosition(rRadius * 0.875f, -rRadius * 0.875f, 0.0f);
drawnObjectNode->setPosition(radius * 0.875f, -radius * 0.875f, 0.0f);
m_poShipRightWing = new CSSVEPFlickeringObject(l_poDrawnObjectNode, (*pFrequencies)[3].first, (*pFrequencies)[3].second);
m_poShipRightWing = new CSSVEPFlickeringObject(drawnObjectNode, (*pFrequencies)[3].first, (*pFrequencies)[3].second);
// create the shot
l_poDrawnObject = l_poPainter->paintTriangle(
Point(0.0f, rRadius * 0.25f),
Point(-rRadius * 0.125f, 0.0f),
Point(rRadius * 0.125f, 0.0f),
ColourValue(1.0f, 1.0f, 0.0f));
l_poDrawnObject->setVisible(false);
drawnObject = painter->paintTriangle(Point(0.0f, radius * 0.25f), Point(-radius * 0.125f, 0.0f), Point(radius * 0.125f, 0.0f), ColourValue(1.0f, 1.0f, 0.0f));
drawnObject->setVisible(false);
m_poShotNode->attachObject(l_poDrawnObject);
m_poShotNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintTriangle(
Point(-rRadius * 0.125f, 0.0f),
Point(0.0f, -rRadius * 0.75f),
Point(rRadius * 0.125f, 0.0f),
ColourValue(1.0f, 1.0f, 0.0f));
l_poDrawnObject->setVisible(false);
drawnObject = painter->paintTriangle(Point(-radius * 0.125f, 0.0f), Point(0.0f, -radius * 0.75f), Point(radius * 0.125f, 0.0f), ColourValue(1.0f, 1.0f, 0.0f));
drawnObject->setVisible(false);
m_poShotNode->attachObject(l_poDrawnObject);
m_poShotNode->attachObject(drawnObject);
}
void CStarShip::processFrame(uint32_t ui32CurrentFrame)
......@@ -136,9 +118,7 @@ void CStarShip::processFrame(uint32_t ui32CurrentFrame)
if (m_iCurrentRotationCount != 0)
{
m_poShipNode->roll(Radian(m_rAngularSpeed * SIGN( m_iCurrentRotationCount )));
m_rCurrentAngle += Radian(m_rAngularSpeed * SIGN( m_iCurrentRotationCount ));
m_iCurrentRotationCount -= SIGN( m_iCurrentRotationCount );
}
......
......@@ -14,7 +14,7 @@ namespace OpenViBESSVEP
class CStarShip
{
public:
CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies);
CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real radius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies);
void processFrame(uint32_t ui32CurrentFrame);
void rotate(int iRotationCount);
......
......@@ -52,7 +52,7 @@ bool CTrainerApplication::setup(IKernelContext* poKernelContext)
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "InstructionsReady");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
m_sheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image");
#endif
......
......@@ -6,55 +6,55 @@
using namespace Ogre;
using namespace OpenViBESSVEP;
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);
float CTrainerFlickeringObject::m_f32TargetWidth = 0.2f;
float CTrainerFlickeringObject::m_f32TargetHeight = 0.2f;
CTrainerApplication* CTrainerFlickeringObject::m_poApplication = nullptr;
SceneNode* CTrainerFlickeringObject::m_parentNode = nullptr;
CBasicPainter* CTrainerFlickeringObject::m_painter = nullptr;
ColourValue CTrainerFlickeringObject::m_lightColor = ColourValue(1.0f, 1.0f, 1.0f);
ColourValue CTrainerFlickeringObject::m_darkColor = ColourValue(0.0f, 0.0f, 0.0f);
float CTrainerFlickeringObject::m_targetWidth = 0.2f;
float CTrainerFlickeringObject::m_targetHeight = 0.2f;
CTrainerApplication* CTrainerFlickeringObject::m_application = nullptr;
void CTrainerFlickeringObject::initialize(CTrainerApplication* poApplication)
{
m_poApplication = poApplication;
m_application = poApplication;
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = poApplication->getConfigurationManager();
m_poPainter = poApplication->getPainter();
m_poParentNode = poApplication->getSceneNode();
m_painter = poApplication->getPainter();
m_parentNode = poApplication->getSceneNode();
m_f32TargetWidth = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}"));
m_f32TargetHeight = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}"));
m_targetWidth = float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}"));
m_targetHeight = float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}"));
m_oLightColour = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}")));
m_lightColor = ColourValue(
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}")),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}")));
m_oDarkColour = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}")));
m_darkColor = ColourValue(
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}")),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}")),
float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}")));
}
CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject(uint32_t l_i32TargetId)
{
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_poApplication->getConfigurationManager();
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_application->getConfigurationManager();
if (m_poPainter != nullptr)
if (m_painter != nullptr)
{
ColourValue l_oCurrentTargetColour = (l_i32TargetId == 0) ? m_oDarkColour : m_oLightColour;
ColourValue l_oCurrentTargetColour = (l_i32TargetId == 0) ? m_darkColor : m_lightColor;
char l_sTargetIdString[255];
sprintf(l_sTargetIdString, "%d", l_i32TargetId);
OpenViBE::CIdentifier l_oTargetId = l_poConfigurationManager->createConfigurationToken("SSVEPTarget_Id", OpenViBE::CString(l_sTargetIdString));
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;
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_application->getFrequencies()))[l_i32TargetId].first;
uint32_t l_ui32FramesD = (*(m_application->getFrequencies()))[l_i32TargetId].second;
m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n";
m_application->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n";
l_poConfigurationManager->releaseConfigurationToken(l_oTargetId);
......@@ -62,12 +62,12 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
}
else
{
m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Fatal << "TrainerTarget object was not properly initialized\n";
m_application->getLogManager() << OpenViBE::Kernel::LogLevel_Fatal << "TrainerTarget object was not properly initialized\n";
return nullptr;
}
}
CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY, ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames) :
CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY, ColourValue oColour, uint8_t ui8LitFrames, uint8_t ui8DarkFrames) :
CSSVEPFlickeringObject(nullptr, ui8LitFrames, ui8DarkFrames)
{
SceneNode* l_poPointerNode;
......@@ -75,26 +75,22 @@ CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY,
MovableObject* l_poLitObject;
MovableObject* l_poDarkObject;
m_poElementNode = m_poParentNode->createChildSceneNode();
m_poElementNode = m_parentNode->createChildSceneNode();
m_poObjectNode = m_poElementNode->createChildSceneNode();
l_poPointerNode = m_poElementNode->createChildSceneNode();
RealRect l_oRectangle(f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2);
RealRect l_oRectangle(f32PosX - m_targetWidth / 2, f32PosY + m_targetHeight / 2, f32PosX + m_targetWidth / 2, f32PosY - m_targetHeight / 2);
l_poLitObject = m_poPainter->paintRectangle(l_oRectangle, oColour);
l_poLitObject = m_painter->paintRectangle(l_oRectangle, oColour);
m_poObjectNode->attachObject(l_poLitObject);
l_poLitObject->setVisible(true);
l_poDarkObject = m_poPainter->paintRectangle(l_oRectangle, m_oDarkColour);
l_poDarkObject = m_painter->paintRectangle(l_oRectangle, m_darkColor);
m_poObjectNode->attachObject(l_poDarkObject);
l_poDarkObject->setVisible(false);
m_poPointer = m_poPainter->paintTriangle(
Point(f32PosX - 0.05f, f32PosY + m_f32TargetHeight),
Point(f32PosX, f32PosY + m_f32TargetHeight - 0.05f),
Point(f32PosX + 0.05f, f32PosY + m_f32TargetHeight),
ColourValue(1, 1, 0));
m_poPointer = m_painter->paintTriangle(Point(f32PosX - 0.05f, f32PosY + m_targetHeight), Point(f32PosX, f32PosY + m_targetHeight - 0.05f), Point(f32PosX + 0.05f, f32PosY + m_targetHeight), ColourValue(1, 1, 0));
l_poPointerNode->attachObject(m_poPointer);
m_poPointer->setVisible(false);
......
......@@ -29,15 +29,15 @@ namespace OpenViBESSVEP
}
private:
static CTrainerApplication* m_poApplication;
static Ogre::SceneNode* m_poParentNode;
static CBasicPainter* m_poPainter;
static float m_f32TargetWidth;
static float m_f32TargetHeight;
static Ogre::ColourValue m_oLightColour;
static Ogre::ColourValue m_oDarkColour;
CTrainerFlickeringObject(float f32PosX, float f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames);
static CTrainerApplication* m_application;
static Ogre::SceneNode* m_parentNode;
static CBasicPainter* m_painter;
static float m_targetWidth;
static float m_targetHeight;
static Ogre::ColourValue m_lightColor;
static Ogre::ColourValue m_darkColor;
CTrainerFlickeringObject(float f32PosX, float f32PosY, Ogre::ColourValue oColour, uint8_t ui8LitFrames, uint8_t ui8DarkFrames);
Ogre::SceneNode* m_poElementNode;
......
......@@ -23,7 +23,7 @@ CApplication::~CApplication()
{
if (m_poPainter != nullptr)
{
(*m_poLogManager) << LogLevel_Debug << "- m_poPainter\n";
(*m_poLogManager) << LogLevel_Debug << "- m_painter\n";
delete m_poPainter;
m_poPainter = nullptr;
}
......@@ -40,7 +40,7 @@ CApplication::~CApplication()
}
(*m_poLogManager) << LogLevel_Debug << "- m_poRoot\n";
(*m_poLogManager) << LogLevel_Debug << "- m_root\n";
if (m_poRoot != nullptr)
{
delete m_poRoot;
......@@ -73,7 +73,7 @@ bool CApplication::setup(IKernelContext* poKernelContext)
// Root creation
CString l_sOgreCfg = l_poConfigurationManager->expand("${Path_UserData}") + "/openvibe-ssvep-demo-ogre.cfg";
(*m_poLogManager) << LogLevel_Debug << "+ m_poRoot = new Ogre::Root(...)\n";
(*m_poLogManager) << LogLevel_Debug << "+ m_root = new Ogre::Root(...)\n";
(*m_poLogManager) << LogLevel_Info << "Ogre cfg file : " << l_sOgreCfg << "\n";
m_poRoot = new Ogre::Root(l_sPluginsPath.toASCIIString(), l_sOgreCfg.toASCIIString(), l_sOgreLog.toASCIIString());
......@@ -87,7 +87,7 @@ bool CApplication::setup(IKernelContext* poKernelContext)
return false;
}
// m_poWindow = m_poRoot->initialise(true);
// m_window = m_root->initialise(true);
Ogre::NameValuePairList l_oOptionList;
......@@ -108,14 +108,14 @@ bool CApplication::setup(IKernelContext* poKernelContext)
m_poViewport = m_poWindow->addViewport(m_poCamera, 1);
this->resizeViewport();
// m_poViewport->setBackgroundColour(Ogre::ColourValue(0.0, 0.5, 0.5));
// m_viewport->setBackgroundColour(Ogre::ColourValue(0.0, 0.5, 0.5));
m_poCamera->setAspectRatio(Ogre::Real(m_poViewport->getActualWidth()) / Ogre::Real(m_poViewport->getActualHeight()));
m_poSceneNode = m_poSceneManager->getRootSceneNode()->createChildSceneNode("SSVEPApplicationNode");
// initialize the painter object
(*m_poLogManager) << LogLevel_Debug << "+ m_poPainter = new CBasicPainter(...)\n";
(*m_poLogManager) << LogLevel_Debug << "+ m_painter = new CBasicPainter(...)\n";
m_poPainter = new CBasicPainter(this);
(*m_poLogManager) << LogLevel_Debug << " * initializing CEGUI\n";
......@@ -185,7 +185,7 @@ bool CApplication::configure()
// Set hard-coded parameters, VSync in particular
m_poRoot->getRenderSystem()->setConfigOption("VSync", "True");
// m_poRoot->getRenderSystem()->setConfigOption("Full Screen", "Yes");
// m_root->getRenderSystem()->setConfigOption("Full Screen", "Yes");
m_poRoot->getRenderSystem()->setConfigOption("Video Mode", "640 x 480 @ 16-bit colour");
......@@ -222,7 +222,7 @@ void CApplication::initCEGUI(const char* logFilename)
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR >= 8)
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(m_poSheet);
#else
CEGUI::System::getSingleton().setGUISheet(m_poSheet);
CEGUI::System::getSingleton().setGUISheet(m_sheet);
#endif
}
......@@ -230,14 +230,14 @@ void CApplication::resizeViewport()
{
(*m_poLogManager) << LogLevel_Trace << "Creating a new viewport\n";
Ogre::uint32 l_ui32ViewportSize = MIN(m_ui32WindowWidth, m_ui32WindowHeight);
(*m_poLogManager) << LogLevel_Info << "New viewport size : " << l_ui32ViewportSize << "\n";
Ogre::uint32 size = MIN(m_ui32WindowWidth, m_ui32WindowHeight);
(*m_poLogManager) << LogLevel_Info << "New viewport size : " << size << "\n";
m_poViewport->setDimensions(
Ogre::Real(m_ui32WindowWidth - l_ui32ViewportSize) / Ogre::Real(m_ui32WindowWidth) / 2,
Ogre::Real(m_ui32WindowHeight - l_ui32ViewportSize) / Ogre::Real(m_ui32WindowHeight) / 2,
Ogre::Real(l_ui32ViewportSize) / Ogre::Real(m_ui32WindowWidth),
Ogre::Real(l_ui32ViewportSize) / Ogre::Real(m_ui32WindowHeight)
Ogre::Real(m_ui32WindowWidth - size) / Ogre::Real(m_ui32WindowWidth) / 2,
Ogre::Real(m_ui32WindowHeight - size) / Ogre::Real(m_ui32WindowHeight) / 2,
Ogre::Real(size) / Ogre::Real(m_ui32WindowWidth),
Ogre::Real(size) / Ogre::Real(m_ui32WindowHeight)
);
}
......
......@@ -35,49 +35,16 @@ namespace OpenViBESSVEP
virtual void startFlickering() {}
virtual void stopFlickering() {}
Ogre::RenderWindow* getWindow()
{
return m_poWindow;
}
Ogre::SceneManager* getSceneManager()
{
return m_poSceneManager;
}
Ogre::SceneNode* getSceneNode()
{
return m_poSceneNode;
}
CBasicPainter* getPainter()
{
return m_poPainter;
}
void exit()
{
m_bContinueRendering = false;
}
OpenViBE::Kernel::ILogManager& getLogManager()
{
return (*m_poLogManager);
}
OpenViBE::Kernel::IConfigurationManager* getConfigurationManager()
{
return &(m_poKernelContext->getConfigurationManager());
}
std::vector<std::pair<uint32_t, uint32_t>>* getFrequencies()
{
return &m_oFrequencies;
}
Ogre::RenderWindow* getWindow() { return m_poWindow; }
Ogre::SceneManager* getSceneManager() { return m_poSceneManager; }
Ogre::SceneNode* getSceneNode() { return m_poSceneNode; }
CBasicPainter* getPainter() { return m_poPainter; }
void exit() { m_bContinueRendering = false; }
OpenViBE::Kernel::ILogManager& getLogManager() { return (*m_poLogManager); }
OpenViBE::Kernel::IConfigurationManager* getConfigurationManager() { return &(m_poKernelContext->getConfigurationManager()); }
std::vector<std::pair<uint32_t, uint32_t>>* getFrequencies() { return &m_oFrequencies; }
void resizeViewport();
protected:
OpenViBE::Kernel::IKernelContext* m_poKernelContext;
OpenViBE::Kernel::ILogManager* m_poLogManager;
......
......@@ -150,12 +150,7 @@ ManualObject* CBasicPainter::paintCircle(Real rX, Real rY, Real rR, ColourValue
return l_poObject;
}
void CBasicPainter::paintText(
const std::string& sID,
const std::string& sText,
Real rX, Real rY,
Real rWidth, Real rHeight,
const ColourValue& oColour)
void CBasicPainter::paintText(const std::string& sID, const std::string& sText, Real rX, Real rY, Real rWidth, Real rHeight, const ColourValue& oColour)
{
OverlayElement* l_pText = m_poOverlayManager->createOverlayElement("TextArea", sID);
......
......@@ -33,12 +33,7 @@ namespace OpenViBESSVEP
Ogre::ManualObject* paintTriangle(Point oP1, Point oP2, Point oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1);
Ogre::ManualObject* paintCircle(Ogre::Real rX, Ogre::Real rY, Ogre::Real rR, Ogre::ColourValue = SSVEP_DEFAULT_COLOUR, bool bFilled = true, int iPlane = 1);
void paintText(
const std::string& sID,
const std::string& sText,
Ogre::Real rX, Ogre::Real rY,
Ogre::Real rWidth, Ogre::Real rHeight,
const Ogre::ColourValue& oColour);
void paintText(const std::string& sID, const std::string& sText, Ogre::Real rX, Ogre::Real rY, Ogre::Real rWidth, Ogre::Real rHeight, const Ogre::ColourValue& oColour);
protected:
CApplication* m_poApplication;
......
......@@ -29,10 +29,10 @@ bool CGenericStimulatorApplication::setup(IKernelContext* poKernelContext)
{
CApplication::setup(poKernelContext);
(*m_poLogManager) << LogLevel_Debug << " * CGenericStimulatorApplication::setup()\n";
IConfigurationManager* l_poConfigurationManager = &(m_poKernelContext->getConfigurationManager());
l_poConfigurationManager->addConfigurationFromFile(m_sScenarioDir + "/appconf/generic-configuration.conf");
std::cout << m_sScenarioDir << "/appconf/generic-configuration.conf" << "\n";
(*m_logManager) << LogLevel_Debug << " * CGenericStimulatorApplication::setup()\n";
IConfigurationManager* l_poConfigurationManager = &(m_kernelContext->getConfigurationManager());
l_poConfigurationManager->addConfigurationFromFile(m_ScenarioDir + "/appconf/generic-configuration.conf");
std::cout << m_ScenarioDir << "/appconf/generic-configuration.conf" << "\n";
poKernelContext->getLogManager().activate(LogLevel_First, LogLevel_Last, true);
......@@ -54,16 +54,16 @@ bool CGenericStimulatorApplication::setup(IKernelContext* poKernelContext)
}