Some construction methods of Weighted_point_3 are erroneous
Issue Details
The constructor of Kernel::Weighted_point_3 and the construction of weighted points using the constructor object are missing a few things; see the simple program below.
Evidently, the statements on lines 67 and 86 in the file Weighted_point_3.h are missing the argument '0' that initializes the weight in case it is not provided, but these are not the only errors....
Source Code
#include <CGAL/Cartesian.h>
int main() {
CGAL::Cartesian<double> kernel;
auto ctr = kernel.construct_weighted_point_3_object();
auto w4 = ctr(0, 0, 0, 1);
CGAL::Cartesian<double>::Weighted_point_3 w3(0, 0, 0, 1);
CGAL::Cartesian<double>::Weighted_point_3 w1(CGAL::ORIGIN);
CGAL::Cartesian<double>::Weighted_point_3 w2(0, 0, 0);
return 0;
}
Environment
- Operating system (Windows/Mac/Linux, 32/64 bits):
- Compiler:
- Release or debug mode:
- Specific flags used (if any):
- CGAL version: latest (6.0)
- Boost version:
- Other libraries versions if used (Eigen, TBB, etc.):
Evidently, the statements on lines 67 and 86 in the file Weighted_point_3.h are missing the argument '0' that initializes the weight in case it is not provided, but these are not the only errors....
There is no need to specify the weight in those lines, the functor will initialize the weight.
The constructor of Kernel::Weighted_point_3 and the construction of weighted points using the constructor object are missing a few things; see the simple program below.
The constructor with 4 FT is the one "missing" and it doesn't exist because it's dangerous: it isn't clear whether it's 3 coordinates + w, or 3 coordinates + hw.
https://doc.cgal.org/latest/Kernel_23/classKernel_1_1ConstructWeightedPoint__3.html is what is currently required (and the default CGAL model offers a little more: https://doc.cgal.org/latest/Kernel_23/classCGAL_1_1Weighted__point__3.html).
@efifogel do you agree? It makes probably no sense to document private or non-existing constructors.