QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RBox Class Reference

Represents a box e.g. More...

#include <RBox.h>

List of all members.

Public Member Functions

bool contains (const RBox &other) const
bool contains (const RVector &v) const
bool containsBox (const RBox &other) const
bool containsPoint (const RVector &v) const
RVector getCenter () const
RVector getCorner1 () const
RVector getCorner2 () const
QList< RVectorgetCorners () const
QList< RVectorgetCorners2d () const
double getHeight () const
QList< RLinegetLines2d () const
RVector getMaximum () const
RVector getMinimum () const
RPolyline getPolyline2d () const
RVector getSize () const
QList< RTrianglegetTriangles () const
double getWidth () const
RBoxgrow (double offset)
void growToInclude (const RBox &other)
 Grows this box to include the given box or sets this box to the given box if this box is invalid.
void growToInclude (const RVector &v)
 Grows this box to include the given point.
void growToIncludeBox (const RBox &other)
void growToIncludePoint (const RVector &v)
RBoxgrowXY (double offset)
bool intersects (const RBox &other) const
bool intersectsWith (const RShape &shape, bool limited=true) const
bool isOutside (const RBox &other) const
bool isOutsideXY (const RBox &other) const
bool isValid () const
bool operator!= (const RBox &other) const
bool operator== (const RBox &other) const
 == operator
 RBox ()
 Copyright (c) 2011-2013 by Andrew Mustun.
 RBox (const QRectF &rect)
 Constructor for a box based on the given QRectF object.
 RBox (const RVector &c1, const RVector &c2)
 Constructor for a box with two given diagonally opposite corners.
 RBox (const RVector &center, double range)
 Creates a square box with the given center and the given range (= side length / 2).
void setCorner1 (const RVector &v)
void setCorner2 (const RVector &v)
QRectF toQRectF () const

Public Attributes

RVector c1
 Getter function for this property: getCorner1.
RVector c2
 Getter function for this property: getCorner2.

Detailed Description

Represents a box e.g.

a bounding box. The surfaces of the box are orthogonal to the Cartesian coordinate system.

Scriptable:
This class is wrapped for script environments.
Shared Pointer Support:
Script wrappers of this class support wrapping in QSharedPointer.
Copyable:
Script wrappers of this class should pass objects by reference.

Constructor & Destructor Documentation

RBox::RBox ( )

Copyright (c) 2011-2013 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD 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 3 of the License, or (at your option) any later version.

QCAD 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 QCAD. Constructor for an invalid box with invalid corner points.

RBox::RBox ( const QRectF &  rect)
explicit

Constructor for a box based on the given QRectF object.

RBox::RBox ( const RVector c1,
const RVector c2 
)

Constructor for a box with two given diagonally opposite corners.

RBox::RBox ( const RVector center,
double  range 
)

Creates a square box with the given center and the given range (= side length / 2).


Member Function Documentation

bool RBox::contains ( const RBox other) const
Returns:
True if the given box is completely inside this box.
bool RBox::contains ( const RVector v) const
   \par Non-Scriptable:

This function is not available in script environments.

Returns:
True if the given vector is inside this box.
bool RBox::containsBox ( const RBox other) const
inline
bool RBox::containsPoint ( const RVector v) const
inline
RVector RBox::getCenter ( ) const
RVector RBox::getCorner1 ( ) const
RVector RBox::getCorner2 ( ) const
QList< RVector > RBox::getCorners ( ) const
Returns:
8 vectors for the eight corners of the box.

The first box corner is the first defining corner c1. The next three corners are the corners on the same Z level as c1, counter-clockwise. The next four corners are on the same Z-level as c2 starting with the corner at the same X/Y position as c1, continueing counter-clockwise.

QList< RVector > RBox::getCorners2d ( ) const
double RBox::getHeight ( ) const
QList< RLine > RBox::getLines2d ( ) const
RVector RBox::getMaximum ( ) const
RVector RBox::getMinimum ( ) const
RPolyline RBox::getPolyline2d ( ) const
RVector RBox::getSize ( ) const
QList< RTriangle > RBox::getTriangles ( ) const
Returns:
12 triangles, two for each side of the box.
double RBox::getWidth ( ) const
RBox & RBox::grow ( double  offset)
void RBox::growToInclude ( const RBox other)

Grows this box to include the given box or sets this box to the given box if this box is invalid.

void RBox::growToInclude ( const RVector v)

Grows this box to include the given point.

   \par Non-Scriptable:

This function is not available in script environments.

void RBox::growToIncludeBox ( const RBox other)
inline
void RBox::growToIncludePoint ( const RVector v)
inline
RBox & RBox::growXY ( double  offset)
bool RBox::intersects ( const RBox other) const
bool RBox::intersectsWith ( const RShape shape,
bool  limited = true 
) const
bool RBox::isOutside ( const RBox other) const
Returns:
True if this box is completely inside the given box.
True if the given box is completely outside this box.
bool RBox::isOutsideXY ( const RBox other) const
Returns:
True if the given box is completely outside this box.
bool RBox::isValid ( ) const
bool RBox::operator!= ( const RBox other) const
inline
bool RBox::operator== ( const RBox other) const

== operator

void RBox::setCorner1 ( const RVector v)
void RBox::setCorner2 ( const RVector v)
QRectF RBox::toQRectF ( ) const

Member Data Documentation

RVector RBox::c1

Getter function for this property: getCorner1.

Setter function for this property: setCorner1

RVector RBox::c2

Getter function for this property: getCorner2.

Setter function for this property: setCorner2


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