| | 1 | = Graphics API = |
| | 2 | |
| | 3 | The Chimera 2 graphics API enables rendering of molecules and density maps. Here is some info on how Hydra is providing these interfaces. |
| | 4 | |
| | 5 | Here are the Python classes in the Hydra graphics module (taken from graphics/__init__.py) that are used by other modules: |
| | 6 | |
| | 7 | * Drawing |
| | 8 | * View |
| | 9 | * Camera |
| | 10 | * Lighting |
| | 11 | * Material |
| | 12 | * Texture |
| | 13 | * Pick |
| | 14 | * Cross_Fade |
| | 15 | * Motion_Blur |
| | 16 | |
| | 17 | These classes handle representing the scene, rendering it, and selecting parts of it. The "scene graph" is the geometric shapes, colors and transparency including hierarchy and instancing, all handled by the Drawing class. A Drawing can have any number of child Drawings, to any depth, in a tree. Some classes handle the rendering (View, Camera, Lighting, Cross_Fade, Motion_Blur) including effects like silhouette edges, shadows, cross fades, and also camera modes like mono, shutter glasses stereo, or oculus rift. Selecting objects using a mouse click is handled by View and Drawing. |
| | 18 | |
| | 19 | The Hydra graphics module also has many private classes like Render, Shader, Framebuffer, Bindings, ... that are lower level OpenGL Python classes. Those are not used outside the graphics module currently. |
| | 20 | |
| | 21 | The API classes above have a total of about 170 methods and there are about 110 private methods and functions. I didn't make a distinction between private and public methods so maybe many of those 170 methods of public classes are in fact private. The public classes also have many attributes (maybe 50 total) that are public in the current Hydra design. So this graphics module is pretty complex (3400 lines of Python, 280 lines of OpenGL shader code). |
| | 22 | |
| | 23 | A first step to see how much complexity there is in the public interfaces is to mark all the private methods with leading underscores. |
| | 24 | |
| | 25 | To get a uniform style some decision should be made about when public class attributes (or properties) are used and when methods are used. It is a mish mash in Hydra. |