00001 #include "vuSphLfFlt_BestMatch.h"
00002 #include <GL/gl.h>
00003
00004 template <int S, class T>
00005 vuSphLfFlt_BestMatch<S,T>::vuSphLfFlt_BestMatch(const vuString& filterName)
00006 : vuSphericFilter<S,T>(filterName)
00007 {
00008 }
00009
00010 template <int S, class T> void vuSphLfFlt_BestMatch<S,T>::
00011 calcFilteredViews(vuSphericView<S,T>**& views,dword& count)
00012 {
00013 dword *idxList = NULL;
00014
00015 CHECKNDELETE(views);
00016 count = 1;
00017
00018 if (!getNearestViews(idxList, count)) {
00019 CHECKNDELETE(idxList);
00020 count = 0;
00021 return log("vuSphLfFlt_BestMatch.filter(): no view found");
00022 }
00023
00024 if (count == 0) {
00025 CHECKNDELETE(idxList);
00026 count = 0;
00027 return log("vuSphLfFlt_BestMatch.filter(): no view found");
00028 }
00029
00030 count = 1;
00031 views = new vuSphericView<S,T>*[count];
00032 views[0] = m_volume->getView(idxList[0]);
00033 CHECKNDELETE(idxList);
00034 }
00035
00036 template <int S, class T> void vuSphLfFlt_BestMatch<S,T>::preview(int hint)
00037 {
00038 dword *idxList = NULL;
00039 dword count = 1;
00040
00041 cerr << "+" << endl;
00042 if (!getNearestViews(idxList, count)) return;
00043 if (count == 0) return;
00044
00045 vuVector lookFrom = m_volume->getView(idxList[0])->getLookFrom();
00046
00047 glPointSize(5.0);
00048 glColor3ub(255, 255, 0);
00049
00050 glBegin(GL_POINTS);
00051 glVertex3f(lookFrom[0], lookFrom[1], lookFrom[2]);
00052 glEnd();
00053 }