Jump to content

How to write to SIM_Data attributes


Recommended Posts

Hi,

 

i am trying to write to some attributes from SIM_Data. How can i get a non-const GU_Detail? The attribute reference is always "read only".

Can someone give me an advice?
 
Here my code:
SIM_GeometryCopy *geo = SIM_DATA_CAST(obj.getNamedSubData(SIM_GEOMETRY_DATANAME), SIM_GeometryCopy);
if (geo)
{
    GU_DetailHandle gdh = geo->getGeometry().getWriteableCopy();
    const GU_Detail* gdp = gdh.peekDetail();
    GEO_AttributeHandle h = gdp->findPointAttribute("hittime");
    if (h.isAttributeValid())
    {
        for (GA_Iterator it(gdp->getPointRange()); !it.atEnd(); it.advance())
        {
            const GEO_Point *ppt = gdp->getGEOPoint(it.getOffset());
            h.setElement(ppt);
            h.setF(1.3f); // this has no effect
        }
    }
}
Edited by ClausKleber
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...