Skip to content

Commit a6e6cd7

Browse files
committed
[ObservationsEntity] move struct definition to .hpp
1 parent 2d80d4d commit a6e6cd7

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

src/qmlAlembic/ObservationsEntity.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,6 @@ namespace abcentity
1515
static const auto& TC_INDEX_ATTRIBUTE_NAME = "Tc-observations indices";
1616
static const auto& RC_INDEX_ATTRIBUTE_NAME = "Rc-observations indices";
1717

18-
/**
19-
* @brief encapsulates sufficient and fast retrievable information on a landmark observed by a view
20-
*/
21-
struct LandmarkPerView
22-
{
23-
LandmarkPerView() = default;
24-
25-
LandmarkPerView(const IndexT& landmarkId, const sfmData::Landmark& landmark,
26-
const sfmData::Observation& observation)
27-
: landmarkId(landmarkId)
28-
, landmark(landmark)
29-
, observation(observation)
30-
{
31-
}
32-
33-
const uint& landmarkId;
34-
const sfmData::Landmark& landmark;
35-
const sfmData::Observation& observation;
36-
};
37-
3818
// helper functions
3919

4020
QGeometryRenderer* createGeometryRenderer(const QByteArray& positionData, const std::string& indexAttributeName);

src/qmlAlembic/ObservationsEntity.hpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,30 @@
33
#include "BaseAlembicObject.hpp"
44
#include <aliceVision/sfmData/SfMData.hpp>
55

6+
using namespace aliceVision;
67

78
namespace abcentity
89
{
910

10-
struct LandmarkPerView;
11+
/**
12+
* @brief encapsulates sufficient and fast retrievable information on a landmark observed by a view
13+
*/
14+
struct LandmarkPerView
15+
{
16+
LandmarkPerView() = default;
17+
18+
LandmarkPerView(const IndexT& landmarkId, const sfmData::Landmark& landmark,
19+
const sfmData::Observation& observation)
20+
: landmarkId(landmarkId)
21+
, landmark(landmark)
22+
, observation(observation)
23+
{
24+
}
25+
26+
const uint& landmarkId;
27+
const sfmData::Landmark& landmark;
28+
const sfmData::Observation& observation;
29+
};
1130

1231
class ObservationsEntity : public BaseAlembicObject
1332
{
@@ -18,7 +37,7 @@ class ObservationsEntity : public BaseAlembicObject
1837
~ObservationsEntity() override = default;
1938

2039
void setData();
21-
void update(const aliceVision::IndexT& viewId, const QVariantMap& viewer2DInfo);
40+
void update(const IndexT& viewId, const QVariantMap& viewer2DInfo);
2241

2342
private:
2443

@@ -34,12 +53,12 @@ class ObservationsEntity : public BaseAlembicObject
3453
// in _indexBytesByLandmark for a landmark
3554
std::vector<std::pair<uint, uint>> _landmarkId2IndexRange;
3655
// maps view id to index of the corresponding position for a view camera in position data
37-
std::map<aliceVision::IndexT, uint> _viewId2vertexPos;
38-
aliceVision::sfmData::SfMData _sfmData;
56+
std::map<IndexT, uint> _viewId2vertexPos;
57+
sfmData::SfMData _sfmData;
3958
// maps view id to a pair containing:
4059
// - the total number of observations of all landmarks observed by this view
4160
// - a vector of LandmarkPerView structures corresponding to the landmarks observed by this view
42-
stl::flat_map<aliceVision::IndexT, std::pair<size_t, std::vector<LandmarkPerView>>> _landmarksPerView;
61+
stl::flat_map<IndexT, std::pair<size_t, std::vector<LandmarkPerView>>> _landmarksPerView;
4362
};
4463

4564
} // namespace

0 commit comments

Comments
 (0)