00001 #include "vuSphLfFlt_Line.h"
00002
00003 template <int SIZE, class TYPE>
00004 vuSphLfFlt_Line<SIZE,TYPE>::vuSphLfFlt_Line(const vuString& filterName)
00005 : vuSphericFilter<SIZE,TYPE>(filterName)
00006 {
00007 }
00008
00009 template <int S, class T> void vuSphLfFlt_Line<S,T>::
00010 calcFilteredViews(vuSphericView<S,T>**& views,dword& count)
00011 {
00012 CHECKNDELETE(views);
00013
00014 dword *idxList = NULL;
00015 count = 2;
00016
00017 if (!getNearestViews(idxList, count)) return;
00018
00019 views = new vuSphericView<S,T>*[count];
00020
00021 for (dword i=0; i<count; i++) {
00022 views[i] = m_volume->getView(idxList[i]);
00023 }
00024 delete [] idxList;
00025 }
00026
00027 template <int SIZE, class TYPE>
00028 void vuSphLfFlt_Line<SIZE,TYPE>::preview(int hint)
00029 {
00030 dword *idxList = NULL;
00031 dword count = 2;
00032
00033 if (!getNearestViews(idxList, count)) return;
00034 if (count == 0) return;
00035
00036 glPointSize(2.0);
00037 glColor3ub(255, 255, 0);
00038
00039 glBegin(GL_LINES);
00040 for (dword i=0; i<count; i++) {
00041 vuVector lookFrom = m_volume->getView(idxList[i])->getLookFrom();
00042 glVertex3f(lookFrom[0], lookFrom[1], lookFrom[2]);
00043 }
00044 glEnd();
00045 }
00046