The Gnome Chemistry Utils 0.12.9
|
00001 // -*- C++ -*- 00002 00003 /* 00004 * Gnome Chemistry Utils 00005 * gcu/chem3ddoc.h 00006 * 00007 * Copyright (C) 2006-2008 Jean Bréfort <jean.brefort@normalesup.org> 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License as 00011 * published by the Free Software Foundation; either version 2 of the 00012 * License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00022 * USA 00023 */ 00024 00025 #ifndef GCU_CHEM3D_DOCUMENT_H 00026 #define GCU_CHEM3D_DOCUMENT_H 00027 00028 #include <gcu/macros.h> 00029 #include <gcu/gldocument.h> 00030 #include <gcu/molecule.h> 00031 #include <openbabel/mol.h> 00032 00034 namespace gcu { 00035 00046 typedef enum 00047 { 00048 BALL_AND_STICK, 00049 SPACEFILL, 00050 CYLINDERS, 00051 WIREFRAME 00052 } Display3DMode; 00053 00054 class Application; 00055 class Matrix; 00056 00062 class Chem3dDoc: public GLDocument 00063 { 00064 public: 00068 Chem3dDoc (); 00073 Chem3dDoc (Application *App, GLView *View); 00077 virtual ~Chem3dDoc (); 00078 00084 void Draw (Matrix const &m) const; 00085 00089 bool IsEmpty () {return !m_Mol || m_Mol->GetAtomsNumber () == 0;} 00090 00097 void Load (char const *uri, char const *mime_type); 00098 00105 void LoadData (char const *data, char const *mime_type); 00106 00112 void OnExportVRML (std::string const &filename); 00113 00117 void Clear (); 00118 00119 private: 00120 Molecule *m_Mol; 00121 00133 GCU_PROP (Display3DMode, Display3D); 00134 }; 00135 00136 } // namespace gcu 00137 00138 #endif // GCU_CHEM3D_DOCUMENT_H