SNAP Library 2.1, Developer Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TFltRect Class Reference

#include <dt.h>

Collaboration diagram for TFltRect:

List of all members.

Public Member Functions

 TFltRect ()
 TFltRect (const TFltRect &FltRect)
 TFltRect (const double &_MnX, const double &_MnY, const double &_MxX, const double &_MxY)
 TFltRect (TSIn &SIn)
void Save (TSOut &SOut) const
void LoadXml (const PXmlTok &XmlTok, const TStr &Nm)
void SaveXml (TSOut &SOut, const TStr &Nm) const
TFltRectoperator= (const TFltRect &FltRect)
double GetMnX () const
double GetMnY () const
double GetMxX () const
double GetMxY () const
double GetXLen () const
double GetYLen () const
double GetXCenter () const
double GetYCenter () const
bool IsXYIn (const double &X, const double &Y) const
TStr GetStr () const

Static Public Member Functions

static bool Intersection (const TFltRect &Rect1, const TFltRect &Rect2)

Public Attributes

TFlt MnX
TFlt MnY
TFlt MxX
TFlt MxY

Detailed Description

Definition at line 1478 of file dt.h.


Constructor & Destructor Documentation

TFltRect::TFltRect ( ) [inline]

Definition at line 1482 of file dt.h.

            :
    MnX(), MnY(), MxX(), MxY(){}
TFltRect::TFltRect ( const TFltRect FltRect) [inline]

Definition at line 1484 of file dt.h.

                                   :
    MnX(FltRect.MnX), MnY(FltRect.MnY), MxX(FltRect.MxX), MxY(FltRect.MxY){}
TFltRect::TFltRect ( const double &  _MnX,
const double &  _MnY,
const double &  _MxX,
const double &  _MxY 
) [inline]

Definition at line 1486 of file dt.h.

                                          :
    MnX(_MnX), MnY(_MnY), MxX(_MxX), MxY(_MxY){}
TFltRect::TFltRect ( TSIn SIn) [inline]

Definition at line 1490 of file dt.h.

                     :
    MnX(SIn), MnY(SIn), MxX(SIn), MxY(SIn){}

Member Function Documentation

double TFltRect::GetMnX ( ) const [inline]

Definition at line 1502 of file dt.h.

References MnX.

Referenced by Intersection().

{return MnX;}

Here is the caller graph for this function:

double TFltRect::GetMnY ( ) const [inline]

Definition at line 1503 of file dt.h.

References MnY.

Referenced by Intersection().

{return MnY;}

Here is the caller graph for this function:

double TFltRect::GetMxX ( ) const [inline]

Definition at line 1504 of file dt.h.

References MxX.

Referenced by Intersection().

{return MxX;}

Here is the caller graph for this function:

double TFltRect::GetMxY ( ) const [inline]

Definition at line 1505 of file dt.h.

References MxY.

Referenced by Intersection().

{return MxY;}

Here is the caller graph for this function:

Definition at line 2325 of file dt.cpp.

References MnX, MnY, MxX, and MxY.

                            {
  TChA ChA;
  ChA+='(';
  ChA+=TFlt::GetStr(MnX, "%0.2f"); ChA+=',';
  ChA+=TFlt::GetStr(MnY, "%0.2f"); ChA+=',';
  ChA+=TFlt::GetStr(MxX, "%0.2f"); ChA+=',';
  ChA+=TFlt::GetStr(MxY, "%0.2f"); ChA+=')';
  return ChA;
}
double TFltRect::GetXCenter ( ) const [inline]

Definition at line 1512 of file dt.h.

References MnX, and MxX.

{return MnX+(MxX-MnX)/2;}
double TFltRect::GetXLen ( ) const [inline]

Definition at line 1508 of file dt.h.

References MnX, and MxX.

{return MxX-MnX;}
double TFltRect::GetYCenter ( ) const [inline]

Definition at line 1513 of file dt.h.

References MnY, and MxY.

{return MnY+(MxY-MnY)/2;}
double TFltRect::GetYLen ( ) const [inline]

Definition at line 1509 of file dt.h.

References MnY, and MxY.

{return MxY-MnY;}
bool TFltRect::Intersection ( const TFltRect Rect1,
const TFltRect Rect2 
) [static]

Definition at line 2317 of file dt.cpp.

References TFlt::GetMn(), GetMnX(), GetMnY(), TFlt::GetMx(), GetMxX(), and GetMxY().

                                                                       {
  const double MnXX = TFlt::GetMx(Rect1.GetMnX(), Rect2.GetMnX());
  const double MnYY = TFlt::GetMx(Rect1.GetMnY(), Rect2.GetMnY());
  const double MxXX = TFlt::GetMn(Rect1.GetMxX(), Rect2.GetMxX());
  const double MxYY = TFlt::GetMn(Rect1.GetMxY(), Rect2.GetMxY());
  return (MnXX < MxXX) && (MnYY < MxYY);
}

Here is the call graph for this function:

bool TFltRect::IsXYIn ( const double &  X,
const double &  Y 
) const [inline]

Definition at line 1516 of file dt.h.

References MnX, MnY, MxX, and MxY.

                                                      {
    return (MnX<=X)&&(X<=MxX)&&(MnY<=Y)&&(Y<=MxY);}
void TFltRect::LoadXml ( const PXmlTok XmlTok,
const TStr Nm 
)

Definition at line 2303 of file dt.cpp.

References TXmlObjSer::GetFltArg(), MnX, MnY, MxX, MxY, and XLoadHd.

                                                           {
  XLoadHd(Nm);
  MnX=TXmlObjSer::GetFltArg(XmlTok, "MnX");
  MnY=TXmlObjSer::GetFltArg(XmlTok, "MnY");
  MxX=TXmlObjSer::GetFltArg(XmlTok, "MxX");
  MxY=TXmlObjSer::GetFltArg(XmlTok, "MxY");
}

Here is the call graph for this function:

TFltRect& TFltRect::operator= ( const TFltRect FltRect) [inline]

Definition at line 1497 of file dt.h.

References MnX, MnY, MxX, and MxY.

                                              {
    MnX=FltRect.MnX; MnY=FltRect.MnY; MxX=FltRect.MxX; MxY=FltRect.MxY;
    return *this;}
void TFltRect::Save ( TSOut SOut) const [inline]

Definition at line 1492 of file dt.h.

References MnX, MnY, MxX, MxY, and TFlt::Save().

                               {
    MnX.Save(SOut); MnY.Save(SOut); MxX.Save(SOut); MxY.Save(SOut);}

Here is the call graph for this function:

void TFltRect::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 2311 of file dt.cpp.

References TFlt::GetStr(), MnX, MnY, MxX, MxY, and XSaveBETagArg4.

                                                        {
  XSaveBETagArg4(Nm,
   "MnX", TFlt::GetStr(double(MnX)), "MnY", TFlt::GetStr(double(MnY)),
   "MxX", TFlt::GetStr(double(MxX)), "MxY", TFlt::GetStr(double(MxY)));
}

Here is the call graph for this function:


Member Data Documentation


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