#include "example_drawer.h"
ADTF_PLUGIN_VERSION("Demo 2D Drawer Example Plugin",
disptb,
DISPTB_VERSION_MAJOR,
DISPTB_VERSION_MINOR,
DISPTB_VERSION_PATCH,
cExampleDrawer)
cExampleDrawer::cExampleDrawer()
{
m_propColorRed.SetDescription("Value for red content of color to draw a circle.");
RegisterPropertyVariable("RGB-Color-Red", m_propColorRed);
m_propColorGreen.SetDescription("Value for green content of color to draw a circle.");
RegisterPropertyVariable("RGB-Color-Green", m_propColorGreen);
m_propColorBlue.SetDescription("Value for blue content of color to draw a circle.");
RegisterPropertyVariable("RGB-Color-Blue", m_propColorBlue);
m_propCircleX1.SetDescription("Value for the x-axis of the first corner to draw a circle.");
RegisterPropertyVariable("Circle-Coords-X1", m_propCircleX1);
m_propCircleX2.SetDescription("Value for the x-axis of the second corner to draw a circle.");
RegisterPropertyVariable("Circle-Coords-X2", m_propCircleX2);
m_propCircleY1.SetDescription("Value for the y-axis of the first corner to draw a circle.");
RegisterPropertyVariable("Circle-Coords-Y1", m_propCircleY1);
m_propCircleY2.SetDescription("Value for the x-axis of the second corner to draw a circle.");
RegisterPropertyVariable("Circle-Coords-Y2", m_propCircleY2);
SetDescription("Use this Drawer to paint a simple circle onto the canvas.");
SetHelpLink("$(ADTF_DISPLAY_TOOLBOX_DIR)/doc/displaytoolbox_html/page_2d_example_drawer_readme.html");
}
tResult cExampleDrawer::Init(tInitStage eStage)
{
RETURN_IF_FAILED(cDrawer::Init(eStage));
RETURN_NOERROR;
}
tResult cExampleDrawer::Shutdown(tInitStage eStage)
{
RETURN_IF_FAILED(cDrawer::Shutdown(eStage));
RETURN_NOERROR;
}
tResult cExampleDrawer::Draw(const adtf::ucom::iobject_ptr<adtf::disptb::graphicslib::ICanvas>& pCanvas)
{
pCanvas->Color(
m_propColorRed,
m_propColorGreen,
m_propColorBlue
);
pCanvas->DrawCircle(
m_propCircleX1,
m_propCircleY1,
m_propCircleX2,
m_propCircleY2
);
RETURN_NOERROR;
}