Skip to content

Commit

Permalink
Merge branch 'mpd'
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Jan 15, 2025
2 parents b36db7c + 5834056 commit 39280e6
Show file tree
Hide file tree
Showing 12 changed files with 269 additions and 8 deletions.
5 changes: 3 additions & 2 deletions MMVII/include/MMVII_DeclareAllCmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ extern cSpecMMVII_Appli TheSpec_ExportUndistMesIm;
extern cSpecMMVII_Appli TheSpecAppliExtractLine;
extern cSpecMMVII_Appli TheSpec_CERN_ImportClino;
extern cSpecMMVII_Appli TheSpec_MMV2_MesIm_2_MMV1;

extern cSpecMMVII_Appli TheSpec_MergeMesImGCP;

extern cSpecMMVII_Appli TheSpec_ExifData;

extern cSpecMMVII_Appli TheSpec_PerturbRandomOri;

};

#endif // _MMVII_DeclareAllCmd_H_
8 changes: 8 additions & 0 deletions MMVII/include/MMVII_PCSens.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ class cSensorCamPC : public cSensorImage
const cPixelDomain & PixelDomain() const override;

void SetPose(const tPose & aPose);
void SetOrient(const tRotR & anOrient);
void SetCenter(const cPt3dr & aC);

bool HasImageAndDepth() const override; // true
cPt3dr Ground2ImageAndDepth(const cPt3dr &) const override;
Expand Down Expand Up @@ -523,6 +525,7 @@ class cSensorCamPC : public cSensorImage

// different accessor to the pose
const tPose & Pose() const;
const tRotR & Orient() const;
const cPt3dr & Center() const;
cPt3dr & Center() ;
cPt3dr AxeI() const;
Expand Down Expand Up @@ -568,6 +571,11 @@ class cSensorCamPC : public cSensorImage
cPt3dr Vec_L2W(const cPt3dr &) const; ///< Coordinat local of cam to coordinate word for a "vector"
cPt3dr Vec_W2L(const cPt3dr &) const; ///< Coordinat word to coordinate local of cam for a "vector"

// Cast to possible heriting class
bool IsSensorCamPC() const override ;
const cSensorCamPC * GetSensorCamPC() const override;
cSensorCamPC * GetSensorCamPC() override;

private :
void Bench();
cSensorCamPC(const cSensorCamPC&) = delete;
Expand Down
8 changes: 8 additions & 0 deletions MMVII/include/MMVII_Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ class cSensorImage : public cObj2DelAtEnd,
void TransferateCoordSys(const cSensorImage & aSI); ///< Transferat coordinate sys aSI if it has any
static const std::string TagCoordSys;

// Cast to possible heriting class
virtual bool IsSensorCamPC() const ;
virtual const cSensorCamPC * GetSensorCamPC() const;
virtual cSensorCamPC * GetSensorCamPC() ;
/// generete a user error
const cSensorCamPC * UserGetSensorCamPC() const;
cSensorCamPC * UserGetSensorCamPC() ;

private :

std::string mNameImage;
Expand Down
1 change: 1 addition & 0 deletions MMVII/include/MMVII_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ enum class eApF
Cloud, ///< Cloud processing
CodedTarget, ///< Coded target (generate, match )
Topo, ///< Topo survey
Simul, ///< Simulation of datas
NoGui, ///< Will not have a GUI frontend
Perso, ///< Personnal
eNbVals ///< Tag for number of value
Expand Down
3 changes: 2 additions & 1 deletion MMVII/include/V1VII.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define _V1V2_H_

#ifndef MMVII_KEEP_LIBRARY_MMV1
#define MMVII_KEEP_LIBRARY_MMV1 false
// Maintain it for now, require for converting V1 TiePoints...
#define MMVII_KEEP_LIBRARY_MMV1 true
#endif

#if (MMVII_KEEP_LIBRARY_MMV1)
Expand Down
5 changes: 3 additions & 2 deletions MMVII/src/Appli/cSpecMMVII_Appli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,11 @@ std::vector<cSpecMMVII_Appli *> & cSpecMMVII_Appli::InternVecAll()
TheVecAll.push_back(&TheSpecAppliExtractLine);
TheVecAll.push_back(&TheSpec_CERN_ImportClino);
TheVecAll.push_back(&TheSpec_MMV2_MesIm_2_MMV1);

TheVecAll.push_back(&TheSpec_MergeMesImGCP);

TheVecAll.push_back(&TheSpec_ExifData);
TheVecAll.push_back(&TheSpec_PerturbRandomOri);


std::sort(TheVecAll.begin(),TheVecAll.end(),CmpCmd);
}

Expand Down
5 changes: 4 additions & 1 deletion MMVII/src/ImagesBase/FileImages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#include "MMVII_Ptxd.h"
#include "cGdalApi.h"

