SNAP Library, User Reference  2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TFltRect Class Reference

#include <dt.h>

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 1447 of file dt.h.


Constructor & Destructor Documentation

TFltRect::TFltRect ( ) [inline]

Definition at line 1451 of file dt.h.

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

Definition at line 1453 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 1455 of file dt.h.

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

Definition at line 1459 of file dt.h.

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

Member Function Documentation

double TFltRect::GetMnX ( ) const [inline]

Definition at line 1471 of file dt.h.

{return MnX;}
double TFltRect::GetMnY ( ) const [inline]

Definition at line 1472 of file dt.h.

{return MnY;}
double TFltRect::GetMxX ( ) const [inline]

Definition at line 1473 of file dt.h.

{return MxX;}
double TFltRect::GetMxY ( ) const [inline]

Definition at line 1474 of file dt.h.

{return MxY;}

Definition at line 2278 of file dt.cpp.

                            {
  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 1481 of file dt.h.

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

Definition at line 1477 of file dt.h.

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

Definition at line 1482 of file dt.h.

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

Definition at line 1478 of file dt.h.

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

Definition at line 2270 of file dt.cpp.

                                                                       {
  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);
}
bool TFltRect::IsXYIn ( const double &  X,
const double &  Y 
) const [inline]

Definition at line 1485 of file dt.h.

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

Definition at line 2256 of file dt.cpp.

                                                           {
  XLoadHd(Nm);
  MnX=TXmlObjSer::GetFltArg(XmlTok, "MnX");
  MnY=TXmlObjSer::GetFltArg(XmlTok, "MnY");
  MxX=TXmlObjSer::GetFltArg(XmlTok, "MxX");
  MxY=TXmlObjSer::GetFltArg(XmlTok, "MxY");
}
TFltRect& TFltRect::operator= ( const TFltRect FltRect) [inline]

Definition at line 1466 of file dt.h.

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

Definition at line 1461 of file dt.h.

                               {
    MnX.Save(SOut); MnY.Save(SOut); MxX.Save(SOut); MxY.Save(SOut);}
void TFltRect::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 2264 of file dt.cpp.

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

Member Data Documentation

Definition at line 1449 of file dt.h.

Definition at line 1449 of file dt.h.

Definition at line 1449 of file dt.h.

Definition at line 1449 of file dt.h.


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