The Gnome Chemistry Utils 0.13.3
|
00001 // -*- C++ -*- 00002 00003 /* 00004 * Gnome Chemistry Utils 00005 * gcu/chem3ddoc.h 00006 * 00007 * Copyright (C) 2006-2011 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 00033 namespace gcu { 00034 00045 typedef enum 00046 { 00047 BALL_AND_STICK, 00048 SPACEFILL, 00049 CYLINDERS, 00050 WIREFRAME 00051 } Display3DMode; 00052 00053 class Application; 00054 class Matrix; 00055 00061 class Chem3dDoc: public GLDocument 00062 { 00063 public: 00067 Chem3dDoc (); 00072 Chem3dDoc (Application *App, GLView *View); 00076 virtual ~Chem3dDoc (); 00077 00083 void Draw (Matrix const &m) const; 00084 00088 bool IsEmpty () {return !m_Mol || m_Mol->GetAtomsNumber () == 0;} 00089 00096 void Load (char const *uri, char const *mime_type); 00097 00106 void LoadData (char const *data, char const *mime_type, size_t size = 0); 00107 00113 void OnExportVRML (std::string const &filename); 00114 00118 void Clear (); 00119 00120 private: 00121 Molecule *m_Mol; 00122 00134 GCU_PROP (Display3DMode, Display3D); 00135 }; 00136 00137 } // namespace gcu 00138 00139 #endif // GCU_CHEM3D_DOCUMENT_H