https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: c54e5918a09b70f42ce39902b55a70c56079b5b2 authored by Norbert Grunwald on 30 April 2021, 20:51:27 UTC
Merge branch 'th2m' into 'master'
Tip revision: c54e591
TINInterface.h
/**
 * @copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#pragma once

#include <string>
#include <vector>

#include "GeoLib/Point.h"
#include "GeoLib/PointVec.h"

namespace GeoLib
{
class Surface;

namespace IO
{

/**
 * Interface for reading and writing Triangulated Irregular Network (TIN) file formats.
 */
class TINInterface
{
public:
    /**
     * Reads TIN file
     * @param fname    TIN file name
     * @param pnt_vec  a point vector to which triangle vertices are added
     * @param errors   a vector of error messages
     * @return a pointer to a GeoLib::Surface object created from TIN data. nullptr is returned if it fails to read the file.
     */
    static GeoLib::Surface* readTIN(std::string const& fname,
                                    GeoLib::PointVec &pnt_vec,
                                    std::vector<std::string>* errors = nullptr);

    /**
     * Writes surface data into TIN file
     * @param surface    surface object
     * @param file_name  TIN file name
     */
    static void writeSurfaceAsTIN(GeoLib::Surface const& surface, std::string const& file_name);
};

} // end namespace IO
} // end namespace GeoLib
back to top