From e849f96c75c95d3f6da6ad7eb6daf0f2a4583ecc Mon Sep 17 00:00:00 2001 From: deseilligny Date: Sun, 12 Jan 2025 18:22:58 +0100 Subject: [PATCH] OK V2 W/o V1 ? --- MMVII/include/V1VII.h | 4 +++- MMVII/src/Exports/MMV2_MesIm_2_MMV1.cpp | 11 +++-------- MMVII/src/ImagesBase/FileImages.cpp | 1 + MMVII/src/MMV1/ExportHomMMV1.cpp | 10 +++------- MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp | 10 +++------- MMVII/src/MMV1/ExportSensorMMV1.cpp | 10 +++------- MMVII/src/MMV1/FluxPtsMMV1.cpp | 10 +++------- MMVII/src/MMV1/ImageFilterMMV1.cpp | 12 ++++-------- MMVII/src/MMV1/Numerics.cpp | 10 ++++------ MMVII/src/MMV1/XmlMMV1.cpp | 18 +++++++----------- MMVII/src/UtiMaths/Polynoms.cpp | 6 ------ 11 files changed, 34 insertions(+), 68 deletions(-) diff --git a/MMVII/include/V1VII.h b/MMVII/include/V1VII.h index ee3cb3e26..2820ad67a 100755 --- a/MMVII/include/V1VII.h +++ b/MMVII/include/V1VII.h @@ -1,7 +1,9 @@ #ifndef _V1V2_H_ #define _V1V2_H_ -#define MMVII_KEEP_LIBRARY_MMV1 true +#ifndef MMVII_KEEP_LIBRARY_MMV1 +#define MMVII_KEEP_LIBRARY_MMV1 false +#endif #if (MMVII_KEEP_LIBRARY_MMV1) diff --git a/MMVII/src/Exports/MMV2_MesIm_2_MMV1.cpp b/MMVII/src/Exports/MMV2_MesIm_2_MMV1.cpp index 5ddcca717..5ab88c824 100644 --- a/MMVII/src/Exports/MMV2_MesIm_2_MMV1.cpp +++ b/MMVII/src/Exports/MMV2_MesIm_2_MMV1.cpp @@ -1,12 +1,7 @@ -#define WITH_MMV1_FUNCTION false - #include "cMMVII_Appli.h" #include "MMVII_PCSens.h" - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif namespace MMVII @@ -61,7 +56,7 @@ int cAppli_MMV2_MesIm_2_MMV1::Exe() //read the image pattern std::vector aVecIm = VectMainSet(0);//interface to MainSet -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) //MicMac v1 cSetOfMesureAppuisFlottants aDico; @@ -122,13 +117,13 @@ int cAppli_MMV2_MesIm_2_MMV1::Exe() //write image measure in MicMac v1 .xml format MakeFileXML(aDico,mNameFile); -#else // (WITH_MMV1_FUNCTION) +#else // (MMVII_KEEP_LIBRARY_MMV1) StdOut() << " \n\n"; StdOut() << " ********************************************************************************************************\n"; StdOut() << " * Use of MMV1 Library is deprecated in this distrib, see with MicMac's administrator how to install it *\n"; StdOut() << " ********************************************************************************************************\n"; MMVII_INTERNAL_ERROR("Deprecated use of MMV1's library"); -#endif // (WITH_MMV1_FUNCTION) +#endif // (MMVII_KEEP_LIBRARY_MMV1) return EXIT_SUCCESS; } diff --git a/MMVII/src/ImagesBase/FileImages.cpp b/MMVII/src/ImagesBase/FileImages.cpp index 0ba33d9eb..7c813048d 100644 --- a/MMVII/src/ImagesBase/FileImages.cpp +++ b/MMVII/src/ImagesBase/FileImages.cpp @@ -4,6 +4,7 @@ #include "MMVII_Ptxd.h" #include "cGdalApi.h" +#define MMVII_KEEP_LIBRARY_MMV1 true #ifdef MMVII_KEEP_MMV1_IMAGE # include "V1VII.h" #endif diff --git a/MMVII/src/MMV1/ExportHomMMV1.cpp b/MMVII/src/MMV1/ExportHomMMV1.cpp index 81dcb8a96..b306101f5 100755 --- a/MMVII/src/MMV1/ExportHomMMV1.cpp +++ b/MMVII/src/MMV1/ExportHomMMV1.cpp @@ -1,8 +1,4 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif #include "MMVII_util.h" #include "MMVII_MeasuresIm.h" @@ -10,7 +6,7 @@ namespace MMVII { -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) cHomogCpleIm ToMMVII(const cNupletPtsHomologues & aNUp) { @@ -86,7 +82,7 @@ cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const { return new cImportHomV1(aDir,aSubDir,aExt); } -#else +#else // MMVII_KEEP_LIBRARY_MMV1 cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const std::string&aSubDir,const std::string&aExt) { @@ -97,7 +93,7 @@ cInterfImportHom::~cInterfImportHom() { } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 diff --git a/MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp b/MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp index 349140c56..b8bf1c083 100755 --- a/MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp +++ b/MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp @@ -1,8 +1,4 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif #include "MMVII_util.h" #include "MMVII_MeasuresIm.h" @@ -15,7 +11,7 @@ namespace MMVII /* */ /* ************************************************* */ -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) void ImportMesImV1(std::list & aResult,const std::string & aNameFileMesImV1) { @@ -50,7 +46,7 @@ cSetMesGCP ImportMesGCPV1(const std::string & aNameFileMesGCPV1,const std::strin return aResult; } -#else +#else // MMVII_KEEP_LIBRARY_MMV1 void ImportMesImV1(std::list & aResult,const std::string & aNameFileMesImV1) { MMVII_INTERNAL_ERROR("No ImportMesImV1 "); @@ -60,7 +56,7 @@ cSetMesGCP ImportMesGCPV1(const std::string & aNameFileMesGCPV1,const std::strin MMVII_INTERNAL_ERROR("No ImportMesGCPV1"); return cSetMesGCP (aNameSet); } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 diff --git a/MMVII/src/MMV1/ExportSensorMMV1.cpp b/MMVII/src/MMV1/ExportSensorMMV1.cpp index f751bb73c..b7e04bdda 100755 --- a/MMVII/src/MMV1/ExportSensorMMV1.cpp +++ b/MMVII/src/MMV1/ExportSensorMMV1.cpp @@ -1,15 +1,11 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif #include "MMVII_MMV1Compat.h" namespace MMVII { -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) /* ************************************************* */ /* */ /* cExportV1StenopeCalInterne */ @@ -160,7 +156,7 @@ cExportV1StenopeCalInterne::cExportV1StenopeCalInterne if ((aNbLayer>0) && (aNbPointPerDim>0)) DoCorresp(mCorresp,aCamV1,aNbPointPerDim,aNbLayer,aDS); } -#else +#else // MMVII_KEEP_LIBRARY_MMV1 cExportV1StenopeCalInterne::cExportV1StenopeCalInterne ( bool isForCalib, @@ -174,6 +170,6 @@ cExportV1StenopeCalInterne::cExportV1StenopeCalInterne { MMVII_INTERNAL_ERROR("Reading of MMV1 Camera is deprecated"); } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 }; diff --git a/MMVII/src/MMV1/FluxPtsMMV1.cpp b/MMVII/src/MMV1/FluxPtsMMV1.cpp index 26807ba92..503de82f1 100755 --- a/MMVII/src/MMV1/FluxPtsMMV1.cpp +++ b/MMVII/src/MMV1/FluxPtsMMV1.cpp @@ -1,8 +1,4 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif #include "MMVII_Geom2D.h" @@ -650,7 +646,7 @@ void BenchCurveDigit(cParamExeBench & aParam) /*************************************************/ -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) Neighbourhood DiscNeich(const tREAL8 & aRay) { std::vector aVPts; @@ -726,7 +722,7 @@ void GetPts_Line(tResFlux & aRes,const cPt2dr & aP1,const cPt2dr &aP2) { GetPts_Line(aRes,aP1,aP2,-1.0); } -#else // (WITH_MMV1_FUNCTION) +#else // (MMVII_KEEP_LIBRARY_MMV1) void GetPts_Line(tResFlux & aResLine,const cPt2dr & aP1,const cPt2dr &aP2) { cLine_CurveBySet aLCS(ToI(aP1),ToI(aP2)); @@ -754,7 +750,7 @@ tResFlux GetPts_Circle(const cPt2dr & aC,double aRay,bool with8Neigh) return aCCS.Compute(); } -#endif // (WITH_MMV1_FUNCTION) +#endif // (MMVII_KEEP_LIBRARY_MMV1) diff --git a/MMVII/src/MMV1/ImageFilterMMV1.cpp b/MMVII/src/MMV1/ImageFilterMMV1.cpp index 5ba74495f..a3ec7c2a2 100755 --- a/MMVII/src/MMV1/ImageFilterMMV1.cpp +++ b/MMVII/src/MMV1/ImageFilterMMV1.cpp @@ -1,8 +1,4 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif #include "MMVII_Matrix.h" #include "MMVII_Linear2DFiltering.h" @@ -61,7 +57,7 @@ void Bench_LabMaj() } -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) /* ************************************************* */ /* */ @@ -111,7 +107,7 @@ void ExportHomMMV1(const std::string & aIm1,const std::string & aIm2,const std:: /* ************************************************* */ // implemantation of methods that used to do be done unsing MMV1 - // Activated with WITH_MMV1_FUNCTION , to check correctness + // Activated with MMVII_KEEP_LIBRARY_MMV1 , to check correctness //================= Curvature of tangent line -> Courb Tgt ================== @@ -306,12 +302,12 @@ void BenchImFilterV1V2() Tpl_BenchDericheV1V2(cPt2di(240,220),2.0); } -#else +#else // MMVII_KEEP_LIBRARY_MMV1 void BenchImFilterV1V2() { Bench_LabMaj(); } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 //============================== diff --git a/MMVII/src/MMV1/Numerics.cpp b/MMVII/src/MMV1/Numerics.cpp index 642c1d4e7..73c618d60 100755 --- a/MMVII/src/MMV1/Numerics.cpp +++ b/MMVII/src/MMV1/Numerics.cpp @@ -1,7 +1,5 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" +#if (MMVII_KEEP_LIBRARY_MMV1) #include "ext_stl/numeric.h" #endif @@ -188,7 +186,7 @@ void BenchKTHVal(cParamExeBench & aParam) /* ***************************************** */ -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) template std::vector V1RealRoots(const std::vector & aVCoef, Type aTol,int aNbMaxIter) { @@ -201,14 +199,14 @@ template return aVRoots; } -#else +#else // MMVII_KEEP_LIBRARY_MMV1 template std::vector V1RealRoots(const std::vector & aVCoef, Type aTol,int aNbMaxIter) { MMVII_INTERNAL_ERROR("No V1RealRoots"); return std::vector(); } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 #define INST_V1ROOTS(TYPE)\ template std::vector V1RealRoots(const std::vector & aVCoef, TYPE aTol,int aNbMaxIter); diff --git a/MMVII/src/MMV1/XmlMMV1.cpp b/MMVII/src/MMV1/XmlMMV1.cpp index 74e2ce7fb..934afb456 100755 --- a/MMVII/src/MMV1/XmlMMV1.cpp +++ b/MMVII/src/MMV1/XmlMMV1.cpp @@ -1,14 +1,10 @@ -#define WITH_MMV1_FUNCTION false - -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif #include "MMVII_Mappings.h" #include "MMVII_AimeTieP.h" -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) #include "../src/uti_image/NewRechPH/cParamNewRechPH.h" #include "im_tpl/cPtOfCorrel.h" #include "algo_geom/qdt.h" @@ -27,7 +23,7 @@ namespace MMVII /* */ /* *********************************** */ -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) /* This class is an interface to use in MMV2, the 3d masq produce by SaisieMasqQT of MMV1, using the MMV1 library @@ -63,18 +59,18 @@ cDataBoundedSet * MMV1_Masq(const cBox3dr &aBox,const std::string & a { return new cMasq_MMV1asBoundeSet(aBox,aNameFile); } -#else +#else // MMVII_KEEP_LIBRARY_MMV1 cDataBoundedSet * MMV1_Masq(const cBox3dr &aBox,const std::string & aNameFile) { MMVII_INTERNAL_ERROR("Handling MMV1 3d-Masq is deprecated"); return nullptr; } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 //============= tNameRel ==================== -#if (WITH_MMV1_FUNCTION) +#if (MMVII_KEEP_LIBRARY_MMV1) void TestTimeV1V2() { @@ -614,7 +610,7 @@ template void cImplem_ExportAimeTiep::FiltrageSpatialPts() template class cImplem_ExportAimeTiep; template class cImplem_ExportAimeTiep; -#else +#else // MMVII_KEEP_LIBRARY_MMV1 template cInterf_ExportAimeTiep::~cInterf_ExportAimeTiep() { } @@ -645,7 +641,7 @@ tNameRel MMV1InitRel(const std::string & aName) MMVII_INTERNAL_ERROR("Handling reaing of MMV1 Rels is deprecated"); return tNameRel(); } -#endif +#endif // MMVII_KEEP_LIBRARY_MMV1 // ============ INSTANTIATION ====================== diff --git a/MMVII/src/UtiMaths/Polynoms.cpp b/MMVII/src/UtiMaths/Polynoms.cpp index 4a0ff9dad..dfa409e87 100755 --- a/MMVII/src/UtiMaths/Polynoms.cpp +++ b/MMVII/src/UtiMaths/Polynoms.cpp @@ -1,15 +1,10 @@ -#define WITH_MMV1_FUNCTION false - #include "MMVII_Matrix.h" #include "MMVII_Ptxd.h" #include "MMVII_Stringifier.h" #include "MMVII_Geom2D.h" -#if (WITH_MMV1_FUNCTION) #include "V1VII.h" -#endif - namespace MMVII { @@ -61,7 +56,6 @@ template cEigenPolynRoots::cEigenPolynRoots(const cPolynom