00001 /*---------------------------------------------------------------------+ 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2002 Qgar Project, LORIA | 00004 | | 00005 | This library is free software; you can redistribute it and/or | 00006 | modify it under the terms of the GNU Lesser General Public | 00007 | License version 2.1, as published by the Free Software Foundation. | 00008 | | 00009 | This library is distributed in the hope that it will be useful, | 00010 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00011 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 00012 | See the GNU Lesser General Public License for more details. | 00013 | | 00014 | The GNU Lesser General Public License is included in the file | 00015 | LICENSE.LGPL, in the root directory of the Qgar packaging. See | 00016 | http://www.gnu.org/licenses/lgpl.html for the terms of the licence. | 00017 | To receive a paper copy, write to the Free Software Foundation, | 00018 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | 00019 | | 00020 | Contact Project Qgar for any information: | 00021 | LORIA - équipe Qgar | 00022 | B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France | 00023 | email: qgar-contact@loria.fr | 00024 | http://www.qgar.org/ | 00025 *---------------------------------------------------------------------*/ 00026 00027 00028 #ifndef __DXFFILE_H_INCLUDED__ 00029 #define __DXFFILE_H_INCLUDED__ 00030 00031 00032 /** 00033 * @file DxfFile.H 00034 * @brief Header file of class qgar::DxfFile. 00035 * 00036 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Philippe Dosch">Philippe Dosch</a> 00037 * @date Jul, 3 2001 16:15 00038 * @since Qgar 1.0 00039 */ 00040 00041 // For RCS/CVS use: Do not delete 00042 /* $Id: DxfFile.H,v 1.32 2005/10/14 17:05:46 masini Exp $ */ 00043 00044 00045 // STL 00046 #include <algorithm> 00047 #include <list> 00048 #include <string> 00049 // QGAR 00050 #include <qgarlib/AbstractGraphicsFile.H> 00051 #include <qgarlib/ConnectedComponents.H> 00052 #include <qgarlib/GenPointChain.H> 00053 #include <qgarlib/primitives.H> 00054 #include <qgarlib/QgarErrorDeveloper.H> 00055 #include <qgarlib/QgarErrorIO.H> 00056 #include <qgarlib/stl.H> 00057 namespace qgar 00058 { 00059 // Avoid #include's when not necessary 00060 class BoundingBox; 00061 template <class T> class AbstractGenPointChain; 00062 } 00063 00064 00065 00066 namespace qgar 00067 { 00068 00069 00070 /** 00071 * @class DxfFile DxfFile.H "qgarlib/DxfFile.H" 00072 * @ingroup IO_FILE 00073 * 00074 * @brief File including Dxf graphics. 00075 * 00076 * @warning 00077 * To enable access to the primitives contained in a DXF file, 00078 * function qgar::DxfFile::read(bool) must first be called on the file: 00079 @verbatim 00080 #include <algorithm> 00081 #include <list> 00082 00083 #include <qgarlib/DxfFile.H> 00084 #include <qgarlib/primitives.H> 00085 #include <qgarlib/stl.H> 00086 00087 using namespace qgar; 00088 using namespace std; 00089 00090 ... 00091 00092 // Open an existing DXF file 00093 DxfFile myFile("a_dxf_file.dxf"); 00094 myFile.openRONLY(); 00095 00096 // Read the primitives contained in the file 00097 myFile.read(); 00098 00099 // Close the file when useless 00100 myFile.close(); 00101 00102 // Get and use primitives... 00103 ... 00104 list<GenQgarSegment<int>*> qgarSegList; 00105 myFile.segments(qgarSegList); 00106 ... 00107 00108 // Delete primitives when useless 00109 for_each(qgarSegList.begin(), qgarSegList.end(), qstlDeleteObject()); 00110 ... 00111 @endverbatim 00112 * 00113 * @todo 00114 * <ul> 00115 * <li>The code in .C file has to be completely revised (and optimized).</li> 00116 * <li>Implement a member function to write a (connected) component: 00117 * qgar::DxfFile::write(const Component&, int, QGEcolor, QGEoutline).</li> 00118 * </ul> 00119 * 00120 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Philippe Dosch">Philippe Dosch</a> 00121 * @date July, 3 2001 16:15 00122 * @since Qgar 1.0 00123 */ 00124 class DxfFile 00125 00126 : public AbstractGraphicsFile 00127 00128 { 00129 // ------------------------------------------------------------------- 00130 // P U B L I C M E M B E R S 00131 // ------------------------------------------------------------------- 00132 public: 00133 00134 00135 /** @name Constructors */ 00136 // ============ 00137 //@{ 00138 00139 /** 00140 * @brief Initialize with given file name. 00141 * 00142 * @param aFileName name of the file 00143 */ 00144 DxfFile(const char* aFileName); 00145 00146 //@} 00147 00148 00149 /** @name Destructor */ 00150 // ========== 00151 //@{ 00152 00153 /** 00154 * @brief Virtual destructor. 00155 */ 00156 virtual ~DxfFile(); 00157 00158 //@} 00159 00160 00161 /** @name Image size */ 00162 // ========== 00163 //@{ 00164 00165 /** 00166 * @brief Get the maximal X coordinate of the image. 00167 */ 00168 inline int sizeX() const; 00169 00170 /** 00171 * @brief Get the maximal Y coordinate of the image. 00172 */ 00173 inline int sizeY() const; 00174 00175 //@} 00176 00177 00178 /** @name Header & footer */ 00179 // =============== 00180 //@{ 00181 00182 /** 00183 * @brief Read the header of a DXF file. 00184 * 00185 * @warning To be used only with DXF files created by Qgar. 00186 * 00187 * @exception qgar::QgarErrorIO (bad header) 00188 */ 00189 void readHeader() throw(QgarErrorIO); 00190 00191 /** 00192 * @brief Write the header of a DXF file. 00193 */ 00194 void writeHeader(); 00195 00196 /** 00197 * @brief Write the footer of a DXF file. 00198 */ 00199 void writeFooter(); 00200 00201 //@} 00202 00203 00204 /** @name Access to primitives of the file */ 00205 // ================================ 00206 //@{ 00207 00208 /** 00209 * @brief Get the chains of points contained in the file. 00210 */ 00211 inline const std::list<GenPointChain<int>*>& 00212 accessChains() const; 00213 00214 /** 00215 * @brief Get a copy of the chains of points contained in the file. 00216 * 00217 * The available chains are <b>appended</b> to the given list. 00218 * 00219 * @param aChainList list to store the chains 00220 * 00221 * @warning 00222 * <ul> 00223 * <li>Chains are not available if function 00224 * qgar::DxfFile::read(bool) has not been called previously.</li> 00225 * <li>The chains should be explicitely deleted once useless.</li> 00226 * </ul> 00227 */ 00228 inline void 00229 chains(std::list<GenPointChain<int>*>& aChainList) const; 00230 00231 /** 00232 * @brief Get the (Qgar) segments contained in the file. 00233 */ 00234 inline const std::list<GenQgarSegment<int>*>& 00235 accessSegments() const; 00236 00237 /** 00238 * @brief Get a copy of the (Qgar) segments contained in the file. 00239 * 00240 * The available segments are <b>appended</b> to the given list. 00241 * 00242 * @param aQSegList list to store the (Qgar) segments 00243 * 00244 * @warning 00245 * <ul> 00246 * <li>Segments are not available if function 00247 * qgar::DxfFile::read(bool) has not been called previously.</li> 00248 * <li>The segments should be explicitely deleted once useless.</li> 00249 * </ul> 00250 */ 00251 inline void 00252 segments(std::list<GenQgarSegment<int>*>& aQSegList) const; 00253 00254 /** 00255 * @brief Get the (Qgar) arcs contained in the file. 00256 */ 00257 inline const std::list<GenQgarArc<int>*>& 00258 accessArcs() const; 00259 00260 /** 00261 * @brief Get a copy of the (Qgar) arcs contained in the file. 00262 * 00263 * The available arcs are <b>appended</b> to the given list. 00264 * 00265 * @param aQArcList list to store the (Qgar) arcs 00266 * 00267 * @warning 00268 * <ul> 00269 * <li>Arcs are not available if function 00270 * qgar::DxfFile::read(bool) has not been called previously.</li> 00271 * <li>The arcs should be explicitely deleted once useless.</li> 00272 * </ul> 00273 */ 00274 inline void 00275 arcs(std::list<GenQgarArc<int>*>& aQArcList) const; 00276 00277 /** 00278 * @brief Get the (Qgar) polylines contained in the file. 00279 */ 00280 inline const std::list<GenQgarPolyline<int>*>& 00281 accessPolylines() const; 00282 00283 /** 00284 * @brief Get a copy of the (Qgar) polylines contained in the file. 00285 * 00286 * The available polylines are <b>appended</b> to the given list. 00287 * 00288 * @param aQPolylineList list to store the (Qgar) polylines 00289 * 00290 * @warning 00291 * <ul> 00292 * <li>Polylines are not available if function 00293 * qgar::DxfFile::read(bool) has not been called previously.</li> 00294 * <li>The polylines should be explicitely deleted once useless.</li> 00295 * </ul> 00296 */ 00297 inline void 00298 polylines(std::list<GenQgarPolyline<int>*>& aQPolylineList) const; 00299 00300 //@} 00301 00302 00303 /** @name Buffered input */ 00304 // ============== 00305 //@{ 00306 00307 /** 00308 * @brief Read all DXF entities contained in the file. 00309 * 00310 * The DXF entities are transformed into (Qgar) primitives 00311 * and are stored in the internal buffers of the file. 00312 * 00313 * @param convertPolylines convert polylines into segments (default <b>true</b>) 00314 * 00315 * @exception qgar::QgarErrorIO (junk in file) 00316 */ 00317 void read(bool convertPolylines = true) throw(QgarErrorIO); 00318 00319 //@} 00320 00321 00322 // ------------------------------------------------------------------- 00323 // P U B L I C M E M B E R S : O U T P U T 00324 // ------------------------------------------------------------------- 00325 public: 00326 00327 // To bring (concrete) functions 'write' inherited from class 00328 // qgar::AbstractGraphicsFile into the scope of the class 00329 using AbstractGraphicsFile::write; 00330 00331 00332 /** @name Output chains */ 00333 // ============= 00334 //@{ 00335 00336 /** 00337 * @brief Write a chain of points with coordinates of type <b>int</b>. 00338 * 00339 * @param aChain a chain 00340 * @param aThickness thickness of the drawing (default <b>3</b> 00341 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00342 * 00343 * @todo Parameter <b>aChain</b> cannot be declared <b>const</b> because 00344 * functions qgar::AbstractGenPointChain::setToBegin 00345 * and qgar::AbstractGenPointChain::moveNext are not declared <b>const</b>. 00346 * In particular, their implementation in class qgar::GenPointChain modify 00347 * data member 00348 * qgar::GenPointChain::_iter, which should be declared as <b>mutable</b>. 00349 */ 00350 void write(AbstractGenPointChain<int>& aChain, 00351 int aThickness = 3, 00352 QGEcolor aColor = QGE_COLOR_DEFAULT); 00353 00354 /** 00355 * @brief Write a chain of points with coordinates of type <b>float</b>. 00356 * 00357 * @param aChain a chain 00358 * @param aThickness thickness of the drawing (default <b>3</b> 00359 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00360 * 00361 * @todo Parameter <b>aChain</b> cannot be declared <b>const</b> because 00362 * functions qgar::AbstractGenPointChain::setToBegin 00363 * and qgar::AbstractGenPointChain::moveNext are not declared <b>const</b>. 00364 * In particular, their implementation in class qgar::GenPointChain modify 00365 * data member 00366 * qgar::GenPointChain::_iter, which should be declared as <b>mutable</b>. 00367 */ 00368 void write(AbstractGenPointChain<float>& aChain, 00369 int aThickness = 3, 00370 QGEcolor aColor = QGE_COLOR_DEFAULT); 00371 00372 /** 00373 * @brief Write a chain of points with coordinates of type <b>double</b>. 00374 * 00375 * @param aChain a chain 00376 * @param aThickness thickness of the drawing (default <b>3</b> 00377 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00378 * 00379 * @todo Parameter <b>aChain</b> cannot be declared <b>const</b> because 00380 * functions qgar::AbstractGenPointChain::setToBegin 00381 * and qgar::AbstractGenPointChain::moveNext are not declared <b>const</b>. 00382 * In particular, their implementation in class qgar::GenPointChain modify 00383 * data member 00384 * qgar::GenPointChain::_iter, which should be declared as <b>mutable</b>. 00385 */ 00386 void write(AbstractGenPointChain<double>& aChain, 00387 int aThickness = 3, 00388 QGEcolor aColor = QGE_COLOR_DEFAULT); 00389 00390 //@} 00391 00392 00393 /** @name Output segments */ 00394 // =============== 00395 //@{ 00396 00397 /** 00398 * @brief Write a geometrical segment with coordinates of type <b>int</b>. 00399 * 00400 * @param aSeg a segment 00401 * @param aThickness thickness of the drawing (default <b>1</b>) 00402 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00403 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00404 */ 00405 void write(const GenSegment<int>& aSeg, 00406 int aThickness = 1, 00407 QGEcolor aColor = QGE_COLOR_BLACK, 00408 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00409 00410 /** 00411 * @brief Write a geometrical segment with coordinates of type <b>float</b>. 00412 * 00413 * @param aSeg a segment 00414 * @param aThickness thickness of the drawing (default <b>1</b>) 00415 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00416 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00417 */ 00418 void write(const GenSegment<float>& aSeg, 00419 int aThickness = 1, 00420 QGEcolor aColor = QGE_COLOR_BLACK, 00421 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00422 00423 /** 00424 * @brief Write a geometrical segment with coordinates of type <b>double</b>. 00425 * 00426 * @param aSeg a segment 00427 * @param aThickness thickness of the drawing (default <b>1</b>) 00428 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00429 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00430 */ 00431 void write(const GenSegment<double>& aSeg, 00432 int aThickness = 1, 00433 QGEcolor aColor = QGE_COLOR_BLACK, 00434 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00435 00436 /** 00437 * @brief Write a list of Qgar segments with integer coordinates. 00438 * 00439 * @param aQSegList a list of Qgar segments 00440 * @param aThickness thickne/ss of the drawing (default <b>1</b>) 00441 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00442 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00443 */ 00444 void write(const std::list<GenQgarSegment<int>*>& aQSegList, 00445 int aThickness = 1, 00446 QGEcolor aColor = QGE_COLOR_DEFAULT, 00447 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00448 00449 //@} 00450 00451 00452 /** @name Output arcs */ 00453 // =========== 00454 //@{ 00455 00456 /** 00457 * @brief Write a geometrical arc with coordinates of type <b>int</b>. 00458 * 00459 * @param anArc a segment 00460 * @param aThickness thickne/ss of the drawing (default <b>1</b>) 00461 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00462 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00463 */ 00464 void write(const GenArc<int>& anArc, 00465 int aThickness = 1, 00466 QGEcolor aColor = QGE_COLOR_DEFAULT, 00467 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00468 00469 /** 00470 * @brief Write a geometrical arc with coordinates of type <b>float</b>. 00471 * 00472 * @param anArc a segment 00473 * @param aThickness thickness of the drawing (default <b>1</b>) 00474 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00475 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00476 */ 00477 void write(const GenArc<float>& anArc, 00478 int aThickness = 1, 00479 QGEcolor aColor = QGE_COLOR_DEFAULT, 00480 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00481 00482 /** 00483 * @brief Write a geometrical arc with coordinates of type <b>double</b>. 00484 * 00485 * @param anArc a segment 00486 * @param aThickness thickness of the drawing (default <b>1</b>) 00487 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00488 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00489 */ 00490 void write(const GenArc<double>& anArc, 00491 int aThickness = 1, 00492 QGEcolor aColor = QGE_COLOR_DEFAULT, 00493 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00494 00495 /** 00496 * @brief Write a list of Qgar arcs with integer coordinates. 00497 * 00498 * @param aQArcList a list of Qgar arcs 00499 * @param aThickness thickness of the drawing (default <b>1</b>) 00500 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00501 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00502 */ 00503 void write(std::list<GenQgarArc<int>*>& aQArcList, 00504 int aThickness = 1, 00505 QGEcolor aColor = QGE_COLOR_DEFAULT, 00506 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00507 00508 //@} 00509 00510 00511 /** @name Output polylines */ 00512 // ================ 00513 //@{ 00514 00515 /** 00516 * @brief Write a geometrical polyline with coordinates of type <b>int</b>. 00517 * 00518 * @param aPoly a polyline 00519 * @param aThickness thickness of the drawing (default <b>1</b>) 00520 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00521 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00522 */ 00523 void write(const GenPolyline<int>& aPoly, 00524 int aThickness = 1, 00525 QGEcolor aColor = QGE_COLOR_DEFAULT, 00526 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00527 00528 /** 00529 * @brief Write a geometrical polyline with coordinates of type <b>float</b>. 00530 * 00531 * @param aPoly a polyline 00532 * @param aThickness thickness of the drawing (default <b>1</b>) 00533 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00534 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00535 */ 00536 void write(const GenPolyline<float>& aPoly, 00537 int aThickness = 1, 00538 QGEcolor aColor = QGE_COLOR_DEFAULT, 00539 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00540 00541 /** 00542 * @brief Write a geometrical polyline with coordinates of type 00543 * <b>double</b>. 00544 * 00545 * @param aPoly a polyline 00546 * @param aThickness thickness of the drawing (default <b>1</b>) 00547 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00548 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00549 */ 00550 void write(const GenPolyline<double>& aPoly, 00551 int aThickness = 1, 00552 QGEcolor aColor = QGE_COLOR_DEFAULT, 00553 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00554 00555 //@} 00556 00557 00558 /** @name Output polygons */ 00559 // =============== 00560 //@{ 00561 00562 /** 00563 * @brief Write a polygon. 00564 * 00565 * @param aPolygon a polygon 00566 * @param aThickness thickness of the drawing (default <b>1</b>) 00567 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00568 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00569 */ 00570 void write(GenPolygon<int>* aPolygon, 00571 int aThickness = 1, 00572 QGEcolor aColor = QGE_COLOR_DEFAULT, 00573 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00574 00575 //@} 00576 00577 00578 /** @name Output bounding boxes */ 00579 // ===================== 00580 //@{ 00581 00582 /** 00583 * @brief Write a bounding box with coordinates of type <b>int</b>. 00584 * 00585 * @param aBox a bounding box 00586 * @param aThickness thickness of the drawing (default <b>1</b>) 00587 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00588 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00589 */ 00590 void write(const BoundingBox& aBox, 00591 int aThickness = 1, 00592 QGEcolor aColor = QGE_COLOR_DEFAULT, 00593 QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00594 00595 //@} 00596 00597 00598 // // /** @name Output Qgar primitives */ 00599 // // ====================== 00600 // //@{ 00601 // 00602 // /** 00603 // * @brief Write a list of Qgar primitives with integer coordinates. 00604 // * 00605 // * @param aQPrimList a list of Qgar primitives 00606 // * @param aThickness thickness of the drawing (default <b>1</b>) 00607 // * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 00608 // * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 00609 // */ 00610 // void write(std::list<AbstractGenQgarPrimitive<int>*>& aQPrimList, 00611 // int aThickness = 1, 00612 // QGEcolor aColor = QGE_COLOR_DEFAULT, 00613 // QGEoutline anOutline = QGE_OUTLINE_DEFAULT); 00614 // 00615 // //@} 00616 00617 00618 /** @name Output texts */ 00619 // ============ 00620 //@{ 00621 00622 /** 00623 * @brief Write a text. 00624 * 00625 * @param aText a text 00626 * @param aX X coordinate of the top left corner of the box bounding the text 00627 * @param aY Y coordinate of the top left corner of the box bounding the text 00628 * @param aHeight font size of the text 00629 * @param aColor color of the text (default qgar::QGE_COLOR_DEFAULT) 00630 */ 00631 void write(const char* aText, 00632 int aX, 00633 int aY, 00634 int aHeight, 00635 QGEcolor aColor = QGE_COLOR_DEFAULT); 00636 00637 //@} 00638 00639 00640 // ------------------------------------------------------------------- 00641 // P R O T E C T E D M E M B E R S 00642 // ------------------------------------------------------------------- 00643 protected: 00644 00645 /** @name DXF Colors */ 00646 // ========== 00647 //@{ 00648 00649 /** 00650 * @brief Table to convert Qgar colors into DXF colors. 00651 * 00652 * <table cellpadding="2" cellspacing="1"> 00653 * <tr><td><b>Qgar color</b> </td><td><b>DXF color</b></td></tr> 00654 * <tr><td>qgar::QGE_COLOR_NONE </td><td>black </td></tr> 00655 * <tr><td>qgar::QGE_COLOR_DEFAULT </td><td>black </td></tr> 00656 * <tr><td>qgar::QGE_COLOR_BLACK </td><td>black </td></tr> 00657 * <tr><td>qgar::QGE_COLOR_DARK_GRAY </td><td>gray </td></tr> 00658 * <tr><td>qgar::QGE_COLOR_GRAY </td><td>gray </td></tr> 00659 * <tr><td>qgar::QGE_COLOR_LIGHT_GRAY </td><td>gray </td></tr> 00660 * <tr><td>qgar::QGE_COLOR_WHITE </td><td>white </td></tr> 00661 * <tr><td>qgar::QGE_COLOR_MAGENTA </td><td>magenta </td></tr> 00662 * <tr><td>qgar::QGE_COLOR_PURPLE </td><td>magenta </td></tr> 00663 * <tr><td>qgar::QGE_COLOR_CYAN </td><td>cyan </td></tr> 00664 * <tr><td>qgar::QGE_COLOR_MEDIUM_BLUE </td><td>blue </td></tr> 00665 * <tr><td>qgar::QGE_COLOR_BLUE </td><td>blue </td></tr> 00666 * <tr><td>qgar::QGE_COLOR_OLIVE_GREEN </td><td>green </td></tr> 00667 * <tr><td>qgar::QGE_COLOR_DARK_GREEN </td><td>green </td></tr> 00668 * <tr><td>qgar::QGE_COLOR_GREEN </td><td>green </td></tr> 00669 * <tr><td>qgar::QGE_COLOR_YELLOW </td><td>yellow </td></tr> 00670 * <tr><td>qgar::QGE_COLOR_ORANGE </td><td>red </td></tr> 00671 * <tr><td>qgar::QGE_COLOR_RED </td><td>red </td></tr> 00672 * <tr><td>qgar::QGE_COLOR_PINK </td><td>red </td></tr> 00673 * <tr><td>qgar::QGE_COLOR_SALMON_PINK </td><td>red </td></tr> 00674 * <tr><td>qgar::QGE_COLOR_BROWN </td><td>black </td></tr> 00675 * <tr><td>qgar::QGE_COLOR_CHOCOLATE_BROWN </td><td>black </td></tr> 00676 * </table> 00677 */ 00678 static const int _s_dxf_colors[22]; 00679 00680 //@} 00681 00682 00683 /** @name DXF codes */ 00684 // ========= 00685 //@{ 00686 00687 /** @brief Comment (999) */ static const int _s_dxf_code_com; 00688 /** @brief Identifier (0) */ static const int _s_dxf_code_ident; 00689 /** @brief Name (2) */ static const int _s_dxf_code_name; 00690 /** @brief Color (62) */ static const int _s_dxf_code_color; 00691 /** @brief X1 (10) */ static const int _s_dxf_code_x1; 00692 /** @brief X2 (11) */ static const int _s_dxf_code_x2; 00693 /** @brief Y1 (20) */ static const int _s_dxf_code_y1; 00694 /** @brief Y2 (21) */ static const int _s_dxf_code_y2; 00695 /** @brief Thickness (39) */ static const int _s_dxf_code_thick; 00696 /** @brief Radius / total pattern length (40) */ static const int _s_dxf_code_radius; 00697 /** @brief Start angle (50) */ static const int _s_dxf_code_start; 00698 /** @brief End angle (51) */ static const int _s_dxf_code_end; 00699 /** @brief Standard flag value (70) */ static const int _s_dxf_code_flag; 00700 /** @brief Descriptive text for linetype (3) */ static const int _s_dxf_code_lintp; 00701 /** @brief Alignment code (72) */ static const int _s_dxf_code_algt; 00702 /** @brief Number of dash length items (73) */ static const int _s_dxf_code_dash; 00703 /** @brief Ltype name (6) */ static const int _s_dxf_code_ltp; 00704 /** @brief Layer name (8) */ static const int _s_dxf_code_layer; 00705 /** @brief Elevation (38) */ static const int _s_dxf_code_elev; 00706 /** @brief Vertices flag (66) */ static const int _s_dxf_code_vertflag; 00707 /** @brief Text height (40) */ static const int _s_dxf_code_txthght; 00708 /** @brief Text value (1) */ static const int _s_dxf_code_txt; 00709 00710 //@} 00711 00712 00713 /** @name DXF TAGS */ 00714 // ======== 00715 //@{ 00716 00717 /** @brief SECTION */ static const char* const _s_dxf_tag_sec; 00718 /** @brief TABLES */ static const char* const _s_dxf_tag_tbs; 00719 /** @brief TABLE */ static const char* const _s_dxf_tag_tbl; 00720 /** @brief LAYER */ static const char* const _s_dxf_tag_layer; 00721 /** @brief LTYPE */ static const char* const _s_dxf_tag_ltp; 00722 /** @brief ENTITIES */ static const char* const _s_dxf_tag_ent; 00723 /** @brief ARC */ static const char* const _s_dxf_tag_arc; 00724 /** @brief LINE */ static const char* const _s_dxf_tag_seg; 00725 /** @brief POLYLINE */ static const char* const _s_dxf_tag_polyl; 00726 /** @brief VERTEX */ static const char* const _s_dxf_tag_vert; 00727 /** @brief EOF */ static const char* const _s_dxf_tag_eof; 00728 /** @brief ENDSEC */ static const char* const _s_dxf_tag_end; 00729 /** @brief ENDTAB */ static const char* const _s_dxf_tag_etb; 00730 /** @brief SEQEND */ static const char* const _s_dxf_tag_esq; 00731 /** @brief TEXT */ static const char* const _s_dxf_tag_txt; 00732 00733 //@} 00734 00735 00736 /** @name DXF comments */ 00737 // ============ 00738 //@{ 00739 00740 /** @brief Created by Qgar on */ static const char* const _s_dxf_com_create; 00741 /** @brief Definitions */ static const char* const _s_dxf_com_def; 00742 /** @brief Linetype definitions */ static const char* const _s_dxf_com_ltp; 00743 /** @brief Layer definitions */ static const char* const _s_dxf_com_layer; 00744 /** @brief Entities */ static const char* const _s_dxf_com_ent; 00745 /** @brief Segment */ static const char* const _s_dxf_com_seg; 00746 /** @brief Arc */ static const char* const _s_dxf_com_arc; 00747 /** @brief Dividing wall */ static const char* const _s_dxf_com_dwall; 00748 /** @brief Bearing wall */ static const char* const _s_dxf_com_bwall; 00749 /** @brief Simple window */ static const char* const _s_dxf_com_swind; 00750 /** @brief Double window */ static const char* const _s_dxf_com_dwind; 00751 /** @brief Door */ static const char* const _s_dxf_com_door; 00752 /** @brief Stairs */ static const char* const _s_dxf_com_stairs; 00753 /** @brief Pipe */ static const char* const _s_dxf_com_pipe; 00754 /** @brief Chaine */ static const char* const _s_dxf_com_chain; 00755 /** @brief Polyline */ static const char* const _s_dxf_com_polyl; 00756 /** @brief Texte */ static const char* const _s_dxf_com_txt; 00757 00758 //@} 00759 00760 00761 /** @name DXF defaults */ 00762 // ============ 00763 //@{ 00764 00765 /** @brief Linetype for contnuous lines (CONTINUOUS") */ static const char* const _s_dxf_default_cont; 00766 /** @brief Linetype for dashed lines (DASHED) */ static const char* const _s_dxf_default_dash; 00767 /** @brief Descriptive for LTYPE (----) */ static const char* const _s_dxf_default_dltp; 00768 /** @brief Number of LTYPE (1) */ static const int _s_dxf_default_ltp; 00769 /** @brief Flag value for LAYER (2) */ static const int _s_dxf_default_fly; 00770 /** @brief Number of LAYERS (8) */ static const int _s_dxf_default_layer; 00771 /** @brief Flag value for LTYPE (64) */ static const int _s_dxf_default_flt; 00772 /** @brief Aligment value for LTYPE (65) */ static const int _s_dxf_default_alg; 00773 /** @brief Dash length for continuous lines (0) */ static const int _s_dxf_default_dash1; 00774 /** @brief Dash length for dashed lines (2) */ static const int _s_dxf_default_dash2; 00775 /** @brief Length pattern for continuous lines (0.0) */ static const double _s_dxf_default_pat1; 00776 /** @brief Length pattern for dashed lines (2.0) */ static const double _s_dxf_default_pat2; 00777 /** @brief Default width for POLYLINE (1) */ static const int _s_dxf_default_wpo; 00778 /** @brief Vertices follow POLYLINE definition (1) */ static const int _s_dxf_default_vfg; 00779 /** @brief Polylines are opened (0) */ static const int _s_dxf_default_pfgo; 00780 /** @brief Polylines are closed (1) */ static const int _s_dxf_default_pfgc; 00781 00782 //@} 00783 00784 00785 /** @name DXF layers */ 00786 // ========== 00787 //@{ 00788 00789 /** @brief PRIMITIVE */ static const char* const _s_dxf_layer_prm; 00790 /** @brief DIVWALL */ static const char* const _s_dxf_layer_dwall; 00791 /** @brief BEARWALL */ static const char* const _s_dxf_layer_bwall; 00792 /** @brief SIMWINDOW */ static const char* const _s_dxf_layer_swind; 00793 /** @brief DOUWINDOW */ static const char* const _s_dxf_layer_dwind; 00794 /** @brief DOOR */ static const char* const _s_dxf_layer_door; 00795 /** @brief STAIRS */ static const char* const _s_dxf_layer_stairs; 00796 /** @brief PIPE */ static const char* const _s_dxf_layer_pipe; 00797 /** @brief CHAINE */ static const char* const _s_dxf_layer_chain; 00798 /** @brief POLYLINE */ static const char* const _s_dxf_layer_polyl; 00799 /** @brief TEXT */ static const char* const _s_dxf_layer_txt; 00800 00801 //@} 00802 00803 00804 /** @name DXF features */ 00805 // ============ 00806 //@{ 00807 00808 /** 00809 * @brief Maximum length of a DXF field (<b>256</b>). 00810 */ 00811 static const unsigned int _s_dxf_maxbuf; 00812 00813 //@} 00814 00815 00816 /** @name Image size */ 00817 // ========== 00818 //@{ 00819 00820 /** 00821 * @brief Maximal X coordinate. 00822 */ 00823 int _maxX; 00824 00825 /** 00826 * @brief Maximal Y coordinate. 00827 */ 00828 int _maxY; 00829 00830 //@} 00831 00832 00833 /** @name Last group read */ 00834 // =============== 00835 //@{ 00836 00837 /** 00838 * @brief Code of last group read. 00839 */ 00840 int _lastGroupCode; 00841 00842 /** 00843 * @brief Value of last group read. 00844 */ 00845 char* _lastGroup; 00846 00847 //@} 00848 00849 00850 /** @name Buffers to store primitives contained in the file */ 00851 // ================================================= 00852 //@{ 00853 00854 /** 00855 * @brief Segments contained in the file. 00856 */ 00857 std::list<GenQgarSegment<int>*> _segmentList; 00858 00859 /** 00860 * @brief Arcs contained in the file. 00861 */ 00862 std::list<GenQgarArc<int>*> _arcList; 00863 00864 /** 00865 * @brief Chains of points contained in the file. 00866 */ 00867 std::list<GenPointChain<int>*> _chainList; 00868 00869 /** 00870 * @brief Polylines contained in the file. 00871 */ 00872 std::list<GenQgarPolyline<int>*> _polylineList; 00873 00874 //@} 00875 00876 00877 /** @name Save DXF entities in the file */ 00878 // ============================= 00879 //@{ 00880 00881 /** 00882 * @brief Save a DXF group into the file. 00883 * 00884 * @param aCode 00885 * @param aGroup 00886 */ 00887 template <class T> 00888 void 00889 saveDxfGroup(int aCode, const T aGroup); 00890 00891 /** 00892 * @brief Save a DXF layer into the file. 00893 * 00894 * @param aName 00895 * @param aFlag 00896 * @param aColor 00897 * @param aLType 00898 */ 00899 void saveDxfLayer(const char* aName, 00900 int aFlag, 00901 int aColor, 00902 const char* aLType); 00903 00904 /** 00905 * @brief Save DXF features into the file. 00906 * 00907 * @param aLayer 00908 * @param aThickness thickness of the drawing 00909 * @param aColor color of the drawing 00910 * @param isDashed (default <b>false</b>) 00911 */ 00912 void saveDxfFeatures(const char* aLayer, 00913 int aThickness, 00914 QGEcolor aColor, 00915 bool isDashed); 00916 00917 //@} 00918 00919 00920 /** @name Save primitives in the file */ 00921 // =========================== 00922 //@{ 00923 00924 /** 00925 * @brief Save a chain of points. 00926 * 00927 * @param aChain a chain 00928 * @param aThickness thickness of the drawing 00929 * @param aColor color of the drawing 00930 */ 00931 template <class T> 00932 void 00933 saveChain(AbstractGenPointChain<T>& aChain, 00934 int aThickness, 00935 QGEcolor aColor); 00936 00937 /** 00938 * @brief Save a segment with <b>integer</b> coordinates. 00939 * 00940 * @param aXSource X coordinate of the source point 00941 * @param aYSource Y coordinate of the source point 00942 * @param aXTarget X coordinate of the target point 00943 * @param aYTarget Y coordinate of the target point 00944 * @param aThickness thickness of the drawing 00945 * @param aColor color of the drawing 00946 * @param anOutline outline of the drawing 00947 */ 00948 void saveSegment(int aXSource, 00949 int aYSource, 00950 int aXTarget, 00951 int aYTarget, 00952 int aThickness, 00953 QGEcolor aColor, 00954 QGEoutline anOutline); 00955 00956 /** 00957 * @brief Save an arc with <b>integer</b> coordinates. 00958 * 00959 * @param aXSource X coordinate of source point 00960 * @param aYSource Y coordinate of source point 00961 * @param aXTarget X coordinate of target point 00962 * @param aYTarget Y coordinate of target point 00963 * @param aXCenter X coordinate of the center 00964 * @param aYCenter Y coordinate of the center 00965 * @param aSourceAngle angle at source point 00966 * @param aTargetAngle angle at target point 00967 * @param aRadius radius of the arc 00968 * @param aThickness thickness of the drawing 00969 * @param aColor color of the drawing 00970 * @param anOutline outline of the drawing 00971 */ 00972 void saveArc(int aXSource, 00973 int aYSource, 00974 int aXTarget, 00975 int aYTarget, 00976 int aXCenter, 00977 int aYCenter, 00978 int aSourceAngle, 00979 int aTargetAngle, 00980 int aRadius, 00981 int aThickness, 00982 QGEcolor aColor, 00983 QGEoutline anOutline); 00984 00985 /** 00986 * @brief Save a polyline. 00987 * 00988 * @param aPoly a polyline 00989 * @param aThickness thickness of the drawing 00990 * @param aColor color of the drawing 00991 * @param anOutline outline of the drawing 00992 */ 00993 template <class T> 00994 void 00995 savePolyline(const GenPolyline<T>& aPoly, 00996 int aThickness, 00997 QGEcolor aColor, 00998 QGEoutline anOutline); 00999 01000 /** 01001 * @brief Save a bounding box. 01002 * 01003 * @param aXTopLeft X coordinate of top left corner 01004 * @param aYTopLeft Y coordinate of top left corner 01005 * @param aXBottomRight X coordinate of bottom right corner 01006 * @param aYBottomRight Y coordinate of bottom right corner 01007 * @param aThickness thickness of the drawing 01008 * @param aColor color of the drawing 01009 * @param anOutline outline of the drawing 01010 */ 01011 void saveBox(int aXTopLeft, 01012 int aYTopLeft, 01013 int aXBottomRight, 01014 int aYBottomRight, 01015 int aThickness, 01016 QGEcolor aColor, 01017 QGEoutline anOutline); 01018 01019 //@} 01020 01021 01022 /** @name Retrieve DXF entities from the file */ 01023 // =================================== 01024 //@{ 01025 01026 /** 01027 * @brief Retrieve a DXF Group from the file. 01028 * 01029 * Return the code of the group which has been retrieved, and store 01030 * the corresponding value in the qgar::DxfFile::lastGroup 01031 * data member as a chain of characters. 01032 * Comments are ignored. 01033 */ 01034 int retrieveDxfGroup(); 01035 01036 //@} 01037 01038 01039 /** @name Retrieve a primitive from the file and append it to a list */ 01040 // ========================================================== 01041 //@{ 01042 01043 /** 01044 * @brief Retrieve a (Qgar) segment from the file. 01045 * 01046 * The segment is added to the end of the given list. 01047 * 01048 * @param aQSegList list to store the segment 01049 * 01050 * @exception qgar::QgarErrorIO (junk in file) 01051 */ 01052 void 01053 retrieveQgarSegment(std::list<GenQgarSegment<int>*>& aQSegList) 01054 throw(QgarErrorIO); 01055 01056 /** 01057 * @brief Retrieve a (Qgar) arc from the file. 01058 * 01059 * The arc is added to the end of the given list. 01060 * 01061 * @param aQArcList list to store the arc that is read 01062 * 01063 * @exception qgar::QgarErrorIO (junk in file) 01064 */ 01065 void retrieveQgarArc(std::list<GenQgarArc<int>*>& aQArcList) 01066 throw(QgarErrorIO); 01067 01068 /** 01069 * @brief Retrieve a chain of points or a (Qgar) polyline 01070 * from the file. 01071 * 01072 * @param aChainList when the entity is a chain, 01073 * it is added to the end of this list 01074 * @param aQPolyList when the entity is a polyline, 01075 * it is added to the end of this list 01076 * 01077 * @exception qgar::QgarErrorIO (junk in file) 01078 */ 01079 void 01080 retrieveChainOrQgarPolyline(std::list<GenPointChain<int>*>& aChainList, 01081 std::list<GenQgarPolyline<int>*>& aQPolyList) 01082 throw(QgarErrorIO); 01083 01084 /** 01085 * @brief Retrieve points (vertices of a polyline) from the file. 01086 * 01087 * @param aPointList list to store the vertices of the polyline 01088 * @param aThickness only significant when the function is called 01089 * to construct a Qgar polyline 01090 * @param isDashed 01091 */ 01092 void retrievePoints(std::list<Point>& aPointList, 01093 int* aThickness, 01094 bool* isDashed); 01095 //@} 01096 01097 01098 /** @name Get a pointer to a primitive of the file */ 01099 // ======================================== 01100 //@{ 01101 01102 /** 01103 * @brief Get a pointer to a (Qgar) segment from the file. 01104 */ 01105 GenQgarSegment<int>* retrievePQgarSegment(); 01106 01107 /** 01108 * @brief Get a pointer to a (Qgar) arc from the file. 01109 */ 01110 GenQgarArc<int>* retrievePQgarArc(); 01111 01112 /** 01113 * @brief Get a pointer to a (Qgar) polyline from the file. 01114 */ 01115 GenQgarPolyline<int>* retrievePQgarPolyline(); 01116 01117 /** 01118 * @brief Get a pointer to a chain of points from the file. 01119 */ 01120 GenPointChain<int>* retrievePChain(); 01121 01122 //@} 01123 01124 01125 // --------------------------------------------------------------------- 01126 // P R I V A T E F U N C T I O N S 01127 // --------------------------------------------------------------------- 01128 private: 01129 01130 // ============================================================ 01131 /** @name Not yet implemented 01132 These functions belong to the private section 01133 as they are not yet implemented and thus should not be used. 01134 */ 01135 // ============================================================ 01136 //@{ 01137 01138 // /** @name Output components */ 01139 // // ================= 01140 // //@{ 01141 01142 /** 01143 * @brief Write a (connected) component. 01144 * 01145 * A component is represented by its contour and the contours 01146 * of included components. 01147 * 01148 * @param aPNode pointer to the node of the component tree 01149 * including the component 01150 * @param aThickness thickness of the drawing (default <b>1</b>) 01151 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01152 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 01153 * 01154 * @warning Not yet implemented. 01155 * 01156 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01157 * 01158 * @todo Implement 01159 * qgar::DxfFile::write(const qgar::ConnectedComponents::node_type* const, int, qgar::QGEcolor, qgar::QGEoutline) 01160 */ 01161 void write(const ConnectedComponents::node_type* const aPNode, 01162 int aThickness = 1, 01163 QGEcolor aColor = QGE_COLOR_DEFAULT, 01164 QGEoutline anOutline = QGE_OUTLINE_DEFAULT) 01165 throw(QgarErrorDeveloper); 01166 01167 // //@} 01168 01169 01170 // /** @name Output circles and arcs of circle */ 01171 // // ================================= 01172 // //@{ 01173 01174 /** 01175 * @brief Write an arc with coordinates of type <b>int</b>. 01176 * 01177 * @param aCenter centre of the circle 01178 * @param aRadius radius of the circle 01179 * @param aThickness thickness of the drawing (default <b>1</b>) 01180 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01181 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 01182 * 01183 * @warning Not yet implemented. 01184 * 01185 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01186 * 01187 * @todo Implement 01188 * qgar::DxfFile::write(const qgar::GenPoint<int>&, double, int, qgar::QGEcolor, qgar::QGEoutline) 01189 */ 01190 void write(const GenPoint<int>& aCenter, 01191 double aRadius, 01192 int aThickness = 1, 01193 QGEcolor aColor = QGE_COLOR_DEFAULT, 01194 QGEoutline anOutline = QGE_OUTLINE_DEFAULT) 01195 throw(QgarErrorDeveloper); 01196 01197 /** 01198 * @brief Write an arc with coordinates of type <b>float</b>. 01199 * 01200 * @param aCenter centre of the circle 01201 * @param aRadius radius of the circle 01202 * @param aThickness thickness of the drawing (default <b>1</b>) 01203 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01204 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 01205 * 01206 * @warning Not yet implemented. 01207 * 01208 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01209 * 01210 * @todo Implement 01211 * qgar::DxfFile::write(const qgar::GenPoint<float>&, double, int, qgar::QGEcolor, qgar::QGEoutline) 01212 */ 01213 void write(const GenPoint<float>& aCenter, 01214 double aRadius, 01215 int aThickness = 1, 01216 QGEcolor aColor = QGE_COLOR_DEFAULT, 01217 QGEoutline anOutline = QGE_OUTLINE_DEFAULT) 01218 throw(QgarErrorDeveloper); 01219 01220 /** 01221 * @brief Write an arc with coordinates of type <b>double</b>. 01222 * 01223 * @param aCenter centre of the circle 01224 * @param aRadius radius of the circle 01225 * @param aThickness thickness of the drawing (default <b>1</b>) 01226 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01227 * @param anOutline outline of the drawing (default qgar::QGE_OUTLINE_DEFAULT) 01228 * 01229 * @warning Not yet implemented. 01230 * 01231 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01232 * 01233 * @todo Implement 01234 * qgar::DxfFile::write(const qgar::GenPoint<double>&, double, int, qgar::QGEcolor, qgar::QGEoutline) 01235 */ 01236 void write(const GenPoint<double>& aCenter, 01237 double aRadius, 01238 int aThickness = 1, 01239 QGEcolor aColor = QGE_COLOR_DEFAULT, 01240 QGEoutline anOutline = QGE_OUTLINE_DEFAULT) 01241 throw(QgarErrorDeveloper); 01242 01243 // //@} 01244 01245 01246 // /** @name Output points */ 01247 // // ============= 01248 // //@{ 01249 01250 /** 01251 * @brief Write a point with coordinates of type <b>int</b>. 01252 * 01253 * @param aPt a point 01254 * @param aThickness thickness of the drawing (default <b>3</b> 01255 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01256 * 01257 * @warning Not yet implemented. 01258 * 01259 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01260 * 01261 * @todo Implement 01262 * qgar::DxfFile::write(const qgar::GenPoint<int>&, int, qgar::QGEcolor) 01263 */ 01264 void write(const GenPoint<int>& aPt, 01265 int aThickness = 3, 01266 QGEcolor aColor = QGE_COLOR_DEFAULT) 01267 throw(QgarErrorDeveloper); 01268 01269 /** 01270 * @brief Write a point with coordinates of type <b>float</b>. 01271 * 01272 * @param aPt a point 01273 * @param aThickness thickness of the drawing (default <b>3</b> 01274 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01275 * 01276 * @warning Not yet implemented. 01277 * 01278 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01279 * 01280 * @todo Implement 01281 * qgar::DxfFile::write(const qgar::GenPoint<float>&, int, qgar::QGEcolor) 01282 */ 01283 void write(const GenPoint<float>& aPt, 01284 int aThickness = 3, 01285 QGEcolor aColor = QGE_COLOR_DEFAULT) 01286 throw(QgarErrorDeveloper); 01287 01288 /** 01289 * @brief Write a point with coordinates of type <b>double</b>. 01290 * 01291 * @param aPt a point 01292 * @param aThickness thickness of the drawing (default <b>3</b> 01293 * @param aColor color of the drawing (default qgar::QGE_COLOR_DEFAULT) 01294 * 01295 * @warning Not yet implemented. 01296 * 01297 * @exception qgar::QgarErrorDeveloper (not yet implemented) 01298 * 01299 * @todo Implement 01300 * qgar::DxfFile::write(const qgar::GenPoint<double>&, int, qgar::QGEcolor) 01301 */ 01302 void write(const GenPoint<double>& aPt, 01303 int aThickness = 3, 01304 QGEcolor aColor = QGE_COLOR_DEFAULT) 01305 throw(QgarErrorDeveloper); 01306 01307 // //@} 01308 01309 //@} 01310 01311 // ------------------------------------------------------------------- 01312 01313 }; // class DxfFile 01314 01315 01316 01317 01318 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 01319 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 01320 // I N L I N E F U N C T I O N S I M P L E M E N T A T I O N 01321 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 01322 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 01323 01324 01325 01326 // ========== 01327 // IMAGE SIZE 01328 // ========== 01329 01330 01331 // GET THE MAXIMAL X COORDINATE OF THE IMAGE 01332 01333 inline int 01334 DxfFile::sizeX() const 01335 { 01336 return _maxX; 01337 } 01338 01339 01340 // GET THE MAXIMAL Y COORDINATE OF THE IMAGE 01341 01342 inline int 01343 DxfFile::sizeY() const 01344 { 01345 return _maxY; 01346 } 01347 01348 01349 // ================================ 01350 // ACCESS TO PRIMITIVES OF THE FILE 01351 // ================================ 01352 01353 01354 // GET THE CHAINS OF POINTS CONTAINED IN THE FILE 01355 01356 inline const std::list<GenPointChain<int>*>& 01357 DxfFile::accessChains() const 01358 { 01359 return _chainList; 01360 } 01361 01362 01363 // GET A COPY OF THE CHAINS OF POINTS CONTAINED IN THE FILE 01364 01365 inline void 01366 DxfFile::chains(std::list<GenPointChain<int>*>& aChainList) const 01367 { 01368 transform(_chainList.begin(), 01369 _chainList.end(), 01370 back_inserter(aChainList), 01371 qstlCloneObject()); 01372 } 01373 01374 01375 // GET THE (QGAR) SEGMENTS CONTAINED IN THE FILE 01376 01377 inline const std::list<GenQgarSegment<int>*>& 01378 DxfFile::accessSegments() const 01379 { 01380 return _segmentList; 01381 } 01382 01383 01384 // GET A COPY OF THE (QGAR) SEGMENTS CONTAINED IN THE FILE 01385 01386 inline void 01387 DxfFile::segments(std::list<GenQgarSegment<int>*>& aQSegList) const 01388 { 01389 transform(_segmentList.begin(), 01390 _segmentList.end(), 01391 back_inserter(aQSegList), 01392 qstlCloneObject()); 01393 } 01394 01395 01396 // GET THE (QGAR) ARCS CONTAINED IN THE FILE 01397 01398 inline const std::list<GenQgarArc<int>*>& 01399 DxfFile::accessArcs() const 01400 { 01401 return _arcList; 01402 } 01403 01404 01405 // GET A COPY OF THE (QGAR) ARCS CONTAINED IN THE FILE 01406 01407 inline void 01408 DxfFile::arcs(std::list<GenQgarArc<int>*>& aQArcList) const 01409 { 01410 transform(_arcList.begin(), 01411 _arcList.end(), 01412 back_inserter(aQArcList), 01413 qstlCloneObject()); 01414 } 01415 01416 01417 // GET THE (QGAR) POLYLINES CONTAINED IN THE FILE 01418 01419 inline const std::list<GenQgarPolyline<int>*>& 01420 DxfFile::accessPolylines() const 01421 { 01422 return _polylineList; 01423 } 01424 01425 01426 // GET A COPY OF THE (QGAR) POLYLINES CONTAINED IN THE FILE 01427 01428 inline void 01429 DxfFile::polylines(std::list<GenQgarPolyline<int>*>& aQPolylineList) const 01430 { 01431 transform(_polylineList.begin(), 01432 _polylineList.end(), 01433 back_inserter(aQPolylineList), 01434 qstlCloneObject()); 01435 } 01436 01437 01438 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 01439 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 01440 01441 01442 } // namespace qgar 01443 01444 #endif /* __DXFFILE_H_INCLUDED__ */