UnityMol  0.9.6-875
UnityMol viewer / In developement
BSpline Class Reference

Public Member Functions

 BSpline ()
 
 BSpline (bool t)
 
void UpdateMatrix3 ()
 
void SetCPoint (int n, Vector3 p)
 
void GetCPoint (int n, out Vector3 p)
 
void ShiftBSplineCPoints ()
 
void CopyCPoints (int n_source, int n_dest)
 
void Feval (float t, out Vector3 p)
 
void Feval2 (float t, out Vector3 p)
 
void Deval (float t, out Vector3 d)
 

Private Member Functions

int Factorial (int n)
 
int BinomialCoef (int i, int n)
 
float BersteinPol (int i, int n, float u)
 
float DBersteinPol (int i, int n, float u)
 
void InitParameters (bool t)
 
void BSplinePointI (int t)
 
void BSplinePoint (float t)
 
void BSplineTangent (float t)
 
void BSplineTangentI (int t)
 
void EvalPoint (float t)
 
void EvalTangent (float t)
 
float FevalX (float t)
 
float FevalY (float t)
 
float FevalZ (float t)
 
float DevalX (float t)
 
float DevalY (float t)
 
float DevalZ (float t)
 

Private Attributes

float[][] bSplineCPoints
 
bool lookup
 
float[][] m3
 
float[] TVector
 
float[] DTVector
 
float[] pt
 
float[] tg
 

Static Private Attributes

static int MAX_BEZIER_ORDER = 10
 
static float[][] BSplineMatrix
 
static int[][] BinomialCoefTable
 
static float[][] TVectorTable
 
static float[][] DTVectorTable
 

Detailed Description

Definition at line 4 of file BSpline.cs.

Constructor & Destructor Documentation

BSpline.BSpline ( )

Definition at line 131 of file BSpline.cs.

References InitParameters().

+ Here is the call graph for this function:

BSpline.BSpline ( bool  t)

Definition at line 135 of file BSpline.cs.

References InitParameters().

+ Here is the call graph for this function:

Member Function Documentation

float BSpline.BersteinPol ( int  i,
int  n,
float  u 
)
private

Definition at line 95 of file BSpline.cs.

References BinomialCoef().

+ Here is the call graph for this function:

int BSpline.BinomialCoef ( int  i,
int  n 
)
private

Definition at line 87 of file BSpline.cs.

References Factorial().

Referenced by BersteinPol(), and DBersteinPol().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BSpline.BSplinePoint ( float  t)
private

Definition at line 203 of file BSpline.cs.

Referenced by EvalPoint().

+ Here is the caller graph for this function:

void BSpline.BSplinePointI ( int  t)
private

Definition at line 187 of file BSpline.cs.

Referenced by EvalPoint().

+ Here is the caller graph for this function:

void BSpline.BSplineTangent ( float  t)
private

Definition at line 220 of file BSpline.cs.

Referenced by EvalTangent().

+ Here is the caller graph for this function:

void BSpline.BSplineTangentI ( int  t)
private

Definition at line 241 of file BSpline.cs.

Referenced by EvalTangent().

+ Here is the caller graph for this function:

void BSpline.CopyCPoints ( int  n_source,
int  n_dest 
)

Definition at line 181 of file BSpline.cs.

Referenced by Ribbons.ConstructControlPoints().

+ Here is the caller graph for this function:

float BSpline.DBersteinPol ( int  i,
int  n,
float  u 
)
private

Definition at line 100 of file BSpline.cs.

References BinomialCoef().

+ Here is the call graph for this function:

void BSpline.Deval ( float  t,
out Vector3  d 
)

Definition at line 286 of file BSpline.cs.

References EvalTangent().

Referenced by Ribbons.GenerateArrowRibbon(), and Ribbons.GenerateFlatRibbon().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float BSpline.DevalX ( float  t)
private

Definition at line 308 of file BSpline.cs.

References EvalTangent().

+ Here is the call graph for this function:

float BSpline.DevalY ( float  t)
private

Definition at line 313 of file BSpline.cs.

References EvalTangent().

+ Here is the call graph for this function:

float BSpline.DevalZ ( float  t)
private

Definition at line 318 of file BSpline.cs.

References EvalTangent().

+ Here is the call graph for this function:

void BSpline.EvalPoint ( float  t)
private

Definition at line 257 of file BSpline.cs.

References BSplinePoint(), and BSplinePointI().

Referenced by Feval(), Feval2(), FevalX(), FevalY(), and FevalZ().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BSpline.EvalTangent ( float  t)
private

Definition at line 264 of file BSpline.cs.

References BSplineTangent(), and BSplineTangentI().

Referenced by Deval(), DevalX(), DevalY(), and DevalZ().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int BSpline.Factorial ( int  n)
private

Definition at line 79 of file BSpline.cs.

Referenced by BinomialCoef().

+ Here is the caller graph for this function:

void BSpline.Feval ( float  t,
out Vector3  p 
)

Definition at line 271 of file BSpline.cs.

References EvalPoint().

Referenced by Ribbons.GenerateArrowRibbon(), Ribbons.GenerateFlatRibbon(), and Ribbons.GenerateSpline().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BSpline.Feval2 ( float  t,
out Vector3  p 
)

Definition at line 278 of file BSpline.cs.

References EvalPoint().

+ Here is the call graph for this function:

