📄 tvrectangle.h
字号:
/* COPYRIGHT NOTICE This material was developed by Christos Faloutsos and King-Ip Linat the University of Maryland, College Park, Department of Computer Science.Permission is granted to copy this software, to redistribute iton a nonprofit basis, and to use it for any purpose, subject tothe following restrictions and understandings. 1. Any copy made of this software must include this copyright noticein full. 2. All materials developed as a consequence of the use of thissoftware shall duly acknowledge such use, in accordance with the usualstandards of acknowledging credit in academic research. 3. The authors have made no warranty or representation that theoperation of this software will be error-free or suitable for anyapplication, and they are under under no obligation to provide anyservices, by way of maintenance, update, or otherwise. The softwareis an experimental prototype offered on an as-is basis. 4. Redistribution for profit requires the express, written permissionof the authors. */// Author : $Author$// Date : $Date$// Id : $Id$// $Id: rectangle.h,v 1.2 1996/04/18 21:50:24 kilin Exp kilin $ // TVRectangle class// Center : center of the rectangle// Radius : half the length of a sideclass TVRectangle { friend ostream& operator<< (ostream&, const TVRectangle&); friend ostream& operator<< (ostream&, const TVRectangle*&); friend ofstream& operator< (ofstream&, const TVRectangle&); friend ofstream& operator< (ofstream&, const TVRectangle*&); friend istream& operator>> (istream&, TVRectangle&); friend istream& operator>> (istream&, TVRectangle*&); friend ifstream& operator>> (ifstream&, TVRectangle&); friend ifstream& operator>> (ifstream&, TVRectangle*&); friend ifstream& operator> (ifstream&, TVRectangle&); friend ifstream& operator> (ifstream&, TVRectangle*&); friend TVRectangle operator<<(const TVector& ,const TVRectangle&); friend TVRectangle MinBoundTVRectangle(TVRectangle*, int, int = 0); friend TVRectangle MinBoundTVRectangle(TVector*, int, int = 0);/* friend TVRectangle MinBoundTVRectangle(TVRectangle*, int, int = SIG_DIM); friend TVRectangle MinBoundTVRectangle(TVector*, int, int = SIG_DIM);*/public : TVRectangle(); // Initialize a vector to be of no dimension // new rectangle{rectangle} (center, radius) TVRectangle(const TVector&, float, int); // TVRectangle with lower, upper corners with sigdim given // sigdim = 0 --> Maximum non-sigdim, sig dim possible TVRectangle(const TVector& low, const TVector& high, int sigdim = 0); // TVRectangle with non-sig portion and sig low/high corners TVRectangle(const TVector& nsig, const TVector &low, const TVector& high); TVRectangle(const TVRectangle&); ~TVRectangle(); TVRectangle& operator=(const TVRectangle&); TVector GetCenter() const; // return center of rectangle float GetRadius() const; // return radius int GetSigDim() const; // get significiant dimensions int GetNonSigDim() const; int GetCenterDim() const; TVector GetSigCenter() const; TVector GetNonSigCenter() const; int Size() const; TVRectangle& PutNonSig(const TVector& v); TVRectangle& PutSig(const TVector& low, const TVector& high); TVRectangle& Put(const TVector& nsig, const TVector& low, const TVector& high); TVRectangle& AppendSig(const TVector& low, const TVector& high); TVRectangle ProjectSigTVRectangle() const; TVRectangle ProjectBack(int) const; TVRectangle ProjectFront(int) const; TVRectangle ProjectMid(int, int) const; TVector ProjectFrontLow(int) const; TVector ProjectFrontHigh(int) const; TVector ProjectMidLow(int, int) const; TVector ProjectMidHigh(int, int) const; int Contain(const TVector&) const; int Contain(const TVRectangle&) const; int Intersect(const TVRectangle&) const; TVRectangle InsertTVector(const TVector&, int = 0); TVRectangle Combine(const TVRectangle&, int = 0); double MinDist(const TVector&) const; int NoIntersectDim(const TVRectangle&) const;private : TVector nonsig; TVector lower, upper;};TVRectangle CalMinCenter(const TVRectangle&, const TVector&);// Return rectangle formed by two vectors;// maxsigdim = 0 --> maximum significant dimensionsTVRectangle NewRect(const TVector& v1, const TVector& v2, int maxsigdim = 0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -