Lattice Class Reference

#include <Lattice.h>

Inheritance diagram for Lattice:
LatticeBase

List of all members.

Public Types

enum  ESide { kLeft = 1, kRight = 2, kBoth = 3 }
typedef LatticeDef::ID ID
typedef LatticeDef::VectorID VectorID
typedef
LatticeBase::LatticeTopology 
Topology
typedef LatticeBase::RightNode RightNode
typedef LatticeBase::LeftNode LeftNode
typedef LatticeBase::Link Link

Public Member Functions

 Lattice (const Text_t *lName, const Text_t *rName, Topology i=LatticeBase::Default, Topology j=LatticeBase::Default, Topology k=LatticeBase::Default, Topology l=LatticeBase::Default)
virtual ~Lattice ()
virtual void GetAllIDs (ESide side, VectorID &ids) const
virtual void GetFarIDs (ESide side, ID startFrom, VectorID &ids) const
virtual void GetNearIDs (ESide side, ID startFrom, VectorID &ids) const
virtual LinkConnectLR (ID leftID, ID rightID)
virtual LinkConnectLR (ID leftID, Link *link, ID rightID)
virtual LinkConnect (ESide side, ID nearID, ID farID)
virtual LinkConnect (ESide side, ID nearID, Link *link, ID farID)

Private Attributes

string fLeftName
string fRightName

Detailed Description

Definition at line 29 of file Lattice.h.


Member Typedef Documentation

Definition at line 38 of file Lattice.h.

Reimplemented from LatticeBase.

Definition at line 42 of file Lattice.h.

Reimplemented from LatticeBase.

Definition at line 43 of file Lattice.h.

Reimplemented from LatticeBase.

Definition at line 41 of file Lattice.h.

Definition at line 40 of file Lattice.h.

Definition at line 39 of file Lattice.h.


Member Enumeration Documentation

Enumerator:
kLeft 
kRight 
kBoth 

Definition at line 36 of file Lattice.h.

00036 { kLeft = 1,  kRight = 2, kBoth = 3 };


Constructor & Destructor Documentation

Lattice::Lattice ( const Text_t *  lName,
const Text_t *  rName,
Topology  i = LatticeBase::Default,
Topology  j = LatticeBase::Default,
Topology  k = LatticeBase::Default,
Topology  l = LatticeBase::Default 
)

Definition at line 216 of file Lattice.cxx.

References fLeftName, fRightName, Msg::kDebug, and MSG.

00221                                                        :
00222 LatticeBase(i,j,k,l)
00223 
00224 //  Purpose:   Constructor
00225 //  Arguments: Lattice topology
00226 //            
00227 //  Return:    n/a
00228 
00229 //  Contact:   N. West
00230 
00231   {
00232     fLeftName  = *lName;
00233     fRightName = *rName;
00234 
00235     MSG("Lat",Msg::kDebug) << "Creating lattice between " << lName
00236                      << " and " << rName << endl;
00237   }

Lattice::~Lattice (  )  [virtual]

Definition at line 241 of file Lattice.cxx.

00241 {}


Member Function Documentation

Lattice::Link * Lattice::Connect ( ESide  side,
ID  nearID,
Link link,
ID  farID 
) [virtual]

Definition at line 124 of file Lattice.cxx.

References ConnectLR(), and kLeft.

00127                                           {
00128 
00129 //  Purpose:   Starting from side connect near to far reusing existing 
00130 //             link if possible.
00131 //  Arguments:
00132 //            side    in   Start side (either kLeft or kRight)
00133 //            nearID  in   ID of near side
00134 //            link    in   link to be used. If =0 then reuse any
00135 //                         link from either side or create if none.
00136 //            in  farID    ID of far side
00137 //  Return:   Connecting link.
00138 
00139 //  Contact:   N. West
00140 
00141 
00142    return ( side == kLeft ) ? ConnectLR( nearID, link, farID ) 
00143                             : ConnectLR( farID,  link, nearID);
00144 
00145 }

Lattice::Link * Lattice::Connect ( ESide  side,
ID  nearID,
ID  farID 
) [virtual]

Definition at line 102 of file Lattice.cxx.

References ConnectLR(), and kLeft.

Referenced by LatticeBuilder::AddSecondary().

00104                                           {
00105 
00106 //  Purpose:   Starting from side connect near to far forcing a 
00107   //           new link
00108 //  Arguments:
00109 //            side    in   Start side (either kLeft or kRight)
00110 //            nearID  in   ID of near side
00111 //            farID   in   ID of far side
00112 //  Return:   Connecting link.
00113 
00114 //  Contact:   N. West
00115 
00116 
00117    return ( side == kLeft ) ? ConnectLR( nearID, farID ) 
00118                             : ConnectLR( farID,  nearID);
00119 
00120 }

Lattice::Link * Lattice::ConnectLR ( ID  leftID,
Link link,
ID  rightID 
) [virtual]

Definition at line 57 of file Lattice.cxx.

References LatticeBase::connect(), LatticeBase::leftNode(), LatticeRightNode::links(), LatticeLeftNode::links(), LatticeBase::links(), LatticeBase::newLeftNode(), LatticeBase::newRightNode(), and LatticeBase::rightNode().

