NCBI C++ ToolKit
Macros | Functions | Variables
opengl_renderer.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbistd.hpp>
#include <corelib/ncbitime.hpp>
#include <corelib/ncbiobj.hpp>
#include <corelib/ncbi_limits.h>
#include <math.h>
#include <stdlib.h>
#include <objects/cn3d/Cn3d_GL_matrix.hpp>
#include <objects/cn3d/Cn3d_vector.hpp>
#include "remove_header_conflicts.hpp"
#include "opengl_renderer.hpp"
#include "structure_window.hpp"
#include "cn3d_glcanvas.hpp"
#include "structure_set.hpp"
#include "style_manager.hpp"
#include "messenger.hpp"
#include "cn3d_tools.hpp"
#include "cn3d_colors.hpp"
+ Include dependency graph for opengl_renderer.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define GL_ENUM_TYPE   GLenum
 
#define GL_INT_TYPE   GLint
 
#define GL_DOUBLE_TYPE   GLdouble
 
#define USE_MY_GLU_QUADS   1
 
#define MAC_GL_SETCOLOR
 
#define GLU_DISK(q, i, o, s, l)   MyGluDisk((i), (o), (s), (l))
 
#define GLU_CYLINDER(q, b, t, h, l, k)   MyGluCylinder((b), (t), (h), (l), (k))
 
#define GLU_SPHERE(q, r, l, k)   MyGluSphere((r), (l), (k))
 
#define MIN_CAMERA_ANGLE   0.001
 
#define MAX_CAMERA_ANGLE   (0.999 * PI)
 
#define SWAPPTR(p1, p2)   tmp=(p1); (p1)=(p2); (p2)=tmp
 

Functions

 USING_SCOPE (objects)
 
static double DegreesToRad (double deg)
 
static double RadToDegrees (double rad)
 
static void Matrix2GL (const Matrix &m, GLdouble *g)
 
static void GL2Matrix (GLdouble *g, Matrix *m)
 
static void DoCylinderPlacementTransform (const Vector &a, const Vector &b, double length)
 

Variables

 USING_NCBI_SCOPE
 
static const double PI = acos(-1.0)
 
static const unsigned int ALL_FRAMES = kMax_UInt
 
static const int pickBufSize = 1024
 
static GLuint selectBuf [pickBufSize]
 
static const GLfloat Color_Off [4] = { 0.0f, 0.0f, 0.0f, 1.0f }
 
static const GLfloat Color_MostlyOff [4] = { 0.05f, 0.05f, 0.05f, 1.0f }
 
static const GLfloat Color_MostlyOn [4] = { 0.95f, 0.95f, 0.95f, 1.0f }
 
static const GLfloat Color_On [4] = { 1.0f, 1.0f, 1.0f, 1.0f }
 
static const GLfloat Color_Specular [4] = { 0.5f, 0.5f, 0.5f, 1.0f }
 
static const GLint Shininess = 40
 
static int atomSlices
 
static int atomStacks
 
static int bondSides
 
static int wormSides
 
static int wormSegments
 
static int helixSides
 
static bool highlightsOn
 
static string projectionType
 
static const GLdouble origin [] = { 0.0, 0.0, 0.0 }
 
static const GLdouble unitZ [] = { 0.0, 0.0, 1.0 }
 

Macro Definition Documentation

◆ GL_DOUBLE_TYPE

#define GL_DOUBLE_TYPE   GLdouble

Definition at line 65 of file opengl_renderer.cpp.

◆ GL_ENUM_TYPE

#define GL_ENUM_TYPE   GLenum

Definition at line 63 of file opengl_renderer.cpp.

◆ GL_INT_TYPE

#define GL_INT_TYPE   GLint

Definition at line 64 of file opengl_renderer.cpp.

◆ GLU_CYLINDER

#define GLU_CYLINDER (   q,
  b,
  t,
  h,
  l,
 
)    MyGluCylinder((b), (t), (h), (l), (k))

Definition at line 213 of file opengl_renderer.cpp.

◆ GLU_DISK

#define GLU_DISK (   q,
  i,
  o,
  s,
 
)    MyGluDisk((i), (o), (s), (l))

Definition at line 161 of file opengl_renderer.cpp.

◆ GLU_SPHERE

#define GLU_SPHERE (   q,
  r,
  l,
 
)    MyGluSphere((r), (l), (k))

Definition at line 256 of file opengl_renderer.cpp.

◆ MAC_GL_SETCOLOR

#define MAC_GL_SETCOLOR

Definition at line 98 of file opengl_renderer.cpp.

◆ MAX_CAMERA_ANGLE

#define MAX_CAMERA_ANGLE   (0.999 * PI)

◆ MIN_CAMERA_ANGLE

#define MIN_CAMERA_ANGLE   0.001

◆ SWAPPTR

#define SWAPPTR (   p1,
  p2 
)    tmp=(p1); (p1)=(p2); (p2)=tmp

◆ USE_MY_GLU_QUADS

#define USE_MY_GLU_QUADS   1

Definition at line 85 of file opengl_renderer.cpp.

Function Documentation

◆ DegreesToRad()

static double DegreesToRad ( double  deg)
inlinestatic

Definition at line 108 of file opengl_renderer.cpp.

References PI.

Referenced by OpenGLRenderer::NewView(), and OpenGLRenderer::ResetCamera().

◆ DoCylinderPlacementTransform()

static void DoCylinderPlacementTransform ( const Vector a,
const Vector b,
double  length 
)
static

Definition at line 1400 of file opengl_renderer.cpp.

References a, b, fabs, and RadToDegrees().

Referenced by OpenGLRenderer::DrawHalfBond(), and OpenGLRenderer::DrawHelix().

◆ GL2Matrix()

static void GL2Matrix ( GLdouble *  g,
Matrix m 
)
static

◆ Matrix2GL()

static void Matrix2GL ( const Matrix m,
GLdouble *  g 
)
static

Definition at line 139 of file opengl_renderer.cpp.

References g(), and Matrix< T >::m.

Referenced by OpenGLRenderer::PushMatrix().

◆ RadToDegrees()

static double RadToDegrees ( double  rad)
inlinestatic

◆ USING_SCOPE()

USING_SCOPE ( objects  )

Variable Documentation

◆ ALL_FRAMES

const unsigned int ALL_FRAMES = kMax_UInt
static

◆ atomSlices

int atomSlices
static

◆ atomStacks

int atomStacks
static

◆ bondSides

int bondSides
static

Definition at line 131 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Construct(), and OpenGLRenderer::DrawHalfBond().

◆ Color_MostlyOff

const GLfloat Color_MostlyOff[4] = { 0.05f, 0.05f, 0.05f, 1.0f }
static

Definition at line 124 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::SetColor().

◆ Color_MostlyOn

const GLfloat Color_MostlyOn[4] = { 0.95f, 0.95f, 0.95f, 1.0f }
static

Definition at line 125 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Init().

◆ Color_Off

const GLfloat Color_Off[4] = { 0.0f, 0.0f, 0.0f, 1.0f }
static

Definition at line 123 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Init(), and OpenGLRenderer::SetColor().

◆ Color_On

const GLfloat Color_On[4] = { 1.0f, 1.0f, 1.0f, 1.0f }
static

Definition at line 126 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Init().

◆ Color_Specular

const GLfloat Color_Specular[4] = { 0.5f, 0.5f, 0.5f, 1.0f }
static

Definition at line 127 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::SetColor().

◆ helixSides

int helixSides
static

Definition at line 131 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Construct(), and OpenGLRenderer::DrawHelix().

◆ highlightsOn

bool highlightsOn
static

Definition at line 132 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Construct(), and OpenGLRenderer::SetColor().

◆ origin

const GLdouble origin[] = { 0.0, 0.0, 0.0 }
static

◆ PI

const double PI = acos(-1.0)
static

◆ pickBufSize

const int pickBufSize = 1024
static

Definition at line 119 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::GetSelected().

◆ projectionType

string projectionType
static

Definition at line 133 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Construct(), and OpenGLRenderer::NewView().

◆ selectBuf

GLuint selectBuf[pickBufSize]
static

Definition at line 120 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::GetSelected().

◆ Shininess

const GLint Shininess = 40
static

Definition at line 128 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Init().

◆ unitZ

const GLdouble unitZ[] = { 0.0, 0.0, 1.0 }
static

Definition at line 159 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::MyGluDisk(), and OpenGLRenderer::MyGluSphere().

◆ USING_NCBI_SCOPE

USING_NCBI_SCOPE

Definition at line 78 of file opengl_renderer.cpp.

◆ wormSegments

int wormSegments
static

Definition at line 131 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Construct(), and OpenGLRenderer::DrawHalfWorm().

◆ wormSides

int wormSides
static

Definition at line 131 of file opengl_renderer.cpp.

Referenced by OpenGLRenderer::Construct(), and OpenGLRenderer::DrawHalfWorm().

Modified on Wed Apr 17 13:09:58 2024 by modify_doxy.py rev. 669887