Line |
Branch |
Exec |
Source |
1 |
|
|
// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH |
2 |
|
|
// |
3 |
|
|
// SPDX-License-Identifier: MIT |
4 |
|
|
|
5 |
|
|
#pragma once |
6 |
|
|
#include "LogicalPositionInfo.h" |
7 |
|
|
#include "BrickBaseInfo.h" |
8 |
|
|
#include "ITileCoordinate.h" |
9 |
|
|
#include "IDimCoordinateQueryClause.h" |
10 |
|
|
#include "ITIleInfoQueryClause.h" |
11 |
|
|
#include "IBlobOutput.h" |
12 |
|
|
|
13 |
|
|
namespace imgdoc2 |
14 |
|
|
{ |
15 |
|
|
/// This interface is providing read-only access to the 3d-document. |
16 |
|
|
class IDocQuery3d |
17 |
|
|
{ |
18 |
|
|
public: |
19 |
|
136 |
virtual ~IDocQuery3d() = default; |
20 |
|
|
|
21 |
|
|
/// Reads tile information for the specified brick. There are three pieces of information which can be retrieved by this method, |
22 |
|
|
/// namely the tile-coordinate, the logical position and the tile-blob-info. If the respective pointers are null, the information |
23 |
|
|
/// will not be retrieved. |
24 |
|
|
/// If the row for the specified primary key does not exist, an exception of type "imgdoc2::non_existing_tile_exception" will be |
25 |
|
|
/// thrown. |
26 |
|
|
/// |
27 |
|
|
/// \param idx The primary key of the tile. |
28 |
|
|
/// \param [out] coordinate If non-null and the operation is successful, the tile-coordinate will be put here. |
29 |
|
|
/// \param [out] info If non-null and the operation is successful, the logical position will be put here. |
30 |
|
|
/// \param [out] brick_blob_info If non-null and the operation is successful, the brick-blob-info will be put here. |
31 |
|
|
virtual void ReadBrickInfo(imgdoc2::dbIndex idx, imgdoc2::ITileCoordinateMutate* coordinate, imgdoc2::LogicalPositionInfo3D* info, imgdoc2::BrickBlobInfo* brick_blob_info) = 0; |
32 |
|
|
|
33 |
|
|
/// Query the tiles table. The two query clauses are used to filter the tiles. The first clause is used to filter the tiles by their |
34 |
|
|
/// coordinates, the second by other "per tile data". The functor is called for each tile which matches the query. If the functor |
35 |
|
|
/// returns false, the enumeration is canceled, and no more calls to the functor will occur anymore. The two query clauses are |
36 |
|
|
/// logically ANDed together. |
37 |
|
|
/// \param clause The query clause (dealing with dimension indexes). |
38 |
|
|
/// \param tileInfoQuery The query clause (dealing with other "per tile data"). |
39 |
|
|
/// \param func A functor which will be called, passing in the index of tiles matching the query. If the functor returns false, the enumeration is canceled, and no |
40 |
|
|
/// more calls to the functor will occur anymore. |
41 |
|
|
virtual void Query(const imgdoc2::IDimCoordinateQueryClause* clause, const imgdoc2::ITileInfoQueryClause* tileInfoQuery, const std::function<bool(imgdoc2::dbIndex)>& func) = 0; |
42 |
|
|
|
43 |
|
|
/// Gets tiles intersecting the specified cuboid (and satisfying the other criteria). |
44 |
|
|
/// \param cuboid The cuboid. |
45 |
|
|
/// \param coordinate_clause The coordinate clause. |
46 |
|
|
/// \param tileinfo_clause The tileinfo clause. |
47 |
|
|
/// \param func A functor which will be called, passing in the index of tiles matching the query. If the functor returns false, the enumeration is canceled, and no |
48 |
|
|
/// more calls to the functor will occur anymore. |
49 |
|
|
virtual void GetTilesIntersectingCuboid(const imgdoc2::CuboidD& cuboid, const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause, const std::function<bool(imgdoc2::dbIndex)>& func) = 0; |
50 |
|
|
|
51 |
|
|
/// Gets tiles intersecting with the specified plane (and satisfying the other criteria). |
52 |
|
|
/// |
53 |
|
|
/// \param plane The plane. |
54 |
|
|
/// \param coordinate_clause The coordinate clause. |
55 |
|
|
/// \param tileinfo_clause The tileinfo clause. |
56 |
|
|
/// \param func A functor which will be called, passing in the index of tiles matching the query. If the functor returns false, the enumeration is canceled, and no |
57 |
|
|
/// more calls to the functor will occur any more. |
58 |
|
|
virtual void GetTilesIntersectingPlane(const imgdoc2::Plane_NormalAndDistD& plane, const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause, const std::function<bool(imgdoc2::dbIndex)>& func) = 0; |
59 |
|
|
|
60 |
|
|
// /// Reads the brick data for the specified brick. |
61 |
|
|
// /// \param idx The primary key of the brick for which the brick data is to be read. |
62 |
|
|
// /// \param [in] data The object which is receiving the blob data. |
63 |
|
|
virtual void ReadBrickData(imgdoc2::dbIndex idx, imgdoc2::IBlobOutput* data) = 0; |
64 |
|
|
public: |
65 |
|
|
// no copy and no move (-> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-copy-move-or-destructor-function-define-or-delete-them-all ) |
66 |
|
68 |
IDocQuery3d() = default; |
67 |
|
|
IDocQuery3d(const IDocQuery3d&) = delete; // copy constructor |
68 |
|
|
IDocQuery3d& operator=(const IDocQuery3d&) = delete; // copy assignment |
69 |
|
|
IDocQuery3d(IDocQuery3d&&) = delete; // move constructor |
70 |
|
|
IDocQuery3d& operator=(IDocQuery3d&&) = delete; // move assignment |
71 |
|
|
}; |
72 |
|
|
} |
73 |
|
|
|