float BSpline.FevalX ( float  t)
private

Definition at line 293 of file BSpline.cs.

References EvalPoint().

+ Here is the call graph for this function:

float BSpline.FevalY ( float  t)
private

Definition at line 298 of file BSpline.cs.

References EvalPoint().

+ Here is the call graph for this function:

float BSpline.FevalZ ( float  t)
private

Definition at line 303 of file BSpline.cs.

References EvalPoint().

+ Here is the call graph for this function:

void BSpline.GetCPoint ( int  n,
out Vector3  p 
)

Definition at line 162 of file BSpline.cs.

Referenced by Ribbons.AddControlPoints(), and Ribbons.ConstructControlPoints().

+ Here is the caller graph for this function:

void BSpline.InitParameters ( bool  t)
private

Definition at line 115 of file BSpline.cs.

Referenced by BSpline().

+ Here is the caller graph for this function:

void BSpline.SetCPoint ( int  n,
Vector3  p 
)

Definition at line 154 of file BSpline.cs.

References UpdateMatrix3().

Referenced by Ribbons.AddControlPoints(), and Ribbons.ConstructControlPoints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BSpline.ShiftBSplineCPoints ( )

Definition at line 170 of file BSpline.cs.

References UpdateMatrix3().

Referenced by Ribbons.ShiftControlPoints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BSpline.UpdateMatrix3 ( )

Definition at line 140 of file BSpline.cs.

Referenced by Ribbons.ConstructControlPoints(), SetCPoint(), and ShiftBSplineCPoints().

+ Here is the caller graph for this function:

Member Data Documentation

int [][] BSpline.BinomialCoefTable
staticprivate
Initial value:
= new int[][] {
new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
new int[] {0, 1, 3, 6, 10, 15, 21, 28, 36, 45},
new int[] {0, 0, 1, 4, 10, 20, 35, 56, 84, 120},
new int[] {0, 0, 0, 1, 5, 15, 35, 70, 126, 210},
new int[] {0, 0, 0, 0, 1, 6, 21, 56, 126, 252},
new int[] {0, 0, 0, 0, 0, 1, 7, 28, 84, 210},
new int[] {0, 0, 0, 0, 0, 0, 1, 8, 36, 120},
new int[] {0, 0, 0, 0, 0, 0, 0, 1, 9, 45},
new int[] {0, 0, 0, 0, 0, 0, 0, 0, 1, 10},
new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
}

Definition at line 29 of file BSpline.cs.

float [][] BSpline.bSplineCPoints
private

Definition at line 8 of file BSpline.cs.

float [][] BSpline.BSplineMatrix
staticprivate
Initial value:
= new float[][] {
new float[] {-1f/6f, 1f/2.0f, -1f/2f, 1f/6f},
new float[] { 1f/2f, -1f, 1f/2f, 0f},
new float[] {-1f/2f, 0f, 1f/2f, 0f},
new float[] { 1f/6f, 2f/3f, 1f/6f, 0f}
}

Definition at line 20 of file BSpline.cs.

float [] BSpline.DTVector
private

Definition at line 15 of file BSpline.cs.

float [][] BSpline.DTVectorTable
staticprivate
Initial value:
= new float[][] {
new float[] { 0f, 0f, 1f, 0f},
new float[] {0.03f, 0.2f, 1f, 0f},
new float[] {0.12f, 0.4f, 1f, 0f},
new float[] {0.27f, 0.6f, 1f, 0f},
new float[] {0.48f, 0.8f, 1f, 0f},
new float[] {0.75f, 1.0f, 1f, 0f},
new float[] {1.08f, 1.2f, 1f, 0f},
new float[] {1.47f, 1.4f, 1f, 0f},
new float[] {1.92f, 1.6f, 1f, 0f},
new float[] {2.43f, 1.8f, 1f, 0f},
new float[] { 3f, 2f, 1f, 0f}
}

Definition at line 64 of file BSpline.cs.

bool BSpline.lookup
private

Definition at line 11 of file BSpline.cs.

float [][] BSpline.m3
private

Definition at line 14 of file BSpline.cs.

int BSpline.MAX_BEZIER_ORDER = 10
staticprivate

Definition at line 5 of file BSpline.cs.

float [] BSpline.pt
private

Definition at line 18 of file BSpline.cs.

float [] BSpline.tg
private

Definition at line 18 of file BSpline.cs.

float [] BSpline.TVector
private

Definition at line 15 of file BSpline.cs.

float [][] BSpline.TVectorTable
staticprivate
Initial value:
= new float[][] {
new float[] { 0f, 0f, 0f, 1f},
new float[] {0.001f, 0.01f, 0.1f, 1f},
new float[] {0.008f, 0.04f, 0.2f, 1f},
new float[] {0.027f, 0.09f, 0.3f, 1f},
new float[] {0.064f, 0.16f, 0.4f, 1f},
new float[] {0.125f, 0.25f, 0.5f, 1f},
new float[] {0.216f, 0.36f, 0.6f, 1f},
new float[] {0.343f, 0.49f, 0.7f, 1f},
new float[] {0.512f, 0.64f, 0.8f, 1f},
new float[] {0.729f, 0.81f, 0.9f, 1f},
new float[] { 1f, 1f, 1f, 1f}
}

Definition at line 44 of file BSpline.cs.


The documentation for this class was generated from the following file: