OpenTTD Source: src/core/geometry_func.hpp File Reference

OpenTTD Source 1.11.0-RC1

Functions
geometry_func.hpp File Reference
`#include "geometry_type.hpp"`

Go to the source code of this file.

## Functions
Dimension | maxdim (const Dimension &d1, const Dimension &d2)
| Compute bounding box of both dimensions. More...
static bool | IsEmptyRect (const Rect &r)
| Check if a rectangle is empty. More...
Rect | BoundingRect (const Rect &r1, const Rect &r2)
| Compute the bounding rectangle around two rectangles. More...

## Detailed Description

Geometry functions.

Definition in file geometry_func.hpp.

## Function Documentation

## ◆ BoundingRect()

Rect BoundingRect | ( | const Rect & | r1,
|  | const Rect & | r2
| ) |  |

Compute the bounding rectangle around two rectangles.

Parameters

  r1 | First rectangle.
  r2 | Second rectangle.

Returns
  The bounding rectangle, the smallest rectangle that contains both arguments.

Definition at line 36 of file geometry_func.cpp.

References IsEmptyRect().

Referenced by VideoDriver_Win32Base::MakeDirty(), and VideoDriver_SDL_Base::MakeDirty().

## ◆ IsEmptyRect()

static bool IsEmptyRect | ( | const Rect & | r | ) |
| inlinestatic

Check if a rectangle is empty.

Parameters

  r | Rectangle to check.

Returns
  True if and only if the rectangle doesn't define space.

Definition at line 22 of file geometry_func.hpp.

Referenced by BoundingRect(), VideoDriver_SDL_Default::Paint(), VideoDriver_Win32GDI::Paint(), and OpenGLBackend::ReleaseVideoBuffer().

## ◆ maxdim()

Dimension maxdim | ( | const Dimension & | d1,
|  | const Dimension & | d2
| ) |  |

Compute bounding box of both dimensions.

Parameters

  d1 | First dimension.
  d2 | Second dimension.

Returns
  The bounding box of both dimensions, the smallest dimension that surrounds both arguments.

Definition at line 22 of file geometry_func.cpp.

Referenced by VehicleGroupWindow::ComputeGroupInfoSize(), BaseVehicleListWindow::GetActionDropdownSize(), GetRailTypeDropDownList(), NetworkContentListWindow::NetworkContentListWindow(), SelectCompanyManagerFaceWindow::OnInit(), IndustryCargoesWindow::OnInit(), NWidgetBackground::SetupSmallestSize(), NWidgetLeaf::SetupSmallestSize(), SelectGameWindow::UpdateWidgetSize(), SetDateWindow::UpdateWidgetSize(), SubsidyListWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), GoalListWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), BootstrapAskForDownloadWindow::UpdateWidgetSize(), ReplaceVehicleWindow::UpdateWidgetSize(), BuildAirportWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), NewsWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), NetworkChatWindow::UpdateWidgetSize(), GenerateLandscapeWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), SaveLoadWindow::UpdateWidgetSize(), NetworkContentListWindow::UpdateWidgetSize(), MusicWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), StoryBookWindow::UpdateWidgetSize(), AIConfigWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), PaymentRatesGraphWindow::UpdateWidgetSize(), CreateScenarioWindow::UpdateWidgetSize(), NetworkStartServerWindow::UpdateWidgetSize(), BuildRailStationWindow::UpdateWidgetSize(), BuildVehicleWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), and NetworkClientListPopupWindow::UpdateWidgetSize().