mirror of https://github.com/CGAL/cgal
Merge pull request #1574 from afabri/Filtered_kernel_init_double_to_avoid_warning-GF
Kernel_23: Initialize numbers in operator>>(istream&, Point/Vector/..)
This commit is contained in:
commit
26c803b6af
|
|
@ -126,16 +126,15 @@ void MdelaunayIpelet::protected_run(int fn)
|
|||
Point_2 pt0_ori1=it->first->vertex(Delaunay::cw(it->second))->info().back();
|
||||
Point_2 pt1_ori0=it->first->vertex(Delaunay::ccw(it->second))->info().front();
|
||||
Point_2 pt1_ori1=it->first->vertex(Delaunay::ccw(it->second))->info().back();
|
||||
Point_2 pt3 = Point_2();
|
||||
|
||||
if(CGAL::compare_xy(pt0_ori0,pt1_ori0)==CGAL::EQUAL || CGAL::compare_xy(pt0_ori1,pt1_ori0)==CGAL::EQUAL)
|
||||
pt3 = pt1_ori1;
|
||||
rt.insert(Weighted_point_2(CGAL::centroid(pt0_ori0,pt0_ori1,pt1_ori1),-CGAL::to_double(CGAL::squared_distance(pt0_ori0,pt0_ori1)+
|
||||
CGAL::squared_distance(pt0_ori0,pt1_ori1)+CGAL::squared_distance(pt1_ori1,pt0_ori1))/9.));
|
||||
else
|
||||
if(CGAL::compare_xy(pt0_ori0,pt1_ori1)==CGAL::EQUAL || CGAL::compare_xy(pt0_ori1,pt1_ori1)==CGAL::EQUAL)
|
||||
pt3 = pt1_ori0;
|
||||
rt.insert(Weighted_point_2(CGAL::centroid(pt0_ori0,pt0_ori1,pt1_ori0),-CGAL::to_double(CGAL::squared_distance(pt0_ori0,pt0_ori1)+
|
||||
CGAL::squared_distance(pt0_ori0,pt1_ori0)+CGAL::squared_distance(pt1_ori0,pt0_ori1))/9.));
|
||||
|
||||
if(pt3!=Point_2()) //if adjacent wpoints comed from a delaunay triangle
|
||||
rt.insert(Weighted_point_2(CGAL::centroid(pt0_ori0,pt0_ori1,pt3),-CGAL::to_double(CGAL::squared_distance(pt0_ori0,pt0_ori1)+
|
||||
CGAL::squared_distance(pt0_ori0,pt3)+CGAL::squared_distance(pt3,pt0_ori1))/9.));
|
||||
}
|
||||
if(fn==2){//Draw 3th Delauney
|
||||
draw_in_ipe(rt);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ template < typename K_base >
|
|||
class Equal_2
|
||||
: public K_base::Equal_2
|
||||
{
|
||||
typedef typename K_base::FT FT;
|
||||
typedef typename K_base::Point_2 Point_2;
|
||||
typedef typename K_base::Vector_2 Vector_2;
|
||||
typedef typename K_base::Equal_2 Base;
|
||||
|
|
@ -68,6 +69,7 @@ public:
|
|||
Get_approx<Point_2> get_approx; // Identity functor for all points
|
||||
// but lazy points
|
||||
double px, py, qx, qy;
|
||||
init_double(px, py,qx, qy, (FT*)(0));
|
||||
|
||||
if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) &&
|
||||
fit_in_double(get_approx(q).x(), qx) && fit_in_double(get_approx(q).y(), qy) )
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ MainWindow::loadEdgConstraints(QString fileName)
|
|||
int n;
|
||||
ifs >> n;
|
||||
|
||||
K::Point_2 p,q, qold;
|
||||
K::Point_2 p,q, qold(0,0); // initialize to avoid maybe-uninitialized warning from GCC6
|
||||
|
||||
CDT::Vertex_handle vp, vq, vqold;
|
||||
while(ifs >> p) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ std::istream&
|
|||
extract(std::istream& is, Circle_2<R>& c)
|
||||
{
|
||||
typename R::Point_2 center;
|
||||
typename R::FT squared_radius;
|
||||
typename R::FT squared_radius(0);
|
||||
int o;
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Direction_2<R>& d, const Cartesian_tag&)
|
||||
{
|
||||
typename R::FT x, y;
|
||||
typename R::FT x(0), y(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(x) >> iformat(y);
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Direction_3<R>& d, const Cartesian_tag&)
|
||||
{
|
||||
typename R::FT x, y, z;
|
||||
typename R::FT x(0), y(0), z(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(x) >> iformat(y) >> iformat(z);
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Line_2<R>& l)
|
||||
{
|
||||
typename R::RT a, b, c;
|
||||
typename R::RT a(0), b(0), c(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(a) >> iformat(b) >> iformat(c);
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ template < class R >
|
|||
std::istream &
|
||||
operator>>(std::istream &is, Plane_3<R> &p)
|
||||
{
|
||||
typename R::RT a, b, c, d;
|
||||
typename R::RT a(0), b(0), c(0), d(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(a) >> iformat(b) >> iformat(c) >> iformat(d);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Point_2<R>& p, const Cartesian_tag&)
|
||||
{
|
||||
typename R::FT x, y;
|
||||
typename R::FT x(0), y(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(x) >> iformat(y);
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Point_3<R>& p, const Cartesian_tag&)
|
||||
{
|
||||
typename R::FT x, y, z;
|
||||
typename R::FT x(0), y(0), z(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(x) >> iformat(y) >> iformat(z);
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ std::istream&
|
|||
extract(std::istream& is, Sphere_3<R>& c, const Cartesian_tag&)
|
||||
{
|
||||
typename R::Point_3 center;
|
||||
typename R::FT squared_radius;
|
||||
typename R::FT squared_radius(0);
|
||||
int o=0;
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Vector_2<R>& v, const Cartesian_tag&)
|
||||
{
|
||||
typename R::FT x, y;
|
||||
typename R::FT x(0), y(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(x) >> iformat(y);
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ template <class R >
|
|||
std::istream&
|
||||
extract(std::istream& is, Vector_3<R>& v, const Cartesian_tag&)
|
||||
{
|
||||
typename R::FT x, y, z;
|
||||
typename R::FT x(0), y(0), z(0);
|
||||
switch(get_mode(is)) {
|
||||
case IO::ASCII :
|
||||
is >> iformat(x) >> iformat(y) >> iformat(z);
|
||||
|
|
|
|||
Loading…
Reference in New Issue