00001 /*================================================================== 00002 00003 Program: View Generation Toolkit 00004 Module: viewpoints.h 00005 Language: C++ 00006 Date: 2002/05/27 00007 Version: 1.0 00008 00009 ===================================================================*/ 00010 00011 #ifndef __VIEWPOINTS_H__ 00012 #define __VIEWPOINTS_H__ 00013 00014 00015 // The following class is the collection of views about a 00016 // sphere in a spherical coordinates (phi, theta). 00017 // 00018 class CViewPoints 00019 { 00020 protected: 00021 // Array containing spherical coordinates of the view 00022 // 00023 int num; 00024 float* phi; float* theta; 00025 int mLevel; 00026 00027 public: 00028 00029 // Initializes the points about the sphere 00030 // 00031 CViewPoints(); 00032 CViewPoints(int n); 00033 ~CViewPoints(); 00034 00035 float Phi(int ind); 00036 float Theta(int ind); 00037 00038 // Returns the number of points in the collection 00039 int Size(); 00040 00041 // Returns the level number 00042 int Level(); 00043 00044 // Returns the pointer to the index list of neightbours. 00045 // All neighbours within range are returned. The range is 00046 // an angle in degrees. The list requires deletion. 00047 // Returns NULL if error occured 00048 // 00049 virtual int* GetNeighbours(int ind, double range, int& n); 00050 00051 // Returns the pointer to the index list of neightbours. 00052 // n closest neighbours are returned, The list requires 00053 // deletion. Returns NULL if error occured 00054 // 00055 virtual int* GetNeighbours(int ind, int n); 00056 00057 // Computes the view points about a sphere 00058 // 00059 virtual void ComputePoints() {}; 00060 protected: 00061 // Allocates memory for points 00062 // Remark: There is no check to see if memory alreafy allocated 00063 void AllocatePoints(int n); 00064 00065 // Sends the exception and destroys the class 00066 void Abort(); 00067 }; 00068 00069 // This is a derived class from CViewPoints that manages 00070 // the points on a sphere obtained by splitting octahedron 00071 class COctahedronPoints : public CViewPoints 00072 { 00073 public: 00074 COctahedronPoints(int n); 00075 00076 void ComputePoints(); 00077 }; 00078 00079 00080 #endif
1.2.18