File ConsistentOrientationBuilder.h
File List > algorithm > ConsistentOrientationBuilder.h
Go to the documentation of this file
// Copyright (c) 2012-2013, IGN France.
// Copyright (c) 2012-2022, Oslandia.
// SPDX-License-Identifier: LGPL-2.0-or-later
#ifndef _SFCGAL_ALGORITHM_CONSISTENTORIENTATIONBUILDER_H_
#define _SFCGAL_ALGORITHM_CONSISTENTORIENTATIONBUILDER_H_
#include "SFCGAL/config.h"
#include "SFCGAL/Geometry.h"
#include "SFCGAL/detail/graph/GeometryGraph.h"
#include "SFCGAL/detail/graph/GeometryGraphBuilder.h"
namespace SFCGAL {
namespace algorithm {
class SFCGAL_API ConsistentOrientationBuilder {
public:
typedef graph::GeometryGraph::vertex_descriptor vertex_descriptor;
typedef graph::GeometryGraph::edge_descriptor edge_descriptor;
typedef graph::GeometryGraph::directed_edge_descriptor
directed_edge_descriptor;
ConsistentOrientationBuilder();
void
addTriangle(const Triangle &triangle);
void
addTriangulatedSurface(const TriangulatedSurface &triangulatedSurface);
TriangulatedSurface
buildTriangulatedSurface();
inline size_t
numTriangles() const
{
return _triangles.size();
}
Triangle
triangleN(const size_t &n) const;
const std::set<size_t> &
neighbors(const size_t &n) const;
private:
graph::GeometryGraph _graph;
graph::GeometryGraphBuilder _graphBuilder;
std::vector<std::vector<edge_descriptor>> _triangles;
std::vector<bool> _visited;
std::vector<bool> _oriented;
std::vector<std::set<size_t>> _neighbors;
void
_makeOrientationConsistent();
void
_computeNeighbors();
int
_findNextTriangle();
};
} // namespace algorithm
} // namespace SFCGAL
#endif