00059                                               {
00060 
00061 //  Purpose:   Connect left and right IDs reusing existing 
00062 //             link if possible.
00063 //  Arguments:
00064 //            leftID in    left ID
00065 //            link   in    link to be used. If =0 then reuse any
00066 //                         link from either side or create if none.
00067 //            rightID in   right ID
00068 //  Return:   Connecting link.
00069 
00070 //  Contact:   N. West
00071 
00072 
00073 //  If necessary create nodes corresponding to IDs.
00074 
00075   LeftNode*  pLN   = LatticeBase::leftNode(leftID);
00076   LeftNode*  lNode = (pLN)? pLN : LatticeBase::newLeftNode(leftID);
00077                      
00078   RightNode* pRN   = LatticeBase::rightNode(rightID);
00079   RightNode* rNode = (pRN)? pRN : LatticeBase::newRightNode(rightID);
00080 
00081 
00082 //  If user has not supplied a Link see if either node already 
00083 //  has a Link we can reuse.
00084 
00085   if ( ! link ) {  
00086     const Links& links = lNode->links();
00087     if ( links.size() != 0 ) link = *links.begin();
00088   }
00089   if ( ! link ) {  
00090     const Links& links = rNode->links();
00091     if ( links.size() != 0 ) link = *links.begin();
00092   }
00093 
00094 
00095 //  Make the connection (LatticeBase will create link if stll none).
00096 
00097   return LatticeBase::connect( leftID, link, rightID );
00098 
00099 }

Lattice::Link * Lattice::ConnectLR ( ID  leftID,
ID  rightID 
) [virtual]

Definition at line 30 of file Lattice.cxx.

References LatticeBase::connect(), LatticeBase::leftNode(), LatticeBase::newLeftNode(), LatticeBase::newRightNode(), and LatticeBase::rightNode().

Referenced by Connect(), and LatticeMaker::CreateLattice().

00031                                     {
00032 
00033 //  Purpose:   Connect left and right IDs forcing a new link
00034 //  Arguments:
00035 //            leftID  in   left ID
00036 //            rightID in   right ID
00037 //  Return:   Connecting link.
00038 
00039 //  Contact:   N. West
00040 
00041 
00042 //  If necessary create nodes corresponding to IDs.
00043 
00044   if ( ! LatticeBase::leftNode(leftID)   
00045                                ) LatticeBase::newLeftNode(leftID);
00046   if ( ! LatticeBase::rightNode(rightID) 
00047                                ) LatticeBase::newRightNode(rightID);
00048 
00049 
00050 //  Make the connection 
00051 
00052   return LatticeBase::connect( leftID, rightID );
00053 
00054 }

void Lattice::GetAllIDs ( ESide  side,
VectorID ids 
) const [virtual]

Definition at line 149 of file Lattice.cxx.

References kLeft, LatticeBase::vLeftID(), and LatticeBase::vRightID().

Referenced by NavSet::Fill(), LatValidate::Test_1(), LatValidate::Test_2(), NavValidate::Test_2(), and LatValidate::Test_3().

00150                                                {
00151 
00152 //  Purpose:   Get vector of all IDs.
00153 //  Arguments:
00154 //            side  in   Side whose IDs are required (either kLeft 
00155 //                       or kRight).
00156 //            ids   in   User supplied vector(contents ignored)
00157 //                  out  Vector of all IDs.
00158 //  Return:    n/a
00159 
00160 //  Contact:   N. West
00161 
00162   if ( side == kLeft ) ids = LatticeBase::vLeftID();
00163   else                 ids = LatticeBase::vRightID();
00164 
00165 }

void Lattice::GetFarIDs ( ESide  side,
ID  startFrom,
VectorID ids 
) const [virtual]

Definition at line 191 of file Lattice.cxx.

References kLeft, LatticeBase::vLeftGivenRight(), and LatticeBase::vRightGivenLeft().

Referenced by NavSet::Fill(), LatValidate::Test_2(), and LatValidate::Test_3().

00193                                                {
00194 
00195 //  Purpose:   Get vector of IDs connected remotely (i.e. across the
00196 //             lattice) to startForm.
00197 //  Arguments:
00198 //            side  in   Side of startFrom ID (either kLeft or kRight).
00199 //            startFrom
00200 //                  in   ID to start from. 
00201 //            ids   in   User supplied vector(contents ignored)
00202 //                  out  Vector of IDs connected remotely to startFrom.
00203 //  Return:    
00204 
00205 //  Contact:   N. West
00206 
00207   const VectorID* idsPtr;
00208   if ( side == kLeft ) idsPtr = LatticeBase::vRightGivenLeft(startFrom);
00209   else                 idsPtr = LatticeBase::vLeftGivenRight(startFrom);
00210   if ( idsPtr ) ids = *idsPtr;
00211   else          ids.clear();
00212 }

void Lattice::GetNearIDs ( ESide  side,
ID  startFrom,
VectorID ids 
) const [virtual]

Definition at line 168 of file Lattice.cxx.

References kLeft, LatticeBase::vLeftGivenLeft(), and LatticeBase::vRightGivenRight().

00170                                                 {
00171 
00172 //  Purpose:   Get vector of IDs connected locally (i.e. on this side
00173 //             of the lattice) to startForm.
00174 //  Arguments:
00175 //            side  in   Side of startFrom ID (either kLeft or kRight).
00176 //            startFrom
00177 //                  in   ID to start from. 
00178 //            ids   in   User supplied vector(contents ignored)
00179 //                  out  Vector of IDs connected locally to startFrom.
00180 //  Return:    n/a
00181 
00182 //  Contact:   N. West
00183 
00184   if ( side == kLeft ) ids = *LatticeBase::vLeftGivenLeft(startFrom);
00185   else                 ids = *LatticeBase::vRightGivenRight(startFrom);
00186 
00187 }


Member Data Documentation

string Lattice::fLeftName [private]

Definition at line 74 of file Lattice.h.

Referenced by Lattice().

string Lattice::fRightName [private]

Definition at line 75 of file Lattice.h.

Referenced by Lattice().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1