Mesh: [skip ci] Add static method to get list of supported input/output mesh formats

This commit is contained in:
wmayer
2019-12-14 15:33:33 +01:00
parent 8ef13be48b
commit 3fce7da269
2 changed files with 32 additions and 0 deletions

View File

@@ -139,6 +139,18 @@ struct Color_Less : public std::binary_function<const App::Color&,
// --------------------------------------------------------------
std::vector<std::string> MeshInput::supportedMeshFormats()
{
std::vector<std::string> fmt;
fmt.emplace_back("bms");
fmt.emplace_back("ply");
fmt.emplace_back("stl");
fmt.emplace_back("obj");
fmt.emplace_back("off");
fmt.emplace_back("smf");
return fmt;
}
bool MeshInput::LoadAny(const char* FileName)
{
// ask for read permission
@@ -1747,6 +1759,22 @@ void MeshOutput::Transform(const Base::Matrix4D& mat)
apply_transform = true;
}
std::vector<std::string> MeshOutput::supportedMeshFormats()
{
std::vector<std::string> fmt;
fmt.emplace_back("bms");
fmt.emplace_back("ply");
fmt.emplace_back("stl");
fmt.emplace_back("obj");
fmt.emplace_back("off");
fmt.emplace_back("smf");
fmt.emplace_back("x3d");
fmt.emplace_back("wrl");
fmt.emplace_back("wrz");
fmt.emplace_back("amf");
return fmt;
}
MeshIO::Format MeshOutput::GetFormat(const char* FileName)
{
Base::FileInfo file(FileName);

View File

@@ -129,6 +129,8 @@ public:
/** Loads a Cadmould FE file. */
bool LoadCadmouldFE (std::ifstream &rstrIn);
static std::vector<std::string> supportedMeshFormats();
protected:
MeshKernel &_rclMesh; /**< reference to mesh data structure */
Material* _material;
@@ -205,6 +207,8 @@ public:
/** Writes a python module which creates a mesh */
bool SavePython (std::ostream &rstrOut) const;
static std::vector<std::string> supportedMeshFormats();
protected:
const MeshKernel &_rclMesh; /**< reference to mesh data structure */
const Material* _material;