Skip to content

Commit 3ed0312

Browse files
author
deseilligny
committed
Chg Ordi
1 parent 021a4c1 commit 3ed0312

File tree

7 files changed

+50
-19
lines changed

7 files changed

+50
-19
lines changed

MMVII/include/MMVII_Geom2D.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ struct cSaveExtrEllipe
845845
{
846846
public :
847847
cSaveExtrEllipe (const cCircTargExtr &,const std::string & aNameCode);
848+
cSaveExtrEllipe (const cEllipse &,int aBlack,int aWhite,const std::string & aNameCode);
849+
848850
cSaveExtrEllipe ();
849851
static std::string NameFile(const cPhotogrammetricProject & ,const cSetMesPtOf1Im &,bool Input);
850852

MMVII/include/MMVII_nums.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,9 @@ class cCelCC : public cMemCheck
950950
size_t mLowCode; ///< lower representant
951951
bool mTmp; ///< some marker to use when convenient
952952
int mNum; ///< Num used so that names is alway the same whatever maybe the selection
953+
bool mSelfSym; ///< is the code self sym with permutation of system
953954

954-
size_t HammingDist(const cCelCC &) const;
955+
size_t HammingDist(const cCelCC &) const;
955956

956957
cCelCC(size_t aLowestCode);
957958
public :

MMVII/src/CodedTarget/cCheckBoardTargetExtract.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ void cAppliCheckBoardTargetExtract::AddCdtE(const cCdEllipse & aCDE)
556556

557557
void cAppliCheckBoardTargetExtract::DoExport()
558558
{
559+
std::vector<cSaveExtrEllipe> aVSavE;
559560
cSetMesPtOf1Im aSetM(FileOfPath(mNameIm));
560561
for (const auto & aCdtM : mVCdtMerged)
561562
{
@@ -565,11 +566,18 @@ void cAppliCheckBoardTargetExtract::DoExport()
565566
cMesIm1Pt aMesIm(aCdtM.mC0,aCode,1.0);
566567
aSetM.AddMeasure(aMesIm);
567568
Tpl_AddOneObjReportCSV(*this,mIdExportCSV,aMesIm);
569+
570+
571+
cSaveExtrEllipe aSEE(aCdtM.Ell(),aCdtM.mBlack,aCdtM.mWhite,aCode);
572+
aVSavE.push_back(aSEE);
573+
// cSaveExtrEllipe anESave(*anEE,aCode);
568574
}
569575
}
570576

571577
aSetM.SortMes();
572578
mPhProj.SaveMeasureIm(aSetM);
579+
580+
SaveInFile(aVSavE,cSaveExtrEllipe::NameFile(mPhProj,aSetM,false));
573581
}
574582

575583
void cAppliCheckBoardTargetExtract::DoOneImage()

