diff --git a/MMVII/include/MMVII_AllClassDeclare.h b/MMVII/include/MMVII_AllClassDeclare.h index 2604bd935d..46cf165590 100755 --- a/MMVII/include/MMVII_AllClassDeclare.h +++ b/MMVII/include/MMVII_AllClassDeclare.h @@ -309,6 +309,11 @@ class cBlocMatrixSensor; class cDataBlocCam; class cBlocOfCamera; +// Clino +class cOneCalibRelClino; +class cOneCalibClino; +class cCalibSetClino; + // sys co class cSysCoordV2; diff --git a/MMVII/include/MMVII_Clino.h b/MMVII/include/MMVII_Clino.h index 994d8016b5..6e0028ed42 100755 --- a/MMVII/include/MMVII_Clino.h +++ b/MMVII/include/MMVII_Clino.h @@ -3,6 +3,7 @@ #include "MMVII_Geom3D.h" #include "MMVII_PCSens.h" +#include "MMVII_memory.h" namespace MMVII @@ -33,6 +34,7 @@ class cOneCalibRelClino tRotR mRot; ///< Value of relative rotation private : }; +void AddData(const cAuxAr2007 & anAux,cOneCalibRelClino & aSet); /** Calibrarion of 1 Clino : Orient to camera + optional relative calib */ class cOneCalibClino @@ -43,9 +45,10 @@ class cOneCalibClino tRotR mRot; ///< Value of rotation std::optional mLinkRel; ///< Possible relative calib }; +void AddData(const cAuxAr2007 & anAux,cOneCalibClino & aSet); /** Global calibration : name of the camera + vector of all individual calibs */ -class cCalibSetClino +class cCalibSetClino : public cMemCheck { public : @@ -56,6 +59,8 @@ class cCalibSetClino /// Set of all clinometers calibration std::vector mClinosCal ; }; +void AddData(const cAuxAr2007 & anAux,cCalibSetClino & aSet); + diff --git a/MMVII/include/MMVII_Sensor.h b/MMVII/include/MMVII_Sensor.h index 34c5902512..b4f9483306 100755 --- a/MMVII/include/MMVII_Sensor.h +++ b/MMVII/include/MMVII_Sensor.h @@ -652,6 +652,20 @@ class cPhotogrammetricProject const cSysCoordV2 & SysCo() const ; bool SysCoIsInit() const; void AssertSysCoIsInit() const; + + //=================================================================== + //================== Clinometers ======================== + //=================================================================== + + /// Standard name for clino file using DPClinoMeters, in or out + std::string NameFileClino(const std::string &aNameCam ,bool Input) const; + /// Save clinometer calib in santdard out folder of DPClinoMeters + void SaveClino(const cCalibSetClino &) const; + /// Is there clinometer in santdard input folder of DPClinoMeters ? + bool HasClinoCalib(const cPerspCamIntrCalib &) const; + /** Read the clinometers calib in standard input folder of DPClinoMeters, create a dyn objec because + * probably "cCalibSetClino" will evolve in a not copiable object*/ + cCalibSetClino * GetClino(const cPerspCamIntrCalib &) const; //=================================================================== //================== Rigid Bloc ========================= diff --git a/MMVII/src/Instrumental/cClinoInit.cpp b/MMVII/src/Instrumental/cClinoInit.cpp index db130a3b03..3ec0b649b4 100644 --- a/MMVII/src/Instrumental/cClinoInit.cpp +++ b/MMVII/src/Instrumental/cClinoInit.cpp @@ -278,6 +278,7 @@ cCollecSpecArg2007 & cAppli_ClinoInit::ArgOpt(cCollecSpecArg2007 & anArgOpt) << AOpt2007(mNbIter,"NbIter","Number of iteration",{eTA2007::HDV}) << AOpt2007(mASim,"AmplSim","Amplitude of rotation is simul [W,P,K,BS]",{{eTA2007::ISizeV,"[5,5]"}}) << AOpt2007(mNameRel12,"Rel12","orientation relative 2 to 1, if several clino",{eTA2007::HDV}) + << mPhProj.DPClinoMeters().ArgDirInOpt() // Just for temporart test we can re-read, to supress later ; } @@ -419,6 +420,7 @@ int cAppli_ClinoInit::Exe() StdOut() << "ExeExe " << aVNamesClino << "\n"; std::string aNameCalibCam; + cPerspCamIntrCalib * aCalib = nullptr; // put low level in a more structured data for (size_t aKLine=0 ; aKLineInternalCalib()->Name(); + aCalib = aCam->InternalCalib(); + aNameCalibCam = aCalib->Name(); // We cannnot have multiple camera for now if ((mCalibSetClino.mNameCam !="") && (mCalibSetClino.mNameCam != aNameCalibCam)) @@ -520,10 +523,20 @@ int cAppli_ClinoInit::Exe() } // Save the result in standard file - std::string aNameOut = mPhProj.DPClinoMeters().FullDirOut() + "ClinoCalib-" + aNameCalibCam + "."+ GlobTaggedNameDefSerial(); - SaveInFile(mCalibSetClino,aNameOut); + mPhProj.SaveClino(mCalibSetClino); + + if (mPhProj.DPClinoMeters().DirInIsInit()) + { + cCalibSetClino* aClinoTest = mPhProj.GetClino(*aCalib); + SaveInFile(*aClinoTest,"TestReWriteClino.xml"); + delete aClinoTest; + } + /* + std::string aNameOut = mPhProj.DPClinoMeters().FullDirOut() + "ClinoCalib-" + aNameCalibCam + "."+ GlobTaggedNameDefSerial(); + SaveInFile(mCalibSetClino,aNameOut); + */ return EXIT_SUCCESS; } diff --git a/MMVII/src/Sensors/cPhotogrammetricProject.cpp b/MMVII/src/Sensors/cPhotogrammetricProject.cpp index 6b4c5fb090..d115d89e4a 100644 --- a/MMVII/src/Sensors/cPhotogrammetricProject.cpp +++ b/MMVII/src/Sensors/cPhotogrammetricProject.cpp @@ -6,6 +6,7 @@ #include "MMVII_2Include_Serial_Tpl.h" #include "MMVII_BlocRig.h" #include "MMVII_DeclareCste.h" +#include "MMVII_Clino.h" #include "cExternalSensor.h" @@ -965,6 +966,36 @@ void cPhotogrammetricProject::ReadHomol std::string aName = NameTiePIn(aNameIm1,aNameIm2,aDirIn); ReadFromFile(aSetHCI.SetH(),aName); } + // ============= Clino meters ================= + +std::string cPhotogrammetricProject::NameFileClino(const std::string &aNameCam,bool Input) const +{ + static const std::string TheClinoPrefix = "ClinoCalib-"; + return mDPClinoMeters.FullDirInOut(Input) + TheClinoPrefix + aNameCam + "."+ GlobTaggedNameDefSerial(); +} + +void cPhotogrammetricProject::SaveClino(const cCalibSetClino & aCalib) const +{ + SaveInFile(aCalib,NameFileClino(aCalib.mNameCam,false)); +} + +bool cPhotogrammetricProject::HasClinoCalib(const cPerspCamIntrCalib & aCalib) const +{ + return ExistFile(NameFileClino(aCalib.Name(),true)); +} + + +cCalibSetClino * cPhotogrammetricProject::GetClino(const cPerspCamIntrCalib & aCalib) const +{ + return ObjectFromFile(NameFileClino(aCalib.Name(),true)); +} + +/* +cCalibSetClino * GetClino(const cPerspCamIntrCalib &); +*/ + + + // ============= Rigid bloc ================= // RIGIDBLOC