1 // OGL_RIBBON.H : ribbon models for peptides/proteins. 2 3 // Copyright (C) 1998 Tommi Hassinen, Jarno Huuskonen. 4 5 // This package is free software; you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation; either version 2 of the License, or 8 // (at your option) any later version. 9 10 // This package is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 15 // You should have received a copy of the GNU General Public License 16 // along with this package; if not, write to the Free Software 17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 19 /*################################################################################################*/ 20 21 #ifndef OGL_RIBBON_H 22 #define OGL_RIBBON_H 23 24 //#include "ghemicalconfig2.h" 25 26 class ogl_ribbon; 27 28 /*################################################################################################*/ 29 30 class spline; // spline.h 31 32 #include "project.h" 33 34 //#include "ogl_objects.h" 35 #include <oglappth/ogl_camera.h> 36 #include <oglappth/transparent.h> 37 38 #include <ghemical/typedef.h> 39 40 /*################################################################################################*/ 41 42 //#define RIBBON_USE_DISPLSTS // un-comment this to enable use of OpenGL display lists... 43 //^^^^^^^^^^^^^^^^^^^^^^^^^^^ 20090420 ; this seems to have problems : assertion `GTK_WIDGET_REALIZED (widget)' failed 44 45 class ogl_ribbon : 46 public ogl_smart_object 47 { 48 public: 49 50 project * prj; 51 color_mode * cmode; 52 53 i32s extra_points; 54 i32s chn; i32s length; 55 56 fGL * cp1; // control points (three components) 57 fGL * cp2; // control points (three components) 58 59 spline * ref1; 60 fGL * head_refs1[2]; 61 fGL * head_points1; // (three components) 62 fGL * tail_refs1[2]; 63 fGL * tail_points1; // (three components) 64 65 spline * ref2; 66 fGL * head_refs2[2]; 67 fGL * head_points2; // (three components) 68 fGL * tail_refs2[2]; 69 fGL * tail_points2; // (three components) 70 71 fGL * data1; // places of the control points in spline 72 fGL * data2a; // coordinates calculated using the spline (three components) 73 fGL * data2b; // coordinates calculated using the spline (three components) 74 fGL * data3; // colors of the points (three components) 75 76 #ifdef RIBBON_USE_DISPLSTS 77 iGLu list_id; 78 #endif // RIBBON_USE_DISPLSTS 79 80 static const i32s resol; 81 82 static const fGL width; 83 static const fGL helix; 84 85 public: 86 87 ogl_ribbon(project *, color_mode *, i32s, i32s); 88 ~ogl_ribbon(void); 89 90 void UpdateExtraPoints(fGL **, fGL *, fGL **, fGL *); 91 GetObjectName(void)92 const char * GetObjectName(void) { return "ribbon"; } // virtual 93 CameraEvent(const ogl_camera &)94 void CameraEvent(const ogl_camera &) { } // virtual 95 BeginTransformation(void)96 bool BeginTransformation(void) { return false; } // virtual EndTransformation(void)97 bool EndTransformation(void) { return false; } // virtual 98 99 void Render(void); // virtual 100 }; 101 102 /*################################################################################################*/ 103 104 #endif // OGL_RIBBON_H 105 106 // eof 107