T O P I C R E V I E W |
spetric |
Posted - Apr 04 2014 : 13:59:51 Hi,
Currently, I'm storing some pointer values inside vector's ObjID property. This information tells the program which class is "in charge" for specific vectorial objects. One class can be "in charge" for several vectorial objects, so this information comes very handy when translating or rotating vectorial objects with respect to some ObjId.
As ObjID is of type integer, in 64-bit environment, integer value is not sufficient to hold pointer values.
Is it safe to use ObjUserData? I'm worried about using ObjUserData as in documentation is stated: "Load/save and clipboard methods save this field allocating the buffer when needed and freeing it when an object is destroyed."
What does it mean?
|
2 L A T E S T R E P L I E S (Newest First) |
xequte |
Posted - Apr 05 2014 : 02:49:40 I forgot to mention there is a demo for it. See "Vectorial with User Data" on the demo page.
Source for it is in your demos folder:
\Annotations\UserDataVect\UserDataVect.dpr
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
xequte |
Posted - Apr 04 2014 : 16:50:18 In general, you should see little difference between using ObjUserData and ObjID.
The main difference is that when the object is destroyed then the memory of ObjUserData will also be freed (if it has not been reset to nil).
Also when loading/saving/copying/pasting the content of the ObjUserData will be stored/copied using a buffer.
Another option for you is to have a seperate table containing your data and assign its index to ObjID.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|