HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_Rolloff.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: GEO Library (C++)
7  *
8  * COMMENTS: Rolloff class for proportional modeling
9  *
10  */
11 
12 #ifndef __GEO_Rolloff_h__
13 #define __GEO_Rolloff_h__
14 
15 #include "GEO_API.h"
16 // This must match PRM_Shared::prmSoftTypes in order...
17 
19 {
25 };
26 
27 class TS_MetaKernel;
28 
29 
31 {
32 public:
34  float r = 1.0f, bool c = true,
35  float tdeg0 = 0.0f, float tdeg1 = 0.0f,
36  TS_MetaKernel *kernel = 0);
37 
38  // Not all rolloff functions require a fsqrted distance, so
39  // avoid it if necessary.
40  float apply(float dist2, bool normalize = true) const;
41 
42  void radius(float r) {
43  myRadius = (r >= 0.0f ? r : 0.0f);
44  myRadius2 = myRadius * myRadius;
45  }
46  float radius(void) const { return myRadius; }
47  float radius2(void) const { return myRadius2; }
48 
49  void connected(bool c) { myConnected = c; }
50  bool connected(void) const { return myConnected; }
51 
52  void type(GEO_RolloffType t) { myType = t; }
53 
54 
55 private:
56  GEO_RolloffType myType;
57  float myRadius; // normalized
58  float myRadius2; // myRadius squared cached for speed
59  bool myConnected;
60 
61  float myTanRad0; // Angle of tangent slope
62  float myTanRad1;
63  TS_MetaKernel *myKernel; // My meta kernel
64 };
65 
66 #endif
void radius(float r)
Definition: GEO_Rolloff.h:42
void connected(bool c)
Definition: GEO_Rolloff.h:49
GLclampf f
Definition: glew.h:3499
GEO_RolloffType
Definition: GEO_Rolloff.h:18
const GLfloat * c
Definition: glew.h:16296
#define GEO_API
Definition: GEO_API.h:14
GridType::Ptr normalize(const GridType &grid, bool threaded, InterruptT *interrupt)
Normalize the vectors of the given vector-valued grid.
bool connected(void) const
Definition: GEO_Rolloff.h:50
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
float radius(void) const
Definition: GEO_Rolloff.h:46
void type(GEO_RolloffType t)
Definition: GEO_Rolloff.h:52
GLdouble GLdouble t
Definition: glew.h:1398
float radius2(void) const
Definition: GEO_Rolloff.h:47