# chem3ddoc.h

Go to the documentation of this file.

    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 <openbabel/mol.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.NumAtoms () == 0;}
    00089
    00096         void Load (char const *uri, char const *mime_type);
    00097
    00104         void LoadData (char const *data, char const *mime_type);
    00105
    00109         const char *GetTitle () {return m_Mol.GetTitle ();}
    00110
    00116         void OnExportVRML (std::string const &filename);
    00117
    00118 private:
    00119         OpenBabel::OBMol m_Mol;
    00120
    00132 GCU_PROP (Display3DMode, Display3D);
    00133 };
    00134
    00135 }       // namespace gcu
    00136
    00137 #endif  //      GCU_CHEM3D_DOCUMENT_H