[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Copying an object
- Subject: Re: Copying an object
- From: "Mark Hadfield" <m.hadfield(at)niwa.cri.nz>
- Date: Wed, 1 Sep 1999 09:30:44 +1200
- Newsgroups: comp.lang.idl-pvwave
- Organization: NIWA
- References: <37CB9D07.A381E318@gsiukltd.freeserve.co.uk>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:16399
> Hi. How may one create an exact copy of an object?
>
> In particular, I have an IDLgrModel containing other Models each with a
> polygon object inside, and each little model is subjected to a number of
> scale/translation/rotations. I want to create another Model identical to
> this in all respects. Is there a direct way to do this?
The best way I have found is to SAVE it then RESTORE it. My routine
MGH_OBJ_CLONE provides a convenient way to do this.
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mgh_obj_clone.pro
It sounds kludgy but it works surprisingly well. I have used it widely &
successfully in my OG code for a year now. Just make sure the IDLgrModel in
question is not a child of any other IDLgrModel or IDLgrView at the time you
clone it.
---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand