Scene.h (pymol-v2.1.0.tar.bz2) | : | Scene.h (pymol-open-source-2.2.0) | ||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
Z* ------------------------------------------------------------------- | Z* ------------------------------------------------------------------- | |||
*/ | */ | |||
#ifndef _H_Scene | #ifndef _H_Scene | |||
#define _H_Scene | #define _H_Scene | |||
#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"SceneDef.h" | ||||
typedef struct { | #include"SceneRender.h" | |||
unsigned char *data; | #include"ShaderMgr.h" | |||
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; | ||||
#define cSceneViewSize 25 | ||||
#define SDOF_NORMAL_MODE 0 | #define SDOF_NORMAL_MODE 0 | |||
#define SDOF_CLIP_MODE 1 | #define SDOF_CLIP_MODE 1 | |||
#define SDOF_DRAG_MODE 2 | #define SDOF_DRAG_MODE 2 | |||
// TODO: define remaining cSceneRay_MODEs (VRML, COLLADA, etc.) | // TODO: define remaining cSceneRay_MODEs (VRML, COLLADA, etc.) | |||
#define cSceneRay_MODE_IDTF 7 | #define cSceneRay_MODE_IDTF 7 | |||
#define cSceneImage_Default -1 | #define cSceneImage_Default -1 | |||
#define cSceneImage_Normal 0 | #define cSceneImage_Normal 0 | |||
#define cSceneImage_Draw 1 | #define cSceneImage_Draw 1 | |||
#define cSceneImage_Ray 2 | #define cSceneImage_Ray 2 | |||
#define cSceneViewSize 25 | ||||
typedef float SceneViewType[cSceneViewSize]; | typedef float SceneViewType[cSceneViewSize]; | |||
typedef struct { | ||||
float unit_left, unit_right, unit_top, unit_bottom, unit_front, unit_back; | ||||
} SceneUnitContext; | ||||
typedef struct { | ||||
int n_col; | ||||
int n_row; | ||||
int first_slot; | ||||
int last_slot; | ||||
float asp_adjust; | ||||
int active; | ||||
int size; | ||||
int slot; | ||||
int mode; | ||||
GLint cur_view[4]; | ||||
GLint cur_viewport_size[2]; | ||||
SceneUnitContext context; /* for whole-window display */ | ||||
} GridInfo; | ||||
/* all information required to define the geometry of a particular view, | ||||
for shipping to and from python as a list of floats | ||||
0-15 = 4x4 rotation matrix | ||||
16-18 = position | ||||
19-21 = origin | ||||
22 = front plane | ||||
23 = rear plane | ||||
24 = orthoscopic flag | ||||
*/ | ||||
float SceneGetDynamicLineWidth(RenderInfo * info, float line_width); | float SceneGetDynamicLineWidth(RenderInfo * info, float line_width); | |||
void SceneInvalidateStencil(PyMOLGlobals * G); | void SceneInvalidateStencil(PyMOLGlobals * G); | |||
int SceneHasImage(PyMOLGlobals * G); | int SceneHasImage(PyMOLGlobals * G); | |||
int SceneInit(PyMOLGlobals * G); | int SceneInit(PyMOLGlobals * G); | |||
void SceneDone(PyMOLGlobals * G); | void SceneDone(PyMOLGlobals * G); | |||
void SceneUpdate(PyMOLGlobals * G, int force); | void SceneUpdate(PyMOLGlobals * G, int force); | |||
int SceneRenderCached(PyMOLGlobals * G); | int SceneRenderCached(PyMOLGlobals * G); | |||
int SceneSetFog(PyMOLGlobals *G, float *fog); | int SceneSetFog(PyMOLGlobals *G); | |||
void SceneRender(PyMOLGlobals * G, Picking * pick, int x, int y, | void SceneSetFogUniforms(PyMOLGlobals * G, CShaderPrg *); | |||
Multipick * smp, int oversize_width, int oversize_height, | ||||
int click_side, int force_copy, int just_background); | ||||
void SceneSetFrame(PyMOLGlobals * G, int mode, int frame); | void SceneSetFrame(PyMOLGlobals * G, int mode, int frame); | |||
int SceneGetFrame(PyMOLGlobals * G); | int SceneGetFrame(PyMOLGlobals * G); | |||
int SceneGetState(PyMOLGlobals * G); | int SceneGetState(PyMOLGlobals * G); | |||
int SceneGetButtonMargin(PyMOLGlobals * G); | int SceneGetButtonMargin(PyMOLGlobals * G); | |||
void SceneDirty(PyMOLGlobals * G); /* scene dirty, but leave the overlay if one exists */ | void SceneDirty(PyMOLGlobals * G); /* scene dirty, but leave the overlay if one exists */ | |||
void SceneInvalidate(PyMOLGlobals * G); /* scene dirty and remove the overlay */ | void SceneInvalidate(PyMOLGlobals * G); /* scene dirty and remove the overlay */ | |||
void SceneChanged(PyMOLGlobals * G); /* update 3D objects */ | void SceneChanged(PyMOLGlobals * G); /* update 3D objects */ | |||
void SceneCountFrames(PyMOLGlobals * G); | int SceneCountFrames(PyMOLGlobals * G); | |||
int SceneGetNFrame(PyMOLGlobals * G, int *has_movie); | int SceneGetNFrame(PyMOLGlobals * G, int *has_movie); | |||
void SceneSetMatrix(PyMOLGlobals * G, float *); | void SceneSetMatrix(PyMOLGlobals * G, float *); | |||
float *SceneGetMatrix(PyMOLGlobals * G); | float *SceneGetMatrix(PyMOLGlobals * G); | |||
float *SceneGetModMatrix(PyMOLGlobals * G); | ||||
#define SceneGetModMatrix SceneGetModelViewMatrix | ||||
float *SceneGetPmvMatrix(PyMOLGlobals * G); | float *SceneGetPmvMatrix(PyMOLGlobals * G); | |||
void SceneReshape(Block * block, int width, int height); | void SceneReshape(Block * block, int width, int height); | |||
float SceneGetScreenVertexScale(PyMOLGlobals * G, float *v1); | float SceneGetScreenVertexScale(PyMOLGlobals * G, float *v1); | |||
short SceneGetVisible(PyMOLGlobals * G, float *v1); | ||||
float SceneGetDepth(PyMOLGlobals * G, float *v1); | ||||
float SceneGetRawDepth(PyMOLGlobals * G, float *v1); | float SceneGetRawDepth(PyMOLGlobals * G, float *v1); | |||
void SceneTest(PyMOLGlobals * G); | void SceneTest(PyMOLGlobals * G); | |||
void SceneIdle(PyMOLGlobals * G); | void SceneIdle(PyMOLGlobals * G); | |||
void SceneFree(PyMOLGlobals * G); | void SceneFree(PyMOLGlobals * G); | |||
int SceneGetDrawFlagGrid(PyMOLGlobals * G, GridInfo * grid, int slot); | int SceneGetDrawFlagGrid(PyMOLGlobals * G, GridInfo * grid, int slot); | |||
bool SceneRay(PyMOLGlobals * G, int width, int height, int mode, | ||||
char **headerVLA, char **charVLA, | ||||
float angle, float shift, int quiet, | ||||
G3dPrimitive ** g3d, int show_timing, int antialias); | ||||
void SceneDoRay(PyMOLGlobals * G, int width, int height, int mode, | ||||
char **headerVLA, char **charVLA, | ||||
float angle, float shift, int quiet, | ||||
G3dPrimitive ** g3d, int show_timing, int antialias); | ||||
int SceneDeferRay(PyMOLGlobals * G, | int SceneDeferRay(PyMOLGlobals * G, | |||
int ray_width, | int ray_width, | |||
int ray_height, | int ray_height, | |||
int mode, | int mode, | |||
float angle, float shift, int quiet, int show_timing, int anti alias); | float angle, float shift, int quiet, int show_timing, int anti alias); | |||
int SceneMakeMovieImage(PyMOLGlobals * G, | int SceneMakeMovieImage(PyMOLGlobals * G, | |||
int show_timing, int validate, int mode, | int show_timing, int validate, int mode, | |||
int width=0, int height=0); | int width=0, int height=0); | |||
int SceneValidateImageMode(PyMOLGlobals * G, int mode, bool defaultdraw); | int SceneValidateImageMode(PyMOLGlobals * G, int mode, bool defaultdraw); | |||
skipping to change at line 157 | skipping to change at line 116 | |||
void SceneTranslateScaled(PyMOLGlobals * G, float x, float y, float z, int sdof_ mode); | void SceneTranslateScaled(PyMOLGlobals * G, float x, float y, float z, int sdof_ mode); | |||
void SceneRotateScaled(PyMOLGlobals * G, float rx, float ry, float rz, int sdof_ mode); | void SceneRotateScaled(PyMOLGlobals * G, float rx, float ry, float rz, int sdof_ mode); | |||
void SceneClip(PyMOLGlobals * G, int plane, float movement, const char *sele, in t state); | void SceneClip(PyMOLGlobals * G, int plane, float movement, const char *sele, in t state); | |||
void SceneGetImageSize(PyMOLGlobals * G, int *width, int *height); | void SceneGetImageSize(PyMOLGlobals * G, int *width, int *height); | |||
float SceneGetGridAspectRatio(PyMOLGlobals * G); | float SceneGetGridAspectRatio(PyMOLGlobals * G); | |||
void SceneScale(PyMOLGlobals * G, float scale); | void SceneScale(PyMOLGlobals * G, float scale); | |||
void SceneResetNormalCGO(PyMOLGlobals * G, CGO *cgo, int lines); | void SceneResetNormalCGO(PyMOLGlobals * G, CGO *cgo, int lines); | |||
void SceneResetNormal(PyMOLGlobals * G, int lines); | void SceneResetNormal(PyMOLGlobals * G, int lines); | |||
void SceneResetNormalUseShader(PyMOLGlobals * G, int lines, short use_shader); | void SceneResetNormalUseShader(PyMOLGlobals * G, int lines, short use_shader); | |||
void SceneResetNormalToViewVector(PyMOLGlobals * G, short use_shader); | ||||
void SceneResetNormalUseShaderAttribute(PyMOLGlobals * G, int lines, short use_s hader, int attr); | void SceneResetNormalUseShaderAttribute(PyMOLGlobals * G, int lines, short use_s hader, int attr); | |||
void SceneGetResetNormal(PyMOLGlobals * G, float *normal, int lines); | void SceneGetResetNormal(PyMOLGlobals * G, float *normal, int lines); | |||
int SceneObjectAdd(PyMOLGlobals * G, CObject * obj); | int SceneObjectAdd(PyMOLGlobals * G, CObject * obj); | |||
int SceneObjectDel(PyMOLGlobals * G, CObject * obj, int allow_purge); | int SceneObjectDel(PyMOLGlobals * G, CObject * obj, int allow_purge); | |||
int SceneObjectIsActive(PyMOLGlobals * G, CObject * obj); | int SceneObjectIsActive(PyMOLGlobals * G, CObject * obj); | |||
void SceneOriginSet(PyMOLGlobals * G, float *origin, int preserve); | void SceneOriginSet(PyMOLGlobals * G, float *origin, int preserve); | |||
void SceneOriginGet(PyMOLGlobals * G, float *origin); | void SceneOriginGet(PyMOLGlobals * G, float *origin); | |||
void SceneWindowSphere(PyMOLGlobals * G, float *location, float radius); | void SceneWindowSphere(PyMOLGlobals * G, float *location, float radius); | |||
void SceneRelocate(PyMOLGlobals * G, float *location); | void SceneRelocate(PyMOLGlobals * G, float *location); | |||
skipping to change at line 185 | skipping to change at line 145 | |||
void SceneGetView(PyMOLGlobals * G, SceneViewType view); | void SceneGetView(PyMOLGlobals * G, SceneViewType view); | |||
void SceneSetView(PyMOLGlobals * G, SceneViewType view, | void SceneSetView(PyMOLGlobals * G, SceneViewType view, | |||
int quiet, float animate, int hand); | int quiet, float animate, int hand); | |||
void SceneRestartSweepTimer(PyMOLGlobals * G); | void SceneRestartSweepTimer(PyMOLGlobals * G); | |||
int SceneViewEqual(SceneViewType left, SceneViewType right); | int SceneViewEqual(SceneViewType left, SceneViewType right); | |||
void SceneToViewElem(PyMOLGlobals * G, CViewElem * elem, const char *scene_name) ; | void SceneToViewElem(PyMOLGlobals * G, CViewElem * elem, const char *scene_name) ; | |||
void SceneFromViewElem(PyMOLGlobals * G, CViewElem * elem, int dirty); | void SceneFromViewElem(PyMOLGlobals * G, CViewElem * elem, int dirty); | |||
void SceneGetCenter(PyMOLGlobals * G, float *pos); | void SceneGetCenter(PyMOLGlobals * G, float *pos); | |||
void SceneGetWidthHeight(PyMOLGlobals * G, int *width, int *height); | void SceneGetWidthHeight(PyMOLGlobals * G, int *width, int *height); | |||
void SceneGetWidthHeightStereo(PyMOLGlobals * G, int *width, int *height); | void SceneGetWidthHeightStereo(PyMOLGlobals * G, int *width, int *height); | |||
int SceneMultipick(PyMOLGlobals * G, Multipick * smp); | ||||
void SceneInvalidateCopy(PyMOLGlobals * G, int free_buffer); | void SceneInvalidateCopy(PyMOLGlobals * G, int free_buffer); | |||
void SceneSetCardInfo(PyMOLGlobals * G, const char *vendor, const char *renderer , const char *version); | void SceneSetCardInfo(PyMOLGlobals * G, const char *vendor, const char *renderer , const char *version); | |||
void SceneGetCardInfo(PyMOLGlobals * G, char **vendor, char **renderer, char **v ersion); | void SceneGetCardInfo(PyMOLGlobals * G, char **vendor, char **renderer, char **v ersion); | |||
int SceneLoadPNG(PyMOLGlobals * G, const char *fname, int movie_flag, int stereo , int quiet); | int SceneLoadPNG(PyMOLGlobals * G, const char *fname, int movie_flag, int stereo , int quiet); | |||
void SceneSetDefaultView(PyMOLGlobals * G); | void SceneSetDefaultView(PyMOLGlobals * G); | |||
void SceneApplyRotMatrix(PyMOLGlobals * G, float *src, float *dst); | ||||
void SceneRovingDirty(PyMOLGlobals * G); | void SceneRovingDirty(PyMOLGlobals * G); | |||
int SceneRovingCheckDirty(PyMOLGlobals * G); | int SceneRovingCheckDirty(PyMOLGlobals * G); | |||
void SceneRovingUpdate(PyMOLGlobals * G); | void SceneRovingUpdate(PyMOLGlobals * G); | |||
void SceneRovingChanged(PyMOLGlobals * G); | void SceneRovingChanged(PyMOLGlobals * G); | |||
void SceneRovingPostpone(PyMOLGlobals * G); | void SceneRovingPostpone(PyMOLGlobals * G); | |||
void SceneCleanupStereo(PyMOLGlobals * G); | void SceneCleanupStereo(PyMOLGlobals * G); | |||
int SceneReinitialize(PyMOLGlobals * G); | int SceneReinitialize(PyMOLGlobals * G); | |||
void SceneUpdateStereoMode(PyMOLGlobals * G); | void SceneUpdateStereoMode(PyMOLGlobals * G); | |||
void SceneSuppressMovieFrame(PyMOLGlobals * G); | void SceneSuppressMovieFrame(PyMOLGlobals * G); | |||
int SceneDeferClick(Block * block, int button, int x, int y, int mod); | int SceneDeferClick(Block * block, int button, int x, int y, int mod); | |||
int SceneDeferRelease(Block * block, int button, int x, int y, int mod); | int SceneDeferRelease(Block * block, int button, int x, int y, int mod); | |||
int SceneDeferDrag(Block * block, int x, int y, int mod); | int SceneDeferDrag(Block * block, int x, int y, int mod); | |||
int SceneDeferImage(PyMOLGlobals * G, int width, int height, const char *filenam e, | int SceneDeferImage(PyMOLGlobals * G, int width, int height, const char *filenam e, | |||
int antialias, float dpi, int format, int quiet); | int antialias, float dpi, int format, int quiet); | |||
char *SceneGetSeleModeKeyword(PyMOLGlobals * G); | char *SceneGetSeleModeKeyword(PyMOLGlobals * G); | |||
void SceneUpdateStereo(PyMOLGlobals * G); | void SceneUpdateStereo(PyMOLGlobals * G); | |||
void ScenePushRasterMatrix(PyMOLGlobals * G, float *v); | float ScenePushRasterMatrix(PyMOLGlobals * G, float *v); | |||
void ScenePopRasterMatrix(PyMOLGlobals * G); | void ScenePopRasterMatrix(PyMOLGlobals * G); | |||
void ScenePrimeAnimation(PyMOLGlobals * G); | void ScenePrimeAnimation(PyMOLGlobals * G); | |||
void SceneLoadAnimation(PyMOLGlobals * G, double duration, int hand); | void SceneLoadAnimation(PyMOLGlobals * G, double duration, int hand); | |||
int SceneMustDrawBoth(PyMOLGlobals * G); | int SceneMustDrawBoth(PyMOLGlobals * G); | |||
float SceneGetReflectScaleValue(PyMOLGlobals * G, int limit); | float SceneGetReflectScaleValue(PyMOLGlobals * G, int limit = 8); | |||
float SceneGetSpecularValue(PyMOLGlobals * G, float spec, int limit); | float SceneGetSpecularValue(PyMOLGlobals * G, float spec, int limit = 8); | |||
void SceneGetAdjustedLightValues(PyMOLGlobals * G, | ||||
float *ptr_spec, | ||||
float *ptr_spec_power, | ||||
float *ptr_spec_direct, | ||||
float *ptr_spec_direct_power, | ||||
int limit = 8); | ||||
void SceneAbortAnimation(PyMOLGlobals * G); | void SceneAbortAnimation(PyMOLGlobals * G); | |||
void SceneObjectUpdateThread(CObjectUpdateThreadInfo * T); | void SceneObjectUpdateThread(CObjectUpdateThreadInfo * T); | |||
int SceneCaptureWindow(PyMOLGlobals * G); | int SceneCaptureWindow(PyMOLGlobals * G); | |||
void SceneZoom(PyMOLGlobals * G, float scale); | void SceneZoom(PyMOLGlobals * G, float scale); | |||
void SceneUpdateObjectMoleculesSingleThread(PyMOLGlobals * G); | ||||
int SceneGetTwoSidedLighting(PyMOLGlobals * G); | int SceneGetTwoSidedLighting(PyMOLGlobals * G); | |||
int SceneGetTwoSidedLightingSettings(PyMOLGlobals * G, const CSetting *set1, con st CSetting *set2); | int SceneGetTwoSidedLightingSettings(PyMOLGlobals * G, const CSetting *set1, con st CSetting *set2); | |||
float SceneGetLineWidthForCylinders(PyMOLGlobals * G, RenderInfo * info, float l ine_width); | float SceneGetLineWidthForCylinders(PyMOLGlobals * G, RenderInfo * info, float l ine_width); | |||
void ScenePushModelViewMatrix(PyMOLGlobals * G); | ||||
void ScenePopModelViewMatrix(PyMOLGlobals * G, bool); | ||||
float *SceneGetModelViewMatrix(PyMOLGlobals * G); | ||||
float *SceneGetProjectionMatrix(PyMOLGlobals * G); | ||||
void SceneSetBackgroundColorAlreadySet(PyMOLGlobals * G, int); | ||||
int SceneGetBackgroundColorAlreadySet(PyMOLGlobals * G); | ||||
void SceneSetDoNotClearBackground(PyMOLGlobals * G, int); | ||||
int SceneGetDoNotClearBackground(PyMOLGlobals * G); | ||||
void SceneProgramLighting(PyMOLGlobals * G, CShaderPrg * shaderPrg = NULL); | ||||
void SceneGLClear(PyMOLGlobals * G, GLbitfield mask); | void SceneGLClear(PyMOLGlobals * G, GLbitfield mask); | |||
#ifdef _PYMOL_IOS | ||||
void SceneTranslateSceneXYWithScale(PyMOLGlobals * G, float x, float y); | ||||
int SceneIsTwisting(PyMOLGlobals * G); | ||||
#endif | ||||
void SceneUpdateAnimation(PyMOLGlobals * G); | void SceneUpdateAnimation(PyMOLGlobals * G); | |||
void SceneSetupGLPicking(PyMOLGlobals * G); | void SceneSetupGLPicking(PyMOLGlobals * G); | |||
int SceneDrawImageOverlay(PyMOLGlobals * G ORTHOCGOARG); | int SceneDrawImageOverlay(PyMOLGlobals * G, int override ORTHOCGOARG); | |||
int SceneIsGridModeActive(PyMOLGlobals * G); | int SceneIncrementTextureRefreshes(PyMOLGlobals * G); | |||
void SceneGetGridModeSize(PyMOLGlobals * G, int *width, int *height); | ||||
void SceneResetTextureRefreshes(PyMOLGlobals * G); | ||||
void SceneGetScaledAxes(PyMOLGlobals * G, CObject *obj, float *xn, float *yn); | ||||
void SceneGetScaledAxesAtPoint(PyMOLGlobals * G, float *pt, float *xn, float *yn | ||||
); | ||||
int SceneGetCopyType(PyMOLGlobals * G); | int SceneGetCopyType(PyMOLGlobals * G); | |||
void SceneGenerateMatrixToAnotherZFromZ(PyMOLGlobals *G, float *convMatrix, floa | ||||
t *curpt, float *pt); | ||||
void SceneAdjustZtoScreenZ(PyMOLGlobals *G, float *pos, float z); | ||||
float SceneGetCurrentBackSafe(PyMOLGlobals *G); | ||||
float SceneGetCurrentFrontSafe(PyMOLGlobals *G); | ||||
void SceneSetPointToWorldScreenRelative(PyMOLGlobals *G, float *pos, float *scre | ||||
enPt); | ||||
int StereoIsAdjacent(PyMOLGlobals * G); | int StereoIsAdjacent(PyMOLGlobals * G); | |||
int SceneGetGridSize(PyMOLGlobals * G, int grid_mode); | ||||
void GridUpdate(GridInfo * I, float asp_ratio, int mode, int size); | ||||
void GridGetRayViewport(GridInfo * I, int width, int height); | ||||
void GridSetRayViewport(GridInfo * I, int slot, int *x, int *y, int *width, | ||||
int *height); | ||||
int SceneGetDrawFlag(GridInfo * grid, int *slot_vla, int slot); | ||||
void SceneApplyImageGamma(PyMOLGlobals * G, unsigned int *buffer, int width, | ||||
int height); | ||||
void ScenePrepareUnitContext(SceneUnitContext * context, int width, int height); | ||||
float GetFovWidth(PyMOLGlobals * G); | ||||
void ScenePrepareMatrix(PyMOLGlobals * G, int mode); | void ScenePrepareMatrix(PyMOLGlobals * G, int mode); | |||
void SceneCopy(PyMOLGlobals * G, GLenum buffer, int force, int entire_window); | void SceneCopy(PyMOLGlobals * G, GLenum buffer, int force, int entire_window); | |||
void SceneInvalidatePicking(PyMOLGlobals * G); | ||||
unsigned char *SceneImagePrepare(PyMOLGlobals * G, int prior_only, int noinvalid | ||||
=0); | ||||
void SceneImageFinish(PyMOLGlobals * G, GLvoid *image); | ||||
#endif | #endif | |||
End of changes. 21 change blocks. | ||||
64 lines changed or deleted | 76 lines changed or added |