ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ObjID in 64-bit
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

spetric

Croatia
308 Posts

Posted - Apr 04 2014 :  13:59:51  Show Profile  Reply
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?

xequte

38459 Posts

Posted - Apr 04 2014 :  16:50:18  Show Profile  Reply
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
Go to Top of Page

xequte

38459 Posts

Posted - Apr 05 2014 :  02:49:40  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: