diff --git a/MMVII/Doc/CommandReferences/SysCo.tex b/MMVII/Doc/CommandReferences/SysCo.tex index fd38d22bda..20efb22ad3 100644 --- a/MMVII/Doc/CommandReferences/SysCo.tex +++ b/MMVII/Doc/CommandReferences/SysCo.tex @@ -35,7 +35,7 @@ \subsection{MMVII Commands} \end{itemize} \subsection{SysCo definition} -The SysCo names to give to {\tt MMVII} commands can be: +The SysCo definitions to give to {\tt MMVII} commands can be: \begin{itemize} \item The name of a file in source sub-folder {\tt MMVII/MMVII-RessourceDir/SysCo} or in project sub-folder {MMVII-PhgrProj/SysCo}, without its extension. \item Any {\tt libproj} definition (such as {\tt IGNF:LAMB93} or {\tt EPSG:4326}) @@ -56,9 +56,9 @@ \subsection{Examples} \begin{itemize} \item {\tt SysCo=L93} will set the SysCo to Lambert93 (IGNF:LAMB93), as definied in \\ {\tt MMVII/MMVII-RessourceDir/SysCo/L93.xml}. -\item {\tt SysCo=LocalPanel} will set the SysCo to a local system named "LocalPanel", that will not be convertible into any other SysCo. +\item {\tt SysCo=LocalPanel} will set the SysCo to a local system definied as "LocalPanel", that will not be convertible into any other SysCo. \item {\tt SysCo=IGNF:LAMB93} will set the SysCo to Lambert93. -\item {\tt SysCo=RTL*0.67451979*45.18899334*0*EPSG:4326} will set the SysCo to a local euclidian frame where origin is $0.67451979, 45.18899334, 0$ in EPSG:4326. +\item {\tt SysCo=RTL*0.67451979*45.18899334*0*EPSG:4326} will set the SysCo to a tangent local euclidian frame where origin is $0.67451979, 45.18899334, 0$ in EPSG:4326. \item {\tt SysCo=Toto} will use a project-defined SysCo if {MMVII-PhgrProj/SysCo/Toto.xml} exists. If not, "Toto" will be used as a libproj definition, and an error will occur. \item {\tt SysCo=GeoC} will set the SysCo to geocentric coordinates. diff --git a/MMVII/MMVII-RessourceDir/SysCo/Geog.xml b/MMVII/MMVII-RessourceDir/SysCo/Geog.xml index 04778fc914..dab84b047d 100644 --- a/MMVII/MMVII-RessourceDir/SysCo/Geog.xml +++ b/MMVII/MMVII-RessourceDir/SysCo/Geog.xml @@ -4,7 +4,7 @@ "0.0.0" - "+proj=latlong" + "+proj=latlong" diff --git a/MMVII/MMVII-RessourceDir/SysCo/L93.xml b/MMVII/MMVII-RessourceDir/SysCo/L93.xml index bdb935d01d..e9b87c0859 100644 --- a/MMVII/MMVII-RessourceDir/SysCo/L93.xml +++ b/MMVII/MMVII-RessourceDir/SysCo/L93.xml @@ -4,7 +4,7 @@ "0.0.0" - "IGNF:LAMB93" + "IGNF:LAMB93" diff --git a/MMVII/include/MMVII_DeclareCste.h b/MMVII/include/MMVII_DeclareCste.h index 8a46f8ba81..76a914c9b3 100755 --- a/MMVII/include/MMVII_DeclareCste.h +++ b/MMVII/include/MMVII_DeclareCste.h @@ -100,7 +100,7 @@ extern const std::string MMVII_StdDest; ///< For destination parameter (TieP extern const std::string MMVII_PrefRefBench; ///< Prefix for file used as reference in bench extern const std::string MMVII_SysCoLocal; ///< Prefix for SysCo type -extern const std::string MMVII_SysCoLGeo; ///< Prefix for SysCo type +extern const std::string MMVII_SysCoLGeo; ///< Prefix for SysCo type extern const std::string MMVII_SysCoRTL; ///< Prefix for SysCo type extern const std::string MMVII_SysCoGeoC; ///< Prefix for SysCo type extern const std::string MMVII_SysCoDefLatLong; ///< Definition for latlong diff --git a/MMVII/include/MMVII_SysCo.h b/MMVII/include/MMVII_SysCo.h index 7a521bd40b..0792b7d7a6 100644 --- a/MMVII/include/MMVII_SysCo.h +++ b/MMVII/include/MMVII_SysCo.h @@ -17,7 +17,7 @@ namespace MMVII class cSysCoData { public : - std::string mName; //< name / def + std::string mDef; //< definition void AddData(const cAuxAr2007 & anAuxInit); }; @@ -31,7 +31,8 @@ void AddData(const cAuxAr2007 & anAux, cSysCoData & aSysCoData); * * SysCo definitions are like this: * "type*param1*param2*..." - * It is interpreted by the factory MakeSysCo() to create an object of the corresponding concrete class + * They entirely define a SysCo and are interpreted by the factory MakeSysCo() to create an object of the corresponding concrete class. + * The definitions are retrieved by command line argument or by deserialization of a cSysCoData. */ class cSysCo : public cDataInvertibleMapping { @@ -43,14 +44,14 @@ public : virtual tPt Inverse(const tPt &) const override = 0; //< from GeoC virtual cRotation3D getVertical(const tPt &) const; //< get rotation from SysCo origin to vertical at this point - virtual tREAL8 getRadiusApprox(const tPt &in) const; - virtual tREAL8 getDistHzApprox(const tPt & aPtA, const tPt & aPtB) const; + virtual tREAL8 getRadiusApprox(const tPt &in) const; //< approximate earth total curvature radius at a point + virtual tREAL8 getDistHzApprox(const tPt & aPtA, const tPt & aPtB) const; //< approximate horizontal distance (along ellipsoid) from one point to an other static tPtrSysCo MakeSysCo(const std::string &aDef); //< factory from a sysco definition - static tPtrSysCo makeRTL(const cPt3dr & anOrigin, const std::string & aSysCoNameIn); + static tPtrSysCo makeRTL(const cPt3dr & anOrigin, const std::string & aSysCoInDef); static tPtrSysCo FromFile(const std::string &aNameFile); - std::string Name() const { return mName; } + std::string Def() const { return mDef; } cSysCoData toSysCoData(); eSysCo getType() const { return mType; } @@ -58,7 +59,7 @@ public : protected : cSysCo(); cSysCo(const std::string & def); - std::string mName; //< name / def + std::string mDef; //< definition eSysCo mType; static PJ* PJ_GeoC2Geog; //< for generic use }; @@ -71,7 +72,7 @@ protected : * Value() goes from mSysCoInit to mSysCoTarget * Inverse() goes from mSysCoTarget to mSysCoInit * - * It works with local cSysCo only if both have the same name. + * It works with cSysCoLocal only if both have the same definition. * */ class cChangeSysCo : public cDataInvertibleMapping { diff --git a/MMVII/src/Sensors/cChangCoSensor.cpp b/MMVII/src/Sensors/cChangCoSensor.cpp index c047dd84ff..359007df5f 100755 --- a/MMVII/src/Sensors/cChangCoSensor.cpp +++ b/MMVII/src/Sensors/cChangCoSensor.cpp @@ -214,8 +214,8 @@ cChSysSensImage::cChSysSensImage { mDirSensInit = aDirSens; mNameImage = aSensInit->NameImage(); - mSysCoOri = aChSys.SysOrigin()->Name(); - SetCoordinateSystem(aChSys.SysTarget()->Name()); + mSysCoOri = aChSys.SysOrigin()->Def(); + SetCoordinateSystem(aChSys.SysTarget()->Def()); cChangCoordSensImage::CCSI_SetSensorAndMap(aSensInit,new cChangeSysCo(aChSys),false /* delete sens*/); } diff --git a/MMVII/src/Sensors/cPhotogrammetricProject.cpp b/MMVII/src/Sensors/cPhotogrammetricProject.cpp index a48a569bc8..ac695430cd 100644 --- a/MMVII/src/Sensors/cPhotogrammetricProject.cpp +++ b/MMVII/src/Sensors/cPhotogrammetricProject.cpp @@ -275,11 +275,6 @@ void cPhotogrammetricProject::FinishInit() CreateDirectories(mDirSysCo,false); CreateDirectories(mDirImportInitOri,false); - // cPt3dr aZeroNDP(652215.52,6861681.77,35.6); - // SaveSysCo(CreateSysCoRTL(aZeroNDP,"Lambert93"),"RTL_NotreDame"); - // maintain it, who knows, but now replaced by - // SaveSysCo(cSysCoordV2::Lambert93(),E2Str(eSysCoGeo::eLambert93),true); - // SaveSysCo(cSysCoordV2::GeoC() ,E2Str(eSysCoGeo::eGeoC) ,true); } diff --git a/MMVII/src/SysCo/CreateRTL.cpp b/MMVII/src/SysCo/CreateRTL.cpp index ac205e53e3..251c333546 100644 --- a/MMVII/src/SysCo/CreateRTL.cpp +++ b/MMVII/src/SysCo/CreateRTL.cpp @@ -35,8 +35,8 @@ private : // Mandatory Arg std::string mSpecIm; - std::string mNameSysIn; - std::string mNameSysOut; + std::string mDefSysCoIn; + std::string mDefSysCoOut; // Optional Arg cPt3dr mOrigin; @@ -55,21 +55,21 @@ cCollecSpecArg2007 & cAppli_CreateRTL::ArgObl(cCollecSpecArg2007 & anArgObl) { return anArgObl << Arg2007(mSpecIm ,"Name of Input File",{{eTA2007::MPatFile,"0"},{eTA2007::FileDirProj}}) - << Arg2007(mNameSysOut ,"Output coordinate system") + << Arg2007(mDefSysCoOut ,"Output coordinate system name") ; } cCollecSpecArg2007 & cAppli_CreateRTL::ArgOpt(cCollecSpecArg2007 & anArgObl) { - return anArgObl - << mPhProj.DPOrient().ArgDirInOpt() - // << mPhProj.DPOrient().ArgDirOutOpt() - << mPhProj.DPPointsMeasures().ArgDirInOpt() + return anArgObl + << mPhProj.DPOrient().ArgDirInOpt() + // << mPhProj.DPOrient().ArgDirOutOpt() + << mPhProj.DPPointsMeasures().ArgDirInOpt() << AOpt2007(mOrigin,"Origin","Force origin of RTL Measures",{{}}) << AOpt2007(mZ0,"Z0","Force altitute of RTL Measures",{{}}) << AOpt2007(mEpsDer,"EpsDer","Epislon 4 computing derivative",{{eTA2007::HDV}}) - << AOpt2007(mNameSysIn ,"SysIn" ,"Input coordinate system (default from GCP or Orient)") + << AOpt2007(mDefSysCoIn ,"SysIn" ,"Input coordinate system (default from GCP or Orient)") ; } @@ -82,12 +82,12 @@ int cAppli_CreateRTL::Exe() bool isInitSens =false; bool isInitGCP =false; - std::string aNameSyIn; + std::string aDefSysCoIn; if (mPhProj.DPOrient().DirInIsInit()) { auto aSysIn = mPhProj.CurSysCoOri(true); if (aSysIn.get()) - aNameSyIn = aSysIn->Name(); + aDefSysCoIn = aSysIn->Def(); for (const auto & aNameIm : VectMainSet(0)) { @@ -110,7 +110,7 @@ int cAppli_CreateRTL::Exe() { auto aSysIn = mPhProj.CurSysCoGCP(true); if (aSysIn.get()) - aNameSyIn = aSysIn->Name(); + aDefSysCoIn = aSysIn->Def(); mPhProj.LoadGCP(aMesIm); for (const auto & aGCP : aMesIm.MesGCP()) @@ -119,7 +119,7 @@ int cAppli_CreateRTL::Exe() isInitGCP = true; } } - SetIfNotInit(mNameSysIn,aNameSyIn); + SetIfNotInit(mDefSysCoIn,aDefSysCoIn); if (! IsInit(&mOrigin)) { @@ -137,9 +137,9 @@ int cAppli_CreateRTL::Exe() mOrigin.z() = mZ0; - tPtrSysCo aSysRTL = mPhProj.CreateSysCoRTL(mOrigin,mNameSysIn); + tPtrSysCo aSysRTL = mPhProj.CreateSysCoRTL(mOrigin,mDefSysCoIn); - mPhProj.SaveSysCo(aSysRTL,mNameSysOut); + mPhProj.SaveSysCo(aSysRTL,mDefSysCoOut); return EXIT_SUCCESS; @@ -148,7 +148,7 @@ int cAppli_CreateRTL::Exe() std::vector cAppli_CreateRTL::Samples() const { - return {"MMVII SysCoCreateRTL VolAllIm.xml Lambert93 RTLProj InOri=InitUPCalVol OutOri=RTLInitUPCalVol Z0=0 EpsDer=200"}; + return {"MMVII SysCoCreateRTL AllIM.xml RTL InOri=SatWGS84 z0=0"}; } diff --git a/MMVII/src/SysCo/SysCo.cpp b/MMVII/src/SysCo/SysCo.cpp index af5ae492ad..1857a5a14b 100644 --- a/MMVII/src/SysCo/SysCo.cpp +++ b/MMVII/src/SysCo/SysCo.cpp @@ -9,7 +9,7 @@ namespace MMVII PJ* cSysCo::PJ_GeoC2Geog = nullptr; -const std::string SysCoNameSep = "*"; +const std::string SysCoDefSep = "*"; PJ* createCRS2CRS(const std::string &def_from, const std::string &def_to); //< returns nullptr if error @@ -34,7 +34,7 @@ tPt3dr fromPjCoord(const PJ_COORD &aPtPJ) void cSysCoData::AddData(const cAuxAr2007 & anAuxInit) { cAuxAr2007 anAux("SysCoData",anAuxInit); - MMVII::AddData(cAuxAr2007("Name",anAux),mName); + MMVII::AddData(cAuxAr2007("Def",anAux),mDef); } void AddData(const cAuxAr2007 & anAux, cSysCoData & aSysCoData) @@ -157,14 +157,14 @@ public : //------------------------------------------------------------ cSysCo::cSysCo() : - mName(), mType(eSysCo::eLocalSys) + mDef(), mType(eSysCo::eLocalSys) { if (!PJ_GeoC2Geog) PJ_GeoC2Geog = createCRS2CRS(MMVII_SysCoDefGeoC, MMVII_SysCoDefLatLong); } cSysCo::cSysCo(const std::string &aDef) : - mName(aDef), mType(eSysCo::eLocalSys) + mDef(aDef), mType(eSysCo::eLocalSys) { } @@ -189,7 +189,7 @@ bool cSysCo::isEuclidian() const cSysCoData cSysCo::toSysCoData() { - return {mName}; + return {mDef}; } cRotation3D cSysCo::getVertical(const tPt &) const @@ -250,19 +250,19 @@ tPtrSysCo cSysCo::MakeSysCo(const std::string &aDef) } } -tPtrSysCo cSysCo::makeRTL(const cPt3dr & anOrigin, const std::string & aSysCoNameIn) +tPtrSysCo cSysCo::makeRTL(const cPt3dr & anOrigin, const std::string & aSysCoInDef) { tPtrSysCo aSysCoFrom; - if (ExistFile(aSysCoNameIn)) - aSysCoFrom = cSysCo::FromFile(aSysCoNameIn); + if (ExistFile(aSysCoInDef)) + aSysCoFrom = cSysCo::FromFile(aSysCoInDef); else - aSysCoFrom = cSysCo::MakeSysCo(aSysCoNameIn); + aSysCoFrom = cSysCo::MakeSysCo(aSysCoInDef); std::ostringstream oss; oss.precision(8); oss<Name(); + oss<Def(); return MakeSysCo(oss.str()); } @@ -271,7 +271,7 @@ tPtrSysCo cSysCo::FromFile(const std::string &aNameFile) { cSysCoData aSysCoDataTmp; ReadFromFile(aSysCoDataTmp,aNameFile); - return MakeSysCo(aSysCoDataTmp.mName); + return MakeSysCo(aSysCoDataTmp.mDef); } //------------------------------------------------------------ @@ -313,13 +313,13 @@ cSysCoLGeo::cSysCoLGeo(const std::string &aDef) : { mType = eSysCo::eLGeo; - auto tokens = SplitString(mName, SysCoNameSep); + auto tokens = SplitString(mDef, SysCoDefSep); MMVII_INTERNAL_ASSERT_User(tokens.size()>0, eTyUEr::eInsufNbParam, - "Error in LGeo definition format: \""+mName+"\"") + "Error in LGeo definition format: \""+mDef+"\"") if (tokens[0]==MMVII_SysCoLGeo) { MMVII_INTERNAL_ASSERT_User(tokens.size()==7, eTyUEr::eInsufNbParam, - "Error in LGeo definition format: \""+mName+"\"") + "Error in LGeo definition format: \""+mDef+"\"") mTranfo2GeoC.Tr() = {std::stod(tokens[1]), std::stod(tokens[2]), std::stod(tokens[3])}; tPt aOmegaPhiKappa(std::stod(tokens[4]), std::stod(tokens[5]), std::stod(tokens[6])); mTranfo2GeoC.SetRotation(cRotation3D::RotFromWPK(aOmegaPhiKappa)); @@ -337,7 +337,7 @@ cSysCoLGeo::cSysCoLGeo(const std::string &aDef) : else { MMVII_INTERNAL_ASSERT_User(false, eTyUEr::eUnClassedError, - "Error in LGeo definition format: \""+mName+"\"") + "Error in LGeo definition format: \""+mDef+"\"") } } @@ -370,15 +370,15 @@ cSysCoRTL::cSysCoRTL(const std::string &aDef) : cSysCoLGeo() { mType = eSysCo::eRTL; - mName = aDef; + mDef = aDef; - auto tokens = SplitString(mName, SysCoNameSep); + auto tokens = SplitString(mDef, SysCoDefSep); MMVII_INTERNAL_ASSERT_User(tokens.size()>0, eTyUEr::eInsufNbParam, - "Error in RTL definition format: \""+mName+"\"") + "Error in RTL definition format: \""+mDef+"\"") if (tokens[0]==MMVII_SysCoRTL) { MMVII_INTERNAL_ASSERT_User(tokens.size()==5, eTyUEr::eInsufNbParam, - "Error in RTL definition format: \""+mName+"\"") + "Error in RTL definition format: \""+mDef+"\"") tPt anOrigin(std::stod(tokens[1]), std::stod(tokens[2]), std::stod(tokens[3])); std::string aInDef = tokens[4]; computeRTL(anOrigin, aInDef); @@ -386,7 +386,7 @@ cSysCoRTL::cSysCoRTL(const std::string &aDef) : else { MMVII_INTERNAL_ASSERT_User(false, eTyUEr::eUnClassedError, - "Error in RTL definition format: \""+mName+"\"") + "Error in RTL definition format: \""+mDef+"\"") } } @@ -397,9 +397,9 @@ cSysCoRTL::cSysCoRTL(tPt anOrigin, std::string aInDef) : std::ostringstream oss; oss.precision(8); oss< (cPt3dr::PCste(aEpsDeriv)), - mSysCoOrigin(aSysCoOrigin),mSysCoTarget(aSysCoTarget),mIsNull(mSysCoOrigin->Name()==mSysCoTarget->Name()) + mSysCoOrigin(aSysCoOrigin),mSysCoTarget(aSysCoTarget),mIsNull(mSysCoOrigin->Def()==mSysCoTarget->Def()) { } cChangeSysCo::cChangeSysCo(const cChangeSysCo &other): cDataInvertibleMapping (other.EpsJac()), - mSysCoOrigin(other.mSysCoOrigin),mSysCoTarget(other.mSysCoTarget),mIsNull(mSysCoOrigin->Name()==mSysCoTarget->Name()) + mSysCoOrigin(other.mSysCoOrigin),mSysCoTarget(other.mSysCoTarget),mIsNull(mSysCoOrigin->Def()==mSysCoTarget->Def()) { }