Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DWF Toolkit origin

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
reterVision
2362 Views, 10 Replies

DWF Toolkit origin

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...

 

 

Tags (2)
10 REPLIES 10
Message 2 of 11
SilviaCao
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.
Message 3 of 11
reterVision
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.

Message 4 of 11
SilviaCao
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.
Message 5 of 11
reterVision
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 weekSmiley Sad

 

Thank you!

Message 6 of 11
SilviaCao
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.
Message 7 of 11
reterVision
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!

Message 8 of 11
SilviaCao
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.
Message 9 of 11
reterVision
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!

Message 10 of 11
SilviaCao
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.
Message 11 of 11
reterVision
in reply to: SilviaCao

Yes, it works!

 

Thank you very much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services