| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #ifndef MESH_EVALUATION_H
|
| | #define MESH_EVALUATION_H
|
| |
|
| | #include <cmath>
|
| | #include <list>
|
| |
|
| | #include "MeshKernel.h"
|
| | #include "Visitor.h"
|
| |
|
| |
|
| | namespace MeshCore
|
| | {
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvaluation(const MeshKernel& rclB)
|
| | : _rclMesh(rclB)
|
| | {}
|
| | virtual ~MeshEvaluation() = default;
|
| |
|
| | MeshEvaluation(const MeshEvaluation&) = delete;
|
| | MeshEvaluation(MeshEvaluation&&) = delete;
|
| | MeshEvaluation& operator=(const MeshEvaluation&) = delete;
|
| | MeshEvaluation& operator=(MeshEvaluation&&) = delete;
|
| |
|
| | |
| | |
| | |
| | |
| |
|
| | virtual bool Evaluate() = 0;
|
| |
|
| | protected:
|
| |
|
| | const MeshKernel& _rclMesh;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshValidation
|
| | {
|
| | public:
|
| | explicit MeshValidation(MeshKernel& rclB)
|
| | : _rclMesh(rclB)
|
| | {}
|
| | virtual ~MeshValidation() = default;
|
| |
|
| | MeshValidation(const MeshValidation&) = delete;
|
| | MeshValidation(MeshValidation&&) = delete;
|
| | MeshValidation& operator=(const MeshValidation&) = delete;
|
| | MeshValidation& operator=(MeshValidation&&) = delete;
|
| |
|
| | |
| | |
| | |
| |
|
| | virtual bool Fixup() = 0;
|
| |
|
| | protected:
|
| |
|
| | MeshKernel& _rclMesh;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshOrientationVisitor: public MeshFacetVisitor
|
| | {
|
| | public:
|
| | MeshOrientationVisitor();
|
| |
|
| |
|
| | bool Visit(const MeshFacet&, const MeshFacet&, FacetIndex, unsigned long) override;
|
| | bool HasNonUnifomOrientedFacets() const;
|
| |
|
| | private:
|
| | bool _nonuniformOrientation {false};
|
| | };
|
| |
|
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshOrientationCollector: public MeshOrientationVisitor
|
| | {
|
| | public:
|
| | MeshOrientationCollector(std::vector<FacetIndex>& aulIndices, std::vector<FacetIndex>& aulComplement);
|
| |
|
| |
|
| | bool Visit(const MeshFacet&, const MeshFacet&, FacetIndex, unsigned long) override;
|
| |
|
| | private:
|
| | std::vector<FacetIndex>& _aulIndices;
|
| | std::vector<FacetIndex>& _aulComplement;
|
| | };
|
| |
|
| | |
| | |
| |
|
| | class MeshExport MeshSameOrientationCollector: public MeshOrientationVisitor
|
| | {
|
| | public:
|
| | explicit MeshSameOrientationCollector(std::vector<FacetIndex>& aulIndices);
|
| |
|
| | bool Visit(const MeshFacet&, const MeshFacet&, FacetIndex, unsigned long) override;
|
| |
|
| | private:
|
| | std::vector<FacetIndex>& _aulIndices;
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalOrientation: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvalOrientation(const MeshKernel& rclM);
|
| | bool Evaluate() override;
|
| | std::vector<FacetIndex> GetIndices() const;
|
| |
|
| | private:
|
| | unsigned long HasFalsePositives(const std::vector<FacetIndex>&) const;
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshFixOrientation: public MeshValidation
|
| | {
|
| | public:
|
| | explicit MeshFixOrientation(MeshKernel& rclM);
|
| | bool Fixup() override;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalSolid: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvalSolid(const MeshKernel& rclM);
|
| | bool Evaluate() override;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalTopology: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvalTopology(const MeshKernel& rclB)
|
| | : MeshEvaluation(rclB)
|
| | {}
|
| | bool Evaluate() override;
|
| |
|
| | void GetFacetManifolds(std::vector<FacetIndex>& raclFacetIndList) const;
|
| | unsigned long CountManifolds() const;
|
| | const std::vector<std::pair<FacetIndex, FacetIndex>>& GetIndices() const
|
| | {
|
| | return nonManifoldList;
|
| | }
|
| | const std::list<std::vector<FacetIndex>>& GetFacets() const
|
| | {
|
| | return nonManifoldFacets;
|
| | }
|
| |
|
| | protected:
|
| |
|
| | std::vector<std::pair<FacetIndex, FacetIndex>> nonManifoldList;
|
| | std::list<std::vector<FacetIndex>> nonManifoldFacets;
|
| |
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshFixTopology: public MeshValidation
|
| | {
|
| | public:
|
| | MeshFixTopology(MeshKernel& rclB, const std::list<std::vector<FacetIndex>>& mf)
|
| | : MeshValidation(rclB)
|
| | , nonManifoldList(mf)
|
| | {}
|
| | bool Fixup() override;
|
| |
|
| | const std::vector<FacetIndex>& GetDeletedFaces() const
|
| | {
|
| | return deletedFaces;
|
| | }
|
| |
|
| | private:
|
| | std::vector<FacetIndex> deletedFaces;
|
| | const std::list<std::vector<FacetIndex>>& nonManifoldList;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalPointManifolds: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvalPointManifolds(const MeshKernel& rclB)
|
| | : MeshEvaluation(rclB)
|
| | {}
|
| | bool Evaluate() override;
|
| |
|
| | void GetFacetIndices(std::vector<FacetIndex>& facets) const;
|
| | const std::list<std::vector<FacetIndex>>& GetFacetIndices() const
|
| | {
|
| | return facetsOfNonManifoldPoints;
|
| | }
|
| | const std::vector<FacetIndex>& GetIndices() const
|
| | {
|
| | return nonManifoldPoints;
|
| | }
|
| | unsigned long CountManifolds() const
|
| | {
|
| | return static_cast<unsigned long>(nonManifoldPoints.size());
|
| | }
|
| |
|
| | private:
|
| | std::vector<FacetIndex> nonManifoldPoints;
|
| | std::list<std::vector<FacetIndex>> facetsOfNonManifoldPoints;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalSingleFacet: public MeshEvalTopology
|
| | {
|
| | public:
|
| | explicit MeshEvalSingleFacet(const MeshKernel& rclB)
|
| | : MeshEvalTopology(rclB)
|
| | {}
|
| | bool Evaluate() override;
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshFixSingleFacet: public MeshValidation
|
| | {
|
| | public:
|
| | MeshFixSingleFacet(MeshKernel& rclB, const std::vector<std::list<FacetIndex>>& mf)
|
| | : MeshValidation(rclB)
|
| | , _raclManifoldList(mf)
|
| | {}
|
| | bool Fixup() override;
|
| |
|
| | private:
|
| | const std::vector<std::list<FacetIndex>>& _raclManifoldList;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalSelfIntersection: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvalSelfIntersection(const MeshKernel& rclB)
|
| | : MeshEvaluation(rclB)
|
| | {}
|
| |
|
| | bool Evaluate() override;
|
| |
|
| | void GetIntersections(
|
| | const std::vector<std::pair<FacetIndex, FacetIndex>>&,
|
| | std::vector<std::pair<Base::Vector3f, Base::Vector3f>>&
|
| | ) const;
|
| |
|
| | void GetIntersections(std::vector<std::pair<FacetIndex, FacetIndex>>&) const;
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshFixSelfIntersection: public MeshValidation
|
| | {
|
| | public:
|
| | MeshFixSelfIntersection(MeshKernel& rclB, const std::vector<std::pair<FacetIndex, FacetIndex>>& si)
|
| | : MeshValidation(rclB)
|
| | , selfIntersectons(si)
|
| | {}
|
| | std::vector<FacetIndex> GetFacets() const;
|
| | bool Fixup() override;
|
| |
|
| | private:
|
| | const std::vector<std::pair<FacetIndex, FacetIndex>>& selfIntersectons;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEvalNeighbourhood: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEvalNeighbourhood(const MeshKernel& rclB)
|
| | : MeshEvaluation(rclB)
|
| | {}
|
| | bool Evaluate() override;
|
| | std::vector<FacetIndex> GetIndices() const;
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshExport MeshFixNeighbourhood: public MeshValidation
|
| | {
|
| | public:
|
| | explicit MeshFixNeighbourhood(MeshKernel& rclB)
|
| | : MeshValidation(rclB)
|
| | {}
|
| | bool Fixup() override;
|
| | };
|
| |
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | class MeshExport MeshEigensystem: public MeshEvaluation
|
| | {
|
| | public:
|
| | explicit MeshEigensystem(const MeshKernel& rclB);
|
| |
|
| |
|
| | Base::Matrix4D Transform() const;
|
| | |
| | |
| |
|
| | Base::Vector3f GetBoundings() const;
|
| |
|
| | bool Evaluate() override;
|
| | |
| | |
| | |
| |
|
| | protected:
|
| | void CalculateLocalSystem();
|
| |
|
| | private:
|
| | Base::Vector3f _cU, _cV, _cW, _cC;
|
| | float _fU, _fV, _fW;
|
| | };
|
| |
|
| | }
|
| |
|
| | #endif
|
| |
|