SDXFrameWork 0.12 SDXFrameWork

- Main Page
- Related Pages
- Classes

All Classes Namespaces Functions Variables Enumerations Enumerator Pages
ShapeDraw.h
1 //Copyright © 2014 SDXFramework
2 //[License]GNU Affero General Public License, version 3
3 //[Contact]http://sourceforge.jp/projects/dxframework/
4 #pragma once
5 #include <Multimedia/Drawing.h>
6
7 //Shape系の描画関数の実装
8 namespace SDX
9 {
10 void Complex::Draw(const Color &描画色) const
11 {
12 for (auto it : shapes)
13 {
14 it->Draw(描画色);
15 }
16 }
17
18 void Point::Draw(const Color &描画色) const
19 {
20 Drawing::Pixel({ x, y }, 描画色);
21 }
22
23 void Line::Draw(const Color &描画色) const
24 {
25 Drawing::Line({ xA, yA }, { xB, yB }, 描画色, (int)thick);
26 if (thick >= 3)
27 {
28 Drawing::Circle({ xA, yA, (thick-1)/2 }, 描画色);
29 Drawing::Circle({ xB, yB, (thick-1)/2 }, 描画色);
30 }
31 }
32
33 void Rect::Draw(const Color &描画色) const
34 {
35 Drawing::Rect({GetLeft(),GetTop(),GetW(),GetH()},描画色,true);
36 }
37
38 void Circle::Draw(const Color &描画色) const
39 {
40 Drawing::Circle({ x, y, radius }, 描画色);
41 }
42 };
SDX::Point::y
double y
座標
Definition: Point.h:26
SDX::Circle::Draw
void Draw(const Color &描画色) const override
描画する.
Definition: ShapeDraw.h:38
SDX::Drawing::Pixel
static void Pixel(const Point &座標, const Color &色)
指定座標に点を描画.
Definition: Drawing.h:428
SDX::Complex::shapes
std::vector< IShape * > shapes
保持するShape
Definition: Complex.h:23
SDX::Drawing::Circle
static void Circle(const Circle &円形, const Color &色, int 太さ=0)
中心と半径を指定して円を描画.
Definition: Drawing.h:365
SDX::Drawing::Line
static void Line(const Point &始点, const Point &終点, const Color &色, int 太さ=1)
始点と終点を結ぶ直線を描画.
Definition: Drawing.h:289
SDX::Complex::Draw
void Draw(const Color &描画色) const override
描画する.
Definition: ShapeDraw.h:10
SDX::Rect::Draw
void Draw(const Color &描画色) const override
描画する.
Definition: ShapeDraw.h:33
SDX::Line::Draw
void Draw(const Color &描画色) const override
描画する.
Definition: ShapeDraw.h:23
SDX::Point::Draw
void Draw(const Color &描画色) const override
描画する.
Definition: ShapeDraw.h:18
SDX::Color
色を表すクラス.
Definition: Color.h:11
SDX::Line::GetH
double GetH() const override
高さを取得.
Definition: Line.h:108
SDX::Line::GetW
double GetW() const override
幅を取得.
Definition: Line.h:103
SDX::Point::x
double x
座標
Definition: Point.h:25
SDX::Drawing::Rect
static void Rect(const Rect &領域, const Color &色, bool 塗りつぶしフラグ=true)
左上の座標と大きさを指定して矩形を描画.
Definition: Drawing.h:342