📄 irectangle.h
字号:
#ifndef IFMERECTANGLE_H
#define IFMERECTANGLE_H
// $Id: irectangle.h,v 17.0 2005/10/28 21:08:33 geh Exp $
/*! \file irectangle.h
\brief Defines the IFMERectangle interface.
*/
/*! \internal
============================================================================
Name : irectangle.h
System : Safe Translator Framework
Language : C++
Purpose : Declaration of IFMERectangle
Author Date Changes made
------------------ ------------ -------------------------------
Don Murray Apr 19, 2000 Original definition
Dale Lutz Jul 06, 2001 Fixed up commenting for doxygen
Tom Weir Jun 01, 2004 Fixed documentation.
Kaustav Mukherjee Nov 16, 2004 Added the internal tag to hide this revision control part.
Copyright (c) 1994 - 2005, Safe Software Inc.
All Rights Reserved
This software may not be copied or reproduced, in all or in part,
without the prior written consent of Safe Software Inc.
The entire risk as to the results and performance of the software,
supporting text and other information contained in this file
(collectively called the "Software") is with the user. Although
Safe Software Incorporated has used considerable efforts in preparing
the Software, Safe Software Incorporated does not warrant the
accuracy or completeness of the Software. In no event will Safe Software
Incorporated be liable for damages, including loss of profits or
consequential damages, arising out of the use of the Software.
*/
/*! \class IFMERectangle
\brief Rectangle class
This class defines IFMERectangle which performs many rectangle operations.
Note that this class lives ONLY in 2 dimensions.
This file defines the interface that subclasses of this class MUST
follow.
Developers MUST NOT implement their own subclasses of this, instead,
the FME will ALWAYS provide them with the subclass instance they
should be using.
*/
// Concrete class
class IFMERectangle
{
public:
/* rectangle accessor functions. -- the non-const ones may be used
// as an lvalue.
*/
// -----------------------------------------------------------------------
/*! minX accessor. May be used as an lvalue.*/
virtual FME_Real64 &minX() = 0;
// -----------------------------------------------------------------------
/*! minY accessor. May be used as an lvalue.*/
virtual FME_Real64 &minY() = 0;
// -----------------------------------------------------------------------
/*! maxX accessor. May be used as an lvalue.*/
virtual FME_Real64 &maxX() = 0;
// -----------------------------------------------------------------------
/*! maxY accessor. May be used as an lvalue.*/
virtual FME_Real64 &maxY() = 0;
// -----------------------------------------------------------------------
/*! minX accessor. */
virtual FME_Real64 minX() const = 0;
// -----------------------------------------------------------------------
/*! minY accessor. */
virtual FME_Real64 minY() const = 0;
// -----------------------------------------------------------------------
/*! maxX accessor. */
virtual FME_Real64 maxX() const = 0;
// -----------------------------------------------------------------------
/*! maxY accessor. */
virtual FME_Real64 maxY() const = 0;
// -----------------------------------------------------------------------
/*! This method returns FME_TRUE if the passed in IFMERectangle intersects
// with this IFMERectangle. */
virtual FME_Boolean intersects(const IFMERectangle &other) const = 0;
// -----------------------------------------------------------------------
/*! This method returns FME_TRUE if the specified rectangle is contained
// wholly within this IFMERectangle, or if it is wholly covered
// by this, or if it is exactly equal to this. */
virtual FME_Boolean contains(const IFMERectangle &other) const = 0;
// -----------------------------------------------------------------------
/*! This method returns FME_TRUE if the specified rectangle is contained
// wholly within this IFMERectangle and returns FME_FALSE otherwise.
// Note that if touching on the edges will not pass. */
virtual FME_Boolean containsStrictly(const IFMERectangle &other) const = 0;
// -----------------------------------------------------------------------
/*! This method assigns this rectangle to the value specified by the
// other rectangle. */
virtual IFMERectangle &operator=(const IFMERectangle &other) = 0;
// -----------------------------------------------------------------------
/*! This method returns TRUE if this rectangle is the same as the other one
*/
virtual FME_Boolean operator==(const IFMERectangle &other) const = 0;
// -----------------------------------------------------------------------
/*! This method takes the union of this and the operand and returns
// the result. The union of two rectangles is the smallest rectangle
// which contains both this rectangle and the rectangle specified. */
virtual IFMERectangle &operator|(const IFMERectangle &other) = 0;
// -----------------------------------------------------------------------
/*! This method expands the rectangle by the percentage passed in.
// The percentage should be real number between 0 and 100.
// If the rectangle had no current spread, then it is given
// one. In such a case, the rectangle is assign an arbitrary spread. */
virtual void expand(FME_Real64 percentage) = 0;
// -----------------------------------------------------------------------
/*! This method grows the rectangle by the specified amount in each of X
// and Y. In total the width of the rectangle will increase by 2 times
// the amount, and the height the same. */
virtual void buffer(FME_Real64 bufAmount) = 0;
// -----------------------------------------------------------------------
/*! This method grows the rectangle by the specified amount in each of X
// and Y. In total the width of the rectangle will increase by 2 times
// the xBuf amount, and the height by 2 times the yBuf amount. */
virtual void buffer(FME_Real64 xBuf, FME_Real64 yBuf) = 0;
// -----------------------------------------------------------------------
/*! This method Returns the area of this rectangle */
virtual FME_Real64 area() const = 0;
protected:
// -----------------------------------------------------------------------
// No one should be making instances of this directly.
// make the constructor protected.
IFMERectangle() {};
// -----------------------------------------------------------------------
// Destructor -- does nothing
virtual ~IFMERectangle() {};
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -