TouchGFX + 0/3 examples
CodeScope will show references to touchgfx::Circle from the following samples and libraries:
Examples
STM32469I-Discovery
Demonstrations
STM32469I_EVAL
Demonstrations
STM324x9I_EVAL
Demonstrations
 
Symbols
loading...
Files
loading...

touchgfx::Circle class

@class Circle Circle.hpp touchgfx/widgets/canvas/Circle.hpp Simple widget capable of drawing a circle. Simple widget capable of drawing a circle. By tweaking the parameters of the circle, several parameters of the circle can be changed. Center, radius, line width, line cap and partial circle arc. This opens for creation of fascinating graphics. @see CanvasWidget

Syntax

class Circle : public CanvasWidget { public:     Circle();     template <typename T>     void setCircle(const T x, const T y, const T r)     {         setCenter<T>(x, y);         setRadius<T>(r);     }     void setCircle(const int16_t x, const int16_t y, const int16_t r)     {         setCircle<int>(x, y, r);     }     template <typename T>     void setCenter(const T x, const T y)     {         this->circleCenterX = CWRUtil::toQ5<T>(x);         this->circleCenterY = CWRUtil::toQ5<T>(y);     }     void setCenter(const int16_t x, const int16_t y)     {         setCenter<int>(x, y);     }     template <typename T>     void getCenter(T& x, T& y) const     {         x = circleCenterX.to<T>();         y = circleCenterY.to<T>();     }     template <typename T>     void setRadius(const T r)     {         this->circleRadius = CWRUtil::toQ5<T>(r);     }     template <typename T>     void getRadius(T& r) const     {         r = circleRadius.to<T>();     }     template <typename T>     void setArc(const T startAngle, const T endAngle)     {         circleArcAngleStart = CWRUtil::toQ5<T>(startAngle);         circleArcAngleEnd = CWRUtil::toQ5<T>(endAngle);     }     void setArc(const int16_t startAngle, const int16_t endAngle)     {         setArc<int>(startAngle, endAngle);     }     template <typename T>     void getArc(T& startAngle, T& endAngle) const     {         startAngle = circleArcAngleStart.to<T>();         endAngle = circleArcAngleEnd.to<T>();     }     int16_t getArcStart() const     {         return circleArcAngleStart.to<int>();     }     template <typename T>     void getArcStart(T& angle) const     {         angle = circleArcAngleStart.to<T>();     }     int16_t getArcEnd() const     {         return circleArcAngleEnd.to<int>();     }     template <typename T>     void getArcEnd(T& angle) const     {         angle = circleArcAngleEnd.to<T>();     }     template <typename T>     void updateArcStart(const T startAngle)     {         CWRUtil::Q5 startAngleQ5 = CWRUtil::toQ5<T>(startAngle);         if (circleArcAngleStart == startAngleQ5)         {             return;         }         Rect minimalRect = getMinimalRectForUpdatedStartAngle(startAngleQ5);         circleArcAngleStart = startAngleQ5;         invalidateRect(minimalRect);     }     template <typename T>     void updateArcEnd(const T endAngle)     {         CWRUtil::Q5 endAngleQ5 = CWRUtil::toQ5<T>(endAngle);         if (circleArcAngleEnd == endAngleQ5)         {             return;         }         Rect minimalRect = getMinimalRectForUpdatedEndAngle(endAngleQ5);         circleArcAngleEnd = endAngleQ5;         invalidateRect(minimalRect);     }     template <typename T>     void setLineWidth(const T width)     {         this->circleLineWidth = CWRUtil::toQ5<T>(width);     }     template <typename T>     void getLineWidth(T& width) const     {         width = circleLineWidth.to<T>();     }     void setPrecision(const int precision);     int getPrecision() const;     void setCapPrecision(const int precision);     int getCapPrecision() const;     virtual bool drawCanvasWidget(const Rect& invalidatedArea) const;     virtual Rect getMinimalRect() const;     Rect getMinimalRect(int16_t arcStart, int16_t arcEnd) const;     Rect getMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd) const; private:     CWRUtil::Q5 circleCenterX;            CWRUtil::Q5 circleCenterY;            CWRUtil::Q5 circleRadius;             CWRUtil::Q5 circleArcAngleStart;      CWRUtil::Q5 circleArcAngleEnd;        CWRUtil::Q5 circleLineWidth;          uint8_t circleArcIncrement;           uint8_t circleCapArcIncrement;        void moveToAR2(Canvas& canvas, const CWRUtil::Q5& angle, const CWRUtil::Q5& r2) const;     void lineToAR2(Canvas& canvas, const CWRUtil::Q5& angle, const CWRUtil::Q5& r2) const;     void lineToXYAR2(Canvas& canvas, const CWRUtil::Q5& x, const CWRUtil::Q5& y, const CWRUtil::Q5& angle, const CWRUtil::Q5& r2) const;     void updateMinMaxAR(const CWRUtil::Q5& a, const CWRUtil::Q5& r2, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const;     void updateMinMaxXY(const CWRUtil::Q5& xNew, const CWRUtil::Q5& yNew, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const;     void calculateMinimalRect(CWRUtil::Q5 arcStart, CWRUtil::Q5 arcEnd, CWRUtil::Q5& xMin, CWRUtil::Q5& xMax, CWRUtil::Q5& yMin, CWRUtil::Q5& yMax) const;     Rect getMinimalRectForUpdatedStartAngle(CWRUtil::Q5& startAngleQ5);     Rect getMinimalRectForUpdatedEndAngle(CWRUtil::Q5& endAngleQ5); };

Fields

circleCenterX

No summary provided. Read more...

circleCenterY

No summary provided. Read more...

circleRadius

No summary provided. Read more...

circleArcAngleStart

No summary provided. Read more...

circleArcAngleEnd

No summary provided. Read more...

circleLineWidth

No summary provided. Read more...

circleArcIncrement

No summary provided. Read more...

circleCapArcIncrement

No summary provided. Read more...

Methods

setCircle()

@fn void Circle::setCircle(const int16_t x, const int16_t y, const int16_t r) Sets the center and radius of the Circle. Sets the center and radius of the Circle. Read more...

setCenter()

No summary provided. Read more...

setCenter()

No summary provided. Read more...

getCenter() const

No summary provided. Read more...

setRadius()

No summary provided. Read more...

getRadius() const

No summary provided. Read more...

setArc()

No summary provided. Read more...

setArc()

No summary provided. Read more...

getArc() const

No summary provided. Read more...

getArcStart() const

@fn int16_t Circle::getArcStart() const Gets the start angle in degrees for the arc. Gets the start angle in degrees for the arc. @see getArc @see setArc. Read more...

getArcStart() const

@fn int16_t Circle::getArcStart() const Gets the start angle in degrees for the arc. Gets the start angle in degrees for the arc. @see getArc @see setArc. Read more...

getArcEnd() const

@fn template T Circle::getArcEnd() const Gets the end angle in degrees for the arc. Gets the end angle in degrees for the arc. @see getArc @see setArc. Read more...

setCircle()

@fn void Circle::setCircle(const int16_t x, const int16_t y, const int16_t r) Sets the center and radius of the Circle. Sets the center and radius of the Circle. Read more...

getArcEnd() const

@fn template T Circle::getArcEnd() const Gets the end angle in degrees for the arc. Gets the end angle in degrees for the arc. @see getArc @see setArc. Read more...

updateArcStart()

No summary provided. Read more...

updateArcEnd()

No summary provided. Read more...

setLineWidth()

No summary provided. Read more...

getLineWidth() const

No summary provided. Read more...

setPrecision()

@fn void Circle::setPrecision(const int precision); Sets a precision of the Circle drawing function. Sets a precision of the Circle drawing function. The number given as precision is the number of degrees used as step counter when drawing smaller line fragments around the circumference of the circle, five being a sensible value. Higher values results in less nice circles but faster rendering. Large circles might need a precision smaller than five. Read more...

getPrecision() const

@fn int Circle::getPrecision() const; Gets the precision of the circle drawing function. Gets the precision of the circle drawing function. The precision is the number of degrees used as step counter when drawing smaller line fragments around the circumference of the circle, the default being being 5. @see setPrecision. Read more...

setCapPrecision()

@fn void Circle::setCapPrecision(const int precision); Sets the precision of the ends of the Circle arc. Sets a precision of the ends of the Circle arc. The precision is given in degrees where 180 is the default which results in a square ended arc (aka "butt cap"). 90 will draw "an arrow head" and smaller values gives a round cap. Larger values of precision results in faster rendering of the circle. Read more...

getCapPrecision() const

@fn int Circle::getCapPrecision() const; Sets the precision of the ends of the Circle arc. Gets the precision of the ends of the Circle arc. @see getCapPrecision. Read more...

drawCanvasWidget() const

@fn virtual bool Circle::drawCanvasWidget(const Rect& invalidatedArea) const; Draws the Circle. Draws the Circle. This class supports partial drawing, so only the area described by the rectangle will be drawn. Read more...

getMinimalRect() const

@fn virtual Rect Circle::getMinimalRect() const; Gets minimal rectangle for the current shape of the circle. Gets minimal rectangle for the current shape of the circle. Read more...

getMinimalRect() const

@fn virtual Rect Circle::getMinimalRect() const; Gets minimal rectangle for the current shape of the circle. Gets minimal rectangle for the current shape of the circle. Read more...

getMinimalRect() const

@fn virtual Rect Circle::getMinimalRect() const; Gets minimal rectangle for the current shape of the circle. Gets minimal rectangle for the current shape of the circle. Read more...

calculateMinimalRect() const

No summary provided. Read more...

getMinimalRectForUpdatedStartAngle()

No summary provided. Read more...

getMinimalRectForUpdatedEndAngle()

No summary provided. Read more...

moveToAR2() const

No summary provided. Read more...

lineToAR2() const

No summary provided. Read more...

lineToXYAR2() const

No summary provided. Read more...

updateMinMaxAR() const

No summary provided. Read more...

updateMinMaxXY() const

No summary provided. Read more...

setArc

No summary provided. Read more...

getArcEnd

No summary provided. Read more...

Examples

touchgfx::Circle is referenced by 3 libraries and example projects.

References

LocationText
Circle.hpp:41
class Circle : public CanvasWidget

Class Tree

Child classes
touchgfx::Circle
all items filtered out