HNurbsSurface

class HNurbsSurface

The HNurbsSurface class encapsulates a NURBS surface or Chaking subdivision surface.

The surface can either be created by passing the necessary parameters like degree, control points, tessellation level or implicitly from an existing nurbs segment in the hoops segment tree. It is internally represented as a HOOPS mesh as described in #HC_Insert_NURBS_Surface and a second invisible mesh representing the control points themselves.

Methods

HNurbsSurface::HNurbsSurface()

Constructs a HNurbsSurface.

HNurbsSurface::~HNurbsSurface()
void HNurbsSurface::Init(HC_KEY key)

This method initializes the Nurbs object based on existing nurbs segment in HOOPS.

Parameters

key: The key to the nurbs segment in HOOPS.
HC_KEY HNurbsSurface::Init(HPoint *center, HPoint *axis, int num_u_vertices, int num_v_vertices, int degree, int tesselation_level, float distance, HSurfaceType stype)

This method initialize the Nurbs object based on given parameters.

Parameters

center: The location of the center of creation.

axis: The initial axis of rotation.

num_u_vertices: The number of control points in the u direction.

num_v_vertices: The number of control points in the v direction.

degree: The degree of the surface.

tesselation_level: The tesselation density.

distance: The distance of vertices. This parameter is used during tesselation.

stype: Pass which type of surface you want to create. It can either be either NURBS or Chakin.

void HNurbsSurface::Recalculate()

This method recalculates the surface based on the existing control points.

HC_KEY HNurbsSurface::GetKey()

Returns

The NURBS surface key.
void HNurbsSurface::DisplayVertices()

This method shows the mesh containing the control points for the surface.

void HNurbsSurface::HideVertices()

This method hides the control point mesh.

void HNurbsSurface::EnableSelectability()

This method enables the selectability of the NURBS surface.

void HNurbsSurface::DisableSelectability()

This method disables the selectability of NURBS Surface.

void HNurbsSurface::UpdateVertex(int vertexnum, float x, float y, float z)

This method allows you to modify a specific control point.

Parameters

vertexnum: The control point index number in the m_pVertices list.

x: The new x coordinate.

y: The new y coordinate.

z: The new z coordinate.

void HNurbsSurface::ShowVertex(int vertexnum, HPoint &v)

This method returns the location of a control point given a specific index identifier.

Parameters

vertexnum: The control point index number in the m_pVertices list.

v: Reference to HPoint structure. This method returns the control poínt position.

void HNurbsSurface::CreateDefaultVertices(HPoint *center, HPoint *axis)

This method creates a set of default control points given a center point and an axis of rotation.

Parameters

center: The center point for creation.

axis: An initial axis of rotation.

HC_KEY HNurbsSurface::GetSurfaceMeshKey()

Returns

The key to the tesselated mesh.
void HNurbsSurface::UpdateVertices()

private

void HNurbsSurface::UpdateParameters()

private

float HNurbsSurface::nip(int i, int p, float u, float *uv)

private

void HNurbsSurface::InsertNurbsMesh(HPoint *pNurbs)

private

void HNurbsSurface::InsertChakinSubdivionSurface(HPoint *pNurbs)

private

void HNurbsSurface::CalculateCornerPoint(HPoint &p1, HPoint &p2, HPoint &res, float factor)

private

void HNurbsSurface::SubdivideSurface(HPoint *old_surface, HPoint *ssurf, int xlen, int ylen, int &new_xlen, int &new_ylen, bool xrefine)

private

void HNurbsSurface::GetVerticesFromHOOPS()

private

void HNurbsSurface::GetParametersFromHOOPS()

private

Variables

HC_KEY HNurbsSurface::m_nurbsKey

private

HC_KEY
HC_KEY HNurbsSurface::m_verticesKey

private

HC_KEY
HC_KEY HNurbsSurface::m_surfaceMeshKey

private

HC_KEY
int HNurbsSurface::m_numUVertices

private

int
int HNurbsSurface::m_numVVertices

private

int
int HNurbsSurface::m_degree

private

int
int HNurbsSurface::m_tesselationLevel

private

int
float HNurbsSurface::m_vertexDistance

private

float
HPoint *HNurbsSurface::m_pVertices

private

HPoint *HNurbsSurface::m_pNurbs

private

HSurfaceType HNurbsSurface::m_surfaceType

private