ROOT
v6-20
Reference Guide
TGDimension.cxx
Go to the documentation of this file.
1
// @(#)root/gui:$Id$
2
// Author: Fons Rademakers 02/01/98
3
4
/*************************************************************************
5
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
/**************************************************************************
12
13
This source is based on Xclass95, a Win95-looking GUI toolkit.
14
Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15
16
Xclass95 is free software; you can redistribute it and/or
17
modify it under the terms of the GNU Library General Public
18
License as published by the Free Software Foundation; either
19
version 2 of the License, or (at your option) any later version.
20
21
**************************************************************************/
22
23
//////////////////////////////////////////////////////////////////////////
24
// //
25
// TGDimension, TGPosition, TGLongPosition, TGInsets and TGRectangle //
26
// //
27
// Several small geometry classes that implement dimensions //
28
// (width and height), positions (x and y), insets and rectangles. //
29
// They are trivial and their members are public. //
30
// //
31
//////////////////////////////////////////////////////////////////////////
32
33
#include "
TGDimension.h
"
34
#include "
TMathBase.h
"
35
36
ClassImp
(
TGDimension
);
37
ClassImp
(
TGPosition
);
38
ClassImp
(
TGLongPosition
);
39
ClassImp
(
TGInsets
);
40
ClassImp
(
TGRectangle
);
41
42
void
TGRectangle::Merge
(
const
TGRectangle
&
r
)
43
{
44
// Merge parameters
45
Int_t
max_x =
TMath::Max
(
fX
+ (
Int_t
)
fW
,
r
.fX + (
Int_t
)
r
.fW);
46
fX
=
TMath::Min
(
fX
,
r
.fX);
47
Int_t
max_y =
TMath::Max
(
fY
+ (
Int_t
)
fH
,
r
.fY + (
Int_t
)
r
.fH);
48
fY
=
TMath::Min
(
fY
,
r
.fY);
49
fW
= max_x -
fX
;
50
fH
= max_y -
fY
;
51
}
r
ROOT::R::TRInterface & r
Definition:
Object.C:4
Int_t
int Int_t
Definition:
RtypesCore.h:41
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:365
TGDimension.h
TMathBase.h
TGDimension
Definition:
TGDimension.h:27
TGInsets
Definition:
TGDimension.h:81
TGLongPosition
Definition:
TGDimension.h:63
TGPosition
Definition:
TGDimension.h:45
TGRectangle
Definition:
TGDimension.h:98
TGRectangle::fH
UInt_t fH
Definition:
TGDimension.h:103
TGRectangle::fW
UInt_t fW
Definition:
TGDimension.h:102
TGRectangle::fX
Int_t fX
Definition:
TGDimension.h:100
TGRectangle::Merge
void Merge(const TGRectangle &r)
Definition:
TGDimension.cxx:42
TGRectangle::fY
Int_t fY
Definition:
TGDimension.h:101
TMath::Max
Short_t Max(Short_t a, Short_t b)
Definition:
TMathBase.h:212
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition:
TMathBase.h:180
gui
gui
src
TGDimension.cxx
ROOT v6-20 - Reference Guide Generated on Fri Apr 1 2022 00:20:58 (GVA Time) using Doxygen 1.9.4