Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Quadric3.hh
1 /*
2  * Quadric3.hh
3  *
4  * Created on: Aug 19, 2008
5  * Author: bangerer
6  */
7 
8 #ifndef __BIAS_QUADRIC3_HH__
9 #define __BIAS_QUADRIC3_HH__
10 
11 #include "bias_config.h"
12 #include <Base/Math/Matrix3x3.hh>
13 #include <Base/Math/Matrix4x4.hh>
14 #include <Base/Math/Vector3.hh>
15 
16 #include <Base/Debug/Error.hh>
17 
18 namespace BIAS {
19 
20  /** @class Quadric3
21  @brief Implements a 3D quadric and quadric operations.
22  @author bangerer
23  @date 19/08/2008
24  */
25  class BIASMathBase_EXPORT Quadric3
26  {
27  public:
28 
29  Quadric3(double a, double b, double c, double d, double area = 1.0);
30 
31  Quadric3(){Clear();};
32 
33  Matrix3x3<double> GetTensor();
34  Vector3<double> GetVector();
35  double GetOffset(){return d2;};
36  double GetArea(){return r;};
37 
38  Matrix4x4<double> GetHomogenous();
39 
40  double Evaluate(double x, double y, double z);
41 
42  void Clear(double val=0.0) { a2=ab=ac=ad=b2=bc=bd=c2=cd=d2=r=val; }
43  bool Optimize(Vector3<double>& v);
44  // some operations
45  Quadric3& operator=(const Quadric3& Q);
46  Quadric3& operator+=(const Quadric3& Q);
47  Quadric3& operator*=(double s);
48 
49  protected:
50  // Variables for the ten quadric coeffizients
51 
52  double a2, ab, ac, ad;
53  double b2, bc, bd;
54  double c2, cd;
55  double d2;
56 
57  // the area for weighting
58  double r;
59 
60  };
61 
62 
63 }
64 
65 #endif /* __BIAS_QUADRIC3_HH__ */
double GetArea()
Definition: Quadric3.hh:36
void Clear(double val=0.0)
Definition: Quadric3.hh:42
BIASMathBase_EXPORT Vector2< T > & operator+=(Vector2< T > &vec, const Vector2< T > &argvec)
add operator for two Vectors
Definition: Vector2.hh:830
Vector2< T > & operator*=(Vector2< T > &vec, const T &scalar)
Multiplication operator with scalar argument.
Definition: Vector2.hh:873
double GetOffset()
Definition: Quadric3.hh:35
Implements a 3D quadric and quadric operations.
Definition: Quadric3.hh:25