First display of the specific elements

This commit is contained in:
Edouard Dupin 2012-03-14 23:28:33 +01:00
parent d2034bf69b
commit 17fb56330b
5 changed files with 56 additions and 10 deletions

View File

@ -19,7 +19,14 @@
drawElement::Circle::Circle(void) : Base("Circle") drawElement::Circle::Circle(void) : Base("Circle")
{ {
m_color.red = 1.0;
m_color.green = 1.0;
m_color.blue = 1.0;
m_color.alpha = 1.0;
m_center.x = 0;
m_center.y = 0;
m_ratio = 0.3;
m_thickness = 0.03;
} }
drawElement::Circle::~Circle(void) drawElement::Circle::~Circle(void)
@ -29,8 +36,8 @@ drawElement::Circle::~Circle(void)
void drawElement::Circle::Draw(ewol::OObject2DColored &OObjects) void drawElement::Circle::Draw(ewol::OObject2DColored &OObjects)
{ {
OObjects.SetColor(1.0, 0.0, 1.0, 1.0); OObjects.SetColor(m_color);
OObjects.Circle(0.2, 0.2, 0.3, 0.05); OObjects.Circle(m_center.x, m_center.y, m_ratio, m_thickness);
} }

View File

@ -23,9 +23,29 @@ namespace drawElement {
Circle(void); Circle(void);
virtual ~Circle(void); virtual ~Circle(void);
private: private:
color_ts m_color;
coord2D_ts m_center;
int32_t m_nbRay;
etkFloat_t m_ratio;
etkFloat_t m_thickness;
etkFloat_t m_shadowOutput;
etkFloat_t m_shadowInput;
public: public:
void ColorSet(color_ts color) { m_color = color; };
color_ts ColorGet(void) { return m_color; };
void CenterSet(coord2D_ts center) { m_center = center; };
coord2D_ts CenterGet(void) { return m_center; };
void RatioSet(etkFloat_t ratio) { m_ratio = ratio; };
etkFloat_t RatioGet(void) { return m_ratio; };
void ThicknessSet(etkFloat_t thickness) { m_thickness = thickness; };
etkFloat_t ThicknessGet(void) { return m_thickness; };
void ShadowOutputSet(etkFloat_t shadowOutput) { m_shadowOutput = shadowOutput; };
etkFloat_t ShadowOutputGet(void) { return m_shadowOutput; };
void ShadowInputSet(etkFloat_t shadowInput) { m_shadowInput = shadowInput; };
etkFloat_t ShadowInputGet(void) { return m_shadowInput; };
void NbRaySet(int32_t nbRay) { m_nbRay = nbRay; };
int32_t nbRayGet(void) { return m_nbRay; };
public: public:
virtual void Draw(ewol::OObject2DColored &OObjects); virtual void Draw(ewol::OObject2DColored &OObjects);
}; };

View File

@ -30,7 +30,7 @@ drawElement::Rectangle::~Rectangle(void)
void drawElement::Rectangle::Draw(ewol::OObject2DColored &OObjects) void drawElement::Rectangle::Draw(ewol::OObject2DColored &OObjects)
{ {
OObjects.SetColor(1.0, 0.0, 0.0, 1.0); OObjects.SetColor(1.0, 0.0, 0.0, 1.0);
OObjects.Rectangle(0.5, 0.5, 0.3, 0.3); OObjects.Rectangle(0.2, 0.5, 0.3, 0.6);
} }

View File

@ -32,6 +32,7 @@
#include <globalMsg.h> #include <globalMsg.h>
#include <ewol/WidgetManager.h> #include <ewol/WidgetManager.h>
#include <ewol/EObject.h> #include <ewol/EObject.h>
#include <elementManager.h>
#undef __class__ #undef __class__
@ -116,16 +117,20 @@ bool widgetDrawer::CalculateMinSize(void)
void widgetDrawer::OnDraw(void) void widgetDrawer::OnDraw(void)
{ {
m_OObjectsColored[ m_currentDrawId].Draw(); m_OObjectsColored[ m_currentDrawId].Draw();
m_OObjectsColoredElement[m_currentDrawId].Draw();
m_OObjectTextNormal[ m_currentDrawId].Draw(); m_OObjectTextNormal[ m_currentDrawId].Draw();
} }
#define BORDER_SIZE (2) #define BORDER_SIZE (2)
void widgetDrawer::OnRegenerateDisplay(void) void widgetDrawer::OnRegenerateDisplay(void)
{ {
if (true == NeedRedraw()) { if (true == NeedRedraw()) {
// clean internal elements ... // clean internal elements ...
m_OObjectTextNormal[ m_currentCreateId].SetFontID(m_fontNormal); m_OObjectTextNormal[ m_currentCreateId].SetFontID(m_fontNormal);
m_OObjectTextNormal[ m_currentCreateId].Clear(); m_OObjectTextNormal[ m_currentCreateId].Clear();
m_OObjectsColored[ m_currentCreateId].Clear(); m_OObjectsColored[ m_currentCreateId].Clear();
m_OObjectsColoredElement[m_currentCreateId].Clear();
// we set 3 pixels in the border (blue) and draw // we set 3 pixels in the border (blue) and draw
color_ts bandColor; color_ts bandColor;
bandColor.red = 0.0; bandColor.red = 0.0;
@ -174,6 +179,18 @@ void widgetDrawer::OnRegenerateDisplay(void)
for (int32_t iii=0; iii<nbElement; iii++) { for (int32_t iii=0; iii<nbElement; iii++) {
m_OObjectsColored[m_currentCreateId].Rectangle(drawPosStart.x, drawPosStart.y + iii*20, drawPosStop.x, 10); m_OObjectsColored[m_currentCreateId].Rectangle(drawPosStart.x, drawPosStart.y + iii*20, drawPosStop.x, 10);
} }
coord2D_ts drawSize;
drawSize.x = drawPosStop.x-drawPosStart.x;
drawSize.y = drawPosStop.y-drawPosStart.y;
m_OObjectsColoredElement[m_currentCreateId].scalingSet(drawSize);
int32_t nbElements = drawElement::Size();
for(int32_t iii=0; iii<nbElements; iii++) {
drawElement::Base* elementLocal = drawElement::Get(iii);
if (NULL != elementLocal) {
elementLocal->Draw(m_OObjectsColoredElement[m_currentCreateId]);
}
}
/*
m_OObjectsColored[m_currentCreateId].clippingDisable(); m_OObjectsColored[m_currentCreateId].clippingDisable();
for (int32_t iii=0; iii<m_linkList.Size(); iii++) { for (int32_t iii=0; iii<m_linkList.Size(); iii++) {
for (int32_t jjj=0; jjj<3; jjj++) { for (int32_t jjj=0; jjj<3; jjj++) {
@ -220,6 +237,7 @@ void widgetDrawer::OnRegenerateDisplay(void)
m_OObjectsColored[m_currentCreateId].SetColor(bgColor); m_OObjectsColored[m_currentCreateId].SetColor(bgColor);
} }
} }
*/
m_needFlipFlop = true; m_needFlipFlop = true;
} }
} }

View File

@ -66,6 +66,7 @@ class widgetDrawer :public ewol::Widget
// drawing elements : // drawing elements :
ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER]; ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER];
ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER]; ewol::OObject2DColored m_OObjectsColored[NB_BOUBLE_BUFFER];
ewol::OObject2DColored m_OObjectsColoredElement[NB_BOUBLE_BUFFER];
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);