Skip to content

Commit

Permalink
MMVII: std::regex_replace uses $& (not $0) for the matched substring
Browse files Browse the repository at this point in the history
  • Loading branch information
meynardc committed Apr 16, 2024
1 parent 87fa75d commit b4196b9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions MMVII/MMVII-UseCaseDataSet/Aerien-Sat/Cmd2-Aerien.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
#
# To filter the set of tie points :
#
# MMVII ImportTiePMul all_liaisons.mes NIXY Vexcell NumL0=1 'PatIm=[.*,$0.tif]' NumByConseq=1 ImFilter=ImAerien.xml
# MMVII ImportTiePMul all_liaisons.mes NIXY Vexcell NumL0=1 'PatIm=[.*,$&.tif]' NumByConseq=1 ImFilter=ImAerien.xml
#
#

Expand All @@ -27,17 +27,17 @@ MMVII EditCalcMTDI Std Focalmm ImTest=21FD244720x00015_00614.tif Modif=[21FD24

# Import Calibration & Orientations
MMVII OriCreateCalib ImAerien.xml CalibInit Degree=[3,1,1]
MMVII ImportOri ExternalData/trajectograhie.opk NXYZWPK CalibInit InitL93Up NumL0=5 ChgN=[".*","\$0.tif"] "AngU=degree" "KIsUp=true" FilterImIn=ImAerien.xml SysCo=Lambert93
MMVII ImportOri ExternalData/trajectograhie.opk NXYZWPK CalibInit InitL93Up NumL0=5 ChgN=[".*","\$&.tif"] "AngU=degree" "KIsUp=true" FilterImIn=ImAerien.xml SysCo=Lambert93

# Import Tie Poins
MMVII ImportTiePMul ExternalData/Filtered_all_liaisons.mes NIXY Vexcell NumL0=0 'PatIm=[.*,$0.tif]' NumByConseq=1
MMVII ImportTiePMul ExternalData/Filtered_all_liaisons.mes NIXY Vexcell NumL0=0 'PatIm=[.*,$&.tif]' NumByConseq=1
# Quick test on bundle adj to see if orient are likely to be correctly imported
MMVII OriBundleAdj ImAerien.xml InitL93Up Test TPDir=Vexcell TiePWeight=[1,1] PatFzCenters=.*


# Import GCP
MMVII ImportGCP ExternalData/Filtered_Terrain.APP 'NIXYZ' AerRTL ChSys=[Lambert93,RTL]
MMVII ImportMesImGCP ExternalData/Filtered_Terrain.MES NIXY AerRTL 'PatIm=[.*,$0.tif]'
MMVII ImportMesImGCP ExternalData/Filtered_Terrain.MES NIXY AerRTL 'PatIm=[.*,$&.tif]'
MMVII OriChSysCo ImAerien.xml RTL InitL93Up RTLD0


Expand Down
2 changes: 1 addition & 1 deletion MMVII/src/Appli/cMMVII_CalcSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ cCollecSpecArg2007 & cAppli_EditSet::ArgOpt(cCollecSpecArg2007 & anArgOpt)
anArgOpt
<< AOpt2007(mShow,"Show","Show detail of set before/after, 0->none, (1) modif, (2) all",{{eTA2007::HDV}})
<< AOpt2007(mNameXmlOut,"Out","Destination, def=Input, no save for " + MMVII_NONE,{})
<< AOpt2007(mChgName,"ChgN","Change name [Pat,Name], for ex \"[(.*),IMU_\\$0]\" add prefix \"IMU_\" ",{{eTA2007::ISizeV,"[2,2]"}})
<< AOpt2007(mChgName,"ChgN","Change name [Pat,Name], for ex \"[(.*),IMU_\\$&]\" add prefix \"IMU_\" ",{{eTA2007::ISizeV,"[2,2]"}})
<< mPhProj.DPMulTieP().ArgDirInOpt("TiePF","TieP for filtering on number")
<< AOpt2007(mNbMinTieP,"NbMinTieP","Number min of tie points, if TiePF",{{eTA2007::HDV}})
<< AOpt2007(mPatFilter,"PatF","Pattern to filter on name")
Expand Down
2 changes: 1 addition & 1 deletion MMVII/src/Appli/cMMVII_Rename.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void cAppli_Rename::TestSet(const std::string & aNameOut)

std::vector<std::string> cAppli_Rename::Samples() const
{
return {"MMVII UtiRename \"948_(.*).JPG\" \"\\$0\" AR=[-,1,1] DoReplace=true"};
return {"MMVII UtiRename \"948_(.*).JPG\" \"\\$&\" AR=[-,1,1] DoReplace=true"};
}

int cAppli_Rename::Exe()
Expand Down
6 changes: 3 additions & 3 deletions MMVII/src/ConvertFormat/ImportOri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ cCollecSpecArg2007 & cAppli_ImportOri::ArgOpt(cCollecSpecArg2007 & anArgObl)
<< AOpt2007(mAngleUnit,"AngU","Unity for angles",{{eTA2007::HDV},{AC_ListVal<eTyUnitAngle>()}})
<< AOpt2007(mRepIJK,"Rep","Repair coded (relative to MMVII convention) ",{{eTA2007::HDV}})
<< AOpt2007(mRepIJDir,"KIsUp","Corespond to repair \"i-j-k\" ",{{eTA2007::HDV}})
<< AOpt2007(mChgName,"ChgN","Change name [Pat,Name], for ex \"[(.*),\\$0.tif]\" add postfix \"tif\" ",{{eTA2007::ISizeV,"[2,2]"}})
<< AOpt2007(mChgName2,"ChgN2","Change name [Pat,Name], for ex \"[(.*),\\$0.IMU]\" add postfix \"IMU\" ",{{eTA2007::ISizeV,"[2,2]"}})
<< AOpt2007(mChgName,"ChgN","Change name [Pat,Name], for ex \"[(.*),\\$&.tif]\" add postfix \"tif\" ",{{eTA2007::ISizeV,"[2,2]"}})
<< AOpt2007(mChgName2,"ChgN2","Change name [Pat,Name], for ex \"[(.*),\\$&.IMU]\" add postfix \"IMU\" ",{{eTA2007::ISizeV,"[2,2]"}})
<< AOpt2007(mNameDicoName,"DicName","Dictionnary for changing names of images ")
<< AOpt2007(mFileSaveIm,"FileSaveIm","File for saving all names of images ")
<< mPhProj.DPMulTieP().ArgDirInOpt("TiePF","TieP for filtering on number")
Expand All @@ -105,7 +105,7 @@ std::vector<std::string> cAppli_ImportOri::Samples() const
{
return
{
"MMVII ImportOri trajectographie_tif.opk NSSXYZWPKS Calib InitUP AngU=degree KIsUp=true ChgN=[\".*\",\"Traj_\\$0\"]",
"MMVII ImportOri trajectographie_tif.opk NSSXYZWPKS Calib InitUP AngU=degree KIsUp=true ChgN=[\".*\",\"Traj_\\$&\"]",
"MMVII ImportOri trajectographie_tif.opk NSSXYZWPKS Calib001 InitUP AngU=degree KIsUp=true DicName=DicoVol.xml"
};
}
Expand Down
2 changes: 1 addition & 1 deletion MMVII/src/ConvertFormat/ImportTiepMul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ std::vector<std::string> cAppli_ImportTiePMul::Samples() const
if (mModeTieP)
return
{
"MMVII ImportTiePMul External-Data/Liaisons.MES NIXY Vexcell NumL0=1 PatIm=[\".*\",\"\\$0.tif\"] PatPt=[\"(MES_)(.*)\",\"\\$2\"]"
"MMVII ImportTiePMul External-Data/Liaisons.MES NIXY Vexcell NumL0=1 PatIm=[\".*\",\"\\$&.tif\"] PatPt=[\"(MES_)(.*)\",\"\\$2\"]"
};

return {};
Expand Down
2 changes: 1 addition & 1 deletion MMVII/src/Utils/uti_set_sel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ cPatternTransfo::cPatternTransfo(const std::vector<std::string> & aVec) :
cPatternTransfo
(
GetDef(aVec,0,std::string(".*")),
GetDef(aVec,1,std::string("$0"))
GetDef(aVec,1,std::string("$&"))
)
{
// JOE
Expand Down

0 comments on commit b4196b9

Please sign in to comment.