MMVII/src/CodedTarget/cCircTargetExtract.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,20 @@ void cCircTargExtr::RefinePosBySym(tREAL8 aStepLim,const tDIm & aDIm ,const cDif
168168
/* */
169169
/* ********************************************* */
170170

171+
172+
cSaveExtrEllipe::cSaveExtrEllipe(const cEllipse & anEllipse,int aBlack,int aWhite,const std::string & aNameCode) :
173+
mEllipse (anEllipse),
174+
mNameCode (aNameCode),
175+
mBlack (aBlack),
176+
mWhite (aWhite)
177+
{
178+
}
179+
180+
171181
cSaveExtrEllipe::cSaveExtrEllipe(const cCircTargExtr & aCTE,const std::string & aCode) :
172-
mEllipse (aCTE.mEllipse),
173-
mNameCode (aCode),
174-
mBlack (aCTE.mVBlack),
175-
mWhite (aCTE.mVWhite)
182+
cSaveExtrEllipe(aCTE.mEllipse,aCTE.mVBlack,aCTE.mVWhite,aCode)
176183
{
184+
177185
}
178186

179187

MMVII/src/CodedTarget/cGenerateEncoding.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ int cAppliGenerateEncoding::Exe()
407407

408408
// [1] ============= read initial value of cells
409409
mCEC = cCompEquiCodes::Alloc(mSpec.mNbBits,mPerCircPerm,mMiror);
410+
/*
411+
if (1)
412+
{
413+
for (const auto & aCEC : *mCEC)
414+
if (aCEC-)
415+
}
416+
*/
410417
mVOC = mCEC->VecOfCells();
411418
StdOut() << "Size Cells init " << mVOC.size() << std::endl;
412419

MMVII/src/Geom2D/cEllipse2D.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ void cEllipse::AddData(const cAuxAr2007 & anAux)
129129
// MMVII::AddData(cAuxAr2007("C0",anAux),mC0);
130130
{
131131
cAuxAr2007 anAuxGeom("GeomForComment",anAux);
132-
MMVII::AddData(cAuxAr2007("LengthGreadAxe",anAuxGeom),mLGa);
132+
MMVII::AddData(cAuxAr2007("LengthGreatAxe",anAuxGeom),mLGa);
133133
MMVII::AddData(cAuxAr2007("LengthSmallAxe",anAuxGeom),mLSa);
134-
MMVII::AddData(cAuxAr2007("DirGreadAxe",anAuxGeom),mVGa);
134+
MMVII::AddData(cAuxAr2007("DirGreatAxe",anAuxGeom),mVGa);
135135
anAuxGeom.Ar().AddComment("GA=" + ToStr(mLGa) + " SA=" + ToStr(mLSa));
136136
}
137137
if (anAux.Input())

MMVII/src/UtiMaths/bitcoding.cpp

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ size_t MaxRun2Length(tU_INT4 aVal,size_t aPow2)
245245

246246
cCelCC::cCelCC(size_t aLowestCode) :
247247
mLowCode (aLowestCode),
248-
mNum (-1)
248+
mNum (-1),
249+
mSelfSym (false)
249250
{
250251
}
251252

@@ -281,22 +282,22 @@ cCompEquiCodes::cCompEquiCodes(size_t aNbBits,size_t aPer,bool WithMirror) :
281282
MMVII_INTERNAL_ASSERT_strong((aNbBits%aPer)==0,"NbBit not multiple of period in cCompEquiCodes");
282283
for (size_t aCode=0 ; aCode < mNbCodeUC ; aCode++)
283284
{
284-
if (mVCodes2Cell[aCode] == nullptr)
285-
{
285+
if (mVCodes2Cell[aCode] == nullptr)
286+
{
286287
cCelCC * aNewCel = new cCelCC(aCode);
287288
aNewCel->mNum = mVecOfCells.size();
288-
mVecOfCells.push_back(aNewCel);
289+
mVecOfCells.push_back(aNewCel);
289290

290-
AddCodeWithPermCirc(aCode,aNewCel);
291-
if (WithMirror)
292-
AddCodeWithPermCirc(BitMirror(aCode,mNbCodeUC),aNewCel);
291+
AddCodeWithPermCirc(aCode,aNewCel);
292+
if (WithMirror)
293+
AddCodeWithPermCirc(BitMirror(aCode,mNbCodeUC),aNewCel);
293294

294-
AddAndResizeUp(mHistoNbBit,NbBits(aCode),1);
295-
}
296-
else
297-
{
295+
AddAndResizeUp(mHistoNbBit,NbBits(aCode),1);
296+
}
297+
else
298+
{
298299
// Nothing to do, code has been processed by equivalent lower codes
299-
}
300+
}
300301
}
301302

302303
//for (const auto & AC : mVecOfCells)
@@ -345,6 +346,8 @@ cCelCC * cCompEquiCodes::CellOfCode(size_t aCode)
345346

346347
void cCompEquiCodes::AddCodeWithPermCirc(size_t aCode,cCelCC * aNewCel)
347348
{
349+
size_t aCodeInit = aCode; // used to compute selfSimFound
350+
348351
for (size_t aBit=0 ; aBit<mNbBits ; aBit+=mPeriod)
349352
{
350353
// Test because code may have already been processed i
@@ -354,6 +357,8 @@ void cCompEquiCodes::AddCodeWithPermCirc(size_t aCode,cCelCC * aNewCel)
354357
mVCodes2Cell[aCode] = aNewCel;
355358
aNewCel->mEquivCode.push_back(aCode);
356359
}
360+
if ((aBit!=0) && (aCode==aCodeInit))
361+
aNewCel->mSelfSym = true;
357362
aCode = N_LeftBitsCircPerm(aCode,mNbCodeUC,mPeriod);
358363
}
359364
}

0 commit comments

Comments
 (0)