高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】correct method of opendwg
correct method of opendwg
correct method of opendwg
hi,
since i have become quite a little acheiver with opendwg, and have worked out all the arb axis algorithm from almost scratch to get my ellipses/arcs etc to look correctly, and went through lots of pain understanding matrix's so blocks inside of blocks inside of blocks etc... render correctly, as i do all this work by hand, i was wondering if someone could tell me if there is actually a more specific "correct" way to use opendwg to vectorize a drawing.
i assume looking at all the classes supplied with opendwg, there is probably a better and more professional and easier way to draw a drawing.
i suppose to sum up what i am saying, what is the correct flow to vectorize a drawing.
thanx in advance
cheers
jason
the singledoc example shows how to do this, in more detail than you might need. if you can create a project using the odvectorizeex.cpp, exgssimpledevice.h and exgssimpledevice.cpp files, and add any other files that it requires to compile, you will have a program that outputs all the rendering details to a logfile or the console.
the key is the exgssimpledevice class which derives from the odgigeometrysimplifier class, which has a number of methods to draw primatives to whatever canvas you desire. you can easily then modify this project to first specify the device context in the exgssimpledevice instance, and override the methods of odgigeometrysimplifier to draw to the dc.
the 4 main methods you should override are polylineout(), polygonout(), rasterimageproc() and metafileproc(). all the other methods ultimately call these methods, if you don't override them to do anything more specific.
you will also have to override the ontraitsmodified() method of the odgsbasevectorizeview class to set the pen and bush properties in the exgssimpledevice instance, which you can get to by calling device() from within ontraitsmodified().
doing this while looking at the singledoc example will help you work things out.
regards,
sijmen.
quote:
originally posted by sijmen
the singledoc example shows how to do this, in more detail than you might need. if you can create a project using the odvectorizeex.cpp, exgssimpledevice.h and exgssimpledevice.cpp files, and add any other files that it requires to compile, you will have a program that outputs all the rendering details to a logfile or the console.
the key is the exgssimpledevice class which derives from the odgigeometrysimplifier class, which has a number of methods to draw primatives to whatever canvas you desire. you can easily then modify this project to first specify the device context in the exgssimpledevice instance, and override the methods of odgigeometrysimplifier to draw to the dc.
the 4 main methods you should override are polylineout(), polygonout(), rasterimageproc() and metafileproc(). all the other methods ultimately call these methods, if you don't override them to do anything more specific.
you will also have to override the ontraitsmodified() method of the odgsbasevectorizeview class to set the pen and bush properties in the exgssimpledevice instance, which you can get to by calling device() from within ontraitsmodified().
doing this while looking at the singledoc example will help you work things out.
regards,
sijmen.
thank you for this information, i will now start investigating the better way to do this.
cheers
jason
|