File: RNA3D_OpenGLGraphics.hxx

package info (click to toggle)
arb 6.0.6-8
  • links: PTS, VCS
  • area: non-free
  • in suites: sid, trixie
  • size: 66,204 kB
  • sloc: ansic: 394,911; cpp: 250,290; makefile: 19,644; sh: 15,879; perl: 10,473; fortran: 6,019; ruby: 683; xml: 503; python: 53; awk: 32
file content (56 lines) | stat: -rw-r--r-- 1,827 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ============================================================ //
//                                                              //
//   File      : RNA3D_OpenGLGraphics.hxx                       //
//   Purpose   :                                                //
//                                                              //
//   Institute of Microbiology (Technical University Munich)    //
//   http://www.arb-home.de/                                    //
//                                                              //
// ============================================================ //

#ifndef RNA3D_OPENGLGRAPHICS_HXX
#define RNA3D_OPENGLGRAPHICS_HXX

struct ColorRGBf {
    float red, green, blue;
    ColorRGBf() {}
    ColorRGBf(float r, float g, float b) { red = r; green = g; blue = b; }

    bool operator==(ColorRGBf c) {
        if ((red == c.red) && (green == c.green) && (blue == c.blue)) {
            return true;
        }
        else {
            return false;
        }
    }
};

struct OpenGLGraphics {
    int       screenXmax, screenYmax, mouseX, mouseY;
    bool      displayGrid;
    ColorRGBf ApplicationBGColor;

    OpenGLGraphics();
    virtual  ~OpenGLGraphics();

    void WinToScreenCoordinates(int x, int y, GLdouble  *screenPos);
    void ScreenToWinCoordinates(int x, int y, GLdouble *winPos);

    void PrintString(float x, float y, float z, char *s, void *font);

    void init_font(GLuint base, char* f);
    void print_string(GLuint base, char* s);
    void InitMainFont(char* f);

    void SetOpenGLBackGroundColor();
    ColorRGBf ConvertGCtoRGB(int gc);
    void SetColor(int gc);
    ColorRGBf GetColor(int gc);

    void DrawBox(float x, float y, float width, float height);
};

#else
#error RNA3D_OpenGLGraphics.hxx included twice
#endif // RNA3D_OPENGLGRAPHICS_HXX