COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coDoSpheres.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef CO_DO_SPHERES_H
9 #define CO_DO_SPHERES_H
10 
11 #include "coDoCoordinates.h"
12 
13 /*
14  $Log: covise_unstr.h,v $
15  * Revision 1.1 1993/09/25 20:52:42 zrhk0125
16  * Initial revision
17  *
18 */
19 
20 /***********************************************************************\
21  ** **
22  ** Untructured class Version: 1.0 **
23  ** **
24  ** **
25  ** Description : Classes for the handling of an unstructured grid **
26  ** and the data on it in a distributed manner. **
27  ** **
28  ** Classes : **
29  ** **
30  ** Copyright (C) 1993 by University of Stuttgart **
31  ** Computer Center (RUS) **
32  ** Allmandring 30 **
33  ** 7000 Stuttgart 80 **
34  ** **
35  ** **
36  ** Author : A. Wierse (RUS) **
37  ** **
38  ** History : **
39  ** 23.06.93 Ver 1.0 **
40  ** **
41  ** **
42 \***********************************************************************/
43 namespace covise
44 {
45 
47 {
48  friend class coDoInitializer;
49  static coDistributedObject *virtualCtor(coShmArray *arr);
50 
51 private:
57 
58 protected:
59  int rebuildFromShm();
60  int getObjInfo(int, coDoInfo **) const;
61  coDoSpheres *cloneObject(const coObjInfo &newinfo) const;
62 
63 public:
64  coDoSpheres(const coObjInfo &info)
65  : coDoCoordinates(info, "SPHERE")
66  {
67  if (name)
68  {
69  if (getShmArray() != 0)
70  {
71  if (rebuildFromShm() == 0)
72  {
73  print_comment(__LINE__, __FILE__, "rebuildFromShm == 0");
74  }
75  }
76  else
77  {
78  print_comment(__LINE__, __FILE__, "object %s doesn't exist", name);
79  new_ok = 0;
80  }
81  }
82  };
83  coDoSpheres(const coObjInfo &info, coDoCoordinates *sph);
84  coDoSpheres(const coObjInfo &info, coShmArray *arr);
85  coDoSpheres(const coObjInfo &info, int no);
86  coDoSpheres(const coObjInfo &info, int no,
87  float *x, float *y, float *z, float *r);
88  coDoSpheres(const coObjInfo &info, int no,
89  float *x, float *y, float *z);
90  int getNumSpheres() const
91  {
92  return no_of_spheres;
93  }
94  int getNumElements() const
95  {
96  return no_of_spheres;
97  }
98  int getNumPoints() const
99  {
100  return no_of_spheres;
101  }
102  void getPointCoordinates(int no, float *xc, float *yc, float *zc) const
103  {
104  *xc = vx[no];
105  *yc = vy[no];
106  *zc = vz[no];
107  };
108  void getAddresses(float **x_c, float **y_c, float **z_c, float **radii_c) const
109  {
110  *x_c = (float *)vx.getDataPtr();
111  *y_c = (float *)vy.getDataPtr();
112  *z_c = (float *)vz.getDataPtr();
113  *radii_c = (float *)vradii.getDataPtr();
114  };
115 };
116 }
117 #endif
GLint GLint GLint GLint GLint GLint y
Definition: khronos-glext.h:6346
coFloatShmArray vradii
Definition: coDoSpheres.h:56
Definition: coDoSpheres.h:46
Definition: covise_shm.h:479
coFloatShmArray vz
Definition: coDoSpheres.h:55
static coShmArray * getShmArray(const char *name)
Definition: coDistributedObject.cpp:60
Definition: covise_statics.cpp:54
coFloatShmArray vy
Definition: coDoSpheres.h:54
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
void getAddresses(float **x_c, float **y_c, float **z_c, float **radii_c) const
Definition: coDoSpheres.h:108
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
void getPointCoordinates(int no, float *xc, float *yc, float *zc) const
Definition: coDoSpheres.h:102
int getNumElements() const
Definition: coDoSpheres.h:94
Definition: coObjID.h:230
Definition: coDoCoordinates.h:47
#define DOEXPORT
Definition: coExport.h:307
Definition: coDistributedObject.h:265
GLdouble GLdouble z
Definition: khronos-glext.h:6565
coFloatShmArray vx
Definition: coDoSpheres.h:53
GLdouble GLdouble GLdouble r
Definition: khronos-glext.h:6457
coDoSpheres(const coObjInfo &info)
Definition: coDoSpheres.h:64
coIntShm no_of_spheres
Definition: coDoSpheres.h:52
Definition: coDistributedObject.h:294
int getNumPoints() const
Definition: coDoSpheres.h:98
int getNumSpheres() const
Definition: coDoSpheres.h:90
GLuint const GLchar * name
Definition: khronos-glext.h:6722