OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Quad Struct Reference

凸四角形 More...

#include <Quad.hpp>

Public Types

using position_type = Vec2
 
using value_type = position_type::value_type
 

Public Member Functions

SIV3D_NODISCARD_CXX20 Quad ()=default
 
constexpr SIV3D_NODISCARD_CXX20 Quad (value_type x0, value_type y0, value_type x1, value_type y1, value_type x2, value_type y2, value_type x3, value_type y3) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 Quad (const position_type &_p0, const position_type &_p1, const position_type &_p2, const position_type &_p3) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 Quad (const Rect &rect) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 Quad (const RectF &rect) noexcept
 
constexpr Quadset (value_type x0, value_type y0, value_type x1, value_type y1, value_type x2, value_type y2, value_type x3, value_type y3) noexcept
 
constexpr Quadset (const position_type &_p0, const position_type &_p1, const position_type &_p2, const position_type &_p3) noexcept
 
constexpr Quadset (const Quad &quad) noexcept
 
constexpr Quad movedBy (value_type x, value_type y) const noexcept
 
constexpr Quad movedBy (position_type v) const noexcept
 
constexpr QuadmoveBy (value_type x, value_type y) noexcept
 
constexpr QuadmoveBy (position_type v) noexcept
 
Quad stretched (value_type size) const noexcept
 
Quad rotatedAt (value_type x, value_type y, value_type angle) const noexcept
 
Quad rotatedAt (position_type pos, value_type angle) const noexcept
 
constexpr Quad scaled (double s) const noexcept
 
constexpr Quad scaled (double sx, double sy) const noexcept
 
constexpr Quad scaled (Vec2 s) const noexcept
 
constexpr Quadscale (double s) noexcept
 
constexpr Quadscale (double sx, double sy) noexcept
 
constexpr Quadscale (Vec2 s) noexcept
 
constexpr Quad scaledAt (Vec2 pos, double s) const noexcept
 
constexpr Quad scaledAt (Vec2 pos, double sx, double sy) const noexcept
 
constexpr Quad scaledAt (Vec2 pos, Vec2 s) const noexcept
 
constexpr QuadscaleAt (Vec2 pos, double s) noexcept
 
constexpr QuadscaleAt (Vec2 pos, double sx, double sy) noexcept
 
constexpr QuadscaleAt (Vec2 pos, Vec2 s) noexcept
 
position_typep (size_t index) noexcept
 
const position_typep (size_t index) const noexcept
 
constexpr position_type point (size_t index) const
 
constexpr Line side (size_t index) const
 
constexpr Triangle triangle (size_t index) const
 
constexpr value_type area () const noexcept
 
value_type perimeter () const noexcept
 
constexpr RectF boundingRect () const noexcept
 
Polygon calculateBuffer (double distance) const
 
Polygon calculateRoundBuffer (double distance) const
 
LineString outline (CloseRing closeRing=CloseRing::No) const
 
LineString outline (double distanceFromOrigin, double length) const
 
Polygon asPolygon () const
 
constexpr Quad lerp (const Quad &other, double f) const noexcept
 
size_t hash () const noexcept
 
template<class Shape2DType >
constexpr bool intersects (const Shape2DType &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 Quadpaint (Image &dst, const Color &color) const
 
const Quadoverwrite (Image &dst, const Color &color, Antialiased antialiased=Antialiased::Yes) const
 
const QuadpaintFrame (Image &dst, int32 thickness, const Color &color) const
 
const QuadoverwriteFrame (Image &dst, int32 thickness, const Color &color, Antialiased antialiased=Antialiased::Yes) const
 
const Quaddraw (const ColorF &color=Palette::White) const
 
const Quaddraw (const ColorF &color0, const ColorF &color1, const ColorF &color2, const ColorF &color3) const
 
const QuaddrawFrame (double thickness=1.0, const ColorF &color=Palette::White) const
 
const QuaddrawFrame (double innerThickness, double outerThickness, const ColorF &color=Palette::White) const
 
TexturedQuad operator() (const Texture &texture) const
 
TexturedQuad operator() (const TextureRegion &textureRegion) const
 

Public Attributes

position_type p0
 
position_type p1
 
position_type p2
 
position_type p3
 

Friends

constexpr friend bool operator== (const Quad &lhs, const Quad &rhs) noexcept
 
constexpr friend bool operator!= (const Quad &lhs, const Quad &rhs) noexcept
 
template<class CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &output, const Quad &value)
 
template<class CharType >
std::basic_istream< CharType > & operator>> (std::basic_istream< CharType > &input, Quad &value)
 
void Formatter (FormatData &formatData, const Quad &value)
 

Detailed Description

凸四角形

Member Typedef Documentation

◆ position_type

◆ value_type

Constructor & Destructor Documentation

◆ Quad() [1/5]

SIV3D_NODISCARD_CXX20 s3d::Quad::Quad ( )
default

◆ Quad() [2/5]

