00001 //====================================================================== 00028 //====================================================================== 00029 00030 #ifndef SIMPLEVECTOR_H_ 00031 #define SIMPLEVECTOR_H_ 00032 00033 #include "sdhlibrary_settings.h" 00034 00035 #if SDH_USE_VCC 00036 # pragma warning(disable : 4290) 00037 #endif 00038 00039 //---------------------------------------------------------------------- 00040 // System Includes - include with <> 00041 //---------------------------------------------------------------------- 00042 00043 00044 //---------------------------------------------------------------------- 00045 // Project Includes - include with "" 00046 //---------------------------------------------------------------------- 00047 00048 #include "sdhexception.h" 00049 00050 //---------------------------------------------------------------------- 00051 // Defines, enums, unions, structs, 00052 //---------------------------------------------------------------------- 00053 00054 NAMESPACE_SDH_START 00055 00056 00057 //---------------------------------------------------------------------- 00058 // Global variables 00059 //---------------------------------------------------------------------- 00060 00061 00062 //---------------------------------------------------------------------- 00063 // Function implementation (function definitions) 00064 //---------------------------------------------------------------------- 00065 00066 00067 //---------------------------------------------------------------------- 00068 // Class declarations 00069 //---------------------------------------------------------------------- 00070 00074 class cSimpleVectorException: public cSDHLibraryException 00075 { 00076 public: 00077 cSimpleVectorException( cMsg const & _msg ) 00078 : cSDHLibraryException( "cSimpleVectorException", _msg ) 00079 {} 00080 }; 00081 //====================================================================== 00082 00083 00085 00091 class cSimpleVector 00092 { 00093 public: 00095 enum 00096 { 00097 eNUMBER_OF_ELEMENTS = 7 00098 }; 00099 00101 cSimpleVector() 00102 throw (cSimpleVectorException*); 00103 00104 00106 cSimpleVector( int _nb_values, char const* str ) 00107 throw (cSimpleVectorException*); 00108 00109 00111 cSimpleVector( int _nb_values, int start_index, char const* str ) 00112 throw (cSimpleVectorException*); 00113 00114 00116 void FromString( int nb_values, int start_index, char const* str ) 00117 throw (cSimpleVectorException*); 00118 00119 00121 double& operator[]( unsigned int index ); 00122 00123 00125 double& x(void); 00126 00127 00129 double& y(void); 00130 00131 00133 double& z(void); 00134 00136 bool Valid( unsigned int index ) const; 00137 00138 protected: 00139 00140 double value[ eNUMBER_OF_ELEMENTS ]; 00141 00143 int valid; 00144 00145 }; // cSimpleVector 00146 //----------------------------------------------------------------- 00147 00148 NAMESPACE_SDH_END 00149 00150 #endif 00151 00152 00153 //====================================================================== 00154 /* 00155 Here are some settings for the emacs/xemacs editor (and can be safely ignored): 00156 (e.g. to explicitely set C++ mode for *.h header files) 00157 00158 Local Variables: 00159 mode:C++ 00160 mode:ELSE 00161 End: 00162 */ 00163 //======================================================================