<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.12"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Engauge Digitizer: Export/ExportToFile.cpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Engauge Digitizer  <span id="projectnumber">2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.12 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_f80ae12f35ecbe33e4cb7b0dcc46c869.html">Export</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">ExportToFile.cpp</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/******************************************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> ******************************************************************************************************/</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> </div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include "Document.h"</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "ExportFileFunctions.h"</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include "ExportFileRelations.h"</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "ExportToFile.h"</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "Logger.h"</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include "MainWindowModel.h"</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include <QTextStream></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include "Transformation.h"</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">const</span> QString CSV_FILENAME_EXTENSION (<span class="stringliteral">"csv"</span>);</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">const</span> QString TSV_FILENAME_EXTENSION (<span class="stringliteral">"tsv"</span>);</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="classExportToFile.html#ad812e65b048386453fe30d06133ee8fc"> 19</a></span> <a class="code" href="classExportToFile.html#ad812e65b048386453fe30d06133ee8fc">ExportToFile::ExportToFile</a>()</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> {</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> }</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classExportToFile.html#accb332d43a56934a44085ca62eda1bb1"> 23</a></span> <span class="keywordtype">void</span> <a class="code" href="classExportToFile.html#accb332d43a56934a44085ca62eda1bb1">ExportToFile::exportToFile</a> (<span class="keyword">const</span> <a class="code" href="classDocumentModelExportFormat.html">DocumentModelExportFormat</a> &modelExport,</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <span class="keyword">const</span> <a class="code" href="classDocument.html">Document</a> &document,</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keyword">const</span> <a class="code" href="classMainWindowModel.html">MainWindowModel</a> &modelMainWindow,</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keyword">const</span> <a class="code" href="classTransformation.html">Transformation</a> &transformation,</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  QTextStream &str)<span class="keyword"> const</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword"></span>{</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  LOG4CPP_INFO_S ((*mainCat)) << <span class="stringliteral">"ExportToFile::exportToFile"</span>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <a class="code" href="classExportFileFunctions.html">ExportFileFunctions</a> exportFunctions;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  exportFunctions.<a class="code" href="classExportFileFunctions.html#ab091f338b2b3a599c31a6682d5eb6f70">exportToFile</a> (modelExport,</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  document,</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  modelMainWindow,</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  transformation,</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  str);</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="classExportFileRelations.html">ExportFileRelations</a> exportRelations;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  exportRelations.<a class="code" href="classExportFileRelations.html#a0a1199beb13f3dfcce38bdb0cc4c37d2">exportToFile</a> (modelExport,</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  document,</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  modelMainWindow,</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  transformation,</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  str);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> }</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classExportToFile.html#af7fe4f8b592739519fc9f6e82465df6b"> 46</a></span> QString <a class="code" href="classExportToFile.html#af7fe4f8b592739519fc9f6e82465df6b">ExportToFile::fileExtensionCsv</a> ()<span class="keyword"> const</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword"></span>{</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">return</span> CSV_FILENAME_EXTENSION;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> }</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classExportToFile.html#ae1ef7390a04407ed81ae59e3549a8718"> 51</a></span> QString <a class="code" href="classExportToFile.html#ae1ef7390a04407ed81ae59e3549a8718">ExportToFile::fileExtensionTsv</a> ()<span class="keyword"> const</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="keyword"></span>{</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">return</span> TSV_FILENAME_EXTENSION;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> }</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classExportToFile.html#a3913283259c189f82c9c72ba8fe93f16"> 56</a></span> QString <a class="code" href="classExportToFile.html#a3913283259c189f82c9c72ba8fe93f16">ExportToFile::filterCsv</a> ()<span class="keyword"> const</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keyword"></span>{</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">return</span> QString (<span class="stringliteral">"Text CSV (*.%1)"</span>)</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  .arg (CSV_FILENAME_EXTENSION);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> }</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classExportToFile.html#a0031108108b0601c75bea6d5796e2eb1"> 62</a></span> QString <a class="code" href="classExportToFile.html#a0031108108b0601c75bea6d5796e2eb1">ExportToFile::filterTsv</a> ()<span class="keyword"> const</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="keyword"></span>{</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">return</span> QString (<span class="stringliteral">"Text TSV (*.%1)"</span>)</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  .arg (TSV_FILENAME_EXTENSION);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> }</div><div class="ttc" id="classDocumentModelExportFormat_html"><div class="ttname"><a href="classDocumentModelExportFormat.html">DocumentModelExportFormat</a></div><div class="ttdoc">Model for DlgSettingsExportFormat and CmdSettingsExportFormat. </div><div class="ttdef"><b>Definition:</b> <a href="DocumentModelExportFormat_8h_source.html#l00023">DocumentModelExportFormat.h:23</a></div></div> <div class="ttc" id="classExportToFile_html_accb332d43a56934a44085ca62eda1bb1"><div class="ttname"><a href="classExportToFile.html#accb332d43a56934a44085ca62eda1bb1">ExportToFile::exportToFile</a></div><div class="ttdeci">void exportToFile(const DocumentModelExportFormat &modelExport, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, QTextStream &str) const</div><div class="ttdoc">Export Document points according to the settings. </div><div class="ttdef"><b>Definition:</b> <a href="ExportToFile_8cpp_source.html#l00023">ExportToFile.cpp:23</a></div></div> <div class="ttc" id="classExportToFile_html_a3913283259c189f82c9c72ba8fe93f16"><div class="ttname"><a href="classExportToFile.html#a3913283259c189f82c9c72ba8fe93f16">ExportToFile::filterCsv</a></div><div class="ttdeci">QString filterCsv() const</div><div class="ttdoc">QFileDialog filter for CSV files. </div><div class="ttdef"><b>Definition:</b> <a href="ExportToFile_8cpp_source.html#l00056">ExportToFile.cpp:56</a></div></div> <div class="ttc" id="classTransformation_html"><div class="ttname"><a href="classTransformation.html">Transformation</a></div><div class="ttdoc">Affine transformation between screen and graph coordinates, based on digitized axis points...</div><div class="ttdef"><b>Definition:</b> <a href="Transformation_8h_source.html#l00031">Transformation.h:31</a></div></div> <div class="ttc" id="classExportFileRelations_html"><div class="ttname"><a href="classExportFileRelations.html">ExportFileRelations</a></div><div class="ttdoc">Strategy class for exporting to a file. This strategy is external to the Document class so that class...</div><div class="ttdef"><b>Definition:</b> <a href="ExportFileRelations_8h_source.html#l00025">ExportFileRelations.h:25</a></div></div> <div class="ttc" id="classMainWindowModel_html"><div class="ttname"><a href="classMainWindowModel.html">MainWindowModel</a></div><div class="ttdoc">Model for DlgSettingsMainWindow. </div><div class="ttdef"><b>Definition:</b> <a href="MainWindowModel_8h_source.html#l00027">MainWindowModel.h:27</a></div></div> <div class="ttc" id="classDocument_html"><div class="ttname"><a href="classDocument.html">Document</a></div><div class="ttdoc">Storage of one imported image and the data attached to that image. </div><div class="ttdef"><b>Definition:</b> <a href="Document_8h_source.html#l00041">Document.h:41</a></div></div> <div class="ttc" id="classExportToFile_html_ae1ef7390a04407ed81ae59e3549a8718"><div class="ttname"><a href="classExportToFile.html#ae1ef7390a04407ed81ae59e3549a8718">ExportToFile::fileExtensionTsv</a></div><div class="ttdeci">QString fileExtensionTsv() const</div><div class="ttdoc">File extension for tsv export files. </div><div class="ttdef"><b>Definition:</b> <a href="ExportToFile_8cpp_source.html#l00051">ExportToFile.cpp:51</a></div></div> <div class="ttc" id="classExportFileFunctions_html"><div class="ttname"><a href="classExportFileFunctions.html">ExportFileFunctions</a></div><div class="ttdoc">Strategy class for exporting to a file. This strategy is external to the Document class so that class...</div><div class="ttdef"><b>Definition:</b> <a href="ExportFileFunctions_8h_source.html#l00024">ExportFileFunctions.h:24</a></div></div> <div class="ttc" id="classExportToFile_html_af7fe4f8b592739519fc9f6e82465df6b"><div class="ttname"><a href="classExportToFile.html#af7fe4f8b592739519fc9f6e82465df6b">ExportToFile::fileExtensionCsv</a></div><div class="ttdeci">QString fileExtensionCsv() const</div><div class="ttdoc">File extension for csv export files. </div><div class="ttdef"><b>Definition:</b> <a href="ExportToFile_8cpp_source.html#l00046">ExportToFile.cpp:46</a></div></div> <div class="ttc" id="classExportToFile_html_a0031108108b0601c75bea6d5796e2eb1"><div class="ttname"><a href="classExportToFile.html#a0031108108b0601c75bea6d5796e2eb1">ExportToFile::filterTsv</a></div><div class="ttdeci">QString filterTsv() const</div><div class="ttdoc">QFileDialog filter for TSV files. </div><div class="ttdef"><b>Definition:</b> <a href="ExportToFile_8cpp_source.html#l00062">ExportToFile.cpp:62</a></div></div> <div class="ttc" id="classExportFileFunctions_html_ab091f338b2b3a599c31a6682d5eb6f70"><div class="ttname"><a href="classExportFileFunctions.html#ab091f338b2b3a599c31a6682d5eb6f70">ExportFileFunctions::exportToFile</a></div><div class="ttdeci">void exportToFile(const DocumentModelExportFormat &modelExportOverride, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, QTextStream &str) const</div><div class="ttdoc">Export Document points according to the settings. </div><div class="ttdef"><b>Definition:</b> <a href="ExportFileFunctions_8cpp_source.html#l00129">ExportFileFunctions.cpp:129</a></div></div> <div class="ttc" id="classExportToFile_html_ad812e65b048386453fe30d06133ee8fc"><div class="ttname"><a href="classExportToFile.html#ad812e65b048386453fe30d06133ee8fc">ExportToFile::ExportToFile</a></div><div class="ttdeci">ExportToFile()</div><div class="ttdoc">Single constructor. </div><div class="ttdef"><b>Definition:</b> <a href="ExportToFile_8cpp_source.html#l00019">ExportToFile.cpp:19</a></div></div> <div class="ttc" id="classExportFileRelations_html_a0a1199beb13f3dfcce38bdb0cc4c37d2"><div class="ttname"><a href="classExportFileRelations.html#a0a1199beb13f3dfcce38bdb0cc4c37d2">ExportFileRelations::exportToFile</a></div><div class="ttdeci">void exportToFile(const DocumentModelExportFormat &modelExportOverride, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, QTextStream &str) const</div><div class="ttdoc">Export Document points according to the settings. </div><div class="ttdef"><b>Definition:</b> <a href="ExportFileRelations_8cpp_source.html#l00106">ExportFileRelations.cpp:106</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Dec 25 2016 20:54:08 for Engauge Digitizer by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.12 </small></address> </body> </html>