constexpr SIV3D_NODISCARD_CXX20 s3d::Quad::Quad ( value_type  x0,
value_type  y0,
value_type  x1,
value_type  y1,
value_type  x2,
value_type  y2,
value_type  x3,
value_type  y3 
)
constexprnoexcept
Parameters
x0
y0
x1
y1
x2
y2
x3
y3

◆ Quad() [3/5]

constexpr SIV3D_NODISCARD_CXX20 s3d::Quad::Quad ( const position_type _p0,
const position_type _p1,
const position_type _p2,
const position_type _p3 
)
constexprnoexcept
Parameters
_p0
_p1
_p2
_p3

◆ Quad() [4/5]

constexpr SIV3D_NODISCARD_CXX20 s3d::Quad::Quad ( const Rect rect)
explicitconstexprnoexcept

◆ Quad() [5/5]

constexpr SIV3D_NODISCARD_CXX20 s3d::Quad::Quad ( const RectF rect)
explicitconstexprnoexcept

Member Function Documentation

◆ area()

constexpr value_type s3d::Quad::area ( ) const
constexprnoexcept

◆ asPolygon()

Polygon s3d::Quad::asPolygon ( ) const

◆ boundingRect()

constexpr RectF s3d::Quad::boundingRect ( ) const
constexprnoexcept

◆ calculateBuffer()

Polygon s3d::Quad::calculateBuffer ( double  distance) const

◆ calculateRoundBuffer()

Polygon s3d::Quad::calculateRoundBuffer ( double  distance) const

◆ contains()

template<class Shape2DType >
bool s3d::Quad::contains ( const Shape2DType &  other) const

◆ draw() [1/2]

const Quad& s3d::Quad::draw ( const ColorF color0,
const ColorF color1,
const ColorF color2,
const ColorF color3 
) const

◆ draw() [2/2]

const Quad& s3d::Quad::draw ( const ColorF color = Palette::White) const

◆ drawFrame() [1/2]

const Quad& s3d::Quad::drawFrame ( double  innerThickness,
double  outerThickness,
const ColorF color = Palette::White 
) const

◆ drawFrame() [2/2]

const Quad& s3d::Quad::drawFrame ( double  thickness = 1.0,
const ColorF color = Palette::White 
) const

◆ hash()

size_t s3d::Quad::hash ( ) const
noexcept

◆ intersects()

template<class Shape2DType >
constexpr bool s3d::Quad::intersects ( const Shape2DType &  other) const
constexpr

◆ intersectsAt()

template<class Shape2DType >
Optional<Array<Vec2> > s3d::Quad::intersectsAt ( const Shape2DType &  other) const

◆ leftClicked()

bool s3d::Quad::leftClicked ( ) const
noexcept

四角形が現在のフレームで左クリックされ始めたかを返します。

Returns
四角形が現在のフレームで左クリックされ始めた場合 true, それ以外の場合は false

◆ leftPressed()

bool s3d::Quad::leftPressed ( ) const
noexcept

四角形が左クリックされているかを返します。

Returns
四角形が左クリックされている場合 true, それ以外の場合は false

◆ leftReleased()

bool s3d::Quad::leftReleased ( ) const
noexcept

現在のフレームで四角形への左クリックが離されたかを返します。

Returns
現在のフレームで四角形への左クリックが離された場合 true, それ以外の場合は false

◆ lerp()

constexpr Quad s3d::Quad::lerp ( const Quad other,
double  f 
) const
constexprnoexcept

◆ mouseOver()

bool s3d::Quad::mouseOver ( ) const
noexcept

四角形上にマウスカーソルがあるかを返します。

Returns
四角形上にマウスカーソルがある場合 true, それ以外の場合は false

◆ moveBy() [1/2]

constexpr Quad& s3d::Quad::moveBy ( position_type  v)
constexprnoexcept

◆ moveBy() [2/2]

constexpr Quad& s3d::Quad::moveBy ( value_type  x,
value_type  y 
)
constexprnoexcept

◆ movedBy() [1/2]

constexpr Quad s3d::Quad::movedBy ( position_type  v) const
constexprnoexcept

◆ movedBy() [2/2]

constexpr Quad s3d::Quad::movedBy ( value_type  x,
value_type  y 
) const
constexprnoexcept

◆ operator()() [1/2]

TexturedQuad s3d::Quad::operator() ( const Texture texture) const

◆ operator()() [2/2]

TexturedQuad s3d::Quad::operator() ( const TextureRegion textureRegion) const

◆ outline() [1/2]

LineString s3d::Quad::outline ( CloseRing  closeRing = CloseRing::No) const

◆ outline() [2/2]

LineString s3d::Quad::outline ( double  distanceFromOrigin,
double  length 
) const

◆ overwrite()

const Quad& s3d::Quad::overwrite ( Image dst,
const Color color,
Antialiased  antialiased = Antialiased::Yes 
) const

◆ overwriteFrame()

const Quad& s3d::Quad::overwriteFrame ( Image dst,
int32  thickness,
const Color color,
Antialiased  antialiased = Antialiased::Yes 
) const

◆ p() [1/2]

const position_type& s3d::Quad::p ( size_t  index) const
noexcept

◆ p() [2/2]

