Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] Native support for 2D and 3D vertices #255

Open
4 tasks
bobluppes opened this issue Dec 1, 2024 · 1 comment
Open
4 tasks

[CORE] Native support for 2D and 3D vertices #255

bobluppes opened this issue Dec 1, 2024 · 1 comment

Comments

@bobluppes
Copy link
Owner

2D and 3D vertices

In order to support geometric algorithms (such as Delaunay triangulation) we want to natively support geometric vertices. The goal of this issue is to implement a point_2d and point_3d class.

Along with these vertex specializations, we can then also provide specializations for geometric graphs (i.e. geometric_graph_2d and geometric_graph_3d).

Syntax

An initial idea for the (public) interface of the new classes is as follows:

(note that this is not set in store and merely serves as a starting point)

// point_2d.h
class point_2d {
  public:
    point_2d(double x, double y);
    
    [[nodiscard]] double x() const noexcept;
    [[nodiscard]] double y() const noexcept;
}

// point_3d.h
class point_3d {
  public:
    point_3d(double x, double y, double z);

    [[nodiscard]] double x() const noexcept;
    [[nodiscard]] double y() const noexcept;
    [[nodiscard]] double z() const noexcept;
}

// geometric_graph.h
template <typename EDGE_T, graph_type GRAPH_TYPE_V>
using geometric_graph_2d = graph<point_2d, EDGE_T, GRAPH_TYPE_V>

template <typename EDGE_T, graph_type GRAPH_TYPE_V>
using geometric_graph_3d = graph<point_3d, EDGE_T, GRAPH_TYPE_V>

This class should live in the graaf::geometric namespace under the (new) directory include/graaflib/geometric/.

Definition of Done

This issue is done when:

  • The new classes are implemented
  • The new classes has a javadoc-style comment for the entire class and for the public methods
  • Appropriate tests are added under test/graaflib/geometric
    • A test coverage of at least 95% is reached
@bobluppes bobluppes added enhancement New feature help wanted Extra attention is needed good first issue Good for newcomers won't do (for now) and removed help wanted Extra attention is needed good first issue Good for newcomers labels Dec 1, 2024
@bobluppes
Copy link
Owner Author

Won't do for now as we aim to keep the library general purpose. Keeping this in the issue list for future reference. If we see that this is a common use case among our users then we may reconsider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant