vcanim.gif (8357 bytes)SAA_bezierCurveGetHandles
Home ] Sales ] Products ] Services ] Support ] Downloads ]

 

 


SAA_bezierCurveGetHandles

SAA_bezierCurveSetHandles

Sets and retrieves the positions of the handles for a bezier curve.

SAA_bezierCurveGetHandles  sceneID modelID geomtype shapeid nbCtrlVertices handles

SAA_bezierCurveSetHandles scene model geomtype  shapeid  nbCtrlVertices handles

model

A spline of type SAA_SPL_BEZIER. You should verify that model is a bezier spline before calling these functions. Use SAA_AllocElem to allocate it.

geomtype

Specifies what geometry you want to work with:

  • SAA_GEOM_ORIGINAL for the original, non-deformed geometry.
  • SAA_GEOM_DEFORMED for deformed geometry (if any deformations, such as lattice, curve, surface, wave, qstretch, flexible envelope, or other custom effects, are applied to the model). To check if a model is deformed, use SAA_modelIsDeformed.
  • SAA_GEOM_SHAPE to access shapes (the shapeid argument specifies which shape).

For example if geometry is original call procedure with parameter $SAA_Constants(SAA_GEOM_ORIGINAL). SAA_Constants is a global array.

shapeid

Identifies the shape if the geometry type is SAA_GEOM_SHAPE. To get the shape identifiers, use SAA_modelGetNbShapes.

nbCtrlVertices

Number of control vertices in the curve.

handles

Array of handles in local coordinates. Use SAA_AllocDVector to allocate it.

The size of the array is (nbCtrlVertices * 2). There are always two bezier handles for each control vertex. handles[2*i] and handles[2*i+1] correspond to vertices[i].

The following functions reset the handles back to the positions of their corresponding control vertices:

Example

proc SAA_bezierCurveGetHandlesExample {} {

    global SAA_Constants

    set sceneID [SAA_AllocScene]

    SAA_sceneGetCurrent $sceneID

    package require SW

    set bezID [SW_name2Element spline1 $sceneID ]

    SAA_splineGetClosed $sceneID $bezID closed

    SAA_modelGetNbVertices $sceneID $bezID nbVert

    set verticesID [SAA_AllocDVector $nbVert]

    set handlesID  [SAA_AllocDVector [expr $nbVert * 2]]

    SAA_modelGetVertices $sceneID $bezID $SAA_Constants(SAA_GEOM_ORIGINAL) 0 \
        $nbVert $verticesID

    SAA_bezierCurveGetHandles $sceneID $bezID $SAA_Constants(SAA_GEOM_ORIGINAL) \
        0 $nbVert $handlesID

    foreach item "$sceneID $bezID $verticesID $handlesID" {
   
        SAA_Free $item
    }
}


SAA Index ] Examples SAA calls index ]

copyright Video-Collage Inc.