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() : myUVal((float)0.), myVVal((float)0.)
26  {
27  myImage.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  myUVal = u; myVVal = v;
36  myImage = 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) { myUVal = u; }
45  void setUVImage(float u, float v) { myUVal = u; myVVal = v; }
46  void setCVImage(const UT_Vector4& img) { myImage = img; }
47 
48  // Grab the private info.
49  void getUVImage(float *u) const { *u = myUVal; }
50  void getUVImage(float *u, float *v) const
51  {
52  *u = myUVal; *v = myVVal;
53  }
54  const UT_Vector4& getCVImage() const { return myImage; }
55 
56  // Compare two Greville points:
57  int operator==(const GEO_Greville &grev) const
58  {
59  return (myUVal == grev.myUVal &&
60  myVVal == grev.myVVal &&
61  myImage == grev.myImage);
62  }
63 
64 protected:
65 private:
66  // The (u,v) position in domain space, and the image on the surface.
67  float myUVal;
68  float myVVal;
69  UT_Vector4 myImage;
70 };
71 
72 #endif
const GLdouble * v
Definition: glcorearb.h:837
int operator==(const GEO_Greville &grev) const
Definition: GEO_Greville.h:57
void setCVImage(const UT_Vector4 &img)
Definition: GEO_Greville.h:46
GLfloat f
Definition: glcorearb.h:1926
IMATH_NAMESPACE::V2f float
#define GEO_API
Definition: GEO_API.h:14
const UT_Vector4 & getCVImage() const
Definition: GEO_Greville.h:54
GLint void * img
Definition: glcorearb.h:556
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