HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 {
24 };
25 
26 class TS_MetaKernel;
27 
28 
30 {
31 public:
33  float r = 1.0f, bool c = true,
34  float tdeg0 = 0.0f, float tdeg1 = 0.0f,
35  TS_MetaKernel *kernel = 0);
36 
37  // Not all rolloff functions require a fsqrted distance, so
38  // avoid it if necessary.
39  float apply(float dist2, bool normalize = true) const;
40 
41  void radius(float r) {
42  myRadius = (r >= 0.0f ? r : 0.0f);
43  myRadius2 = myRadius * myRadius;
44  }
45  float radius(void) const { return myRadius; }
46  float radius2(void) const { return myRadius2; }
47 
48  void connected(bool c) { myConnected = c; }
49  bool connected(void) const { return myConnected; }
50 
51  void type(GEO_RolloffType t) { myType = t; }
52 
53 
54 private:
55  GEO_RolloffType myType;
56  float myRadius; // normalized
57  float myRadius2; // myRadius squared cached for speed
58  bool myConnected;
59 
60  float myTanRad0; // Angle of tangent slope
61  float myTanRad1;
62  TS_MetaKernel *myKernel; // My meta kernel
63 };
64 
65 #endif
void radius(float r)
Definition: GEO_Rolloff.h:41
void connected(bool c)
Definition: GEO_Rolloff.h:48
GLfloat f
Definition: glcorearb.h:1925
GEO_RolloffType
Definition: GEO_Rolloff.h:18
#define GEO_API
Definition: GEO_API.h:10
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:49
float radius(void) const
Definition: GEO_Rolloff.h:45
void type(GEO_RolloffType t)
Definition: GEO_Rolloff.h:51
GLboolean r
Definition: glcorearb.h:1221
float radius2(void) const
Definition: GEO_Rolloff.h:46