plot: rename Source to UnfoldedData

This commit is contained in:
陈浩南 2023-10-12 17:16:56 +08:00
parent f1720c425d
commit 7cf384bf6c
2 changed files with 11 additions and 11 deletions

View File

@ -23,13 +23,13 @@ namespace ufo
};
std::vector<FigureConfigType> Figures;
struct SourceType : public UnfoldSolver::OutputType
struct UnfoldedDataType : public UnfoldSolver::OutputType
{
SourceType(std::string filename);
SourceType() = default;
UnfoldedDataType(std::string filename);
UnfoldedDataType() = default;
};
std::string SourceFilename;
SourceType Source;
std::string UnfoldedDataFilename;
UnfoldedDataType UnfoldedData;
InputType(std::string config_file);
};
@ -56,7 +56,7 @@ namespace ufo
static std::vector<std::reference_wrapper<const UnfoldSolver::OutputType::QpointDataType>> search_qpoints
(
const std::pair<Eigen::Vector3d, Eigen::Vector3d>& path,
const decltype(InputType::SourceType::QpointData)& available_qpoints,
const decltype(InputType::UnfoldedDataType::QpointData)& available_qpoints,
double threshold, bool exclude_endpoint = false
);
// 根据搜索到的 q 点, 计算每个点的数值

View File

@ -2,7 +2,7 @@
namespace ufo
{
PlotSolver::InputType::SourceType::SourceType(std::string filename)
PlotSolver::InputType::UnfoldedDataType::UnfoldedDataType(std::string filename)
{
static_cast<UnfoldSolver::OutputType&>(*this) = zpp_read<UnfoldSolver::OutputType>(filename);
}
@ -49,8 +49,8 @@ namespace ufo
}
}
}
SourceFilename = input["SourceFilename"].as<std::string>();
Source = SourceType(SourceFilename);
UnfoldedDataFilename = input["UnfoldedDataFilename"].as<std::string>();
UnfoldedData = UnfoldedDataType(UnfoldedDataFilename);
}
const PlotSolver::OutputType& PlotSolver::OutputType::write(std::string filename, std::string format) const
{
@ -85,7 +85,7 @@ namespace ufo
lines.emplace_back(path[i], path[i + 1]);
qpoints.push_back(search_qpoints
(
lines.back(), Input_.Source.QpointData,
lines.back(), Input_.UnfoldedData.QpointData,
0.001, i != path.size() - 2
));
}
@ -113,7 +113,7 @@ namespace ufo
std::vector<std::reference_wrapper<const UnfoldSolver::OutputType::QpointDataType>> PlotSolver::search_qpoints
(
const std::pair<Eigen::Vector3d, Eigen::Vector3d>& path,
const decltype(InputType::SourceType::QpointData)& available_qpoints,
const decltype(InputType::UnfoldedDataType::QpointData)& available_qpoints,
double threshold, bool exclude_endpoint
)
{