- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

# NURBSCurve Class Reference

This reference page is linked to from the following overview topics: Mudbox 2013.

Search for all occurrences

## Detailed Description

Definition at line 17 of file nurbs.h.

`#include <nurbs.h>`

Inheritance diagram for NURBSCurve:
[legend]

List of all members.

## Classes
struct | ChordLength
## Public Member Functions
| NURBSCurve (int iDegree=2, bool bFalloff=false)
| ~NURBSCurve (void)
bool | operator== (const NURBSCurve &) const throw ()
bool | operator!= (const NURBSCurve &v) const throw ()
void | SetVisible (bool bVisible)
| Sets the node visibility Should be overridden in derived classes.
bool | Visible (void)
bool | AddCP (const Vector &v, int iIndex=-1)
void | RemoveCP (unsigned int iIndex)
void | MoveCP (unsigned int iIndex, const Vector &v)
void | Interpolate (const QList< CurvePoint > &points)
void | RecalcKnots (void)
int | GetDegree (void)
void | SetDegree (int iDegree)
Matrix | GetMatrix (void)
void | Display (bool bScreen=true)
void | Render ()
| Virtual render method.
void | Recalculate ()
void | ProjectPoint (const Vector &vOrig, float fGuess, float &u, Vector &vProjected, float fMin=0.001f, float fMax=0.001f, int iMaxTry=100) const
void | BasisFunction (float u, int i, Store< float > &N) const
void | DeriveBasisFunction (int n, float u, int span, Store< Store< float > > &aDerF) const
int | FindSpan (float u) const
void | DeriveAt (float u, int iDeg, Store< Vector > &aDerivs) const
float | GetMaxParam (void) const
Vector | operator() (float u) const
void | Serialize (Stream &s)
| Serialize the node.
Vector | TransformToWorld (const Vector &v)
Vector | TransformToLocal (const Vector &v)
NURBSCurve & | operator= (const NURBSCurve &c)
void | PrecalculateValues (void)
void | CalculateChordLengths (void)
float | GetChordPos (float fLength)
void | Close (void)
## Public Attributes
| DECLARE_CLASS
int | m_iCPs
int | m_iSelectedCP
bool | m_bEdited
bool | m_bVisible
bool | m_bClosed
bool | m_bPrecalculated
float | m_fTotalLength
float | m_fPosX
float | m_fPosY
float | m_fAngle
float | m_fScale
QString | m_sName
Store< Vector > | m_aCPs
Store< float > | m_aKnots
Store< float > | m_aPrecalc
NURBSCurve * | m_pFalloff
## Protected Member Functions
void | CalculateChordLength (float fStart, float fEnd)
## Protected Attributes
int | m_iDegree
Store< ChordLength > | m_aChordLengths

## Constructor & Destructor Documentation

NURBSCurve | ( | int | iDegree = `2`,
|  | bool | bFalloff = `false`
| ) |  |

~NURBSCurve | ( | void |  | ) |

## Member Function Documentation

bool operator== | ( | const NURBSCurve & |  | ) | const throw () `[inline]`

Definition at line 25 of file nurbs.h.

    { return false; };

bool operator!= | ( | const NURBSCurve & | v | ) | const throw () `[inline]`

Definition at line 26 of file nurbs.h.

    { return !operator ==( v ); };

void SetVisible | ( | bool | b | ) | `[inline, virtual]`

Search for all occurrences

Sets the node visibility Should be overridden in derived classes.

Reimplemented from TreeNode.

Definition at line 28 of file nurbs.h.

    { m_bVisible = bVisible; };

bool Visible | ( | void |  | ) | `[inline]`

Search for all occurrences

Definition at line 29 of file nurbs.h.

    { return m_bVisible; };

bool AddCP | ( | const Vector & | v,
|  | int | iIndex = `-1`
| ) |  |

Search for all occurrences

void RemoveCP | ( | unsigned int | iIndex | ) |

Search for all occurrences

void MoveCP | ( | unsigned int | iIndex,
|  | const Vector & | v
| ) |  |

Search for all occurrences

void Interpolate | ( | const QList< CurvePoint > & | points | ) |

Search for all occurrences

void RecalcKnots | ( | void |  | ) |

Search for all occurrences

int GetDegree | ( | void |  | ) | `[inline]`

Search for all occurrences

Definition at line 35 of file nurbs.h.

    { return m_iDegree; };

void SetDegree | ( | int | iDegree | ) |

Search for all occurrences

Matrix GetMatrix | ( | void |  | ) |

Search for all occurrences

void Display | ( | bool | bScreen = `true` | ) |

Search for all occurrences

void Render | ( |  | ) | `[virtual]`

Search for all occurrences

Virtual render method.

Reimplemented from CurveBase.

void Recalculate | ( |  | ) |

Search for all occurrences

void ProjectPoint | ( | const Vector & | vOrig,
|  | float | fGuess,
|  | float & | u,
|  | Vector & | vProjected,
|  | float | fMin = `0.001f`,
|  | float | fMax = `0.001f`,
|  | int | iMaxTry = `100`
| ) |  | const

Search for all occurrences

void BasisFunction | ( | float | u,
|  | int | i,
|  | Store< float > & | N
| ) |  | const

Search for all occurrences

void DeriveBasisFunction | ( | int | n,
|  | float | u,
|  | int | span,
|  | Store< Store< float > > & | aDerF
| ) |  | const

