Wm4Query2TRational.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef WM4QUERY2TRATIONAL_H
00018 #define WM4QUERY2TRATIONAL_H
00019
00020 #include "Wm4FoundationLIB.h"
00021 #include "Wm4Query2.h"
00022 #include "Wm4RVector2.h"
00023
00024 namespace Wm4
00025 {
00026
00027 template <class Real>
00028 class Query2TRational : public Query2<Real>
00029 {
00030 public:
00031
00032
00033 Query2TRational (int iVQuantity, const Vector2<Real>* akVertex);
00034 virtual ~Query2TRational ();
00035
00036
00037 virtual Query::Type GetType () const;
00038
00039
00040
00041 virtual int ToLine (int i, int iV0, int iV1) const;
00042 virtual int ToLine (const Vector2<Real>& rkP, int iV0, int iV1) const;
00043
00044 virtual int ToTriangle (int i, int iV0, int iV1, int iV2) const;
00045 virtual int ToTriangle (const Vector2<Real>& rkP, int iV0, int iV1,
00046 int iV2) const;
00047
00048 virtual int ToCircumcircle (int i, int iV0, int iV1, int iV2) const;
00049 virtual int ToCircumcircle (const Vector2<Real>& rkP, int iV0, int iV1,
00050 int iV2) const;
00051
00052 private:
00053 using Query2<Real>::m_iVQuantity;
00054 using Query2<Real>::m_akVertex;
00055
00056
00057
00058
00059 typedef TRational<4*sizeof(Real)> Rational;
00060 typedef RVector2<4*sizeof(Real)> RVector;
00061 mutable RVector* m_akRVertex;
00062 mutable bool* m_abEvaluated;
00063
00064 void Convert (int iQuantity, int* aiIndex) const;
00065
00066 int ToLine (const RVector& rkRP, int iV0, int iV1) const;
00067 int ToTriangle (const RVector& rkRP, int iV0, int iV1, int iV2) const;
00068 int ToCircumcircle (const RVector& rkRP, int iV0, int iV1, int iV2) const;
00069
00070 static Rational Dot (Rational& rkX0, Rational& rkY0, Rational& rkX1,
00071 Rational& rkY1);
00072
00073 static Rational Det2 (Rational& rkX0, Rational& rkY0, Rational& rkX1,
00074 Rational& rkY1);
00075
00076 static Rational Det3 (Rational& rkX0, Rational& rkY0, Rational& rkZ0,
00077 Rational& rkX1, Rational& rkY1, Rational& rkZ1, Rational& rkX2,
00078 Rational& rkY2, Rational& rkZ2);
00079 };
00080
00081 }
00082
00083 #include "Wm4Query2TRational.inl"
00084
00085 namespace Wm4
00086 {
00087 typedef Query2TRational<float> Query2TRationalf;
00088 typedef Query2TRational<double> Query2TRationald;
00089
00090 }
00091
00092 #endif