• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
Rect Class Reference

#include <rect.h>

Public Member Functions

 Rect (const Coordinate bottomLeft, const Coordinate topRight)
 
 Rect (const Coordinate bottomLeft, const double width, const double height)
 
 Rect (double xa, double ya, double width, double height)
 
 Rect (const Rect &r)
 
 Rect ()
 
double bottom () const
 
Coordinate bottomLeft () const
 
Coordinate bottomRight () const
 
Coordinate center () const
 
bool contains (const Coordinate &p) const
 
bool contains (const Coordinate &p, double allowed_miss) const
 
void eat (const Rect &r)
 
double height () const
 
bool intersects (const Rect &p) const
 
double left () const
 
Rect matchShape (const Rect &rhs, bool shrink=false) const
 
void moveBy (const Coordinate p)
 
void normalize ()
 
Rect normalized () const
 
Rect & operator*= (const double r)
 
Rect & operator+= (const Coordinate p)
 
Rect & operator/= (const double r)
 
Rect & operator|= (const Rect &rhs)
 
double right () const
 
void scale (const double r)
 
void setBottom (const double p)
 
void setBottomLeft (const Coordinate p)
 
void setBottomRight (const Coordinate p)
 
void setCenter (const Coordinate p)
 
void setContains (Coordinate p)
 
void setHeight (const double h)
 
void setLeft (const double p)
 
void setRight (const double p)
 
void setTop (const double p)
 
void setTopLeft (const Coordinate p)
 
void setTopRight (const Coordinate p)
 
void setWidth (const double w)
 
double top () const
 
Coordinate topLeft () const
 
Coordinate topRight () const
 
QRect toQRect () const
 
bool valid ()
 
double width () const
 

Static Public Member Functions

static Rect fromQRect (const QRect &)
 
static Rect invalidRect ()
 

Protected Attributes

Coordinate mBottomLeft
 
double mheight
 
double mwidth
 

Friends

kdbgstream & operator<< (kdbgstream &s, const Rect &t)
 

Detailed Description

This file is part of Kig, a KDE program for Interactive Geometry...

Copyright (C) 2002 Dominique Devriese devri.nosp@m.ese@.nosp@m.kde.o.nosp@m.rg

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA like Coordinate is a QPoint replacement with doubles, this is a QRect replacement with doubles...

Definition at line 34 of file rect.h.

Constructor & Destructor Documentation

Rect::Rect ( const Coordinate  bottomLeft,
const Coordinate  topRight 
)

constructors...

Definition at line 38 of file rect.cc.

Rect::Rect ( const Coordinate  bottomLeft,
const double  width,
const double  height 
)

Definition at line 46 of file rect.cc.

Rect::Rect ( double  xa,
double  ya,
double  width,
double  height 
)

Definition at line 54 of file rect.cc.

Rect::Rect ( const Rect &  r)

Definition at line 62 of file rect.cc.

Rect::Rect ( )

Definition at line 70 of file rect.cc.

Member Function Documentation

double Rect::bottom ( ) const

Definition at line 194 of file rect.cc.

Coordinate Rect::bottomLeft ( ) const

Definition at line 161 of file rect.cc.

Coordinate Rect::bottomRight ( ) const

Definition at line 166 of file rect.cc.

Coordinate Rect::center ( ) const

Definition at line 181 of file rect.cc.

bool Rect::contains ( const Coordinate &  p) const

Definition at line 222 of file rect.cc.

bool Rect::contains ( const Coordinate &  p,
double  allowed_miss 
) const

Definition at line 214 of file rect.cc.

void Rect::eat ( const Rect &  r)

This expands the rect so that it contains r.

It has friends '|=' and '|' below...

Definition at line 274 of file rect.cc.

Rect Rect::fromQRect ( const QRect &  r)
static

Definition at line 256 of file rect.cc.

double Rect::height ( ) const

Definition at line 209 of file rect.cc.

bool Rect::intersects ( const Rect &  p) const

Definition at line 230 of file rect.cc.

Rect Rect::invalidRect ( )
static

Definition at line 305 of file rect.cc.

double Rect::left ( ) const

Definition at line 186 of file rect.cc.

Rect Rect::matchShape ( const Rect &  rhs,
bool  shrink = false 
) const

return a rect which is a copy of this rect, but has an aspect ratio equal to rhs's one.

. if shrink is true, the rect will be shrunk, otherwise extended.. The center of the new rect is the same as this rect's center..

Definition at line 282 of file rect.cc.

void Rect::moveBy ( const Coordinate  p)

moves the rect while keeping the size constant...

Definition at line 144 of file rect.cc.

void Rect::normalize ( )

this makes sure width and height are > 0 ...

Definition at line 130 of file rect.cc.

Rect Rect::normalized ( ) const

Definition at line 249 of file rect.cc.

Rect& Rect::operator*= ( const double  r)
inline

synonym for scale...

Definition at line 84 of file rect.h.

Rect& Rect::operator+= ( const Coordinate  p)
inline

synonym for moveBy...

Definition at line 76 of file rect.h.

Rect& Rect::operator/= ( const double  r)
inline

Definition at line 85 of file rect.h.

Rect& Rect::operator|= ( const Rect &  rhs)
inline

synonym for eat.

Definition at line 96 of file rect.h.

double Rect::right ( ) const

Definition at line 190 of file rect.cc.

void Rect::scale ( const double  r)

scale: only the size changes, topLeft is kept where it is...

Definition at line 149 of file rect.cc.

void Rect::setBottom ( const double  p)

Definition at line 108 of file rect.cc.

void Rect::setBottomLeft ( const Coordinate  p)

Definition at line 76 of file rect.cc.

void Rect::setBottomRight ( const Coordinate  p)

Definition at line 81 of file rect.cc.

void Rect::setCenter ( const Coordinate  p)

Definition at line 91 of file rect.cc.

void Rect::setContains ( Coordinate  p)

this makes sure p is in the rect, extending it if necessary...

Definition at line 240 of file rect.cc.

void Rect::setHeight ( const double  h)

Definition at line 125 of file rect.cc.

void Rect::setLeft ( const double  p)

Definition at line 96 of file rect.cc.

void Rect::setRight ( const double  p)

Definition at line 103 of file rect.cc.

void Rect::setTop ( const double  p)

Definition at line 115 of file rect.cc.

void Rect::setTopLeft ( const Coordinate  p)

Definition at line 261 of file rect.cc.

void Rect::setTopRight ( const Coordinate  p)

Definition at line 86 of file rect.cc.

void Rect::setWidth ( const double  w)

Definition at line 120 of file rect.cc.

double Rect::top ( ) const

Definition at line 199 of file rect.cc.

Coordinate Rect::topLeft ( ) const

Definition at line 171 of file rect.cc.

Coordinate Rect::topRight ( ) const

Definition at line 176 of file rect.cc.

QRect Rect::toQRect ( ) const

Definition at line 156 of file rect.cc.

bool Rect::valid ( )

Definition at line 300 of file rect.cc.

double Rect::width ( ) const

Definition at line 204 of file rect.cc.

Friends And Related Function Documentation

kdbgstream& operator<< ( kdbgstream &  s,
const Rect &  t 
)
friend

Definition at line 28 of file rect.cc.

Member Data Documentation

Coordinate Rect::mBottomLeft
protected

Definition at line 126 of file rect.h.

double Rect::mheight
protected

Definition at line 128 of file rect.h.

double Rect::mwidth
protected

Definition at line 127 of file rect.h.


The documentation for this class was generated from the following files:
  • rect.h
  • rect.cc
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal