4 #ifndef U3D_CURVATURE_TRIANGLED_SURFACE_HPP_
5 #define U3D_CURVATURE_TRIANGLED_SURFACE_HPP_
7 #include "u3d_triangled_abstract_surface.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; };
53 friend class CurvaturePlate;
54 class CurvaturePlate {
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; };
64 CurvaturePlate(
const CurvaturePlate&) {};
65 void operator=(
const CurvaturePlate&) {};
70 double minCurv, maxCurv;
74 virtual void triangulate();
77 PQ_Point(
double p_,
double q_) : p(p_), q(q_) {};
82 friend class PointsKeeper;
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; };
92 PointsKeeper(
const PointsKeeper&) {};
94 pq_points_vector pq_points;
100 struct QuadMapCoords {
101 QuadMapCoords() : level(0), i(0), j(0) {};
102 QuadMapCoords(
int level_,
int i_,
int j_) : level(level_), i(i_), j(j_) {};
103 inline bool operator() (
const QuadMapCoords& c1,
const QuadMapCoords& c2);
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; };
125 struct PointComparator {
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; };
145 struct TrigPointComparator {
146 TrigPointComparator(PointsKeeper* p) : pKeeper(p) {};
147 bool operator()(
const Quad::Point&,
const Quad::Point&);
149 PointsKeeper* pKeeper;
151 typedef set<Quad::Point, TrigPointComparator> QTrigPoints;
154 typedef map<QuadMapCoords, Quad, QuadMapCoords> QuadMap;
159 bool checkUpCoord(QuadMapCoords cmc);
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);
184 PointsKeeper pKeeper;
186 CurvaturePlate curvPlate;
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_triangled_abstract_surface.hpp:31
Definition: u3d_box.hpp:24
Definition: u3d_curvature_triangled_surface.hpp:27
Definition: u3d_point.hpp:16
Definition: u3d_defines.hpp:188
Definition: u3d_curvature_triangled_surface.hpp:21