suanPan
BSplineSurface.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
30#ifndef BSPLINESURFACE_H
31#define BSPLINESURFACE_H
32
33#include "BSpline.h"
34
36protected:
37 const uword dimension;
38
39 field<vec> net;
40
42
43public:
44 explicit BSplineSurface(vec, vec, uword, field<vec>&& = {});
45 BSplineSurface(const BSplineSurface&) = default;
49 virtual ~BSplineSurface() = default;
50
51 void set_control_polygon(field<vec>&&);
52 void set_control_polygon(const field<vec>&);
53
54 [[nodiscard]] field<uvec> get_all_element_span() const;
55 [[nodiscard]] uvec get_number_of_control_points() const;
56
57 [[nodiscard]] vec evaluate_point(double, double) const;
58 [[nodiscard]] field<vec> evaluate_point_derivative(double, double, sword = -1, sword = -1) const;
59
60 [[nodiscard]] mat evaluate_shape_function(double, double) const;
61 [[nodiscard]] field<mat> evaluate_shape_function_derivative(double, double, sword = -1, sword = -1) const;
62
63 [[nodiscard]] virtual vec evaluate_point(double, double, const field<vec>&) const;
64 [[nodiscard]] virtual field<vec> evaluate_point_derivative(double, double, const field<vec>&, sword = -1, sword = -1) const;
65
66 [[nodiscard]] virtual mat evaluate_shape_function(double, double, const field<vec>&) const;
67 [[nodiscard]] virtual field<mat> evaluate_shape_function_derivative(double, double, const field<vec>&, sword = -1, sword = -1) const;
68};
69
70class BSplineSurface2D final : public BSplineSurface {
71public:
72 explicit BSplineSurface2D(vec, vec, field<vec>&& = {});
73};
74
75class BSplineSurface3D final : public BSplineSurface {
76public:
77 explicit BSplineSurface3D(vec, vec, field<vec>&& = {});
78};
79
80class BSplineSurface4D final : public BSplineSurface {
81public:
82 explicit BSplineSurface4D(vec, vec, field<vec>&& = {});
83};
84
85#endif
86
Definition: BSpline.h:44
Definition: BSplineSurface.h:70
BSplineSurface2D(vec, vec, field< vec > &&={})
Definition: BSplineSurface.cpp:151
Definition: BSplineSurface.h:75
BSplineSurface3D(vec, vec, field< vec > &&={})
Definition: BSplineSurface.cpp:154
Definition: BSplineSurface.h:80
BSplineSurface4D(vec, vec, field< vec > &&={})
Definition: BSplineSurface.cpp:157
Definition: BSplineSurface.h:35
BSplineSurface(vec, vec, uword, field< vec > &&={})
Definition: BSplineSurface.cpp:20
const uword dimension
Definition: BSplineSurface.h:37
BSpline line_v
Definition: BSplineSurface.h:41
BSplineSurface & operator=(const BSplineSurface &)=delete
field< vec > net
Definition: BSplineSurface.h:39
BSplineSurface(BSplineSurface &&)=default
virtual ~BSplineSurface()=default
vec evaluate_point(double, double) const
Definition: BSplineSurface.cpp:41
mat evaluate_shape_function(double, double) const
Definition: BSplineSurface.cpp:45
field< vec > evaluate_point_derivative(double, double, sword=-1, sword=-1) const
Definition: BSplineSurface.cpp:43
uvec get_number_of_control_points() const
Definition: BSplineSurface.cpp:39
BSplineSurface(const BSplineSurface &)=default
BSplineSurface & operator=(BSplineSurface &&)=delete
BSpline line_u
Definition: BSplineSurface.h:41
void set_control_polygon(field< vec > &&)
Definition: BSplineSurface.cpp:26
field< mat > evaluate_shape_function_derivative(double, double, sword=-1, sword=-1) const
Definition: BSplineSurface.cpp:47
field< uvec > get_all_element_span() const
Definition: BSplineSurface.cpp:30