position_type& s3d::Quad::p ( size_t  index)
noexcept

◆ paint()

const Quad& s3d::Quad::paint ( Image dst,
const Color color 
) const

◆ paintFrame()

const Quad& s3d::Quad::paintFrame ( Image dst,
int32  thickness,
const Color color 
) const

◆ perimeter()

value_type s3d::Quad::perimeter ( ) const
noexcept

◆ point()

constexpr position_type s3d::Quad::point ( size_t  index) const
constexpr

◆ rightClicked()

bool s3d::Quad::rightClicked ( ) const
noexcept

四角形が現在のフレームで右クリックされ始めたかを返します。

Returns
四角形が現在のフレームで右クリックされ始めた場合 true, それ以外の場合は false

◆ rightPressed()

bool s3d::Quad::rightPressed ( ) const
noexcept

四角形が右クリックされているかを返します。

Returns
四角形が右クリックされている場合 true, それ以外の場合は false

◆ rightReleased()

bool s3d::Quad::rightReleased ( ) const
noexcept

現在のフレームで四角形への右クリックが離されたかを返します。

Returns
現在のフレームで四角形への右クリックが離された場合 true, それ以外の場合は false

◆ rotatedAt() [1/2]

Quad s3d::Quad::rotatedAt ( position_type  pos,
value_type  angle 
) const
noexcept

◆ rotatedAt() [2/2]

Quad s3d::Quad::rotatedAt ( value_type  x,
value_type  y,
value_type  angle 
) const
noexcept

◆ scale() [1/3]

constexpr Quad& s3d::Quad::scale ( double  s)
constexprnoexcept

◆ scale() [2/3]

constexpr Quad& s3d::Quad::scale ( double  sx,
double  sy 
)
constexprnoexcept

◆ scale() [3/3]

constexpr Quad& s3d::Quad::scale ( Vec2  s)
constexprnoexcept

◆ scaleAt() [1/3]

constexpr Quad& s3d::Quad::scaleAt ( Vec2  pos,
double  s 
)
constexprnoexcept

◆ scaleAt() [2/3]

constexpr Quad& s3d::Quad::scaleAt ( Vec2  pos,
double  sx,
double  sy 
)
constexprnoexcept

◆ scaleAt() [3/3]

constexpr Quad& s3d::Quad::scaleAt ( Vec2  pos,
Vec2  s 
)
constexprnoexcept

◆ scaled() [1/3]

constexpr Quad s3d::Quad::scaled ( double  s) const
constexprnoexcept

◆ scaled() [2/3]

constexpr Quad s3d::Quad::scaled ( double  sx,
double  sy 
) const
constexprnoexcept

◆ scaled() [3/3]

constexpr Quad s3d::Quad::scaled ( Vec2  s) const
constexprnoexcept

◆ scaledAt() [1/3]

constexpr Quad s3d::Quad::scaledAt ( Vec2  pos,
double  s 
) const
constexprnoexcept

◆ scaledAt() [2/3]

constexpr Quad s3d::Quad::scaledAt ( Vec2  pos,
double  sx,
double  sy 
) const
constexprnoexcept

◆ scaledAt() [3/3]

constexpr Quad s3d::Quad::scaledAt ( Vec2  pos,
Vec2  s 
) const
constexprnoexcept

◆ set() [1/3]

constexpr Quad& s3d::Quad::set ( const position_type _p0,
const position_type _p1,
const position_type _p2,
const position_type _p3 
)
constexprnoexcept

◆ set() [2/3]

constexpr Quad& s3d::Quad::set ( const Quad quad)
constexprnoexcept

◆ set() [3/3]

constexpr Quad& s3d::Quad::set ( value_type  x0,
value_type  y0,
value_type  x1,
value_type  y1,
value_type  x2,
value_type  y2,
value_type  x3,
value_type  y3 
)
constexprnoexcept

◆ side()

constexpr Line s3d::Quad::side ( size_t  index) const
constexpr

◆ stretched()

Quad s3d::Quad::stretched ( value_type  size) const
noexcept

◆ triangle()

constexpr Triangle s3d::Quad::triangle ( size_t  index) const
constexpr

Friends And Related Function Documentation

◆ Formatter

void Formatter ( FormatData formatData,
const Quad value 
)
friend

◆ operator!=

constexpr friend bool operator!= ( const Quad lhs,
const Quad rhs 
)
friend

◆ operator<<

template<class CharType >
std::basic_ostream<CharType>& operator<< ( std::basic_ostream< CharType > &  output,
const Quad value 
)
friend

◆ operator==

constexpr friend bool operator== ( const Quad lhs,
const Quad rhs 
)
friend

◆ operator>>

template<class CharType >
std::basic_istream<CharType>& operator>> ( std::basic_istream< CharType > &  input,
Quad value 
)
friend

Member Data Documentation

◆ p0

position_type s3d::Quad::p0

◆ p1

position_type s3d::Quad::p1

◆ p2

position_type s3d::Quad::p2

◆ p3

position_type s3d::Quad::p3

The documentation for this struct was generated from the following file: