4 #ifndef U3D_CURVATURE_TRIANGLED_SURFACE_HPP_
5 #define U3D_CURVATURE_TRIANGLED_SURFACE_HPP_
7 #include "u3d_triangled_abstract_surface.hpp"
8 #include <mth/u3d_box.hpp>
34 double minTriangleSide
43 virtual bool removePoint(
int i);
44 virtual void movePoint(
int i,
double d1,
double d2,
double d3);
46 virtual U3dBox getBox()
const {
return m_box; };
59 bool checkCurvature(
const double& dp,
const double& dq,
const double& up,
const double& uq);
60 ~
CurvaturePlate() {
for (
unsigned i=0; i<n; ++i)
delete[] curvatures[i];
delete[] curvatures; };
61 double getMinCurv() {
return minCurv; };
62 double getMaxCurv() {
return maxCurv; };
70 double minCurv, maxCurv;
74 virtual void triangulate();
77 PQ_Point(
double p_,
double q_) : p(p_), q(q_) {};
84 typedef vector<PQ_Point> pq_points_vector;
88 inline int add_point(
const double& p,
const double& q);
89 inline double p(
const int& num) {
return pq_points[num].p; };
90 inline double q(
const int& num) {
return pq_points[num].q; };
94 pq_points_vector pq_points;
102 QuadMapCoords(
int level_,
int i_,
int j_) : level(level_), i(i_), j(j_) {};
106 QuadMapCoords& up() { --level; i /= 2; j /= 2;
return *
this; };
107 QuadMapCoords& down() { ++level; i *= 2; j *= 2;
return *
this; };
115 enum Placement {UP, RIGHT, DOWN, LEFT};
118 Point(
int number, Placement p) : ndx(number), placement(p) {};
121 inline bool operator==(
const Point& other)
const {
return ndx == other.ndx && placement == other.placement; };
126 inline bool operator()(
const Point& p1,
const Point& p2);
129 typedef set<Point, PointComparator> QPoints;
131 Quad(
int vul,
int vur,
int vdr,
int vdl);
133 void add_points(
const QPoints& ps,
const Placement& p);
135 QPoints get_points(
const Placement& p)
const;
137 const QPoints& points()
const {
return qpoints; };
138 const vector<Point>& angles()
const {
return qangles; };
141 vector<Point> qangles;
151 typedef set<Quad::Point, TrigPointComparator> QTrigPoints;
154 typedef map<QuadMapCoords, Quad, QuadMapCoords> QuadMap;
155 typedef vector<QuadMap> QuadMapVector;
162 QuadMapVector quadMapVector;
169 double minTriangleSide;
171 double sqr_minTrSide;
175 void make_quads(
QuadMapCoords cmc,
double dp,
double dq,
double up,
double uq,
176 int vul,
int vur,
int vdr,
int vdl);
179 Quad::QPoints get_neighbour_points(
QuadMapCoords cmc,
const Quad::Placement& p);
180 inline int get_neighbour_point(
QuadMapCoords cmc,
const Quad::Placement& p);
182 vector<int> max_coords;
191 double minX, minY, minZ;
192 double maxX, maxY, maxZ;
198 #endif // U3D_CURVATURE_TRIANGLED_SURFACE_HPP_
Definition: u3d_math_abstract_surface.hpp:11
Definition: u3d_curvature_triangled_surface.hpp:100
Definition: u3d_triangled_abstract_surface.hpp:31
Definition: u3d_curvature_triangled_surface.hpp:145
Definition: u3d_curvature_triangled_surface.hpp:125
Definition: u3d_box.hpp:24
Definition: u3d_curvature_triangled_surface.hpp:27
Definition: u3d_curvature_triangled_surface.hpp:76
Definition: u3d_curvature_triangled_surface.hpp:117
Definition: u3d_point.hpp:16
Definition: u3d_curvature_triangled_surface.hpp:112
Definition: u3d_curvature_triangled_surface.hpp:83
Definition: u3d_curvature_triangled_surface.hpp:54
Definition: u3d_curvature_triangled_surface.hpp:21