Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | List of all members
Rectangle< T > Class Template Reference

#include <rectangle.h>

Public Member Functions

 Rectangle (T &topLeftCorner, T &bottomRightCorner)
 
constexpr T getCenter () const
 
constexpr T getSize () const
 

Public Attributes

const T tl
 
const T br
 

Detailed Description

template<typename T>
class Rectangle< T >

Definition at line 36 of file rectangle.h.

Constructor & Destructor Documentation

◆ Rectangle()

template<typename T>
Rectangle< T >::Rectangle ( T &  topLeftCorner,
T &  bottomRightCorner 
)
inlineexplicit

Definition at line 38 of file rectangle.h.

38  :
39  tl(std::move(topLeftCorner)), br(std::move(bottomRightCorner)) {
40  static_assert(std::is_base_of<Point, T>::value, "T must inherit from Point");
41  }
const T tl
Definition: rectangle.h:52
const T br
Definition: rectangle.h:53

Member Function Documentation

◆ getCenter()

template<typename T>
constexpr T Rectangle< T >::getCenter ( ) const
inline

Definition at line 44 of file rectangle.h.

44  {
45  return (tl + br) / 2;
46  }
const T tl
Definition: rectangle.h:52
const T br
Definition: rectangle.h:53

◆ getSize()

template<typename T>
constexpr T Rectangle< T >::getSize ( ) const
inline

Definition at line 48 of file rectangle.h.

48  {
49  return (br - tl) + 1;
50  }
const T tl
Definition: rectangle.h:52
const T br
Definition: rectangle.h:53

Member Data Documentation

◆ br

template<typename T>
const T Rectangle< T >::br

Definition at line 53 of file rectangle.h.

◆ tl

template<typename T>
const T Rectangle< T >::tl

Definition at line 52 of file rectangle.h.


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