00001
00011 #pragma once
00012
00013 #include "MatrixTypes.h"
00014
00015 #pragma warning (push, 3)
00016 #include <vector>
00017 #pragma warning (pop)
00018
00019
00020
00021 #define COPY_FROM(a,b) a::operator=(b)
00022
00023 #define INHERIT_EQUALITY(OurClass, ParentClass, OtherClass) \
00024 OurClass( OtherClass &q) { COPY_FROM(ParentClass,q);} \
00025 void operator=(const OtherClass &q) { COPY_FROM(ParentClass,q);} \
00026
00027
00028
00029
00030
00031
00032 class Quadric : public SymmetricMatrix4x4
00033 {
00034 public:
00035
00036
00037 Quadric() {}
00038 INHERIT_EQUALITY (Quadric, SymmetricMatrix4x4, SymmetricMatrix4x4);
00039 INHERIT_EQUALITY (Quadric, SymmetricMatrix4x4, Matrix4x4);
00040
00041
00042 bool getOptimumPoint (Vertex &v) const;
00043 double getCost (Vertex &v) const;
00044 };
00045
00046
00047
00048
00049
00050
00051 class VertexQuadric : public Vertex
00052 {
00053 public:
00054
00055 VertexQuadric (mfloat x, mfloat y, mfloat z);
00056
00057
00058 Quadric quadric;
00059 };
00060
00061
00062 typedef std::vector< VertexQuadric > VertexArray;
00063 typedef std::vector< Quadric > QuadricArray;