Visual Computing Library
Loading...
Searching...
No Matches
edge.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_MESH_ELEMENTS_EDGE_H
24#define VCL_MESH_ELEMENTS_EDGE_H
25
26#include "element.h"
27
28#include <vclib/concepts/mesh/elements/edge.h>
29
30namespace vcl {
31
46template<typename MeshType, typename... Comps>
47class Edge : public Element<ElemId::EDGE, MeshType, Comps...>
48{
49 // VertexPointers or VertexIndices component of the Edge
50 using VRefs = typename Edge::VertexReferences;
51
52public:
53 using VertexType = VRefs::VertexType;
54 using VRefs::setVertices;
55
63 Edge() = default;
64
71 void setVertices(VertexType* v0, VertexType* v1)
72 {
73 VRefs::setVertex(0u, v0);
74 VRefs::setVertex(1u, v1);
75 }
76
83 void setVertices(uint vi0, uint vi1)
84 {
85 VRefs::setVertex(0u, vi0);
86 VRefs::setVertex(1u, vi1);
87 }
88};
89
90template<typename MeshType, typename... Comps>
91class Edge<MeshType, TypeWrapper<Comps...>> : public Edge<MeshType, Comps...>
92{
93};
94
95} // namespace vcl
96
97#endif // VCL_MESH_ELEMENTS_EDGE_H
The Edge class represents an Edge element of the vcl::Mesh class.
Definition edge.h:48
void setVertices(uint vi0, uint vi1)
Sets the vertices of the edge.
Definition edge.h:83
Edge()=default
Empty constructor.
void setVertices(VertexType *v0, VertexType *v1)
Sets the vertices of the edge.
Definition edge.h:71
The Element class.
Definition element.h:57
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
A simple structure that wraps a list of variadic templates, without instantiating anything....
Definition type_wrapper.h:41