HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_Greville.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Geometry Library (C++)
7  *
8  * COMMENTS:
9  * This class implements a Greville abscissa, which is an average
10  * of "order" knots in parametric space.
11  *
12  */
13 
14 #ifndef __GEO_Greville_h__
15 #define __GEO_Greville_h__
16 
17 #include "GEO_API.h"
18 #include <UT/UT_Vector4.h>
19 
21 {
22 public:
23  // Trivial constructor that sets all the private data to 0. Needed when
24  // instantiating arrays of Greville objects.
25  GEO_Greville() : uVal((float)0.), vVal((float)0.)
26  {
27  image.assign(0.0F, 0.0F, 0.0F, 1.0F);
28  }
29 
30  // Constructor that takes the (u,v) or (u) position of the Greville abscissa
31  // in parametric space, and its image on the surface. Later, the image
32  // info might represent the CV displacement. img is copied memberwise.
33  GEO_Greville(const UT_Vector4 &img, float u = 0.0f, float v = 0.0f)
34  {
35  uVal = u; vVal = v;
36  image = img;
37  }
38 
39  // Class destructor. Does nothing.
41 
42  // Set either image: in domain space or in surface (CV) space
43  // respectively. img is copied memberwise.
44  void setUVImage(float u) { uVal = u; }
45  void setUVImage(float u, float v) { uVal = u; vVal = v; }
46  void setCVImage(const UT_Vector4& img) { image = img; }
47 
48  // Grab the private info.
49  void getUVImage(float *u) const { *u = uVal; }
50  void getUVImage(float *u, float *v) const
51  {
52  *u = uVal; *v = vVal;
53  }
54  const UT_Vector4& getCVImage(void) const { return image; }
55 
56  // Deeply copy the data of the source.
58  {
59  if (this != &src)
60  {
61  uVal = src.uVal; vVal = src.vVal;
62  image = src.image;
63  }
64  return *this;
65  }
66 
67  // Compare two Greville points:
68  int operator==(const GEO_Greville &grev) const
69  {
70  return (uVal == grev.uVal && vVal == grev.vVal &&
71  image == grev.image);
72  }
73 
74 protected:
75 private:
76  // The (u,v) position in domain space, and the image on the surface.
77  float uVal;
78  float vVal;
80 };
81 
82 #endif
const GLdouble * v
Definition: glcorearb.h:836
int operator==(const GEO_Greville &grev) const
Definition: GEO_Greville.h:68
png_bytepp image
Definition: png.h:1849
void setCVImage(const UT_Vector4 &img)
Definition: GEO_Greville.h:46
GLfloat f
Definition: glcorearb.h:1925
GEO_Greville & operator=(const GEO_Greville &src)
Definition: GEO_Greville.h:57
#define GEO_API
Definition: GEO_API.h:10
GLint void * img
Definition: glcorearb.h:555
const UT_Vector4 & getCVImage(void) const
Definition: GEO_Greville.h:54
void getUVImage(float *u) const
Definition: GEO_Greville.h:49
void setUVImage(float u)
Definition: GEO_Greville.h:44
GEO_Greville(const UT_Vector4 &img, float u=0.0f, float v=0.0f)
Definition: GEO_Greville.h:33
void setUVImage(float u, float v)
Definition: GEO_Greville.h:45
void getUVImage(float *u, float *v) const
Definition: GEO_Greville.h:50
GLenum src
Definition: glcorearb.h:1792