Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/plateau/dataset/gml_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <optional>
#include "plateau/network/client.h"
#include "city_model_package.h"
#include "plateau/dataset/grid_code.h"

namespace plateau::dataset {

Expand All @@ -20,7 +21,11 @@ namespace plateau::dataset {
const std::string& getPath() const;
void setPath(const std::string& path);
std::shared_ptr<GridCode> getGridCode() const;
GridCode* getGridCodeRaw() const; // 寿命管理をDLL利用者に任せる用です
/**
* getGridCode関数をP/Invokeで利用するための生ポインタ版です。
* 新しいGridCodeインスタンスを生成して返すので、DLL利用者が廃棄する必要があります。
*/
GridCode* getGridCodeRaw() const;
double getEpsg() const;
bool isPolarCoordinateSystem() const;
const std::string& getFeatureType() const;
Expand Down
2 changes: 1 addition & 1 deletion include/plateau/dataset/grid_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace plateau::dataset {
static std::shared_ptr<GridCode> create(const std::string& code);

/**
* \brief 与えられたコードから適切なGridCodeの派生クラスのインスタンスを作成します
* \brief create()をUnityのP/Invokeから呼び出す版です。newして返すので、利用者が適切に廃棄する必要があります
* \param code コード文字列
* \return コードの形式に応じてMeshCodeまたはStandardMapGridのインスタンスを返します。生ポインタで返されます。
* \throw std::invalid_argument コードの形式が不正な場合
Expand Down
15 changes: 5 additions & 10 deletions include/plateau/dataset/i_dataset_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ namespace plateau::dataset {
return name_;
}

explicit operator std::string& () {
return name_;
}

explicit operator std::string() const {
return name_;
}
Expand Down Expand Up @@ -114,12 +110,6 @@ namespace plateau::dataset {
*/
virtual std::shared_ptr<IDatasetAccessor> filter(const geometry::Extent& extent) const = 0;

/**
* \brief メッシュコードで都市モデルデータをフィルタリングします。
* \param grid_codes 欲しい地域IDのvector
* \param collection フィルタリングされた都市モデルデータの格納先
*/
virtual void filterByGridCodes(const std::vector<GridCode*>& grid_codes, IDatasetAccessor& collection) const = 0;

/**
* \brief メッシュコードで都市モデルデータをフィルタリングします。
Expand All @@ -129,6 +119,11 @@ namespace plateau::dataset {
virtual std::shared_ptr<IDatasetAccessor> filterByGridCodes(
const std::vector<std::shared_ptr<GridCode>>& grid_codes) const = 0;

/**
* \brief filterByGridCodes関数の、UnityでP/Invokeから呼び出す版です。引数のvector内のポインタの廃棄はDLL側で責任を持ってください。
*/
virtual void filterByGridCodes(const std::vector<GridCode*>& grid_codes, IDatasetAccessor& collection) const = 0;

/**
* \brief 都市モデルデータが存在する地域メッシュのリストを取得します。
*/
Expand Down
3 changes: 3 additions & 0 deletions include/plateau/dataset/invalid_grid_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace plateau::dataset {
return std::make_shared<InvalidGridCode>();
}

/**
* InvalidGridCodeをnewして返します。DLLの利用者が廃棄に責任を持つ必要があります。
*/
GridCode* upperRaw() const override {
return new InvalidGridCode();
}
Expand Down
Loading