NURBSCurve Class Reference

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



Detailed Description

Definition at line 17 of file nurbs.h.

#include <nurbs.h>

Inheritance diagram for NURBSCurve:
Inheritance graph
[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]

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]

Definition at line 29 of file nurbs.h.

{ return m_bVisible; };
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  ) [inline]

Definition at line 35 of file nurbs.h.

{ return m_iDegree; };
void SetDegree ( int  iDegree )
Matrix GetMatrix ( void  )
void Display ( bool  bScreen = true )
void Render ( ) [virtual]

Virtual render method.

Reimplemented from CurveBase.

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 [inline]

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]

Serialize the node.

Reimplemented from CurveBase.

Vector TransformToWorld ( const Vector v ) [inline]

Definition at line 69 of file nurbs.h.

    {
        Matrix m = GetMatrix();
        return m.Transform( v );
    };
Vector TransformToLocal ( const Vector v ) [inline]

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  )
void CalculateChordLengths ( void  )
float GetChordPos ( float  fLength )
void Close ( void  )
void CalculateChordLength ( float  fStart,
float  fEnd 
) [protected]

Member Data Documentation

Reimplemented from CurveBase.

Definition at line 20 of file nurbs.h.

int m_iCPs

Definition at line 109 of file nurbs.h.

Definition at line 109 of file nurbs.h.

Definition at line 110 of file nurbs.h.

Reimplemented from TreeNode.

Definition at line 110 of file nurbs.h.

Reimplemented from CurveBase.

Definition at line 110 of file nurbs.h.

Definition at line 110 of file nurbs.h.

Definition at line 111 of file nurbs.h.

float m_fPosX

Definition at line 112 of file nurbs.h.

float m_fPosY

Definition at line 112 of file nurbs.h.

float m_fAngle

Definition at line 112 of file nurbs.h.

float m_fScale

Definition at line 112 of file nurbs.h.

Definition at line 115 of file nurbs.h.

Definition at line 116 of file nurbs.h.

int m_iDegree [protected]

Definition at line 120 of file nurbs.h.

Definition at line 128 of file nurbs.h.


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

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