Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

DispCmds.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2019 The Board of Trustees of the           
00004  *cr                        University of Illinois                       
00005  *cr                         All Rights Reserved                        
00006  *cr                                                                   
00007  ***************************************************************************/
00008 /***************************************************************************
00009  * RCS INFORMATION:
00010  *
00011  *      $RCSfile: DispCmds.h,v $
00012  *      $Author: johns $        $Locker:  $             $State: Exp $
00013  *      $Revision: 1.121 $      $Date: 2021/05/14 22:47:22 $
00014  *
00015  ***************************************************************************/
00037 #ifndef DISPCMDS_H
00038 #define DISPCMDS_H
00039 
00040 class VMDDisplayList;
00041 class Scene;
00042 
00049 #define VMDMAXVERTEXBUFSZ (128*1024*1024)
00050 
00054 enum { DBEGINREPGEOMGROUP, DPOINT, DPOINTARRAY, DLITPOINTARRAY, 
00055        DLINE, DLINEARRAY, DPOLYLINEARRAY, 
00056        DCYLINDER, 
00057 #if defined(VMDOPTIXRTRT)
00058        DCYLINDERARRAY, 
00059 #endif
00060        DSPHERE, DSPHEREARRAY, DCUBEARRAY,
00061        DTRIANGLE, DSQUARE, DCONE, 
00062        DTRIMESH_C4F_N3F_V3F, DTRIMESH_C3F_N3F_V3F, 
00063        DTRIMESH_C4U_N3F_V3F, DTRIMESH_C4U_N3B_V3F,
00064        DTRISTRIP, DWIREMESH,
00065        DCOLORINDEX, DMATERIALON, DMATERIALOFF, 
00066        DTEXT, DCOMMENT, 
00067        DCLIPPLANE, DVOLSLICE, DVOLTEXON, DVOLTEXOFF, DVOLUMETEXTURE,
00068        DSPHERERES, DSPHERETYPE, DLINEWIDTH, DLINESTYLE,
00069        DPICKPOINT_ARRAY, DLASTCOMMAND=-1};
00070 
00072 enum { SOLIDSPHERE, POINTSPHERE };
00073 enum { SOLIDLINE, DASHEDLINE };
00074 
00075 
00081 struct DispCmdBeginRepGeomGroup {
00082   void putdata(const char *, VMDDisplayList *);
00083 };
00084 
00085 
00088 struct DispCmdComment {
00089   void putdata(const char *, VMDDisplayList *);
00090 };
00091 
00092 
00094 struct DispCmdPoint {
00095   void putdata(const float *, VMDDisplayList *);
00096   float pos[3];
00097 };
00098 
00099 
00101 struct DispCmdSphere {
00102   void putdata(float *, float, VMDDisplayList *);
00103   float pos_r[4]; 
00104 
00105 };
00106 
00107 
00108 #if defined(VMDOPTIXRTRT)
00109 
00111 struct DispCmdCylinderArray {
00112   static void putdata(const float * points, const float * radii, 
00113                       const float * colors, int num_cyls, 
00114                       int cyl_res, int cyl_caps, VMDDisplayList * dobj);
00115 
00116   inline void getpointers(
00117     float *& points,
00118     float *& radii,
00119     float *& colors
00120     ) const {
00121     char *rawptr = (char *)this;
00122     points = (float *) (rawptr + sizeof(DispCmdCylinderArray));
00123     radii  = (float *) (rawptr + sizeof(DispCmdCylinderArray) +
00124                         sizeof(float) * numcylinders * 6L);
00125     colors = (float *) (rawptr + sizeof(DispCmdCylinderArray) +
00126                         sizeof(float) * numcylinders * 6L +
00127                         sizeof(float) * numcylinders);
00128   }
00129 
00130   int numcylinders;
00131   int cylinderres;
00132   int cylindercaps;
00133 };
00134 
00135 #endif
00136 
00137 
00139 struct DispCmdSphereArray {
00140   static void putdata(const float * centers, const float * radii, 
00141                       const float * colors, int num_spheres, 
00142                       int sphere_res, VMDDisplayList * dobj);
00143 
00144   inline void getpointers(
00145     float *& centers,
00146     float *& radii,
00147     float *& colors
00148     ) const {
00149     char *rawptr = (char *)this;
00150     centers = (float *) (rawptr + sizeof(DispCmdSphereArray));
00151     radii   = (float *) (rawptr + sizeof(DispCmdSphereArray) +
00152                          sizeof(float) * numspheres * 3L);
00153     colors  = (float *) (rawptr + sizeof(DispCmdSphereArray) +
00154                          sizeof(float) * numspheres * 3L +
00155                          sizeof(float) * numspheres);
00156   }
00157 
00158   int numspheres;
00159   int sphereres;
00160 };
00161 
00162 
00164 // position, radii (from center to each wall), and color arrays
00165 struct DispCmdLatticeCubeArray {
00166   static void putdata(const float * centers, const float * radii, 
00167                       const float * colors, int num_cubes, 
00168                       VMDDisplayList * dobj);
00169 
00170   inline void getpointers(
00171     float *& centers,
00172     float *& radii,
00173     float *& colors
00174     ) const {
00175     char *rawptr = (char *)this;
00176     centers = (float *) (rawptr + sizeof(DispCmdLatticeCubeArray));
00177     radii   = (float *) (rawptr + sizeof(DispCmdLatticeCubeArray) +
00178                          sizeof(float) * numcubes * 3L);
00179     colors  = (float *) (rawptr + sizeof(DispCmdLatticeCubeArray) +
00180                          sizeof(float) * numcubes * 3L +
00181                          sizeof(float) * numcubes);
00182   }
00183 
00184   int numcubes;
00185 };
00186 
00187 
00189 struct DispCmdPointArray {
00190   static void putdata(const float * centers, const float * colors, float size,
00191                       int num_points, VMDDisplayList * dobj);
00192 
00193   static void putdata(const float * centers, const int *, Scene *, float size,
00194                       int num_points, const int *, int selected, 
00195                       VMDDisplayList * dobj);
00196 
00197   inline void getpointers(
00198     float *& centers,
00199     float *& colors
00200     ) const {
00201     char *rawptr = (char *)this;
00202     centers = (float *) (rawptr + sizeof(DispCmdPointArray));
00203     colors  = (float *) (rawptr + sizeof(DispCmdPointArray) +
00204                          sizeof(float) * numpoints * 3L);
00205   }
00206   float size;
00207   int numpoints;
00208 };
00209 
00210 
00212 struct DispCmdLitPointArray {
00213   static void putdata(const float * centers, const float * normals, 
00214                const float * colors, float size, int num_points, 
00215                VMDDisplayList * dobj);
00216 
00217   inline void getpointers(
00218     float *& centers,
00219     float *& normals,
00220     float *& colors
00221     ) const {
00222     char *rawptr = (char *)this;
00223     centers = (float *) (rawptr + sizeof(DispCmdLitPointArray));
00224     normals = (float *) (rawptr + sizeof(DispCmdLitPointArray) + 
00225                          sizeof(float) * numpoints * 3L);
00226     colors  = (float *) (rawptr + sizeof(DispCmdLitPointArray) +
00227                          sizeof(float) * numpoints * 6L);
00228   }
00229 
00230   float size;
00231   int numpoints;
00232 };
00233 
00234 
00236 struct DispCmdLine {
00237   void putdata(float *, float *, VMDDisplayList *);
00238   float pos1[3];
00239   float pos2[3];
00240 };
00241 
00242 
00248 struct DispCmdLineArray {
00249   void putdata(float *v, int nlines, VMDDisplayList *);
00250 }; 
00251 
00252 
00258 struct DispCmdPolyLineArray {
00259   void putdata(float *v, int nlines, VMDDisplayList *);
00260 }; 
00261 
00262  
00267 struct DispCmdTriangle {
00268   void putdata(const float *, const float *, const float *, VMDDisplayList *);
00269   void putdata(const float *, const float *, const float *,
00270                const float *, const float *, const float *, VMDDisplayList *);
00271 
00272   float pos1[3], pos2[3], pos3[3];
00273   float norm1[3], norm2[3], norm3[3];
00274   void set_array(const float *, const float *, const float *, 
00275                  const float *, const float *, const float *,
00276                  VMDDisplayList *);
00277 };
00278  
00280 struct DispCmdSquare {
00281   float pos1[3], pos2[3], pos3[3], pos4[3];
00282   float norml[3];
00283   void putdata(float *p1, float *p2, float *p3, VMDDisplayList *);
00284 };
00285 
00286 
00288 struct DispCmdTriMesh {
00289   static void putdata(const float * vertices, 
00290                       const float * normals,
00291                       const float * colors,
00292                       int num_facets,
00293                       VMDDisplayList *);
00294 
00295   static void putdata(const float * vertices,
00296                       const float * normals,
00297                       const unsigned char * colors,
00298                       int num_facets,
00299                       VMDDisplayList *);
00300 
00301   static void putdata(const float * vertices,
00302                       const char * normals,
00303                       const unsigned char * colors,
00304                       int num_facets,
00305                       VMDDisplayList *);
00306 
00307   static void putdata(const float * vertices, 
00308                       const float * normals,
00309                       const float * colors,
00310                       int num_verts,
00311                       const int * facets, 
00312                       int num_facets, 
00313                       int enablestrips,
00314                       VMDDisplayList *);
00315 
00316 #if defined(VMDCUDA)
00317 
00318   static void cuda_putdata(const float * vertices_d, 
00319                            const float * normals_d,
00320                            const float * colors_d,
00321                            int num_facets,
00322                            VMDDisplayList *);
00323 
00325   static void cuda_putdata(const float * vertices_d, 
00326                            const float * normals_d,
00327                            const unsigned char * colors_d,
00328                            int num_facets,
00329                            VMDDisplayList *);
00330 
00332   static void cuda_putdata(const float * vertices_d, 
00333                            const char * normals_d,
00334                            const unsigned char * colors_d,
00335                            int num_facets,
00336                            VMDDisplayList *);
00337 #endif
00338 
00342   inline void getpointers(float *& cnv, int *& f) const {
00343     cnv = (float *)(((char *)this) + sizeof(DispCmdTriMesh));
00344     f = (int *)(cnv + 10L*numverts);
00345   }
00346 
00349   inline void getpointers(float *&c, float *&n, float *&v) const {
00350     c = (float *)(((char *)this) + sizeof(DispCmdTriMesh));
00351     n = c + 3L * numverts;
00352     v = n + 3L * numverts;
00353   }
00354 
00355   inline void getpointers(unsigned char *&c, float *&n, float *&v) const {
00356     c = (unsigned char *)(((char *)this) + sizeof(DispCmdTriMesh));
00357     n = (float *) (c + numverts * 4L * sizeof(unsigned char));
00358     v = n + 3L * numverts;
00359   }
00360 
00361   inline void getpointers(unsigned char *&c, signed char *&n, float *&v) const {
00362     c = (unsigned char *)(((char *)this) + sizeof(DispCmdTriMesh));
00363     v = (float *) (c + numverts * 4L * sizeof(unsigned char));
00364     n = (signed char *) (v + 3L * numverts);
00365   }
00366 
00369   inline void getpointers(float *&n, float *&v) const {
00370     n = (float *)(((char *)this) + sizeof(DispCmdTriMesh));
00371     v = n + 3L * numverts;
00372   }
00373 
00374   inline void getpointers(signed char *&n, float *&v) const {
00375     v = (float *)(((char *)this) + sizeof(DispCmdTriMesh));
00376     n = (signed char *) (v + 3L * numverts);
00377   }
00378 
00379   int pervertexcolors;   
00380   int pervertexnormals;  
00381   int numverts;          
00382   int numfacets;         
00383 };
00384 
00385 
00387 struct DispCmdTriStrips {
00388   static void putdata(const float * vertices, 
00389                const float * normals,
00390                const float * colors,
00391                int num_verts,
00392                const int * verts_per_strip,
00393                int num_strips, 
00394                const unsigned int * strip_data,
00395                const int num_strip_verts,
00396                int double_sided_lighting,
00397                VMDDisplayList * dobj);
00398 
00402   inline void getpointers(
00403       float *& cnv,
00404       int   *& f,
00405       int   *& vertsperstrip) const {
00406 
00407     char *rawptr = (char *)this;
00408     cnv= (float *)         (rawptr +
00409                             sizeof(DispCmdTriStrips));
00410   
00411     f= (int *)             (rawptr +
00412                             sizeof(DispCmdTriStrips) +
00413                             sizeof(float) * numverts * 10L);
00414   
00415     vertsperstrip= (int *) (rawptr +
00416                             sizeof(DispCmdTriStrips) +
00417                             sizeof(float) * numverts * 10L +
00418                             sizeof(int)   * numstripverts);
00419   }
00420 
00421   int numverts;         
00422   int numstrips;        
00423   int numstripverts;    
00424   int doublesided;      
00425 }; 
00426 
00427 
00429 struct DispCmdWireMesh {
00430   static void putdata(const float * vertices, 
00431                const float * normals,
00432                const float * colors,
00433                int num_verts,
00434                const int * lines, 
00435                int num_lines, VMDDisplayList *);
00436 
00437   inline void getpointers(
00438     float *& cnv,          
00439     int   *& l             
00440     ) const {
00441     char *rawptr = (char *)this;
00442     cnv=(float *) (rawptr + sizeof(DispCmdWireMesh)); 
00443     l=(int *) (rawptr + sizeof(DispCmdWireMesh) + sizeof(float) * numverts * 10L);
00444   }
00445 
00446   int numverts;         
00447   int numlines;         
00448 };
00449 
00450 
00451 #define CYLINDER_TRAILINGCAP 1
00452 #define CYLINDER_LEADINGCAP  2
00453 
00455 struct DispCmdCylinder {
00456   DispCmdCylinder(void);
00457   float rot[2];         
00458   int lastres;
00459   void putdata(const float *, const float *, float, int, int filled, 
00460                VMDDisplayList *); 
00461 };
00462  
00463 
00465 struct DispCmdCone {
00466   void putdata(const float *, const float *, float, float, 
00467                int, VMDDisplayList *);
00468   float pos1[3], pos2[3]; 
00469   float radius, radius2; 
00470   int res;
00471 };
00472 
00473 
00475 struct DispCmdColorIndex {
00476   void putdata(int, VMDDisplayList *);
00477   int color;
00478 };
00479 
00480 
00482 struct DispCmdText {
00483   void putdata(const float *, const char *, float thickness, 
00484                float size, float ox, float oy, VMDDisplayList *);
00485 };
00486 
00488 struct DispCmdVolSlice {
00489   void putdata(int mode, const float *norm, const float *verts, const float *texcoords, 
00490       VMDDisplayList *);
00492   int texmode;            
00493   float normal[3];        
00495   float v[12];
00496   float t[12];
00497 };
00498 
00501 struct DispCmdVolumeTexture {
00502   void putdata(unsigned long texID, const int size[3], 
00503       unsigned char *texptr, const float vp0[3], const float vp1[3], 
00504       const float vp2[3], const float vp3[3], VMDDisplayList *);
00505   unsigned char * texmap; 
00506   unsigned long ID;       
00507   unsigned xsize;
00508   unsigned ysize;
00509   unsigned zsize;
00510   float v0[3];            
00511   float v1[3];            
00512   float v2[3];            
00513   float v3[3];            
00514 };
00515 
00517 struct DispCmdSphereRes {
00518   void putdata(int, VMDDisplayList *);
00519   int res;
00520 };
00521 
00522 
00524 struct DispCmdSphereType {
00525   void putdata(int, VMDDisplayList *);
00526   int type;
00527 };
00528 
00529 
00531 struct DispCmdLineType {
00532   void putdata(int, VMDDisplayList *);
00533   int type;
00534 };
00535 
00536 
00538 struct DispCmdLineWidth {
00539   void putdata(int, VMDDisplayList *);
00540   int width;
00541 };
00542 
00543 
00545 struct DispCmdPickPoint {
00546   void putdata(float *, int, VMDDisplayList *);
00547   float postag[3];
00548   int tag;
00549 };
00550 
00551 
00554 struct DispCmdPickPointArray {
00559   void putdata(int num, int numsel, int firstsel,
00560                int *on, float *coords, VMDDisplayList *);
00561 
00563   void putdata(int num, int *indices, float *coords, VMDDisplayList *);
00564 
00565   inline void getpointers(float *& coords, int *& tags) const {
00566     char *rawptr = (char *)this;
00567     coords = (float *) (rawptr + sizeof(DispCmdPickPointArray));
00568 
00569     if (allselected) {
00570       tags = NULL;
00571       return;
00572     }
00573 
00574     tags = (int *) (rawptr + sizeof(DispCmdPickPointArray) + 
00575                     3L * sizeof(float) * numpicks);
00576   }
00577 
00578   int numpicks;
00579   int allselected;
00580   int firstindex;
00581 };
00582 
00583 #endif
00584 

Generated on Fri Mar 29 02:45:07 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002