56 template<
typename T >
61 struct Destroyer< SettingsInterface >
64 static void destroy( SettingsInterface *settings )
72 struct Destroyer< CameraInterface >
75 static void destroy( CameraInterface *camera )
83 struct Destroyer< CameraCalibrationInterface >
86 static void destroy( CameraCalibrationInterface *calib )
94 struct Destroyer< CamerasLoaderInterface >
96 static void destroy( CamerasLoaderInterface *camerasLoader )
104 struct Destroyer< SparsePointCloudInterface >
107 static void destroy( SparsePointCloudInterface *pointCloud )
115 struct Destroyer< StereoPointCloudInterface >
118 static void destroy( StereoPointCloudInterface *pointCloud )
126 struct Destroyer< StereoMeshInterface >
129 static void destroy( StereoMeshInterface *mesh )
137 struct Destroyer< StereoTexturedMeshInterface >
139 static void destroy( StereoTexturedMeshInterface *texturedMesh )
147 struct Destroyer< WorkspaceLoaderInterface >
150 static void destroy( WorkspaceLoaderInterface *workspaceLoader )
158 struct Destroyer< WorkspaceSaverInterface >
161 static void destroy( WorkspaceSaverInterface *workspaceSaver )
169 struct Destroyer< ControlPointConstraintInterface >
172 static void destroy( ControlPointConstraintInterface *controlPoint )
180 struct Destroyer< BoundingBoxInterface >
183 static void destroy( BoundingBoxInterface *bb )
191 struct Destroyer< OrthophotoInterface >
194 static void destroy( OrthophotoInterface *op )
202 struct Destroyer< ProjectedCoordinateSystemInterface >
205 static void destroy( ProjectedCoordinateSystemInterface *pcs )
213 struct Destroyer< CameraConstraintInterface >
216 static void destroy( CameraConstraintInterface *cc )
224 struct Destroyer< DynamicBufferInterface >
227 static void destroy( DynamicBufferInterface *ptr )
235 struct Destroyer< LicenseInfoInterface >
238 static void destroy( LicenseInfoInterface *ptr )
244 template<
typename T >
245 class UniquePtr final
249 UniquePtr() =
default;
251 UniquePtr( T *
object )
255 UniquePtr( UniquePtr &&other )
256 : mObject( other.release() )
259 UniquePtr &operator =( UniquePtr &&other )
261 if (
this != &other )
263 reset( other.release() );
276 explicit operator bool()
const
278 return mObject !=
nullptr;
286 const T *operator ->()
const
296 const T &operator *()
const
308 void reset( T *
object =
nullptr )
311 Detail::Destroyer< T >::destroy( mObject );
325 T *mObject =
nullptr;
330 template<
typename T >
333 static_assert( std::is_same< CameraInterface, T >::value ||
334 std::is_same< CamerasLoaderInterface, T >::value ||
335 std::is_same< ControlPointConstraintInterface, T >::value ||
336 std::is_same< SparsePointCloudInterface, T >::value ||
337 std::is_same< StereoPointCloudInterface, T >::value ||
338 std::is_same< StereoMeshInterface, T >::value ||
339 std::is_same< StereoTexturedMeshInterface, T >::value ||
340 std::is_same< CameraConstraintInterface, T >::value ||
341 std::is_same< ProjectedCoordinateSystemInterface, T >::value ||
342 std::is_same< BoundingBoxInterface, T >::value,
343 "This kind of buffer can only be used with object classes" );
354 Buffer( std::vector< Detail::UniquePtr< T > > &v )
355 : data( v.empty() ? nullptr : reinterpret_cast< T ** >( v.data() ) )
356 , count( v.empty() ? 0 : v.size() )
358 static_assert(
sizeof( Detail::UniquePtr< T > ) ==
359 sizeof( std::ptrdiff_t ),
"" );
362 explicit operator bool()
const
364 return data !=
nullptr;
369 template<
typename T >
372 static_assert( std::is_same< CameraInterface, T >::value ||
373 std::is_same< CamerasLoaderInterface, T >::value ||
374 std::is_same< ControlPointConstraintInterface, T >::value ||
375 std::is_same< SparsePointCloudInterface, T >::value ||
376 std::is_same< StereoPointCloudInterface, T >::value ||
377 std::is_same< StereoMeshInterface, T >::value ||
378 std::is_same< StereoTexturedMeshInterface, T >::value ||
379 std::is_same< ProjectedCoordinateSystemInterface, T >::value ||
380 std::is_same< CameraConstraintInterface, T >::value ||
381 std::is_same< BoundingBoxInterface, T >::value,
382 "This kind of buffer can only be used with object classes" );
385 const T *
const *data =
nullptr;
394 : data( v.empty() ? nullptr : reinterpret_cast< const T *const * >( v.data() ) )
395 , count( v.empty() ? 0 : v.size() )
397 static_assert(
sizeof( Detail::UniquePtr< T > ) ==
398 sizeof( std::ptrdiff_t ),
"" );
401 explicit operator bool()
const
403 return data !=
nullptr;
414 const std::size_t len = std::strlen( nMessage );
416 if ( len > 3 && nMessage[ 0 ] ==
'[' && nMessage[ 2 ] ==
']' )
417 nMessage = nMessage + 3;
421 ( *mFileStream ) << nMessage;
425 std::cout << nMessage;
437 void start(
const char *nWindowTitle,
bool nShowGlobalProgress,
bool nShowCancelButton )
449 void resetTicks(
unsigned int nTicks,
const char *nLoadingText )
542 const Point2 &referencePoint,
Stores a camera object to feed the Structure from Motion parameters.
Definition: CameraInterface.h:38
Pure virtual Log Listener interface.
Definition: LogListenerInterface.h:41
Pure virtual Progress Bar interface.
Definition: ProgressBarInterface.h:32
Definition: BoundingBoxInterface.cpp:26
void DestroyDynamicBuffer(DynamicBufferInterface *buf)
Definition: DynamicBufferInterface.cpp:32
void DestroyOrthophoto(OrthophotoInterface *orthophoto)
Definition: OrthophotoInterface.cpp:32
void DestroyProjectedCoordinateSystem(ProjectedCoordinateSystemInterface *pcs)
Definition: ProjectedCoordinateSystemInterface.cpp:32
Detail::UniquePtr< DynamicBufferInterface > UniqueDynamicBufferPtr
Automatically manages the lifetime of a DynamicBuffer object.
Definition: Utilities.h:519
Detail::UniquePtr< OrthophotoInterface > UniqueOrthophotoPtr
Automatically manages the lifetime of a Orthophoto object.
Definition: Utilities.h:510
void DestroyStereoTexturedMesh(StereoTexturedMeshInterface *stereoTexturedMesh)
Definition: StereoTexturedMeshInterface.cpp:32
void DestroyStereoPointCloud(StereoPointCloudInterface *stereoPointCloud)
Definition: StereoPointCloudInterface.cpp:32
void DestroyWorkspaceSaver(WorkspaceSaverInterface *workspaceSaver)
Definition: WorkspaceSaverInterface.cpp:32
Detail::UniquePtr< CameraConstraintInterface > UniqueCameraConstraintPtr
Automatically manages the lifetime of a CameraConstraint object.
Definition: Utilities.h:516
Result SampleEpipolarLine(const CameraInterface &referenceCamera, const Point2 &referencePoint, const CameraInterface &targetCamera, int sampleCount, Buffer< Point2 > inOutPoints)
Definition: Utilities.cpp:208
Detail::UniquePtr< StereoTexturedMeshInterface > UniqueStereoTexturedMeshPtr
Automatically manages the lifetime of a Stereo textured mesh object.
Definition: Utilities.h:492
void DestroyBoundingBox(BoundingBoxInterface *boundingBox)
Definition: BoundingBoxInterface.cpp:32
void DestroySettings(SettingsInterface *settings)
Definition: SettingsInterface.cpp:32
void DestroyWorkspaceLoader(WorkspaceLoaderInterface *workspaceLoader)
Definition: WorkspaceLoaderInterface.cpp:32
Result ComputeCamerasRating(Buffer< CameraInterface * > cameras, Buffer< Pair< CameraInterface *, Point2 > > selectedPoints, Buffer< int > inOutRatings)
Compute camera ratings based on point visibility.
Definition: Utilities.cpp:313
Detail::UniquePtr< WorkspaceSaverInterface > UniqueWorkspaceSaverPtr
Automatically manages the lifetime of a Workspace Saver object.
Definition: Utilities.h:501
void DestroyCamerasLoader(CamerasLoaderInterface *CamerasLoader)
Definition: CamerasLoaderInterface.cpp:32
const char * GetResultMessage(Result inResult)
Definition: Utilities.cpp:157
Detail::UniquePtr< CamerasLoaderInterface > UniqueCamerasLoaderPtr
Automatically manages the lifetime of a CamerasLoader object.
Definition: Utilities.h:480
void DestroyStereoMesh(StereoMeshInterface *stereoMesh)
Definition: StereoMeshInterface.cpp:32
void DestroyCameraConstraint(CameraConstraintInterface *cameraConstraint)
Definition: CameraConstraintInterface.cpp:32
Detail::UniquePtr< WorkspaceLoaderInterface > UniqueWorkspaceLoaderPtr
Automatically manages the lifetime of a Workspace Loader object.
Definition: Utilities.h:504
Detail::UniquePtr< CameraCalibrationInterface > UniqueCameraCalibrationPtr
Automatically manages the lifetime of a Camera calibration object.
Definition: Utilities.h:477
Detail::UniquePtr< StereoPointCloudInterface > UniqueStereoPointCloudPtr
Automatically manages the lifetime of a Stereo Point cloud object.
Definition: Utilities.h:486
Detail::UniquePtr< LicenseInfoInterface > UniqueLicenseInfoPtr
Automatically manages the lifetime of a LicenseInfo object.
Definition: Utilities.h:522
Detail::UniquePtr< BoundingBoxInterface > UniqueBoundingBoxPtr
Automatically manages the lifetime of a Bounding box object.
Definition: Utilities.h:498
void DestroySparsePointCloud(SparsePointCloudInterface *boundingBox)
Definition: SparsePointCloudInterface.cpp:32
Detail::UniquePtr< ControlPointConstraintInterface > UniqueControlPointConstraintPtr
Automatically manages the lifetime of a Control Point Constraint object.
Definition: Utilities.h:507
void DestroyLicenseInfo(LicenseInfoInterface *buf)
Definition: LicenseInfoInterface.cpp:32
void DestroyCamera(CameraInterface *camera)
Definition: CameraInterface.cpp:32
Detail::UniquePtr< StereoMeshInterface > UniqueStereoMeshPtr
Automatically manages the lifetime of a Stereo mesh object.
Definition: Utilities.h:489
Detail::UniquePtr< SparsePointCloudInterface > UniqueSparsePointCloudPtr
Automatically manages the lifetime of a Sparse Point Cloud object.
Definition: Utilities.h:483
void DestroyCameraCalibration(CameraCalibrationInterface *cameraCalibration)
Definition: CameraCalibrationInterface.cpp:32
Detail::UniquePtr< ProjectedCoordinateSystemInterface > UniqueProjectedCoordinateSystemPtr
Automatically manages the lifetime of a ProjectedCoordinateSystem object.
Definition: Utilities.h:513
void DestroyControlPointConstraint(ControlPointConstraintInterface *controlPoint)
Definition: ControlPointConstraintInterface.cpp:32
std::size_t Size
Size type.
Definition: CommonDef.h:103
Detail::UniquePtr< SettingsInterface > UniqueSettingsPtr
Automatically manages the lifetime of a Settings object.
Definition: Utilities.h:495
Detail::UniquePtr< CameraInterface > UniqueCameraPtr
Automatically manages the lifetime of a Camera object.
Definition: Utilities.h:474
Result
Enumerates possible results generated by FlowEngine.
Definition: CommonDef.h:45
Buffer(std::vector< Detail::UniquePtr< T > > &v)
Constructor from std::vector.
Definition: Utilities.h:354
Holds a (mutable) non_owning pointer and a size Used to marshal memory buffers as arguments in a safe...
Definition: CommonDef.h:118
ConstBuffer(const std::vector< Detail::UniquePtr< T > > &v)
Conversion from std::vector.
Definition: Utilities.h:393
Holds a (non mutable) non_owning pointer and a count Used to marshal memory buffers as arguments in a...
Definition: CommonDef.h:191
Simple log listener class.
Definition: Utilities.h:409
std::ostream * mFileStream
Pointer to an optional file stream.
Definition: Utilities.h:430
void messageLogged(const char *nMessage)
Send to stdout and optionally on a file stream.
Definition: Utilities.h:411
Bound 2 values together.
Definition: CommonDef.h:506
a 2 dimensional point
Definition: CommonDef.h:388
Simple/Empty progress bar class.
Definition: Utilities.h:435
void resetGlobalTicks(unsigned int nGlobalTicks, const char *nLoadingText)
Set global progress bar ticks (if any) and reset the counter to 0.
Definition: Utilities.h:455
void start(const char *nWindowTitle, bool nShowGlobalProgress, bool nShowCancelButton)
Show the progress bar.
Definition: Utilities.h:437
void resetTicks(unsigned int nTicks, const char *nLoadingText)
Set progress bar ticks and reset the counter to 0.
Definition: Utilities.h:449
void update()
Progress the loading bar - Add + 1 Tick.
Definition: Utilities.h:461
void finish()
Hide the loading bar.
Definition: Utilities.h:443
void updateGlobal()
Progress the global progress bar - Add + 1 Tick.
Definition: Utilities.h:467