#include "AliMpMotifTypePadIterator.h"
#include "AliMpMotifType.h"
#include "AliMpEncodePair.h"
ClassImp(AliMpMotifTypePadIterator)
AliMpMotifTypePadIterator::AliMpMotifTypePadIterator():
AliMpVPadIterator(),
fkMotifType(0),
fCurrentIx(-1),
fCurrentIy(-1)
{
}
AliMpMotifTypePadIterator::AliMpMotifTypePadIterator(
const AliMpMotifType* motifType)
: AliMpVPadIterator(),
fkMotifType(motifType),
fCurrentIx(-1),
fCurrentIy(-1)
{
}
AliMpMotifTypePadIterator::AliMpMotifTypePadIterator(
const AliMpMotifTypePadIterator& right)
: AliMpVPadIterator(right),
fkMotifType(right.fkMotifType),
fCurrentIx(right.fCurrentIx),
fCurrentIy(right.fCurrentIy)
{
}
AliMpMotifTypePadIterator::~AliMpMotifTypePadIterator()
{
}
AliMpMotifTypePadIterator&
AliMpMotifTypePadIterator::operator = (const AliMpMotifTypePadIterator& right)
{
if (this == &right) return *this;
AliMpVPadIterator::operator=(right);
fkMotifType = right.fkMotifType;
fCurrentIx = right.fCurrentIx;
fCurrentIy = right.fCurrentIy;
return *this;
}
Bool_t
AliMpMotifTypePadIterator::FindFirstPadInLine(Int_t ix, Int_t iy,
Int_t& newIx, Int_t& newIy) const
{
if ( ! fkMotifType ) {
newIx = -1;
newIy = -1;
return false;
}
while ( ix < fkMotifType->GetNofPadsX() ) {
if ( fkMotifType->HasPadByLocalIndices(ix, iy) ) {
newIx = ix;
newIy = iy;
return true;
}
ix++;
}
newIx = -1;
newIy = -1;
return false;
}
Bool_t AliMpMotifTypePadIterator::IsValid() const
{
return fkMotifType!=0 && fCurrentIx >=0 && fCurrentIy >=0;
}
void AliMpMotifTypePadIterator::First()
{
if ( ! fkMotifType ) {
Invalidate();
return ;
}
fCurrentIx = 0;
fCurrentIy = 0;
if ( fkMotifType->HasPadByLocalIndices(fCurrentIx, fCurrentIy) ) return;
Next();
return;
}
void AliMpMotifTypePadIterator::Next()
{
if ( ! IsValid() ) return;
while ( fCurrentIy < fkMotifType->GetNofPadsY() ) {
Int_t nextTryIx, nextTryIy;
Bool_t result
= FindFirstPadInLine(fCurrentIx+1, fCurrentIy, nextTryIx, nextTryIy);
if ( result ){
fCurrentIx = nextTryIx;
fCurrentIy = nextTryIy;
return;
}
fCurrentIx = -1;
fCurrentIy++;
}
Invalidate();
return;
}
Bool_t AliMpMotifTypePadIterator::IsDone() const
{
return ! IsValid();
}
AliMpPad AliMpMotifTypePadIterator::CurrentItem() const
{
if ( ! fkMotifType )
return AliMpPad::Invalid();
else
return AliMpPad(0, 0,
fCurrentIx, fCurrentIy,
0., 0.,0., 0.);
}
void AliMpMotifTypePadIterator::Invalidate()
{
fCurrentIx = -1;
fCurrentIy = -1;
}
AliMpMotifTypePadIterator.cxx:1 AliMpMotifTypePadIterator.cxx:2 AliMpMotifTypePadIterator.cxx:3 AliMpMotifTypePadIterator.cxx:4 AliMpMotifTypePadIterator.cxx:5 AliMpMotifTypePadIterator.cxx:6 AliMpMotifTypePadIterator.cxx:7 AliMpMotifTypePadIterator.cxx:8 AliMpMotifTypePadIterator.cxx:9 AliMpMotifTypePadIterator.cxx:10 AliMpMotifTypePadIterator.cxx:11 AliMpMotifTypePadIterator.cxx:12 AliMpMotifTypePadIterator.cxx:13 AliMpMotifTypePadIterator.cxx:14 AliMpMotifTypePadIterator.cxx:15 AliMpMotifTypePadIterator.cxx:16 AliMpMotifTypePadIterator.cxx:17 AliMpMotifTypePadIterator.cxx:18 AliMpMotifTypePadIterator.cxx:19 AliMpMotifTypePadIterator.cxx:20 AliMpMotifTypePadIterator.cxx:21 AliMpMotifTypePadIterator.cxx:22 AliMpMotifTypePadIterator.cxx:23 AliMpMotifTypePadIterator.cxx:24 AliMpMotifTypePadIterator.cxx:25 AliMpMotifTypePadIterator.cxx:26 AliMpMotifTypePadIterator.cxx:27 AliMpMotifTypePadIterator.cxx:28 AliMpMotifTypePadIterator.cxx:29 AliMpMotifTypePadIterator.cxx:30 AliMpMotifTypePadIterator.cxx:31 AliMpMotifTypePadIterator.cxx:32 AliMpMotifTypePadIterator.cxx:33 AliMpMotifTypePadIterator.cxx:34 AliMpMotifTypePadIterator.cxx:35 AliMpMotifTypePadIterator.cxx:36 AliMpMotifTypePadIterator.cxx:37 AliMpMotifTypePadIterator.cxx:38 AliMpMotifTypePadIterator.cxx:39 AliMpMotifTypePadIterator.cxx:40 AliMpMotifTypePadIterator.cxx:41 AliMpMotifTypePadIterator.cxx:42 AliMpMotifTypePadIterator.cxx:43 AliMpMotifTypePadIterator.cxx:44 AliMpMotifTypePadIterator.cxx:45 AliMpMotifTypePadIterator.cxx:46 AliMpMotifTypePadIterator.cxx:47 AliMpMotifTypePadIterator.cxx:48 AliMpMotifTypePadIterator.cxx:49 AliMpMotifTypePadIterator.cxx:50 AliMpMotifTypePadIterator.cxx:51 AliMpMotifTypePadIterator.cxx:52 AliMpMotifTypePadIterator.cxx:53 AliMpMotifTypePadIterator.cxx:54 AliMpMotifTypePadIterator.cxx:55 AliMpMotifTypePadIterator.cxx:56 AliMpMotifTypePadIterator.cxx:57 AliMpMotifTypePadIterator.cxx:58 AliMpMotifTypePadIterator.cxx:59 AliMpMotifTypePadIterator.cxx:60 AliMpMotifTypePadIterator.cxx:61 AliMpMotifTypePadIterator.cxx:62 AliMpMotifTypePadIterator.cxx:63 AliMpMotifTypePadIterator.cxx:64 AliMpMotifTypePadIterator.cxx:65 AliMpMotifTypePadIterator.cxx:66 AliMpMotifTypePadIterator.cxx:67 AliMpMotifTypePadIterator.cxx:68 AliMpMotifTypePadIterator.cxx:69 AliMpMotifTypePadIterator.cxx:70 AliMpMotifTypePadIterator.cxx:71 AliMpMotifTypePadIterator.cxx:72 AliMpMotifTypePadIterator.cxx:73 AliMpMotifTypePadIterator.cxx:74 AliMpMotifTypePadIterator.cxx:75 AliMpMotifTypePadIterator.cxx:76 AliMpMotifTypePadIterator.cxx:77 AliMpMotifTypePadIterator.cxx:78 AliMpMotifTypePadIterator.cxx:79 AliMpMotifTypePadIterator.cxx:80 AliMpMotifTypePadIterator.cxx:81 AliMpMotifTypePadIterator.cxx:82 AliMpMotifTypePadIterator.cxx:83 AliMpMotifTypePadIterator.cxx:84 AliMpMotifTypePadIterator.cxx:85 AliMpMotifTypePadIterator.cxx:86 AliMpMotifTypePadIterator.cxx:87 AliMpMotifTypePadIterator.cxx:88 AliMpMotifTypePadIterator.cxx:89 AliMpMotifTypePadIterator.cxx:90 AliMpMotifTypePadIterator.cxx:91 AliMpMotifTypePadIterator.cxx:92 AliMpMotifTypePadIterator.cxx:93 AliMpMotifTypePadIterator.cxx:94 AliMpMotifTypePadIterator.cxx:95 AliMpMotifTypePadIterator.cxx:96 AliMpMotifTypePadIterator.cxx:97 AliMpMotifTypePadIterator.cxx:98 AliMpMotifTypePadIterator.cxx:99 AliMpMotifTypePadIterator.cxx:100 AliMpMotifTypePadIterator.cxx:101 AliMpMotifTypePadIterator.cxx:102 AliMpMotifTypePadIterator.cxx:103 AliMpMotifTypePadIterator.cxx:104 AliMpMotifTypePadIterator.cxx:105 AliMpMotifTypePadIterator.cxx:106 AliMpMotifTypePadIterator.cxx:107 AliMpMotifTypePadIterator.cxx:108 AliMpMotifTypePadIterator.cxx:109 AliMpMotifTypePadIterator.cxx:110 AliMpMotifTypePadIterator.cxx:111 AliMpMotifTypePadIterator.cxx:112 AliMpMotifTypePadIterator.cxx:113 AliMpMotifTypePadIterator.cxx:114 AliMpMotifTypePadIterator.cxx:115 AliMpMotifTypePadIterator.cxx:116 AliMpMotifTypePadIterator.cxx:117 AliMpMotifTypePadIterator.cxx:118 AliMpMotifTypePadIterator.cxx:119 AliMpMotifTypePadIterator.cxx:120 AliMpMotifTypePadIterator.cxx:121 AliMpMotifTypePadIterator.cxx:122 AliMpMotifTypePadIterator.cxx:123 AliMpMotifTypePadIterator.cxx:124 AliMpMotifTypePadIterator.cxx:125 AliMpMotifTypePadIterator.cxx:126 AliMpMotifTypePadIterator.cxx:127 AliMpMotifTypePadIterator.cxx:128 AliMpMotifTypePadIterator.cxx:129 AliMpMotifTypePadIterator.cxx:130 AliMpMotifTypePadIterator.cxx:131 AliMpMotifTypePadIterator.cxx:132 AliMpMotifTypePadIterator.cxx:133 AliMpMotifTypePadIterator.cxx:134 AliMpMotifTypePadIterator.cxx:135 AliMpMotifTypePadIterator.cxx:136 AliMpMotifTypePadIterator.cxx:137 AliMpMotifTypePadIterator.cxx:138 AliMpMotifTypePadIterator.cxx:139 AliMpMotifTypePadIterator.cxx:140 AliMpMotifTypePadIterator.cxx:141 AliMpMotifTypePadIterator.cxx:142 AliMpMotifTypePadIterator.cxx:143 AliMpMotifTypePadIterator.cxx:144 AliMpMotifTypePadIterator.cxx:145 AliMpMotifTypePadIterator.cxx:146 AliMpMotifTypePadIterator.cxx:147 AliMpMotifTypePadIterator.cxx:148 AliMpMotifTypePadIterator.cxx:149 AliMpMotifTypePadIterator.cxx:150 AliMpMotifTypePadIterator.cxx:151 AliMpMotifTypePadIterator.cxx:152 AliMpMotifTypePadIterator.cxx:153 AliMpMotifTypePadIterator.cxx:154 AliMpMotifTypePadIterator.cxx:155 AliMpMotifTypePadIterator.cxx:156 AliMpMotifTypePadIterator.cxx:157 AliMpMotifTypePadIterator.cxx:158 AliMpMotifTypePadIterator.cxx:159 AliMpMotifTypePadIterator.cxx:160 AliMpMotifTypePadIterator.cxx:161 AliMpMotifTypePadIterator.cxx:162 AliMpMotifTypePadIterator.cxx:163 AliMpMotifTypePadIterator.cxx:164 AliMpMotifTypePadIterator.cxx:165 AliMpMotifTypePadIterator.cxx:166 AliMpMotifTypePadIterator.cxx:167 AliMpMotifTypePadIterator.cxx:168 AliMpMotifTypePadIterator.cxx:169 AliMpMotifTypePadIterator.cxx:170 AliMpMotifTypePadIterator.cxx:171 AliMpMotifTypePadIterator.cxx:172 AliMpMotifTypePadIterator.cxx:173 AliMpMotifTypePadIterator.cxx:174 AliMpMotifTypePadIterator.cxx:175 AliMpMotifTypePadIterator.cxx:176 AliMpMotifTypePadIterator.cxx:177 AliMpMotifTypePadIterator.cxx:178 AliMpMotifTypePadIterator.cxx:179 AliMpMotifTypePadIterator.cxx:180 AliMpMotifTypePadIterator.cxx:181 AliMpMotifTypePadIterator.cxx:182 AliMpMotifTypePadIterator.cxx:183 AliMpMotifTypePadIterator.cxx:184 AliMpMotifTypePadIterator.cxx:185 AliMpMotifTypePadIterator.cxx:186 AliMpMotifTypePadIterator.cxx:187 AliMpMotifTypePadIterator.cxx:188 AliMpMotifTypePadIterator.cxx:189 AliMpMotifTypePadIterator.cxx:190 AliMpMotifTypePadIterator.cxx:191 AliMpMotifTypePadIterator.cxx:192 AliMpMotifTypePadIterator.cxx:193 AliMpMotifTypePadIterator.cxx:194 AliMpMotifTypePadIterator.cxx:195 AliMpMotifTypePadIterator.cxx:196 AliMpMotifTypePadIterator.cxx:197 AliMpMotifTypePadIterator.cxx:198 AliMpMotifTypePadIterator.cxx:199 AliMpMotifTypePadIterator.cxx:200 AliMpMotifTypePadIterator.cxx:201 AliMpMotifTypePadIterator.cxx:202 AliMpMotifTypePadIterator.cxx:203 AliMpMotifTypePadIterator.cxx:204 AliMpMotifTypePadIterator.cxx:205 AliMpMotifTypePadIterator.cxx:206 AliMpMotifTypePadIterator.cxx:207 AliMpMotifTypePadIterator.cxx:208 AliMpMotifTypePadIterator.cxx:209 AliMpMotifTypePadIterator.cxx:210 AliMpMotifTypePadIterator.cxx:211 AliMpMotifTypePadIterator.cxx:212 AliMpMotifTypePadIterator.cxx:213 AliMpMotifTypePadIterator.cxx:214 AliMpMotifTypePadIterator.cxx:215 AliMpMotifTypePadIterator.cxx:216 AliMpMotifTypePadIterator.cxx:217 AliMpMotifTypePadIterator.cxx:218 AliMpMotifTypePadIterator.cxx:219 AliMpMotifTypePadIterator.cxx:220 AliMpMotifTypePadIterator.cxx:221 AliMpMotifTypePadIterator.cxx:222