DXF file display based on open source Dxflib analytic library

Source: Internet
Author: User

Dxflib realizes the parsing of DXF file. After all the elements have been parsed, they will be dl_creationadapter through the virtual function interface callback, so we will inherit this class and rewrite the methods of the elements we want to draw, such as a line corresponding to the virtual void AddLine (const dl_linedata &); The DL_LINEDATA structure data holds the data that we want to draw straight lines.

I am using the MFC CDC, a double buffering mechanism. Draw all the entities into the memory buffer according to the data, and then copy them to the window DC. It is worth noting that panning and zooming and coordinate system transformations. Because the upper-left corner of the application is the origin (0,0), the face we need to show is the y-axis positive direction is the screen from bottom to top. (The actual y-direction of the screen is up and down). Only points, lines, circles, arcs, polygons, splines (including with control points, and vertices), and a single line of text are implemented. Like Linetype, line color, multiline text, ellipse these are not implemented. But dxflib this information can be resolved, only in accordance with the rules in theory is achievable.

The results are as follows:


The above image is enlarged with the following effect:


Other effects:




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.