Search for all occurrences

int FindSpan | ( | float | u | ) | const

Search for all occurrences

void DeriveAt | ( | float | u,
|  | int | iDeg,
|  | Store< Vector > & | aDerivs
| ) |  | const

Search for all occurrences

float GetMaxParam | ( | void |  | ) | const `[inline]`

Search for all occurrences

Definition at line 46 of file nurbs.h.

        {
            if( m_aKnots.ItemCount() == 0 )
                return 0.0f;
            return m_aKnots[m_aKnots.ItemCount()-1];
        };

Vector operator() | ( | float | u | ) | const `[inline]`

Definition at line 52 of file nurbs.h.

        {
            Vector v;
            if( m_iCPs <= m_iDegree )
                return v;

            Store<float> aN( "NURBSCurve temp" );
            int iSpan = FindSpan(u);
            BasisFunction( u, iSpan, aN );

            for( int i = m_iDegree; i >= 0; --i )
            {
                v += aN[i] * m_aCPs[iSpan-m_iDegree+i];
            };
            return v;
        };

void Serialize | ( | Stream & | s | ) | `[virtual]`

Search for all occurrences

Serialize the node.

Reimplemented from CurveBase.

Vector TransformToWorld | ( | const Vector & | v | ) | `[inline]`

Search for all occurrences

Definition at line 69 of file nurbs.h.

        {
            Matrix m = GetMatrix();
            return m.Transform( v );
        };

Vector TransformToLocal | ( | const Vector & | v | ) | `[inline]`

Search for all occurrences

Definition at line 74 of file nurbs.h.

        {
            Matrix m = GetMatrix();
            m.Invert();
            return m.Transform( v );
        };

NURBSCurve& operator= | ( | const NURBSCurve & | c | ) | `[inline]`

Definition at line 80 of file nurbs.h.

        {
            m_iDegree = c.m_iDegree;
            m_iCPs = c.m_iCPs;
            m_iSelectedCP = c.m_iSelectedCP;
            m_bEdited = c.m_bEdited;
            m_bVisible = c.m_bVisible;
            m_bClosed = c.m_bClosed;
            m_bPrecalculated = c.m_bPrecalculated;
            m_fTotalLength = c.m_fTotalLength;
            m_fPosX = c.m_fPosX;
            m_fPosY = c.m_fPosY;
            m_fAngle = c.m_fAngle;
            m_fScale = c.m_fScale;
            m_sName = c.m_sName;
            if( !m_pFalloff && c.m_pFalloff )
                m_pFalloff = new NURBSCurve( 3, false );
            if( c.m_pFalloff )
                *m_pFalloff = *(c.m_pFalloff);
            c.m_aCPs.Clone( m_aCPs );
            c.m_aKnots.Clone( m_aKnots );
            c.m_aPrecalc.Clone( m_aPrecalc );
            return *this;
        };

void PrecalculateValues | ( | void |  | ) |

Search for all occurrences

void CalculateChordLengths | ( | void |  | ) |

Search for all occurrences

float GetChordPos | ( | float | fLength | ) |

Search for all occurrences

void Close | ( | void |  | ) |

Search for all occurrences

void CalculateChordLength | ( | float | fStart,
|  | float | fEnd
| ) |  | `[protected]`

Search for all occurrences

## Member Data Documentation

DECLARE_CLASS

Search for all occurrences

Reimplemented from CurveBase.

Definition at line 20 of file nurbs.h.

int m_iCPs

Search for all occurrences

Definition at line 109 of file nurbs.h.

int m_iSelectedCP

Search for all occurrences

Definition at line 109 of file nurbs.h.

bool m_bEdited

Search for all occurrences

Definition at line 110 of file nurbs.h.

bool m_bVisible

Search for all occurrences

Reimplemented from TreeNode.

Definition at line 110 of file nurbs.h.

bool m_bClosed

Search for all occurrences

Reimplemented from CurveBase.

Definition at line 110 of file nurbs.h.

bool m_bPrecalculated

Search for all occurrences

Definition at line 110 of file nurbs.h.

float m_fTotalLength

Search for all occurrences

Definition at line 111 of file nurbs.h.

float m_fPosX

Search for all occurrences

Definition at line 112 of file nurbs.h.

float m_fPosY

Search for all occurrences

Definition at line 112 of file nurbs.h.

float m_fAngle

Search for all occurrences

Definition at line 112 of file nurbs.h.

float m_fScale

Search for all occurrences

Definition at line 112 of file nurbs.h.

QString m_sName

Search for all occurrences

Definition at line 113 of file nurbs.h.

Store<Vector> m_aCPs

Search for all occurrences

Definition at line 114 of file nurbs.h.

Store<float> m_aKnots

Search for all occurrences

Definition at line 115 of file nurbs.h.

Store<float> m_aPrecalc

Search for all occurrences

Definition at line 116 of file nurbs.h.

NURBSCurve* m_pFalloff

Search for all occurrences

Definition at line 117 of file nurbs.h.

int m_iDegree `[protected]`

Search for all occurrences

Definition at line 120 of file nurbs.h.

Store<ChordLength> m_aChordLengths `[protected]`

Search for all occurrences

Definition at line 128 of file nurbs.h.

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

- Mudbox/nurbs.h

NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve
NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve NURBSCurve