#define MMVII_KEEP_LIBRARY_MMV1 true


#ifdef MMVII_KEEP_MMV1_IMAGE
#define MMVII_KEEP_LIBRARY_MMV1 true
# include "V1VII.h"
#endif

Expand All @@ -25,6 +27,7 @@ namespace MMVII
#ifdef MMVII_KEEP_MMV1_IMAGE
static GenIm::type_el ToMMV1(eTyNums aV2)
{
// StdOut() << "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj\n";
switch (aV2)
{
case eTyNums::eTN_INT1 : return GenIm::int1 ;
Expand Down
4 changes: 3 additions & 1 deletion MMVII/src/MMV1/ExportHomMMV1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const
MMVII_INTERNAL_ERROR("No CreateImportV1 ");
return nullptr;
}
#endif // MMVII_KEEP_LIBRARY_MMV1


cInterfImportHom::~cInterfImportHom()
{
}

#endif // MMVII_KEEP_LIBRARY_MMV1



Expand Down
27 changes: 27 additions & 0 deletions MMVII/src/Sensors/SensorBases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,33 @@ void cSensorImage::TransferateCoordSys(const cSensorImage & aSI)
}
const std::string cSensorImage::TagCoordSys = "CoordinateSys";

bool cSensorImage::IsSensorCamPC() const { return false; }
const cSensorCamPC * cSensorImage::GetSensorCamPC() const
{
MMVII_INTERNAL_ERROR("impossible required cast to cSensorCamPC");
return nullptr;
}
cSensorCamPC * cSensorImage::GetSensorCamPC()
{
MMVII_INTERNAL_ERROR("impossible required cast to cSensorCamPC");
return nullptr;
}

cSensorCamPC * cSensorImage::UserGetSensorCamPC()
{
if (!IsSensorCamPC())
{
MMVII_UnclasseUsEr("Camera " + NameImage() + " was not central perspective");
}
return GetSensorCamPC();
}


const cSensorCamPC * cSensorImage::UserGetSensorCamPC() const
{
return const_cast<cSensorImage*>(this)->UserGetSensorCamPC();
}



/* ******************************************************* */
Expand Down
22 changes: 21 additions & 1 deletion MMVII/src/Sensors/cSensorCamPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const cPt3dr & cPoseWithUK::Tr() const {return mPose.Tr();}
cPt3dr & cPoseWithUK::Tr() {return mPose.Tr();}



cPt3dr & cPoseWithUK::Omega() {return mOmega;}
const cPt3dr & cPoseWithUK::Omega() const {return mOmega;}

Expand Down Expand Up @@ -156,7 +157,17 @@ void cSensorCamPC::SetPose(const tPose & aPose)
mPose_WU.SetPose(aPose);
}

// void SetCenter(const cPt3dr & aC);

void cSensorCamPC::SetOrient(const tRotR & anOrient)
{
SetPose(tPose(Center(),anOrient));
}

void cSensorCamPC::SetCenter(const cPt3dr & aC)
{
SetPose(tPose(aC,Orient()));
}


#if (1)
Expand Down Expand Up @@ -307,7 +318,9 @@ const cPixelDomain & cSensorCamPC::PixelDomain() const

cPerspCamIntrCalib * cSensorCamPC::InternalCalib() const {return mInternalCalib;}

const cPt3dr & cSensorCamPC::Center() const {return mPose_WU.Tr();}
const cPt3dr & cSensorCamPC::Center() const {return mPose_WU.Tr();}
const tRotR & cSensorCamPC::Orient() const {return mPose_WU.Pose().Rot();}

const cPt3dr & cSensorCamPC::Omega() const {return mPose_WU.Omega();}
cPt3dr & cSensorCamPC::Center() {return mPose_WU.Tr();}
cPt3dr & cSensorCamPC::Omega() {return mPose_WU.Omega();}
Expand Down Expand Up @@ -584,6 +597,13 @@ void cSensorCamPC::BenchOneCalib(cPerspCamIntrCalib * aCalib)
aCam.Bench();
}

// ================= Cast ===================

bool cSensorCamPC::IsSensorCamPC() const { return true; }
const cSensorCamPC * cSensorCamPC::GetSensorCamPC() const { return this; }
cSensorCamPC * cSensorCamPC::GetSensorCamPC() { return this; }



}; // MMVII

Expand Down
1 change: 1 addition & 0 deletions MMVII/src/Serial/ElemStrToVal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ template<> cE2Str<eApF>::tMapE2Str cE2Str<eApF>::mE2S
{eApF::Cloud,"Cloud"},
{eApF::CodedTarget,"CodedTarget"},
{eApF::Topo,"Topo"},
{eApF::Simul,"Simul"},
{eApF::NoGui,"NoGui"},
{eApF::Perso,"Perso"}
};
Expand Down
Loading

0 comments on commit 39280e6

Please sign in to comment.