- priority: 5 --> 7
As a final note on mySIM_Geometry, on line 351 you cast
a "const
SIM_Geometry *" to a "mySIM_Geometry *", which you
should never ever do
with the SIM library. Even though in this case the cast to
mySIM_Geometry is safe (since mySIM_Geometry has no
virtual functions or
member data), the casting away of the const is a mortal
sin in DOPs.
Doing so lets you modify data that is shared by
mutliple objects, or
used inthe cache (so you are modifying data back in
time). If you do
find that you need the funtionality provided by
mySIM_Geometry::setGdp,
I would suggest you use code like this:
SIM_GeometryCopy *modgeo;
modgeo = SIM_DATA_CREATE(*currObject,
SIM_GEOMETRY_DATANAME,
SIM_GeometryCopy, SIM_DATA_RETURN_EXISTING |
SIM_DATA_ADOPT_EXISTING_ON_DELETE);
if( modgeo )
{
GU_Detail *modgdp = modgeo->lockGeometry();
// modify modgdp any way you want
modgeo->releaseGeometry();
}