<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>CD_DXF</title> <link rel="stylesheet" type="text/css" href="../../style.css"> </head> <body> <h2 style="text-align: left">CD_DXF - AutoCAD Image Exchange File Driver (cddxf.h)</h2> <p>This driver allows generating an AutoCAD image exchange file. The file name usually has an extension .DXF. This driver supports only AutoCAD version 10.0 or later. The format's copyrights are property of <a href="http://www.autodesk.com" target="_top">Autodesk</a>.</p> <h3>Use</h3> <p>The file is created and opened by calling function <font face="Courier"> <a href="../func/init.html#cdCreateCanvas"><strong>cdCreateCanvas</strong></a>(CD_DXF, Data)</font>, in which <font face="Courier">Data</font> contains the file name and canvas dimensions. This function opens the file and writes its header. Then, other functions in the CD library can be called as usual. The <font face="Courier">Data</font> parameter string has the following format:</p> <pre><em>"filename [widthxheight] [resolution]" </em>or in C <em>"<strong><tt>%s %gx%g %g</tt></strong>"</em></pre> <p>Only the parameter <font face="Courier">filename</font> is required. The filename must be inside double quotes (") if it has spaces.<font face="Courier"> Width</font> and <font face="Courier">height</font> are provided in millimeters (note the lowercase "x" between them), and their default value in pixels is <font face="Courier">INT_MAX</font> for both dimensions. <font face="Courier">Resolution </font>is the number of pixels per millimeter; its default value is "3.78 pixels/mm" (96 DPI). <font face="Courier">Width</font>, <font face="Courier">height</font> and <font face="Courier">resolution</font> are given in real values and are used only by <a href="../func/coordinates.html#cdGetCanvasSize"><font face="Courier"><strong> cdCanvasGetSize</strong></font></a><font face="Courier"><strong> </strong></font>and in pixel-millimeter conversion. </p> <p>Any amount of such canvases may exist simultaneously. It is important to note that a call to function <a href="../func/init.html#cdKillCanvas"><font face="Courier"><strong> cdKillCanvas</strong></font></a> is required to close the DXF file properly.</p> <p><b>Images </b>- The DXF format does not support client or server images and works with an indexed-color format (color quality is limited to 256 fixed colors). </p> <p><strong>Precision of Coordinates -</strong> The primitives use coordinates in real numbers.</p> <p><strong>Layers -</strong> The format can work with several layers. It is necessary to draw the primitives of layer '0' first, then layer '1' and so on. Use functions <a href="../func/control.html#cdFlush"><font face="Courier"><strong>Flush</strong></font></a> to change the current layer.</p> <h3>Behavior of Functions</h3> <h4>Control </h4> <ul> <li><a href="../func/control.html#cdFlush"><font face="Courier"><strong>Flush</strong></font></a>: changes the current layer (the initial layer is '0', followed by '1' and so on). </li> <li><a href="../func/control.html#cdClear"><font face="Courier"><strong>Clear</strong></font></a>: does nothing.</li> <li><a href="../func/other.html#cdPlay"><font face="Courier"><strong>Play</strong></font></a>: does nothing, returns <font face="Courier">CD_ERROR</font>. </li> </ul> <h4>Coordinate System and Clipping</h4> <ul> <li><a href="../func/clipping.html#cdClip"><font face="Courier"><strong>Clip</strong></font></a>: does nothing (no clipping function is supported), returns <font face="Courier">CD_CLIPOFF</font>.</li> <li><a href="../func/coordinates.html#cdUpdateYAxis"><font face="Courier"> <strong>UpdateYAxis</strong></font></a>: does nothing. Axis orientation is the same as in the CD library.</li> <li><strong>Transformation Matrix</strong>: not supported.</li> </ul> <h4>Primitives</h4> <ul> <li><a href="../func/filled.html#cdBox"><font face="Courier"><strong>Box</strong></font></a>: draws only the box's borders (no filling function is supported). Behaves like <strong><font face="Courier">Rect</font></strong>.</li> <li><a href="../func/filled.html#cdSector"><font face="Courier"><strong>Sector</strong></font></a>: draws a "hollow" sector, that is, only its borders.</li> <li><a href="../func/lines.html#cdBegin"><font face="Courier"><strong>Begin</strong></font></a>: <font face="Courier"><strong><tt>CD_FILL</tt></strong></font> is mapped to <font face="Courier"><strong><tt> CD_CLOSED_LINES</tt></strong></font>. if parameter <strong><tt>CD_CLIP</tt></strong> or <strong><tt>CD_BEZIER</tt></strong> are specified, does nothing.</li> <li><strong><font face="Courier"><a href="../func/filled.html#cdChord">Chord</a></font></strong>: does nothing.</li> <li>Floating point primitives are supported.</li> </ul> <h4>Attributes</h4> <ul> <li><a href="../func/filled.html#cdBackOpacity"><font face="Courier"><strong> BackOpacity</strong></font></a>: does nothing, returns <font face="Courier">CD_TRANSPARENT</font>.</li> <li><a href="../func/attributes.html#cdWriteMode"><font face="Courier"> <strong> WriteMode</strong></font></a>: does nothing, returns <font face="Courier">CD_REPLACE</font>.</li> <li><a href="../func/filled.html#cdInteriorStyle"><font face="Courier"> <strong> InteriorStyle</strong></font></a>: does nothing (filling is not supported), returns 0.</li> <li><a href="../func/filled.html#cdHatch"><font face="Courier"><strong>Hatch</strong></font></a>: does nothing. </li> <li><a href="../func/filled.html#cdFillMode"><font face="Courier"><strong> FillMode</strong></font></a>: does nothing.</li> <li><a href="../func/filled.html#cdLineCap"><font face="Courier"><strong> LineCap</strong></font></a>: does nothing.</li> <li><a href="../func/filled.html#cdLineJoin"><font face="Courier"><strong> LineJoin</strong></font></a>: does nothing.</li> <li><a href="../func/filled.html#cdStipple"><font face="Courier"><strong> Stipple</strong></font></a>: does nothing.</li> <li><a href="../func/filled.html#cdPattern"><font face="Courier"><strong> Pattern</strong></font></a>: does nothing.</li> <li><a href="../func/text.html#cdTextSize"><font face="Courier"><strong> TextSize</strong></font></a>: returns a bounding box usually larger than the text (the computation is based on the widest character).</li> <li><a href="../func/text.html#cdTextOrientation"><font face="Courier"> <strong> TextOrientation</strong></font></a>: does nothing.</li> <li><a href="../func/text.html#cdFont"><font face="Courier"><strong>Font</strong></font></a>: italic styles correspond to the basic styles with an inclination of 15<sup>o</sup>. See the font mapping table for the equivalence used to map fonts of the CD library into AutoCAD fonts. No other fonts are supported.</li> </ul> <div align="center"> <center> <table border="1" cellpadding="5"> <caption valign="top"><font size="4">Font Mapping</font></caption> <tr> <th>CD Fonts</th> <th>AutoCAD Fonts</th> </tr> <tr> <td><font face="Courier">S</font><span style="font-family: Courier">ystem</span></td> <td><font face="Courier">STANDARD (sem arquivo)</font></td> </tr> <tr> <td><font face="Courier">Courier</font></td> <td><font face="Courier">ROMAN (romanc.shx)</font></td> </tr> <tr> <td><font face="Courier">Courier + CD_BOLD</font></td> <td><font face="Courier">ROMAN_BOLD (romant.shx)</font></td> </tr> <tr> <td><font face="Courier">Times</font></td> <td><font face="Courier">ROMANTIC (rom_____.pfb)</font></td> </tr> <tr> <td><font face="Courier">Times + CD_BOLD</font></td> <td><font face="Courier">ROMANTIC_BOLD (romb_____.pfb)</font></td> </tr> <tr> <td><font face="Courier">Helvetica</font></td> <td><font face="Courier">SANSSERIF (sas_____.pfb)</font></td> </tr> <tr> <td><font face="Courier">Helvetica + CD_BOLD</font></td> <td><font face="Courier">SANSSERIF_BOLD (sasb____.pfb)</font></td> </tr> </table> </center> </div> <h4>Colors</h4> <ul> <li><a href="../func/attributes.html#cdForeground"><font face="Courier"> <strong> Foreground</strong></font></a>: indexes<font face="Courier"> long int *color</font> in the fixed palette (AutoCAD uses a 256-color palette - for further detail, see AutoCAD's Reference Manual).</li> <li><a href="../func/attributes.html#cdBackground"><font face="Courier"> <strong> Background</strong></font></a>: does nothing, returns <font face="Courier">CD_WHITE</font>.</li> <li><a href="../func/color.html#cdGetColorPlanes"><font face="Courier"> <strong> GetColorPlanes</strong></font></a>: returns 8.</li> <li><a href="../func/color.html#cdPalette"><font face="Courier"><strong>Palette</strong></font></a>: does nothing (the palette is fixed). </li> </ul> <h4>Client Images</h4> <ul> <li>All functions do nothing.</li> </ul> <h4>Server Images </h4> <ul> <li>All functions do nothing.</li> </ul> <p> </p> </body> </html>