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

角丸長方形 More...

#include <RoundRect.hpp>

Public Types

using position_type = RectF::position_type
 
using size_type = RectF::size_type
 
using value_type = position_type::value_type
 

Public Member Functions

SIV3D_NODISCARD_CXX20 RoundRect ()=default
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (value_type _x, value_type _y, value_type _w, value_type _h, value_type _r) noexcept
 
template<class X , class Y , class W , class H , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< X >, std::is_arithmetic< Y >, std::is_arithmetic< W >, std::is_arithmetic< H >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 RoundRect (X _x, Y _y, W _w, H _h, R _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (position_type pos, value_type _w, value_type _h, value_type _r) noexcept
 
template<class W , class H , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< W >, std::is_arithmetic< H >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 RoundRect (position_type pos, W _w, H _h, R _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (value_type _x, value_type _y, size_type size, value_type _r) noexcept
 
template<class X , class Y , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< X >, std::is_arithmetic< Y >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 RoundRect (X _x, Y _y, size_type size, R _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (position_type pos, value_type size, value_type _r) noexcept
 
template<class S , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< S >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 RoundRect (position_type pos, S size, R _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (position_type pos, size_type size, value_type _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (Arg::center_< position_type > _center, value_type _w, value_type _h, value_type _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (Arg::center_< position_type > _center, size_type size, value_type _r) noexcept
 
constexpr SIV3D_NODISCARD_CXX20 RoundRect (const RectF &_rect, value_type _r) noexcept
 
constexpr RoundRect & set (value_type _x, value_type _y, value_type _w, value_type _h, value_type _r) noexcept
 
constexpr RoundRect & set (const position_type &pos, value_type _w, value_type _h, value_type _r) noexcept
 
constexpr RoundRect & set (value_type _x, value_type _y, const size_type &size, value_type _r) noexcept
 
constexpr RoundRect & set (const position_type &pos, const size_type &size, value_type _r) noexcept
 
constexpr RoundRect & set (const RectF &_rect, value_type _r) noexcept
 
constexpr RoundRect & set (const RoundRect &roundRect) noexcept
 
constexpr RoundRect & setPos (value_type _x, value_type _y) noexcept
 
constexpr RoundRect & setPos (position_type _pos) noexcept
 
constexpr RoundRect & setCenter (value_type _x, value_type _y) noexcept
 
constexpr RoundRect & setCenter (position_type _center) noexcept
 
constexpr RoundRect & setSize (value_type _w, value_type _h) noexcept
 
constexpr RoundRect & setSize (size_type _size) noexcept
 
constexpr RoundRect movedBy (value_type _x, value_type _y) const noexcept
 
constexpr RoundRect movedBy (position_type v) const noexcept
 
constexpr RoundRect & moveBy (value_type _x, value_type _y) noexcept
 
constexpr RoundRect & moveBy (position_type v) noexcept
 
constexpr RoundRect stretched (value_type size) const noexcept
 
constexpr RoundRect stretched (value_type _x, value_type _y) const noexcept
 
constexpr RoundRect stretched (size_type xy) const noexcept
 
constexpr RoundRect stretched (value_type top, value_type right, value_type bottom, value_type left) const noexcept
 
constexpr position_type topCenter () const noexcept
 
constexpr position_type bottomCenter () const noexcept
 
constexpr position_type leftCenter () const noexcept
 
constexpr position_type rightCenter () const noexcept
 
constexpr position_type center () const noexcept
 
constexpr value_type area () const noexcept
 
constexpr value_type perimeter () const noexcept
 
constexpr value_type horizontalAspectRatio () const noexcept
 
Array< Vec2 > outerVertices (uint32 quality=24) const
 
Polygon asPolygon (uint32 quality=24) const
 
constexpr RoundRect lerp (const RoundRect &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 RoundRect & paint (Image &dst, const Color &color) const
 
const RoundRect & overwrite (Image &dst, const Color &color, Antialiased antialiased=Antialiased::Yes) const
 
const RoundRect & paintFrame (Image &dst, int32 innerThickness, int32 outerThickness, const Color &color) const
 
const RoundRect & overwriteFrame (Image &dst, int32 innerThickness, int32 outerThickness, const Color &color, Antialiased antialiased=Antialiased::Yes) const
 
const RoundRect & draw (const ColorF &color=Palette::White) const
 
const RoundRect & drawFrame (double thickness=1.0, const ColorF &color=Palette::White) const
 
const RoundRect & drawFrame (double innerThickness, double outerThickness, const ColorF &color=Palette::White) const
 
const RoundRect & drawShadow (const Vec2 &offset, double blurRadius, double spread=0.0, const ColorF &color=ColorF{ 0.0, 0.5 }) const
 
TexturedRoundRect operator() (const Texture &texture) const
 
TexturedRoundRect operator() (const TextureRegion &textureRegion) const
 

Public Attributes

union {
   RectF   rect
 
   struct {
      value_type   x
 
      value_type   y
 
      value_type   w
 
      value_type   h
 
   } 
 
}; 
 
value_type r
 

Friends

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

Detailed Description

角丸長方形

Member Typedef Documentation

◆ position_type

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ RoundRect() [1/13]

SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( )
default

◆ RoundRect() [2/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( value_type  _x,
value_type  _y,
value_type  _w,
value_type  _h,
value_type  _r 
)
constexprnoexcept
Parameters
_x
_y
_w
_h
_r

◆ RoundRect() [3/13]

template<class X , class Y , class W , class H , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< X >, std::is_arithmetic< Y >, std::is_arithmetic< W >, std::is_arithmetic< H >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( X  _x,
Y  _y,
W  _w,
H  _h,
R  _r 
)
constexprnoexcept

◆ RoundRect() [4/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( position_type  pos,
value_type  _w,
value_type  _h,
value_type  _r 
)
constexprnoexcept
Parameters
pos
_w
_h
_r

◆ RoundRect() [5/13]

template<class W , class H , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< W >, std::is_arithmetic< H >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( position_type  pos,
W  _w,
H  _h,
R  _r 
)
constexprnoexcept

◆ RoundRect() [6/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( value_type  _x,
value_type  _y,
size_type  size,
value_type  _r 
)
constexprnoexcept
Parameters
_x
_y
size
_r

◆ RoundRect() [7/13]

template<class X , class Y , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< X >, std::is_arithmetic< Y >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( X  _x,
Y  _y,
size_type  size,
R  _r 
)
constexprnoexcept

◆ RoundRect() [8/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( position_type  pos,
value_type  size,
value_type  _r 
)
constexprnoexcept
Parameters
pos
size
_r

◆ RoundRect() [9/13]

template<class S , class R , std::enable_if_t< std::conjunction_v< std::is_arithmetic< S >, std::is_arithmetic< R >>> * = nullptr>
constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( position_type  pos,
S  size,
R  _r 
)
constexprnoexcept

◆ RoundRect() [10/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( position_type  pos,
size_type  size,
value_type  _r 
)
constexprnoexcept
Parameters
pos
size
_r

◆ RoundRect() [11/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( Arg::center_< position_type >  _center,
value_type  _w,
value_type  _h,
value_type  _r 
)
constexprnoexcept
Parameters
_center
_w
_h
_r

◆ RoundRect() [12/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( Arg::center_< position_type >  _center,
size_type  size,
value_type  _r 
)
constexprnoexcept
Parameters
_center
size
_r

◆ RoundRect() [13/13]

constexpr SIV3D_NODISCARD_CXX20 s3d::RoundRect::RoundRect ( const RectF &  _rect,
value_type  _r 
)
constexprnoexcept
Parameters
_rect
_r

Member Function Documentation

◆ area()

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

◆ asPolygon()

Polygon s3d::RoundRect::asPolygon ( uint32  quality = 24) const

◆ bottomCenter()

constexpr position_type s3d::RoundRect::bottomCenter ( ) const
constexprnoexcept

◆ center()

constexpr position_type s3d::RoundRect::center ( ) const
constexprnoexcept

◆ contains()

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

◆ draw()

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

◆ drawFrame() [1/2]

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

◆ drawFrame() [2/2]

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

◆ drawShadow()

const RoundRect& s3d::RoundRect::drawShadow ( const Vec2 &  offset,
double  blurRadius,
double  spread = 0.0,
const ColorF &  color = ColorF{ 0.0, 0.5 } 
) const

◆ hash()

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

◆ horizontalAspectRatio()

constexpr value_type s3d::RoundRect::horizontalAspectRatio ( ) const
constexprnoexcept

◆ intersects()

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

◆ intersectsAt()

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

◆ leftCenter()

constexpr position_type s3d::RoundRect::leftCenter ( ) const
constexprnoexcept

◆ leftClicked()

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

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

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

◆ leftPressed()

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

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

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

◆ leftReleased()

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

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

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

◆ lerp()

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

◆ mouseOver()

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

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

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

◆ moveBy() [1/2]

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

◆ moveBy() [2/2]

constexpr RoundRect& s3d::RoundRect::moveBy ( value_type  _x,
value_type  _y 
)
constexprnoexcept

◆ movedBy() [1/2]

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

◆ movedBy() [2/2]

constexpr RoundRect s3d::RoundRect::movedBy ( value_type  _x,
value_type  _y 
) const
constexprnoexcept

◆ operator()() [1/2]

TexturedRoundRect s3d::RoundRect::operator() ( const Texture &  texture) const

◆ operator()() [2/2]

TexturedRoundRect s3d::RoundRect::operator() ( const TextureRegion &  textureRegion) const

◆ outerVertices()

Array<Vec2> s3d::RoundRect::outerVertices ( uint32  quality = 24) const

◆ overwrite()

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

◆ overwriteFrame()

const RoundRect& s3d::RoundRect::overwriteFrame ( Image &  dst,
int32  innerThickness,
int32  outerThickness,
const Color &  color,
Antialiased  antialiased = Antialiased::Yes 
) const

◆ paint()

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

◆ paintFrame()

const RoundRect& s3d::RoundRect::paintFrame ( Image &  dst,
int32  innerThickness,
int32  outerThickness,
const Color &  color 
) const

◆ perimeter()

constexpr value_type s3d::RoundRect::perimeter ( ) const
constexprnoexcept

◆ rightCenter()

constexpr position_type s3d::RoundRect::rightCenter ( ) const
constexprnoexcept

◆ rightClicked()

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

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

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

◆ rightPressed()

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

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

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

◆ rightReleased()

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

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

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

◆ set() [1/6]

constexpr RoundRect& s3d::RoundRect::set ( const position_type &  pos,
const size_type &  size,
value_type  _r 
)
constexprnoexcept

◆ set() [2/6]

constexpr RoundRect& s3d::RoundRect::set ( const position_type &  pos,
value_type  _w,
value_type  _h,
value_type  _r 
)
constexprnoexcept

◆ set() [3/6]

constexpr RoundRect& s3d::RoundRect::set ( const RectF &  _rect,
value_type  _r 
)
constexprnoexcept

◆ set() [4/6]

constexpr RoundRect& s3d::RoundRect::set ( const RoundRect &  roundRect)
constexprnoexcept

◆ set() [5/6]

constexpr RoundRect& s3d::RoundRect::set ( value_type  _x,
value_type  _y,
const size_type &  size,
value_type  _r 
)
constexprnoexcept

◆ set() [6/6]

constexpr RoundRect& s3d::RoundRect::set ( value_type  _x,
value_type  _y,
value_type  _w,
value_type  _h,
value_type  _r 
)
constexprnoexcept

◆ setCenter() [1/2]

constexpr RoundRect& s3d::RoundRect::setCenter ( position_type  _center)
constexprnoexcept

◆ setCenter() [2/2]

constexpr RoundRect& s3d::RoundRect::setCenter ( value_type  _x,
value_type  _y 
)
constexprnoexcept

◆ setPos() [1/2]

constexpr RoundRect& s3d::RoundRect::setPos ( position_type  _pos)
constexprnoexcept

◆ setPos() [2/2]

constexpr RoundRect& s3d::RoundRect::setPos ( value_type  _x,
value_type  _y 
)
constexprnoexcept

◆ setSize() [1/2]

constexpr RoundRect& s3d::RoundRect::setSize ( size_type  _size)
constexprnoexcept

◆ setSize() [2/2]

constexpr RoundRect& s3d::RoundRect::setSize ( value_type  _w,
value_type  _h 
)
constexprnoexcept

◆ stretched() [1/4]

constexpr RoundRect s3d::RoundRect::stretched ( size_type  xy) const
constexprnoexcept

◆ stretched() [2/4]

constexpr RoundRect s3d::RoundRect::stretched ( value_type  _x,
value_type  _y 
) const
constexprnoexcept

◆ stretched() [3/4]

constexpr RoundRect s3d::RoundRect::stretched ( value_type  size) const
constexprnoexcept

◆ stretched() [4/4]

constexpr RoundRect s3d::RoundRect::stretched ( value_type  top,
value_type  right,
value_type  bottom,
value_type  left 
) const
constexprnoexcept

◆ topCenter()

constexpr position_type s3d::RoundRect::topCenter ( ) const
constexprnoexcept

Friends And Related Function Documentation

◆ Formatter

void Formatter ( FormatData &  formatData,
const RoundRect &  value 
)
friend

◆ operator!=

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

◆ operator<<

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

◆ operator==

constexpr friend bool operator== ( const RoundRect &  lhs,
const RoundRect &  rhs 
)
friend

◆ operator>>

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

Member Data Documentation

◆ @78

union { ... }

◆ h

value_type s3d::RoundRect::h

◆ r

value_type s3d::RoundRect::r

◆ rect

RectF s3d::RoundRect::rect

◆ w

value_type s3d::RoundRect::w

◆ x

value_type s3d::RoundRect::x

◆ y

value_type s3d::RoundRect::y

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