PLearn 0.1
|
00001 00002 #ifndef Molecule_INC 00003 #define Molecule_INC 00004 00005 00006 #include <plearn/io/load_and_save.h> 00007 #include <plearn/math/TMat_maths.h> 00008 #include <plearn/base/Object.h> 00009 #include "SurfaceMesh.h" 00010 #include "geometry.h" 00011 #include <vector> 00012 00013 #include <string> 00014 00015 namespace PLearn { 00016 00017 class Molecule; 00018 typedef PP< Molecule > PMolecule; 00019 00020 00021 class Molecule : public Object{ 00022 00023 private: 00024 typedef Object inherited; 00025 00026 public: 00027 // int nPoints ; // the number of points on the surface of the molecule 00028 PLearn::Mat chem ; // containts the chemical properties for each point on the surface 00029 PLearn::Mat geom ; // contains the x,y,z position for each point on the surface 00030 string vrml_file ; 00031 00032 Molecule(); 00033 Molecule(PLearn::Mat _chem, PLearn::Mat _geom, string vrml_file="") ; 00034 00035 // virtual ~Molecule() {} 00036 00037 private: 00039 void build_(); 00040 00041 protected: 00043 static void declareOptions(OptionList& ol); 00044 00045 public: 00046 // Declares other standard object methods. 00047 PLEARN_DECLARE_OBJECT(Molecule); 00048 00049 // simply calls inherited::build() then build_() 00050 virtual void build(); 00051 00053 virtual void makeDeepCopyFromShallowCopy(CopiesMap& copies); 00054 00055 00056 00057 00058 static std::string getVrmlType(const std::string& name) ; 00059 static void readVrml(const std::string& name,PLearn::SurfMesh& sm) ; 00060 static void writeVrml(const std::string& name,const std::string& to,PLearn::SurfMesh& sm) ; 00061 static void getVrmlVertexCoords(const std::string& name,PLearn::Mat& xmat) ; 00062 static void readMolecules(const std::string & fileName, std::vector<PMolecule> & storage ) ; 00063 static PMolecule readMolecule(const std::string & fileName) ; 00064 00065 }; 00066 // Declares a few other classes and functions related to this class 00067 DECLARE_OBJECT_PTR(Molecule); 00068 00069 } 00070 00071 00072 #endif