~ubuntu-branches/ubuntu/breezy/garlic/breezy

« back to all changes in this revision

Viewing changes to hide_backbone.c

  • Committer: Bazaar Package Importer
  • Author(s): zhaoway
  • Date: 2001-04-24 07:09:13 UTC
  • Revision ID: james.westby@ubuntu.com-20010424070913-uzpupnwdfhmliebz
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2000 Damir Zucic */
 
2
 
 
3
/*=============================================================================
 
4
 
 
5
                                hide_backbone.c
 
6
 
 
7
Purpose:
 
8
        Hide backbone for selected atoms: set hiddenF in each BackboneS
 
9
        structure.
 
10
 
 
11
Input:
 
12
        (1) Pointer to MolComplexS structure.
 
13
        (2) The number of macromolecular complexes.
 
14
 
 
15
Output:
 
16
        (1) The hiddenF set to one for selected atoms.
 
17
        (2) Return value.
 
18
 
 
19
Return value:
 
20
        Positive always.
 
21
 
 
22
========includes:============================================================*/
 
23
 
 
24
#include <stdio.h>
 
25
 
 
26
#include <X11/Xlib.h>
 
27
#include <X11/Xutil.h>
 
28
#include <X11/Xos.h>
 
29
#include <X11/Xatom.h>
 
30
 
 
31
#include "defines.h"
 
32
#include "typedefs.h"
 
33
 
 
34
/*======hide backbone:=======================================================*/
 
35
 
 
36
int HideBackbone_ (MolComplexS *mol_complexSP, int mol_complexesN)
 
37
{
 
38
int             mol_complexI;
 
39
MolComplexS     *curr_mol_complexSP;
 
40
size_t          c_alphaI, c_alphaN;
 
41
BackboneS       *curr_backboneSP;
 
42
AtomS           *curr_atomSP;
 
43
 
 
44
/* Scan every macromolecular complex: */
 
45
for (mol_complexI = 0; mol_complexI < mol_complexesN; mol_complexI++)
 
46
        {
 
47
        /** Pointer to the current macromolecular complex: **/
 
48
        curr_mol_complexSP = mol_complexSP + mol_complexI;
 
49
 
 
50
        /** Check is the current macromolecular complex caught: **/
 
51
        if (curr_mol_complexSP->catchF == 0) continue;
 
52
 
 
53
        /** The number of CA atoms in the current complex: **/
 
54
        c_alphaN = curr_mol_complexSP->c_alphaN;
 
55
 
 
56
        /** Scan the array of BackboneS structures: **/
 
57
        for (c_alphaI = 0; c_alphaI < c_alphaN; c_alphaI++)
 
58
                {
 
59
                /*** Pointer to the current CA atom: ***/
 
60
                curr_backboneSP = curr_mol_complexSP->backboneSP + c_alphaI;
 
61
                curr_atomSP = curr_mol_complexSP->atomSP +
 
62
                              curr_backboneSP->c_alphaI;
 
63
 
 
64
                /*** Check is the current CA atom selected and set ***/
 
65
                /*** hiddenF.  If the current CA atom is selected, ***/
 
66
                /*** the backbone  element  should  be  unvisible. ***/
 
67
                if (curr_atomSP->selectedF) curr_backboneSP->hiddenF = 1;
 
68
                }
 
69
        }
 
70
 
 
71
/* Return positive value (trivial): */
 
72
return 1;
 
73
}
 
74
 
 
75
/*===========================================================================*/
 
76
 
 
77