newTools.h

Go to the documentation of this file.
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_NEWTOOLS_H
00019 
00020 #define OC_NEWTOOLS_H
00021 //
00022 #include <vector>
00023 #include  <cmath>
00024 //
00025 #include "Atoms.h"
00026 
00027 bool skipString(std::ifstream &data, const std::string &keyword) ;
00028 
00029 int  giveNumberOfOA(const std::string & atom) ;
00030 
00031 inline std::string convertToString(const int n){
00032   std::stringstream  s ;
00033   std::string        sn ;
00034   s << n ; s >> sn ;
00035   return sn ; 
00036 }
00037 inline int posAtomInString(std::string &atomName)
00038 {
00039   int pos = 0 ;
00040   std::stringstream s ; int val = -1;
00041   s << atomName[0] ; s >> val ;
00042   if( val >= 0 && val <= 9 ) 
00043     {pos = 1; }
00044 
00045   return pos ;
00046 }
00047 
00048   //
00049 void renumLinear(setOfAtoms   & atomsSet, std::vector<int>& newNumerotation ) ;
00050 //
00051 //
00052 //
00053 
00054 void sortInFirstDimension(setOfAtoms& atoms, std::vector<int>&  newNum) ;
00055 
00056 void readPartitionAndSetColor(std::ifstream& part, std::vector<std::string>& color) ;
00057 
00058 
00059 inline double distance(double * P1, double * P2 )
00060 {
00061   double dist  ;
00062   dist = 0.0 ;
00063   for( int i = 0 ; i < 3 ; ++i) { 
00064     dist += (P1[i] - P2[i])* (P1[i] - P2[i]) ;}
00065   return sqrt(dist) ;
00066 }
00067 #endif
00068  

Generated on Sat Jan 28 21:07:25 2006 for QC++ by  doxygen 1.4.4