In my tool's header file I have defined a EditElemHandle:
private:
EditElemHandle m_eehMaster;
In the tool's implementation of the OnPostInstall() I read a cell from a library using mdlCell_getElmDscr() and them make some "tweaks" to that cell by assigning the ElementDescr that the cell was read into and use it to initialize the EditElemHandle:
PlaceTool::OnPostInstall ()
{ mdlCell_getElmDscr( &edP,....);
m_eehMaster.SetElemDescr( edP, true, false );
}void PlaceTool::OnComplexDynamics (MstnButtonEventCP ev)
{
// we have the cell in m_eehMaster as a "template". Make a copy and apply the transform to it.
EditElemHandle eeh( m_eehMaster, true );
}
This EditElemHandle is used as a "template". In the OnComplexDynamics() function I copy that EditElemHandle into a local EditElemHandle and transform it based on the cursor location. Because I don't want to continually transform the copy, it is "reset" back to the original state each time in OnComplexDymanics() by making a copy of the "master".
Now, I wish to persist that transformed copy so I can add it to the file during my OnElementModify(). So, I've added another EditElemHandle to the header file:
private:
EditElemHandle m_eehMaster;
EditElemHandle m_eehCurrent;
But my question is how to perform the "copy" from m_eehMaster into m_eehCurrent in OnComplexDynamics(). I've tried:
m_eehCurrent.SetElemDescr( m_eehMaster.GetElemDescrP(), false, false );
but that's not correct as my graphics don't show up. It complies OK, but it doesn't provide the desired result, so I'm assuming the approach is not proper.
Thanks,
Bruce