NCBI C Toolkit Cross Reference

C/cn3d/cn3dshim.h


  1 /*   cn3dshim.h
  2 * ===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *            National Center for Biotechnology Information (NCBI)
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's official duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government do not place any restriction on its use or reproduction.
 13 *  We would, however, appreciate having the NCBI and the author cited in
 14 *  any work or product based on this material
 15 *
 16 *  Although all reasonable efforts have been taken to ensure the accuracy
 17 *  and reliability of the software and data, the NLM and the U.S.
 18 *  Government do not and cannot warrant the performance or results that
 19 *  may be obtained by using this software or data. The NLM and the U.S.
 20 *  Government disclaim all warranties, express or implied, including
 21 *  warranties of performance, merchantability or fitness for any particular
 22 *  purpose.
 23 *
 24 * ===========================================================================
 25 *
 26 * File Name:  cn3dshim.h
 27 *
 28 * Author: Lewis Geer
 29 *
 30 * Version Creation Date:   1/26/99
 31 *
 32 * File Description: Files use in Viewer3D -> OpenGL shim
 33 *
 34 * Modifications:
 35 * $Log: cn3dshim.h,v $
 36 * Revision 6.22  2000/07/08 20:43:57  vakatov
 37 * Get all "#include" out of the 'extern "C" { }' scope;  other cleanup...
 38 *
 39 * Revision 6.21  2000/04/04 22:18:42  lewisg
 40 * add defline to ddv, fix seq import bugs, set boundbox
 41 *
 42 * Revision 6.20  2000/03/20 18:18:34  thiessen
 43 * fixed header problem causing network unavailability
 44 *
 45 * Revision 6.19  2000/03/18 00:06:00  lewisg
 46 * add blast, new help, new menus
 47 *
 48 * Revision 6.18  2000/03/15 19:32:20  lewisg
 49 * launch only single udv window
 50 *
 51 * Revision 6.17  2000/03/08 21:46:15  lewisg
 52 * cn3d saves viewport, misc bugs
 53 *
 54 * Revision 6.16  2000/02/19 01:23:59  lewisg
 55 * use ibm, add row tracking code, various bug fixes
 56 *
 57 * Revision 6.15  2000/02/05 01:32:21  lewisg
 58 * add viewmgr, move place freeing is done in ddv, modify visual c++ projects
 59 *
 60 * Revision 6.14  2000/01/06 00:04:43  lewisg
 61 * selection bug fixes, update message outbound, animation APIs moved to vibrant
 62 *
 63 * Revision 6.13  2000/01/04 15:55:51  lewisg
 64 * don't hang on disconnected network and fix memory leak/hang at exit
 65 *
 66 * Revision 6.12  1999/12/27 23:14:12  lewisg
 67 * add colormgr show/hide in Cn3D
 68 *
 69 * Revision 6.11  1999/12/23 21:40:33  lewisg
 70 * move animation controls to dialog
 71 *
 72 * Revision 6.10  1999/12/08 22:58:01  thiessen
 73 * added quality settings for OpenGL rendering
 74 *
 75 * Revision 6.9  1999/12/03 23:17:23  lewisg
 76 * Patrick's new global update msg, argument passing when launching ddv, experimental editing
 77 *
 78 * Revision 6.8  1999/12/01 16:15:54  lewisg
 79 * interim checkin to fix blocking memory leak
 80 *
 81 * Revision 6.7  1999/11/22 14:46:44  thiessen
 82 * moved _OPENGL code blocks to only vibrant and ncbicn3d libraries
 83 *
 84 * Revision 6.6  1999/10/29 14:15:31  thiessen
 85 * ran all Cn3D source through GNU Indent to prettify
 86 *
 87 * Revision 6.5  1999/10/18 15:32:50  lewisg
 88 * move ClearSequences() to cn3dshim.c
 89 *
 90 * Revision 6.4  1999/10/05 23:18:25  lewisg
 91 * add ddv and udv to cn3d with memory management
 92 *
 93 * Revision 6.3  1999/09/21 18:09:15  lewisg
 94 * binary search added to color manager, various bug fixes, etc.
 95 *
 96 * Revision 6.2  1999/04/06 14:23:30  lewisg
 97 * add opengl replacement for viewer3d
 98 *
 99 * Revision 6.1  1999/02/10 23:49:44  lewisg
100 * use RGB values instead of indexed palette
101 *
102 *
103 * ===========================================================================  */
104 
105 #ifndef _CN3DSHIM_
106 #define _CN3DSHIM_
107 
108 #include <shim3d.h>
109 #include <viewmgr.h>
110 
111 #ifndef _OPENGL
112 #include <viewer3d.h>
113 #endif
114 
115 
116 #undef NLM_EXTERN
117 #ifdef NLM_IMPORT
118 #define NLM_EXTERN NLM_IMPORT
119 #else
120 #define NLM_EXTERN extern
121 #endif
122 
123 #ifdef __cplusplus
124 extern "C" {
125 #endif
126 
127 #ifndef _OPENGL
128 extern Viewer3D Cn3D_v3d;   /* the 3d view pane */
129 extern void Cn3D_SaveActiveCam(void);
130 #endif
131 
132 typedef struct _Cn3D_AnimateDlg {
133     WindoW Cn3D_wAnimate;
134 } Cn3D_AnimateDlg;
135 
136 
137 typedef struct _Cn3D_ColorData {
138     DDV_ColorGlobal *pDDVColorGlobal;
139     Boolean IsUserData;     /* is the DDV_ColorGlobal userdata? */
140     SeqAnnot *sap;          /* the current seqalign */
141     ValNode *pvnsep;        /* the current seqentry */
142     Boolean StandAlone;     /* is Cn3D running standalone? */
143     Uint2 sapprocid, sepprocid, userkey;
144     WindoW Cn3D_w;
145     Cn3D_AnimateDlg AnimateDlg;
146     Boolean UseEntrez;  /* turn on entrez use */
147     Boolean EntrezOn;   /* is entrez on? */
148     Int4 rows;          /* number of rows in initial seqalign */
149     Boolean AlignMode;  /* is Cn3D showing alignments or sequences? */
150     Boolean IBM;        /* are we using intersect by master? */
151     IteM BlastMany;     /* blast many menu item */
152 #ifdef _OPENGL
153     TOGL_Data *OGL_Data;    /* pointer to OGL data */
154 #endif
155 } TCn3D_ColorData;
156 
157 extern TCn3D_ColorData Cn3D_ColorData; /* where all dynamic color info is kept */
158 
159 
160 
161 /*****************************************************************************
162 
163 Function: Cn3D_SetVisible()
164 
165 Purpose: Sets the visible bit for a chain in the biostruc AND the color
166         manager
167   
168 Parameters: pColorGlobal
169             pmmdThis: the chain
170             fVisible: true if the chain is to be visible
171 
172 *****************************************************************************/
173 
174 NLM_EXTERN void Cn3D_SetVisible(DDV_ColorGlobal *pColorGlobal, PMMD pmmdThis,
175                                 Boolean fVisible);
176 
177 
178 /*****************************************************************************
179 
180 Function: Cn3D_IsVisible()
181 
182 Purpose: Gets the visible bit for a chain in the biostruc.
183   
184 Parameters: pColorGlobal
185             pmmdThis: the chain
186 
187 Returns:  TRUE if visible
188 
189 *****************************************************************************/
190 
191 NLM_EXTERN Boolean Cn3D_IsVisible(DDV_ColorGlobal *pColorGlobal,
192                                    PMMD pmmdThis);
193 
194 
195 /*****************************************************************************
196 
197 Function: ClearSequences()
198 
199 Purpose: Deletes the Cn3D messagefunc from userdata on the SeqAnnots and
200          SeqEntries presently displayed.
201   
202 *****************************************************************************/
203 extern void ClearSequences(void);
204 
205 extern void Cn3D_ConstructColorData(TCn3D_ColorData * ColorData
206 #ifdef _OPENGL
207                                     , TOGL_Data * OGL_Data
208 #endif
209                                     , Boolean StandAlone);
210 
211 /* destructor for Color structure */
212 extern void Cn3D_DestructColorData(TCn3D_ColorData * ColorData);
213 
214 extern void fnCHLresidue(PDNMG pdnmgThis,
215 #ifndef _OPENGL
216                          Viewer3D vvv,
217 #endif
218                          Boolean highlight);
219 
220 
221 /*****************************************************************************
222 
223 Function: Cn3D_FindFeature
224 
225 Purpose: Finds a feature of a given type in the feature set
226   
227 Parameters: bsfsp, the head of the BiostrucFeatureSets to search
228             type, the type of feature to look for
229             num, the nth occurrence of the feature type
230 
231 Returns: The feature if found,  NULL otherwise
232             
233 *****************************************************************************/
234 NLM_EXTERN BiostrucFeature *Cn3D_FindFeature(BiostrucFeatureSetPtr bsfsp,
235                                              Int4 type, Int4 num);
236 
237 /*****************************************************************************
238 
239 Function: Cn3D_AddFeatureSet
240 
241 Purpose: Adds a new BiostrucFeatureSet the feature set
242   
243 Parameters: bsfspp, pointer to the head of the BiostrucFeatureSets
244 
245 Returns: the feature set
246             
247 *****************************************************************************/
248 NLM_EXTERN BiostrucFeatureSetPtr Cn3D_AddFeatureSet(
249                                        BiostrucFeatureSetPtr *bsfspp);
250 
251 
252 #ifdef _OPENGL
253 extern void LIBCALL Cn3D_Size(TOGL_BoundBox * BoundBox,
254                               PDNMS pdnmsThis);
255 NLM_EXTERN void Cn3D_Animate(IteM i);
256 extern Nlm_GrouP LIBCALL OGL_Quality(Nlm_GrouP prnt);
257 
258 
259 /*****************************************************************************
260 
261 Function: Cn3D_Matrix2Asn
262 
263 Purpose: Converts an OpenGL matrix to an ASN.1 GLMatrix
264   
265 Parameters: glmatrix, the destination ASN.1 GLMatrix
266             modelmatrixin, the source opengl matrix
267             
268 *****************************************************************************/
269 NLM_EXTERN void Cn3D_Matrix2Asn (GLMatrix *glmatrix, void *modelmatrix);
270 
271 /*****************************************************************************
272 
273 Function: Cn3D_Asn2Matrix
274 
275 Purpose: Converts an ASN.1 GLMatrix to an OpenGL matrix
276   
277 Parameters: modelmatrixin, the destination opengl matrix
278             glmatrix, the source ASN.1 GLMatrix
279 
280 *****************************************************************************/
281 NLM_EXTERN void Cn3D_Asn2Matrix (void *modelmatrix, GLMatrix *glmatrix);
282 
283 #endif                          /* _OPENGL */
284 
285 #ifdef __cplusplus
286 }
287 #endif
288 
289 #undef NLM_EXTERN
290 #ifdef NLM_EXPORT
291 #define NLM_EXTERN NLM_EXPORT
292 #else
293 #define NLM_EXTERN
294 #endif
295 
296 #endif                          /* _CN3DSHIM_ */
297 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.