![]() |
OpenSiv3D
v0.6.5
C++20 framework for creative coding
|
多角形 More...
#include <Polygon.hpp>
Public Member Functions | |
| SIV3D_NODISCARD_CXX20 | Polygon () |
| SIV3D_NODISCARD_CXX20 | Polygon (const Polygon &polygon) |
| SIV3D_NODISCARD_CXX20 | Polygon (Polygon &&polygon) noexcept |
| SIV3D_NODISCARD_CXX20 | Polygon (const Vec2 *outer, size_t size, Array< Array< Vec2 >> holes={}, SkipValidation skipValidation=SkipValidation::No) |
| SIV3D_NODISCARD_CXX20 | Polygon (const Array< Vec2 > &outer, Array< Array< Vec2 >> holes={}, SkipValidation skipValidation=SkipValidation::No) |
| SIV3D_NODISCARD_CXX20 | Polygon (const Array< Vec2 > &outer, const Array< TriangleIndex > &indices, const RectF &boundingRect, SkipValidation skipValidation=SkipValidation::No) |
| SIV3D_NODISCARD_CXX20 | Polygon (const Array< Vec2 > &outer, Array< Array< Vec2 >> holes, const Array< Float2 > &vertices, const Array< TriangleIndex > &indices, const RectF &boundingRect, SkipValidation skipValidation=SkipValidation::No) |
| SIV3D_NODISCARD_CXX20 | Polygon (std::initializer_list< Vec2 > outer, SkipValidation skipValidation=SkipValidation::No) |
| SIV3D_NODISCARD_CXX20 | Polygon (const Shape2D &shape) |
| ~Polygon () | |
| Polygon & | operator= (const Polygon &polygon) |
| Polygon & | operator= (Polygon &&polygon) noexcept |
| bool | isEmpty () const noexcept |
| 多角形が空であるかを返します。 More... | |
| operator bool () const noexcept | |
| 多角形が空ではないかを返します。 More... | |
| bool | hasHoles () const noexcept |
| 多角形が穴を持っているかを返します。 More... | |
| size_t | num_holes () const noexcept |
| 多角形が持つ穴の個数を返します。 More... | |
| void | swap (Polygon &polygon) noexcept |
| const Array< Vec2 > & | outer () const noexcept |
| 多角形の外周の頂点配列を返します。 More... | |
| const Array< Array< Vec2 > > & | inners () const noexcept |
| 多角形の穴を構成する頂点配列を返します。 More... | |
| const Array< Float2 > & | vertices () const noexcept |
| 多角形のすべての頂点を返します。 More... | |
| const Array< TriangleIndex > & | indices () const noexcept |
| 多角形の三角形分割のすべての頂点インデックスを返します。 More... | |
| const RectF & | boundingRect () const noexcept |
| 多角形のバウンディングボックスを返します。 More... | |
| size_t | num_triangles () const noexcept |
| 多角形の三角形分割での三角形の個数を返します。 More... | |
| Triangle | triangle (size_t index) const |
| 多角形の三角形分割での、個々の三角形を返します。 More... | |
| bool | addHole (const RectF &rect) |
| 多角形に穴を追加します。 More... | |
| bool | addHole (const Triangle &triangle) |
| 多角形に穴を追加します。 More... | |
| bool | addHole (const Quad &quad) |
| 多角形に穴を追加します。 More... | |
| bool | addHole (const Circle &circle, uint32 quality=24) |
| 多角形に穴を追加します。 More... | |
| bool | addHole (const Ellipse &ellipse, uint32 quality=24) |
| 多角形に穴を追加します。 More... | |
| bool | addHole (const RoundRect &roundRect, uint32 quality=24) |
| 多角形に穴を追加します。 More... | |
| bool | addHole (Array< Vec2 > hole) |
| 多角形に穴を追加します。 More... | |
| bool | addHoles (Array< Array< Vec2 >> holes) |
| 多角形に穴を追加します。 More... | |
| Polygon | movedBy (double x, double y) const |
| Polygon | movedBy (Vec2 v) const |
| Polygon & | moveBy (double x, double y) noexcept |
| Polygon & | moveBy (Vec2 v) noexcept |
| Polygon | rotated (double angle) const |
| Polygon | rotatedAt (double x, double y, double angle) const |
| Polygon | rotatedAt (Vec2 pos, double angle) const |
| Polygon & | rotate (double angle) |
| Polygon & | rotateAt (double x, double y, double angle) |
| Polygon & | rotateAt (Vec2 pos, double angle) |
| Polygon | transformed (double s, double c, const Vec2 &pos) const |
| Polygon & | transform (double s, double c, const Vec2 &pos) |
| Polygon | scaled (double s) const |
| Polygon | scaled (double sx, double sy) const |
| Polygon | scaled (Vec2 s) const |
| Polygon & | scale (double s) |
| Polygon & | scale (double sx, double sy) |
| Polygon & | scale (Vec2 s) |
| Polygon | scaledAt (Vec2 pos, double s) const |
| Polygon | scaledAt (Vec2 pos, double sx, double sy) const |
| Polygon | scaledAt (Vec2 pos, Vec2 s) const |
| Polygon & | scaleAt (Vec2 pos, double s) |
| Polygon & | scaleAt (Vec2 pos, double sx, double sy) |
| Polygon & | scaleAt (Vec2 pos, Vec2 s) |
| double | area () const noexcept |
| 多角形の面積を返します。 More... | |
| double | perimeter () const noexcept |
| 多角形の、穴を含めた輪郭の長さを返します。 More... | |
| Vec2 | centroid () const |
| 多角形の重心の座標を返します。 More... | |
| Polygon | computeConvexHull () const |
| 多角形の凸包を計算して返します。 More... | |
| Polygon | calculateBuffer (double distance) const |
| 多角形を太らせた、新しい多角形を返します。 More... | |
| Polygon | calculateRoundBuffer (double distance) const |
| 多角形を丸く太らせた、新しい多角形を返します。 More... | |
| Polygon | simplified (double maxDistance=2.0) const |
| 多角形を単純化した、新しい多角形を返します。 More... | |
| LineString | outline (CloseRing closeRing=CloseRing::No) const |
| 多角形の外周を LineString で返します。 More... | |
| LineString | outline (double distanceFromOrigin, double length) const |
| 多角形の外周の一部を LineString で返します。 More... | |
| bool | append (const RectF &other) |
| 多角形に新しい領域を追加します。新しい領域は既存の多角形と接続していなければなりません。 More... | |
| bool | append (const Polygon &other) |
| 多角形に新しい領域を追加します。新しい領域は既存の多角形と接続していなければなりません。 More... | |
| template<class Shape2DType > | |
| bool | intersects (const Shape2DType &other) const |
| bool | intersects (const Line &other) const |
| bool | intersects (const Rect &other) const |
| bool | intersects (const RectF &other) const |
| bool | intersects (const Polygon &other) const |
| template<class Shape2DType > | |
| Optional< Array< Vec2 > > | intersectsAt (const Shape2DType &other) const |
| template<class Shape2DType > | |
| bool | contains (const Shape2DType &other) const |
| bool | leftClicked () const noexcept |
| 多角形が現在のフレームで左クリックされ始めたかを返します。 More... | |
| bool | leftPressed () const noexcept |
| 多角形が左クリックされているかを返します。 More... | |
| bool | leftReleased () const noexcept |
| 現在のフレームで多角形への左クリックが離されたかを返します。 More... | |
| bool | rightClicked () const noexcept |
| 多角形が現在のフレームで右クリックされ始めたかを返します。 More... | |
| bool | rightPressed () const noexcept |
| 多角形が右クリックされているかを返します。 More... | |
| bool | rightReleased () const noexcept |
| 現在のフレームで多角形への右クリックが離されたかを返します。 More... | |
| bool | mouseOver () const noexcept |
| 多角形上にマウスカーソルがあるかを返します。 More... | |
| const Polygon & | paint (Image &dst, const Color &color) const |
| const Polygon & | paint (Image &dst, double x, double y, const Color &color) const |
| const Polygon & | paint (Image &dst, const Vec2 &pos, const Color &color) const |
| const Polygon & | overwrite (Image &dst, const Color &color, Antialiased antialiased=Antialiased::Yes) const |
| const Polygon & | overwrite (Image &dst, double x, double y, const Color &color, Antialiased antialiased=Antialiased::Yes) const |
| const Polygon & | overwrite (Image &dst, const Vec2 &pos, const Color &color, Antialiased antialiased=Antialiased::Yes) const |
| const Polygon & | draw (const ColorF &color=Palette::White) const |
| void | draw (double x, double y, const ColorF &color=Palette::White) const |
| void | draw (const Vec2 &pos, const ColorF &color=Palette::White) const |
| void | drawTransformed (double angle, const Vec2 &pos, const ColorF &color=Palette::White) const |
| void | drawTransformed (double s, double c, const Vec2 &pos, const ColorF &color=Palette::White) const |
| const Polygon & | drawFrame (double thickness=1.0, const ColorF &color=Palette::White) const |
| void | drawFrame (double x, double y, double thickness=1.0, const ColorF &color=Palette::White) const |
| void | drawFrame (const Vec2 &pos, double thickness=1.0, const ColorF &color=Palette::White) const |
| const Polygon & | drawWireframe (double thickness=1.0, const ColorF &color=Palette::White) const |
| void | drawWireframe (double x, double y, double thickness=1.0, const ColorF &color=Palette::White) const |
| void | drawWireframe (const Vec2 &pos, double thickness=1.0, const ColorF &color=Palette::White) const |
| Buffer2D | toBuffer2D (const Vec2 &uvOrigin, const Vec2 &uvScale) const |
| Buffer2D | toBuffer2D (Arg::center_< Vec2 > uvCenter, const Vec2 &uvScale) const |
| Buffer2D | toBuffer2D (Arg::center_< Vec2 > uvCenter, const Vec2 &uvScale, double uvRotation) const |
| Buffer2D | toBuffer2D (const Mat3x2 &uvMat) const |
| const PolygonDetail * | _detail () const noexcept |
Static Public Member Functions | |
| static PolygonFailureType | Validate (const Vec2 *pVertex, size_t vertexSize, const Array< Array< Vec2 >> &holes={}) |
| static PolygonFailureType | Validate (const Array< Vec2 > &vertices, const Array< Array< Vec2 >> &holes={}) |
| static Array< Polygon > | Correct (const Vec2 *pVertex, size_t vertexSize, const Array< Array< Vec2 >> &holes={}) |
| 頂点配列から多角形を生成します。 More... | |
| static Array< Polygon > | Correct (const Array< Vec2 > &vertices, const Array< Array< Vec2 >> &holes={}) |
| 頂点配列から多角形を生成します。 More... | |
| static Polygon | CorrectOne (const Vec2 *pVertex, size_t vertexSize, const Array< Array< Vec2 >> &holes={}) |
| static Polygon | CorrectOne (const Array< Vec2 > &vertices, const Array< Array< Vec2 >> &holes={}) |
Friends | |
| template<class CharType > | |
| std::basic_ostream< CharType > & | operator<< (std::basic_ostream< CharType > &output, const Polygon &value) |
| void | Formatter (FormatData &formatData, const Polygon &value) |
多角形
| SIV3D_NODISCARD_CXX20 s3d::Polygon::Polygon | ( | ) |
| SIV3D_NODISCARD_CXX20 s3d::Polygon::Polygon | ( | const Polygon & | polygon | ) |
|
noexcept |
| SIV3D_NODISCARD_CXX20 s3d::Polygon::Polygon | ( | const Vec2 * | outer, |
| size_t | size, | ||
| Array< Array< Vec2 >> | holes = {}, |
||
| SkipValidation | skipValidation = SkipValidation::No |
||
| ) |
|
explicit |
| SIV3D_NODISCARD_CXX20 s3d::Polygon::Polygon | ( | const Array< Vec2 > & | outer, |
| const Array< TriangleIndex > & | indices, | ||
| const RectF & | boundingRect, | ||
| SkipValidation | skipValidation = SkipValidation::No |
||
| ) |
| SIV3D_NODISCARD_CXX20 s3d::Polygon::Polygon | ( | const Array< Vec2 > & | outer, |
| Array< Array< Vec2 >> | holes, | ||
| const Array< Float2 > & | vertices, | ||
| const Array< TriangleIndex > & | indices, | ||
| const RectF & | boundingRect, | ||
| SkipValidation | skipValidation = SkipValidation::No |
||
| ) |
|
explicit |
| SIV3D_NODISCARD_CXX20 s3d::Polygon::Polygon | ( | const Shape2D & | shape | ) |
| s3d::Polygon::~Polygon | ( | ) |
|
noexcept |
多角形に穴を追加します。
| hole | 穴を構成する頂点配列 |
多角形に穴を追加します。
| circle | 穴の形状 |
| quality | 頂点分割の品質 |
多角形に穴を追加します。
| ellipse | 穴の形状 |
| quality | 頂点分割の品質 |
| bool s3d::Polygon::addHole | ( | const Quad & | quad | ) |
多角形に穴を追加します。
| quad | 穴の形状 |
| bool s3d::Polygon::addHole | ( | const RectF & | rect | ) |
多角形に穴を追加します。
| rect | 穴の形状 |
多角形に穴を追加します。
| roundRect | 穴の形状 |
| quality | 頂点分割の品質 |
| bool s3d::Polygon::addHole | ( | const Triangle & | triangle | ) |
多角形に穴を追加します。
| triangle | 穴の形状 |
多角形に穴を追加します。
| holes | 穴を構成する頂点配列の配列(複数の穴) |
| bool s3d::Polygon::append | ( | const Polygon & | other | ) |
多角形に新しい領域を追加します。新しい領域は既存の多角形と接続していなければなりません。
| other | 新しい領域 |
| bool s3d::Polygon::append | ( | const RectF & | other | ) |
多角形に新しい領域を追加します。新しい領域は既存の多角形と接続していなければなりません。
| other | 新しい領域 |
|
noexcept |
多角形の面積を返します。
|
noexcept |
多角形のバウンディングボックスを返します。
| Polygon s3d::Polygon::calculateBuffer | ( | double | distance | ) | const |
多角形を太らせた、新しい多角形を返します。
| distance | 太らせる距離。負の場合は細らせます。 |
| Polygon s3d::Polygon::calculateRoundBuffer | ( | double | distance | ) | const |
多角形を丸く太らせた、新しい多角形を返します。
| distance | 太らせる距離。負の場合は細らせます。 |
| Vec2 s3d::Polygon::centroid | ( | ) | const |
多角形の重心の座標を返します。
| Polygon s3d::Polygon::computeConvexHull | ( | ) | const |
多角形の凸包を計算して返します。
| bool s3d::Polygon::contains | ( | const Shape2DType & | other | ) | const |
|
static |
頂点配列から多角形を生成します。
| vertices | 頂点配列 |
| holes | 多角形の穴 |
|
static |
頂点配列から多角形を生成します。
| pVertex | 頂点配列の先頭ポインタ |
| vertexSize | 頂点配列の要素数 |
| holes | 多角形の穴 |
|
static |
|
static |
| void s3d::Polygon::draw | ( | double | x, |
| double | y, | ||
| const ColorF & | color = Palette::White |
||
| ) | const |
| void s3d::Polygon::drawFrame | ( | const Vec2 & | pos, |
| double | thickness = 1.0, |
||
| const ColorF & | color = Palette::White |
||
| ) | const |
| const Polygon& s3d::Polygon::drawFrame | ( | double | thickness = 1.0, |
| const ColorF & | color = Palette::White |
||
| ) | const |
| void s3d::Polygon::drawFrame | ( | double | x, |
| double | y, | ||
| double | thickness = 1.0, |
||
| const ColorF & | color = Palette::White |
||
| ) | const |
| void s3d::Polygon::drawTransformed | ( | double | angle, |
| const Vec2 & | pos, | ||
| const ColorF & | color = Palette::White |
||
| ) | const |
| void s3d::Polygon::drawTransformed | ( | double | s, |
| double | c, | ||
| const Vec2 & | pos, | ||
| const ColorF & | color = Palette::White |
||
| ) | const |
| void s3d::Polygon::drawWireframe | ( | const Vec2 & | pos, |
| double | thickness = 1.0, |
||
| const ColorF & | color = Palette::White |
||
| ) | const |
| const Polygon& s3d::Polygon::drawWireframe | ( | double | thickness = 1.0, |
| const ColorF & | color = Palette::White |
||
| ) | const |
| void s3d::Polygon::drawWireframe | ( | double | x, |
| double | y, | ||
| double | thickness = 1.0, |
||
| const ColorF & | color = Palette::White |
||
| ) | const |
|
noexcept |
多角形が穴を持っているかを返します。
|
noexcept |
多角形の穴を構成する頂点配列を返します。
| bool s3d::Polygon::intersects | ( | const Line & | other | ) | const |
| bool s3d::Polygon::intersects | ( | const Polygon & | other | ) | const |
| bool s3d::Polygon::intersects | ( | const Rect & | other | ) | const |
| bool s3d::Polygon::intersects | ( | const RectF & | other | ) | const |
| bool s3d::Polygon::intersects | ( | const Shape2DType & | other | ) | const |
| Optional<Array<Vec2> > s3d::Polygon::intersectsAt | ( | const Shape2DType & | other | ) | const |
|
noexcept |
多角形が空であるかを返します。
|
noexcept |
多角形が現在のフレームで左クリックされ始めたかを返します。
|
noexcept |
多角形が左クリックされているかを返します。
|
noexcept |
現在のフレームで多角形への左クリックが離されたかを返します。
|
noexcept |
多角形上にマウスカーソルがあるかを返します。
|
noexcept |
| Polygon s3d::Polygon::movedBy | ( | double | x, |
| double | y | ||
| ) | const |
|
noexcept |
多角形が持つ穴の個数を返します。
|
noexcept |
多角形の三角形分割での三角形の個数を返します。
|
explicitnoexcept |
多角形が空ではないかを返します。
| LineString s3d::Polygon::outline | ( | CloseRing | closeRing = CloseRing::No | ) | const |
多角形の外周を LineString で返します。
| closeRing | 始点と終点を一致させる場合は CloseRing::Yes, それ以外の場合は CloseRing::No |
| LineString s3d::Polygon::outline | ( | double | distanceFromOrigin, |
| double | length | ||
| ) | const |
多角形の外周の一部を LineString で返します。
| distanceFromOrigin | 取得の開始位置(Polygon 外周の最初の頂点からの距離) |
| length | 取得する LineString の長さ |
| const Polygon& s3d::Polygon::overwrite | ( | Image & | dst, |
| const Color & | color, | ||
| Antialiased | antialiased = Antialiased::Yes |
||
| ) | const |
| const Polygon& s3d::Polygon::overwrite | ( | Image & | dst, |
| const Vec2 & | pos, | ||
| const Color & | color, | ||
| Antialiased | antialiased = Antialiased::Yes |
||
| ) | const |
| const Polygon& s3d::Polygon::overwrite | ( | Image & | dst, |
| double | x, | ||
| double | y, | ||
| const Color & | color, | ||
| Antialiased | antialiased = Antialiased::Yes |
||
| ) | const |
|
noexcept |
多角形の、穴を含めた輪郭の長さを返します。
|
noexcept |
多角形が現在のフレームで右クリックされ始めたかを返します。
|
noexcept |
多角形が右クリックされているかを返します。
|
noexcept |
現在のフレームで多角形への右クリックが離されたかを返します。
| Polygon& s3d::Polygon::rotate | ( | double | angle | ) |
| Polygon& s3d::Polygon::rotateAt | ( | double | x, |
| double | y, | ||
| double | angle | ||
| ) |
| Polygon s3d::Polygon::rotated | ( | double | angle | ) | const |
| Polygon s3d::Polygon::rotatedAt | ( | double | x, |
| double | y, | ||
| double | angle | ||
| ) | const |
| Polygon& s3d::Polygon::scale | ( | double | s | ) |
| Polygon& s3d::Polygon::scale | ( | double | sx, |
| double | sy | ||
| ) |
| Polygon s3d::Polygon::scaled | ( | double | s | ) | const |
| Polygon s3d::Polygon::scaled | ( | double | sx, |
| double | sy | ||
| ) | const |
| Polygon s3d::Polygon::simplified | ( | double | maxDistance = 2.0 | ) | const |
多角形を単純化した、新しい多角形を返します。
| maxDistance | 単純化に使う距離。大きいほど単純化されます。 |
|
noexcept |
| Buffer2D s3d::Polygon::toBuffer2D | ( | Arg::center_< Vec2 > | uvCenter, |
| const Vec2 & | uvScale, | ||
| double | uvRotation | ||
| ) | const |
| Triangle s3d::Polygon::triangle | ( | size_t | index | ) | const |
|
static |
|
static |
|
friend |
|
friend |