SnakeGrid Transformer Change 0046

Mesh with unnamed cell

A transformation error occurs when a Mesh element is processed that has been grouped using an unnamed cell element. The Mesh element is not transformed by its vertices (possibly transformed by the cell origin). If the element is dropped (i.e. the unnamed cell removed) - then the Mesh element transforms OK.

Changes...

Modified iSgrdUtil_modifyElement() to return just replace the cell header element, otherwise return the whole descriptor. This was causing an error when you transformed a no named cell containing meshes: it only moved the header because the inner elements were never processed.

In the iSgrdUtil_modifyElement() function is now does this:

         if (CELL_HEADER_ELM  mdlElement_getType (&pMsedNew->el))
         {
            // V025
            // If cell has a name then return the whole descriptor
            // otherwise return just the header part. 
  
            if (EL01_SUCCESS ! iEl01_mseuCellExtractName (iAbd, iDbg, sCellName, 255, &pMsedNew->el))
               return (iCoreAbd_abend (iAbd, SGRDUTIL_FAIL, __LINE__, sMod, sFunc, "iEl01_mseuCellExtractName() failed"));
            if (strlen (sCellName) > 0)
            {
               // This is a named cell, just move by the origin alone
               // This should force all the inner elements to move
               // relatively. 
  
               //printf ("replace element descr\n");
               *ppMsed  pMsedNew;
               return (MODIFY_STATUS_REPLACEDSCR);
            }
            else
            {
               // We will be processing the inner parts
               // ourself. Just return the new cell header part. 
  
               //printf ("replace element\n");
               mdlElement_memcpy (pMseu, &(pMsedNew->el));
               return (MODIFY_STATUS_REPLACE);
            }
         }
         else
         {
            //printf ("replace element descr\n");
            *ppMsed  pMsedNew;
            return (MODIFY_STATUS_REPLACEDSCR);
         }

See Also

Topic revision: r2 - 18 May 2011 - 08:11:40 - Main.adk
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback