SceneDef.h (pymol-open-source-2.2.0) | : | SceneDef.h (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
Z* ------------------------------------------------------------------- | Z* ------------------------------------------------------------------- | |||
*/ | */ | |||
#ifndef _H_SceneDef | #ifndef _H_SceneDef | |||
#define _H_SceneDef | #define _H_SceneDef | |||
#include"Base.h" | #include"Base.h" | |||
#include"PyMOLObject.h" | #include"PyMOLObject.h" | |||
#include"Ortho.h" | #include"Ortho.h" | |||
#include"View.h" | #include"View.h" | |||
#include"Image.h" | ||||
#include"ScrollBar.h" | ||||
#include<list> | #include<list> | |||
#include<vector> | #include<vector> | |||
#ifdef PURE_OPENGL_ES_2 | #ifdef PURE_OPENGL_ES_2 | |||
# define GLEW_EXT_gpu_shader4 false | # define GLEW_EXT_gpu_shader4 false | |||
# define GLEW_EXT_geometry_shader4 false | # define GLEW_EXT_geometry_shader4 false | |||
# ifdef _WEBGL | # ifdef _WEBGL | |||
# include <emscripten/val.h> | # include <emscripten/val.h> | |||
# define GLEW_EXT_draw_buffers2 !emscripten::val::module_property("ONEBUFFER"). as<bool>() | # define GLEW_EXT_draw_buffers2 !emscripten::val::module_property("ONEBUFFER"). as<bool>() | |||
# else | # else | |||
# define GLEW_EXT_draw_buffers2 false | # define GLEW_EXT_draw_buffers2 false | |||
# endif | # endif | |||
#endif | #endif | |||
#define TM3_IS_ONEBUF !GLEW_EXT_draw_buffers2 | #define TM3_IS_ONEBUF !GLEW_EXT_draw_buffers2 | |||
#define TRN_BKG 0x30 | #define TRN_BKG 0x30 | |||
#define MAX_ANI_ELEM 300 | #define MAX_ANI_ELEM 300 | |||
typedef struct { | struct DeferredMouse : public CDeferred { | |||
CDeferred deferred; | Block *block { nullptr }; | |||
Block *block; | int button { 0 }; | |||
int button; | int x { 0 }; | |||
int x; | int y { 0 }; | |||
int y; | int mod { 0 }; | |||
int mod; | double when { 0.0 }; | |||
double when; | int mode_override { 0 }; | |||
int mode_override; | DeferredMouse(PyMOLGlobals * G) : CDeferred(G){} | |||
} DeferredMouse; | }; | |||
typedef struct { | struct DeferredImage : public CDeferred { | |||
CDeferred deferred; | int width { 0 }; | |||
PyMOLGlobals *G; | int height { 0 }; | |||
int width; | std::string filename; | |||
int height; | int quiet { 0 }; | |||
char *filename; /* NOTE: on heap! must free when done */ | int antialias { 0 }; | |||
int quiet; | float dpi { 0.0f }; | |||
int antialias; | int entire_window { 0 }; | |||
float dpi; | int format { 0 }; | |||
int entire_window; | DeferredImage(PyMOLGlobals * G) : CDeferred(G){} | |||
int format; | }; | |||
} DeferredImage; | ||||
typedef struct { | struct DeferredRay : public CDeferred { | |||
CDeferred deferred; | int ray_width { 0 }; | |||
PyMOLGlobals *G; | int ray_height { 0 }; | |||
int ray_width; | int mode { 0 }; | |||
int ray_height; | float angle { 0.0f }; | |||
int mode; | float shift { 0.0f }; | |||
float angle; | int quiet { 0 }; | |||
float shift; | int show_timing { 0 }; | |||
int quiet; | int antialias { 0 }; | |||
int show_timing; | DeferredRay(PyMOLGlobals * G) : CDeferred(G){} | |||
int antialias; | }; | |||
} DeferredRay; | ||||
typedef struct { | typedef struct { | |||
int len; | int len; | |||
const char *name; | const char *name; | |||
int x1, y1, x2, y2, drawn; | int x1, y1, x2, y2, drawn; | |||
} SceneElem; | } SceneElem; | |||
typedef struct { | typedef struct { | |||
unsigned char *data; | ||||
int size; | ||||
int width, height; | ||||
int stereo; /* indicates data actually contains two back to | ||||
back full-screen images */ | ||||
int needs_alpha_reset; /* needs alpha reset */ | ||||
} ImageType; | ||||
typedef struct { | ||||
float unit_left, unit_right, unit_top, unit_bottom, unit_front, unit_back; | float unit_left, unit_right, unit_top, unit_bottom, unit_front, unit_back; | |||
} SceneUnitContext; | } SceneUnitContext; | |||
typedef struct { | typedef struct { | |||
int n_col; | int n_col; | |||
int n_row; | int n_row; | |||
int first_slot; | int first_slot; | |||
int last_slot; | int last_slot; | |||
float asp_adjust; | float asp_adjust; | |||
int active; | int active; | |||
int size; | int size; | |||
int slot; | int slot; | |||
int mode; | int mode; | |||
GLint cur_view[4]; | GLint cur_view[4]; | |||
GLint cur_viewport_size[2]; | GLint cur_viewport_size[2]; | |||
SceneUnitContext context; /* for whole-window display */ | SceneUnitContext context; /* for whole-window display */ | |||
} GridInfo; | } GridInfo; | |||
class CScene { | class CScene : public Block { | |||
public: | public: | |||
::Block *Block { nullptr }; | ||||
std::list<CObject*> Obj, GadgetObjs, NonGadgetObjs; | std::list<CObject*> Obj, GadgetObjs, NonGadgetObjs; | |||
float RotMatrix[16]; /* WARNING: column major, as per OpenGL spec */ | float RotMatrix[16]; /* WARNING: column major, as per OpenGL spec */ | |||
float InvMatrix[16]; /* WARNING: column major, as per OpenGL spec */ | float InvMatrix[16]; /* WARNING: column major, as per OpenGL spec */ | |||
float PmvMatrix[16]; | float PmvMatrix[16]; | |||
float Scale; | float Scale; | |||
int Width, Height; | int Width, Height; | |||
int Button; | int Button; | |||
int LastX, LastY; | int LastX, LastY; | |||
int StartX, StartY; | int StartX, StartY; | |||
int LastWinX, LastWinY; | int LastWinX, LastWinY; | |||
skipping to change at line 143 | skipping to change at line 134 | |||
float Pos[3], Origin[3]; | float Pos[3], Origin[3]; | |||
float H; | float H; | |||
float Front, Back, FrontSafe, BackSafe; | float Front, Back, FrontSafe, BackSafe; | |||
float TextColor[3]; | float TextColor[3]; | |||
double SweepTime; | double SweepTime; | |||
int DirtyFlag; | int DirtyFlag; | |||
int ChangedFlag; | int ChangedFlag; | |||
int CopyType, CopyNextFlag, CopyForced; | int CopyType, CopyNextFlag, CopyForced; | |||
int NFrame { 0 }; | int NFrame { 0 }; | |||
int HasMovie { 0 }; | int HasMovie { 0 }; | |||
ImageType *Image { nullptr }; | std::shared_ptr<pymol::Image> Image { nullptr }; | |||
int MovieOwnsImageFlag; | ||||
int MovieFrameFlag; | int MovieFrameFlag; | |||
double LastRender, RenderTime, LastFrameTime, LastFrameAdjust; | double LastRender, RenderTime, LastFrameTime, LastFrameAdjust; | |||
double LastSweep, LastSweepTime; | double LastSweep, LastSweepTime; | |||
float LastSweepX, LastSweepY; | float LastSweepX, LastSweepY; | |||
int RockFrame; | int RockFrame; | |||
Picking LastPicked; | Picking LastPicked; | |||
int StereoMode; | int StereoMode; | |||
OrthoLineType vendor, renderer, version; | OrthoLineType vendor, renderer, version; | |||
int SculptingFlag, SculptingSave; | int SculptingFlag, SculptingSave; | |||
int RovingDirtyFlag; | int RovingDirtyFlag; | |||
skipping to change at line 182 | skipping to change at line 172 | |||
float VertexScale; | float VertexScale; | |||
float FogStart; | float FogStart; | |||
float FogEnd; | float FogEnd; | |||
/* Scene Names */ | /* Scene Names */ | |||
int ButtonsShown, ButtonDrag, ButtonMargin, ButtonsValid; | int ButtonsShown, ButtonDrag, ButtonMargin, ButtonsValid; | |||
int Over, Pressed, PressMode, HowFarDown, NSkip; | int Over, Pressed, PressMode, HowFarDown, NSkip; | |||
int ScrollBarActive; | int ScrollBarActive; | |||
int ReorderFlag; | int ReorderFlag; | |||
OrthoLineType ReorderLog; | OrthoLineType ReorderLog; | |||
struct CScrollBar *ScrollBar { nullptr }; | ScrollBar m_ScrollBar; | |||
char *SceneNameVLA { nullptr }; | char *SceneNameVLA { nullptr }; | |||
SceneElem *SceneVLA { nullptr }; | SceneElem *SceneVLA { nullptr }; | |||
int NScene; | int NScene; | |||
CGO *AlphaCGO { nullptr }; | CGO *AlphaCGO { nullptr }; | |||
int *SlotVLA { nullptr }; | int *SlotVLA { nullptr }; | |||
int StencilValid, StencilParity; | int StencilValid, StencilParity; | |||
int ReinterpolateFlag; | int ReinterpolateFlag; | |||
CObject *ReinterpolateObj { nullptr }; | CObject *ReinterpolateObj { nullptr }; | |||
skipping to change at line 218 | skipping to change at line 208 | |||
int do_not_clear; | int do_not_clear; | |||
GridInfo grid; | GridInfo grid; | |||
int last_grid_size; | int last_grid_size; | |||
int n_texture_refreshes { 0 }; | int n_texture_refreshes { 0 }; | |||
CGO *offscreenCGO { nullptr }; | CGO *offscreenCGO { nullptr }; | |||
CGO *offscreenOIT_CGO { nullptr }; | CGO *offscreenOIT_CGO { nullptr }; | |||
CGO *offscreenOIT_CGO_copy { nullptr }; | CGO *offscreenOIT_CGO_copy { nullptr }; | |||
void (*vp_prepareViewPortForStereo)(PyMOLGlobals *, CScene *, int, short, int, int, int, int, int); | void (*vp_prepareViewPortForStereo)(PyMOLGlobals *, CScene *, int, short, int, int, int, int, int); | |||
int vp_times, vp_x, vp_y, vp_owidth, vp_oheight, vp_stereo_mode; | int vp_times, vp_x, vp_y, vp_owidth, vp_oheight, vp_stereo_mode; | |||
float vp_width_scale; | float vp_width_scale; | |||
Picking *pickVLA { nullptr }; | std::vector<Picking> pickVLA {}; | |||
bool invPick; // if set, picking should be re-built | bool invPick; // if set, picking should be re-built | |||
CScene(PyMOLGlobals * G) : Block(G), m_ScrollBar(G, false) {} | ||||
virtual int click(int button, int x, int y, int mod) override; | ||||
virtual int release(int button, int x, int y, int mod) override; | ||||
virtual int drag(int x, int y, int mod) override; | ||||
virtual void draw(CGO* orthoCGO) override; | ||||
virtual void reshape(int width, int height) override; | ||||
// PYMOL-2561, PYMOL-2711 : This structure used to be calloc-ed, this replicat es that | // PYMOL-2561, PYMOL-2711 : This structure used to be calloc-ed, this replicat es that | |||
void *operator new(size_t size) { | void *operator new(size_t size) { | |||
void *mem = ::operator new(size); | void *mem = ::operator new(size); | |||
memset(mem, 0, size); | memset(mem, 0, size); | |||
return mem; | return mem; | |||
} | } | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 11 change blocks. | ||||
49 lines changed or deleted | 46 lines changed or added |