QEM_Quadric.h

Go to the documentation of this file.
00001 
00011 #pragma once
00012 
00013 #include "MatrixTypes.h"
00014 
00015 #pragma warning (push, 3)
00016 #include <vector>
00017 #pragma warning (pop)
00018 
00019 // sometimes, we want to be able to easily inherit assignment and 
00020 // copy construction from our parent.
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 // Quadric: This is a 4x4 symmetrical matrix, which serves to help
00029 // measure the cost of a potential collapse, using the Quadric Error
00030 // Metric.
00031 
00032 class Quadric : public SymmetricMatrix4x4
00033 {
00034     public:
00035 
00036             // constructors
00037             Quadric() {} 
00038             INHERIT_EQUALITY (Quadric, SymmetricMatrix4x4, SymmetricMatrix4x4);
00039             INHERIT_EQUALITY (Quadric, SymmetricMatrix4x4, Matrix4x4);
00040 
00041             // accessors
00042             bool   getOptimumPoint (Vertex &v) const;
00043             double getCost (Vertex &v) const;
00044 };
00045 
00046 
00047 
00048 // -------------------------------------------------------------------
00049 // VertexQuadric: A vertex with a quadric glued on.
00050 
00051 class VertexQuadric : public Vertex
00052 {
00053     public:
00054             // constructor
00055             VertexQuadric (mfloat x, mfloat y, mfloat z);
00056 
00057             // member variables
00058             Quadric quadric;
00059 };
00060 
00061 
00062 typedef std::vector< VertexQuadric > VertexArray;
00063 typedef std::vector< Quadric > QuadricArray;

Generated on Tue May 21 03:34:51 2002 for Archimedes by doxygen1.2.15