DWF

Reply
Active Member
reterVision
Posts: 10
Registered: ‎10-10-2011
Message 1 of 11 (1,306 Views)
Accepted Solution

DWF Toolkit origin

1306 Views, 10 Replies
10-23-2011 08:02 PM

Hi, I'm doing a DWF viewer right now, but I've met some problems with the layout for the extracted objects.

 

I found that if only one or no WT_Origin informaton within a DWF file, my model will be displayed correctly, but I got more than one origin points read from the file, the layout of the model will be totally mess.

 

So I wanna know how the origin points being sorted in the file, is ONE ORIGIN could be refered by MULTIPLE points? Or the position of objects are decided by layers?

 

Thank you a lot if you can help me, this problem has been tortured a long time...

 

 

Employee
Posts: 136
Registered: ‎06-07-2009
Message 2 of 11 (1,280 Views)

Re: DWF Toolkit origin

10-25-2011 07:40 PM in reply to: reterVision

Thank you for your questions.

 

The WT_Origin defines an absolute point in drawing coordinates used to reset the relative coordinate processing.  The DWF Toolkit will process the WT_Origin object automatically when reading the DWF file; so if your model processes the WT_Origin object, please skip the WT_Origin object.

 

Please let me know if you have any further questions.



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
reterVision
Posts: 10
Registered: ‎10-10-2011
Message 3 of 11 (1,273 Views)

Re: DWF Toolkit origin

10-26-2011 07:15 PM in reply to: SilviaCao

Hi Silvia:

 

Thank you for your reply.

 

I did what you told me, things get little better, but the model still has some abnormal offset.

Do I need to do anything about layers? Or something with WT_View and WT_Units? Because I think they defined the translation of the model.

 

What am doing now is extract the points directly from W2D objects then scale them to a propery size before drawing them on the screen, is anything wrong with the process?

 

Again, thank you for your time.

Employee
Posts: 136
Registered: ‎06-07-2009
Message 4 of 11 (1,250 Views)

Re: DWF Toolkit origin

10-30-2011 06:30 PM in reply to: reterVision

Yes, you need to process the WT_Units, which defines the translation of the model.

 

And your process is correct.



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
reterVision
Posts: 10
Registered: ‎10-10-2011
Message 5 of 11 (1,245 Views)

Re: DWF Toolkit origin

10-30-2011 07:30 PM in reply to: SilviaCao

Hi, Silvia:

 

I still got problem with this issue, when I process models with just one WT_Origin, the layout will be corret, but if I met model with multiple WT_Origin, the individual objects in the model will scatter all around the screen, which is definitely wrong.

 

How should I solve this issue? It has bothered me more than a week:smileysad:

 

Thank you!

Employee
Posts: 136
Registered: ‎06-07-2009
Message 6 of 11 (1,225 Views)

Re: DWF Toolkit origin

11-09-2011 07:19 PM in reply to: reterVision

Could you please send us more information to research?

  1. Please send us a snapshot of the model; it is better if you can send us the original DWF file.
  2. Please send us a snapshot of your source code to read the DWF objects.


Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
reterVision
Posts: 10
Registered: ‎10-10-2011
Message 7 of 11 (1,222 Views)

Re: DWF Toolkit origin

11-09-2011 09:51 PM in reply to: SilviaCao

Hi Silvia:

 

I really appreciate your help, the files you want are in the attachment.

 

DSTA-BCA_v5.dwf is the DWF file I'm using to test.

WrongDisplay.png is the output of my program which I'm using OpenGL to render.

Code.txt is containing how I parse the WT_Unit, WT_View and WT_Polyline.

 

Please let me know when you found anything wrong!

Thank you!

Employee
Posts: 136
Registered: ‎06-07-2009
Message 8 of 11 (1,220 Views)

Re: DWF Toolkit origin

11-09-2011 10:29 PM in reply to: reterVision

In the “Code.txt”, function “getUnits”, what does the “m_transformMatDWF” use to do? Please comment the function “getUnits” and try again.

And could you please send us more codes from extracting the DWF file to calling the function getUnits()?



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
reterVision
Posts: 10
Registered: ‎10-10-2011
Message 9 of 11 (1,218 Views)

Re: DWF Toolkit origin

11-10-2011 12:29 AM in reply to: SilviaCao

Hi Silvia:

 

Thank you for your reply.

I just use m_transformMatDWF[0] and m_transformMatDWF[5] as scale parameter to scale my model, I didn't do any translation with them.

 

And the code you ask is in the attachment.

 

Thank you!

Employee
Posts: 136
Registered: ‎06-07-2009
Message 10 of 11 (1,209 Views)

Re: DWF Toolkit origin

11-10-2011 10:49 PM in reply to: reterVision

Please replace the “get_next_object()” with “process_next_object()” in function rewriteW2D(), and test again.



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community