Example #1
0
Sphere& Sphere::setFromPoints( const std::vector<Vector3>& points) {

  auto box = Box3();
  auto center = Vector3();

  box.setFromPoints( points ).center( center );

  return setFromPoints(points, center);

}
Example #2
0
 Circle::Circle(const arma::vec2& a, const arma::vec2& b, const arma::vec2& c, const double tolerance)
     : radius(0.0), radiusSq(0.0), centre(arma::fill::zeros) {
     setFromPoints(std::forward<const arma::vec2&>(a),
                   std::forward<const arma::vec2&>(b),
                   std::forward<const arma::vec2&>(c),
                   tolerance);
 }
Example #3
0
 bool RansacLineModel::regenerate(const std::vector<DataPoint>& pts) {
     if(pts.size() == REQUIRED_POINTS && !arma::all(pts[0] == pts[1])) {
         setFromPoints(pts[0], pts[1]);
         return true;
     }
     else {
         return false;
     }
 }
Example #4
0
        bool RansacCircleModel::regenerate(const std::array<DataPoint, REQUIRED_POINTS>& points) {
            if (points.size() == REQUIRED_POINTS && !arma::all(points[0] == points[1])
                && !arma::all(points[0] == points[2]) && !arma::all(points[1] == points[2])) {
                return setFromPoints(points[0], points[1], points[2], 1.0e-2);
            }

            else {
                return false;
            }
        }
void rspf2dBilinearTransform::setFromPoints(const rspfDpt& in1, const rspfDpt& in2, const rspfDpt& in3, const rspfDpt& in4,
                                             const rspfDpt& out1, const rspfDpt& out2, const rspfDpt& out3, const rspfDpt& out4)
{
   rspfDpt input[4];
   rspfDpt output[4];
   
   input[0] = in1;
   input[1] = in2;
   input[2] = in3;
   input[3] = in4;
   
   output[0] = out1;
   output[1] = out2;
   output[2] = out3;
   output[3] = out4;
   
   setFromPoints(&input[0], &output[0], 4);
}
Example #6
0
Box3& Box3::applyMatrix4(const Matrix4& matrix)
{
    vector<Vector3> points(8);

    // NOTE: I am using a binary pattern to specify all 2^3 combinations below
    points[0].set( mMin.x(), mMin.y(), mMin.z() ).applyMatrix4( matrix ); // 000
    points[1].set( mMin.x(), mMin.y(), mMax.z() ).applyMatrix4( matrix ); // 001
    points[2].set( mMin.x(), mMax.y(), mMin.z() ).applyMatrix4( matrix ); // 010
    points[3].set( mMin.x(), mMax.y(), mMax.z() ).applyMatrix4( matrix ); // 011
    points[4].set( mMax.x(), mMin.y(), mMin.z() ).applyMatrix4( matrix ); // 100
    points[5].set( mMax.x(), mMin.y(), mMax.z() ).applyMatrix4( matrix ); // 101
    points[6].set( mMax.x(), mMax.y(), mMin.z() ).applyMatrix4( matrix ); // 110
    points[7].set( mMax.x(), mMax.y(), mMax.z() ).applyMatrix4( matrix );  // 111

    makeEmpty();
    setFromPoints( points );

    return *this;
}