OpenTTD Source 20260711-master-g3fb3006dff
geometry_type.hpp File Reference

All geometry types in OpenTTD. More...

Go to the source code of this file.

Data Structures

struct  Alignment
 Horizontal and vertical alignment. More...
struct  Coord2D< T >
 A coordinate with two dimensions. More...
struct  Coord3D< T >
 A coordinate with three dimensions. More...
struct  Dimension
 Dimensions (a width and height) of a rectangle in 2D. More...
struct  RectPadding
 Padding dimensions to apply to each side of a Rect. More...
struct  Rect
 Specification of a rectangle with absolute coordinates of all edges. More...
struct  PointDimension
 Specification of a rectangle with an absolute top-left coordinate and a (relative) width/height. More...

Typedefs

using Point = Coord2D<int>
 Coordinates of a point in 2D.

Enumerations

enum class  AlignmentH : uint8_t {
  Start , Centre , End , ForceLeft ,
  ForceRight
}
 Horizontal alignments. More...
enum class  AlignmentV : uint8_t { Top , Middle , Bottom }
 Vertical alignments. More...

Functions

int CentreBounds (int min, int max, int size)
 Determine where to position a centred object.

Detailed Description

All geometry types in OpenTTD.

Definition in file geometry_type.hpp.

Typedef Documentation

◆ Point

using Point = Coord2D<int>

Coordinates of a point in 2D.

Definition at line 102 of file geometry_type.hpp.

Enumeration Type Documentation

◆ AlignmentH

enum class AlignmentH : uint8_t
strong

Horizontal alignments.

Enumerator
Start 

Align to the start, LTR/RTL aware.

Centre 

Align to the centre.

End 

Align to the end, LTR/RTL aware.

ForceLeft 

Force align to the left.

ForceRight 

Force align to the right.

Definition at line 20 of file geometry_type.hpp.

◆ AlignmentV

enum class AlignmentV : uint8_t
strong

Vertical alignments.

Enumerator
Top 

Align to the top.

Middle 

Align to the middle.

Bottom 

Align to the bottom.

Definition at line 29 of file geometry_type.hpp.

Function Documentation

◆ CentreBounds()