00001 // This is a -*- C++ -*- file 00002 //------------------------------------------------------------------------------------// 00003 // // 00004 // Copyright (c) 2001 // 00005 // INRIA // 00006 // 54600 VILLERS LES NANCY // 00007 // France // 00008 // // 00009 //------------------------------------------------------------------------------------// 00010 // // 00011 // * NOTICE OF PROPRIETARY INFORMATION * // 00012 // // 00013 // The information contained in this file is considered proprietary and the exclusive // 00014 // property of INRIA. This information may not be disclosed, duplicated // 00015 // or used, in whole or in part, for any purpose whatsoever without express written // 00016 // authorization from INRIA // 00017 // 00018 #ifndef OC_ATOMS_ELEMENTS_H 00019 00020 #define OC_ATOMS_ELEMENTS_H 00021 00022 #include <string> 00023 #include <fstream> 00024 #include <sstream> 00025 #include <vector> 00026 00027 class atomElement { 00028 public: 00029 atomElement() ; 00030 ~atomElement() ; 00031 // 00032 int getFragmentNumber() ; 00033 // 00034 std::string getFragmentName() const 00035 {return this->_fragName ;} 00036 // 00037 std::string fragmentName() const 00038 {return this->_fragName ;} 00039 // 00040 std::string& fragmentName() 00041 {return this->_fragName ;} 00042 // 00043 std::string getAtomName() const 00044 {return this->_name ;} 00045 std::string getName() const 00046 {return this->_name ;} 00047 // 00048 int number() const 00049 {return _num;} 00050 void set(const int num, const double *pos, const std::string &name, std::string &fragName ); 00051 // 00052 double dist2To(const double *xyz ){ 00053 return (_xyz[0] - xyz[0])*(_xyz[0] - xyz[0]) + (_xyz[1] - xyz[1])*(_xyz[1] - xyz[1]) 00054 + (_xyz[2] - xyz[2])*(_xyz[2] - xyz[2]); 00055 } 00056 double* pos() 00057 { return _xyz ; } 00058 // 00059 void copy(const atomElement &) ; 00060 // 00061 void addXYZ(const double pas[3]) 00062 { _xyz[0] += pas[0] ; _xyz[1] += pas[1] ;_xyz[2] += pas[2] ;} 00063 // 00064 bool read(std::stringstream & sline) ; 00065 //-------------------------------------------------------------// 00066 // Public Data : 00067 //-------------------------------------------------------------// 00068 int _num ; 00069 double _xyz[3] ; 00070 std::string _name ; 00071 std::string _fragName ; 00072 std::vector<int> _connect ; 00073 } ; 00074 00075 00076 00077 00078 class DCatomElement : public atomElement { 00079 public: 00080 DCatomElement() ; 00081 ~DCatomElement() ; 00082 // 00083 std::string markName() const 00084 {return this->_markName ;} 00085 // 00086 std::string& markName() 00087 {return this->_markName ;} 00088 // 00089 int numberOfMySubdomain() const 00090 {return _myNum;} 00091 // 00092 int& numberOfMySubdomain() 00093 {return _myNum;} 00094 // 00095 void copy(const DCatomElement &) ; 00096 // 00097 bool read(std::stringstream & sline, const std::string & mark) ; 00098 //-------------------------------------------------------------// 00099 // Public Data : 00100 //-------------------------------------------------------------// 00101 int _myNum ; 00102 std::string _markName ; 00103 } ; 00104 00105 #endif