1
/* Copyright (C) 2000 Damir Zucic */
3
/*=============================================================================
8
Initialize color fading data: reference point (center) position,
9
front surface and back surface distance from the center.
12
(1) Pointer to MolComplexS structure.
15
(1) Color fading parameters initialized.
20
========includes:============================================================*/
25
#include <X11/Xutil.h>
27
#include <X11/Xatom.h>
32
/*======initialize color fading parameters:==================================*/
34
void InitFading_ (MolComplexS *mol_complexSP)
36
double relative_z0, relative_z1;
37
double fading_z0, fading_z1;
40
/* Initialize the reference point: */
41
mol_complexSP->fading_center_vectorS.x =
42
mol_complexSP->geometric_center_vectorS.x;
43
mol_complexSP->fading_center_vectorS.y =
44
mol_complexSP->geometric_center_vectorS.y;
45
mol_complexSP->fading_center_vectorS.z =
46
mol_complexSP->geometric_center_vectorS.z;
48
/* Prepare the extreme z values (relative to the fading center): */
49
relative_z0 = mol_complexSP->left_top_near_vectorS.z -
50
mol_complexSP->fading_center_vectorS.z;
51
relative_z1 = mol_complexSP->right_bottom_far_vectorS.z -
52
mol_complexSP->fading_center_vectorS.z;
54
/* Set the initial front and back surface distance */
55
/* from the center. This depends on fading style. */
56
switch (mol_complexSP->fading_modeI)
58
/** Fading off (all atoms should be colored as near atoms): **/
64
fading_z0 = relative_z0;
65
fading_z1 = relative_z1;
66
mol_complexSP->fading_front_relative_position = fading_z0;
67
mol_complexSP->fading_back_relative_position = fading_z1;
70
/** Sphere, half-sphere, cylinder and half-cylinder: **/
75
fading_z0 = -relative_z0;
77
mol_complexSP->fading_front_relative_position = fading_z0;
78
mol_complexSP->fading_back_relative_position = fading_z1;
80
/** Unsupported fading modes (do nothing): **/
86
/*===========================================================================*/