COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coDoGeometry.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_GEOMETRY_H
9 #define CO_DO_GEOMETRY_H
10 
11 /*
12  $Log: covise_geometry.h,v $
13  * Revision 1.1 1993/09/25 20:44:13 zrhk0125
14  * Initial revision
15  *
16 */
17 
18 #include "coDistributedObject.h"
19 
20 /***********************************************************************\
21  ** **
22  ** Geometry class Version: 1.0 **
23  ** **
24  ** **
25  ** Description : Classes for the handling of Geometry for the **
26  ** renderer **
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  ** 12.08.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 public:
52  enum { NumChannels = 8 };
53 
54 private:
58  const coDistributedObject *colors[NumChannels];
65 
66 protected:
67  int rebuildFromShm();
68  int getObjInfo(int, coDoInfo **) const;
69  coDoGeometry *cloneObject(const coObjInfo &newinfo) const;
70 
71 public:
72  coDoGeometry(const coObjInfo &info)
73  : coDistributedObject(info, "GEOMET")
74  {
75  if (name != (char *)NULL)
76  {
77  if (getShmArray() != 0)
78  {
79  if (rebuildFromShm() == 0)
80  {
81  print_comment(__LINE__, __FILE__, "rebuildFromShm == 0");
82  }
83  }
84  else
85  {
86  print_comment(__LINE__, __FILE__, "object %s doesn't exist", name);
87  new_ok = 0;
88  }
89  }
90  };
91 
92  void setGeometry(int gtype, const coDistributedObject *geo);
93  void setColors(int cattr, const coDistributedObject *c, size_t chan = 0);
94  void setNormals(int nattr, const coDistributedObject *n);
95  void setTexture(int tattr, const coDistributedObject *t);
96  void setVertexAttribute(int vattr, const coDistributedObject *v);
97 
98  coDoGeometry(const coObjInfo &info, coShmArray *arr);
99  coDoGeometry(const coObjInfo &info, const coDistributedObject *geo);
101  {
102  return geometry;
103  };
104  const coDistributedObject *getColors(size_t chan = 0) const
105  {
106  return colors[chan];
107  };
109  {
110  return normals;
111  };
113  {
114  return texture;
115  };
117  {
118  return vertexAttribute;
119  };
120 
121  int getGeometryType() const
122  {
123  return geometry_type;
124  }
125  int getColorAttributes() const
126  {
127  return color_attr;
128  }
129  void setColorAttributes(int cattr)
130  {
131  color_attr = cattr;
132  }
134  {
135  return normal_attr;
136  }
137  void setNormalAttributes(int nattr)
138  {
139  normal_attr = nattr;
140  }
142  {
143  return texture_attr;
144  }
145  void setTextureAttributes(int nattr)
146  {
147  texture_attr = nattr;
148  }
150  {
151  return vertexAttribute_attr;
152  }
154  {
155  vertexAttribute_attr = vattr;
156  }
157 };
158 }
159 #endif
GLenum GLuint texture
Definition: khronos-glext.h:6986
GLuint const GLchar * name
Definition: khronos-glext.h:6722
const coDistributedObject * vertexAttribute
Definition: coDoGeometry.h:64
const coDistributedObject * normals
Definition: coDoGeometry.h:60
int getNormalAttributes() const
Definition: coDoGeometry.h:133
const coDistributedObject * getNormals() const
Definition: coDoGeometry.h:108
Definition: covise_shm.h:481
GLdouble n
Definition: khronos-glext.h:8447
const coDistributedObject * geometry
Definition: coDoGeometry.h:56
Definition: covise_statics.cpp:54
void setColorAttributes(int cattr)
Definition: coDoGeometry.h:129
const coDistributedObject * texture
Definition: coDoGeometry.h:62
#define NULL
Definition: covise_list.h:22
const coDistributedObject * getVertexAttribute() const
Definition: coDoGeometry.h:116
int getGeometryType() const
Definition: coDoGeometry.h:121
void setNormalAttributes(int nattr)
Definition: coDoGeometry.h:137
void setVertexAttributeAttributes(int vattr)
Definition: coDoGeometry.h:153
const coDistributedObject * getGeometry() const
Definition: coDoGeometry.h:100
Definition: coObjID.h:230
const coDistributedObject * getColors(size_t chan=0) const
Definition: coDoGeometry.h:104
Definition: coDistributedObject.h:266
coIntShm normal_attr
Definition: coDoGeometry.h:59
coIntShm vertexAttribute_attr
Definition: coDoGeometry.h:63
coDoGeometry(const coObjInfo &info)
Definition: coDoGeometry.h:72
const GLdouble * v
Definition: khronos-glext.h:6442
const GLubyte * c
Definition: khronos-glext.h:9864
const coDistributedObject * getTexture() const
Definition: coDoGeometry.h:112
#define DOEXPORT
Definition: coExport.h:307
coIntShm geometry_type
Definition: coDoGeometry.h:55
void setTextureAttributes(int nattr)
Definition: coDoGeometry.h:145
void print_comment(int line, const char *filename, const char *fmt,...)
Definition: coLog.cpp:25
int getColorAttributes() const
Definition: coDoGeometry.h:125
int getTextureAttributes() const
Definition: coDoGeometry.h:141
coIntShm texture_attr
Definition: coDoGeometry.h:61
int getVertexAttributeAttributes() const
Definition: coDoGeometry.h:149
Definition: coDistributedObject.h:295
static coShmArray * getShmArray(const char *name)
Definition: coDistributedObject.cpp:60
Definition: coDoGeometry.h:46
GLdouble GLdouble t
Definition: khronos-glext.h:6449
coIntShm color_attr
Definition: coDoGeometry.h:57