Results 1 to 2 of 2

Thread: how to get out path data from a vgPath

  1. #1
    Junior Member
    Join Date
    Mar 2009

    how to get out path data from a vgPath

    Hi friends:

    I am wrapping up OpenVG provided path fuctions to implement a generic Path Class which supports funtions like beginPath,closePath, moveTo, lineTo , arcTo, arc, bezierTo.. etc. most of the memeber functions share the same prototypes as defined in the html5.0 canvas protocol.

    For some of them ,i only need to use vgAppendToPath to append the new segments and coordinates to the existing vgPath . but sometimes , i have to use the information of the pointes already in the path with the newly added coordinates to make some calculations., for eg. arcTo.

    are there any cool ways to get points information from a vgPath handle which can achieve some similar effects like getLastPoint, getPointArray, getSegmentArray?

    if not ,the only way i can do seems to be maintaining one or two arrays by myself. however,problem is the newly added points' coordinates can probably be changed by vgTransformpath, then i should synchronously transform the maintained points array by myself too. its really awkward and ineffective.

    thanks for your suggestions .^_^

  2. #2
    Senior Member
    Join Date
    Feb 2006

    Re: how to get out path data from a vgPath

    Short answer: not really. You may need to look for an extension that allows that sort of functionality.

    It's a shame the functionality is not included - especially when vgGetParameterfv() accepts querying for VG_PATH_NUM_SEGMENTS, and VG_PATH_NUM_COORDS.
    I suppose the thinking was to allow the driver to internally allow other transformations to the datatype, and querying the value would force the VG driver to keep the original data lying around.

    That said, you can get some information by calling PointAlongPath() (it accepts start segment and number of segments, so querying with 0 and a large float value can (very inefficiently) get you the end points of any segment).

    I suggest just keeping the original data with your path data and updating it on vgAppendPathData, vgTransformPath, vgInterpolate, etc. It's a pain, but alas...

Similar Threads

  1. How can we use same VGPath in multiple threads
    By srastogi in forum OpenVG and VGU
    Replies: 3
    Last Post: 09-17-2009, 08:48 AM
  2. tesselate VG path data to triangles
    By wycwang in forum OpenGL ES general technical discussions
    Replies: 3
    Last Post: 11-17-2008, 09:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts