source: tspsg/docs/html/tspmodel_8h_source.html @ 7bb19df196

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since 7bb19df196 was f2ff738751, checked in by Oleksii Serdiuk, 15 years ago

Updated translations and regenerated documentation.

  • Property mode set to 100644
File size: 13.7 KB
RevLine 
[8af59c4aa3]1<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6<title>TSPSG: TSP Solver and Generator: src/tspmodel.h Source File</title>
7<link href="tabs.css" rel="stylesheet" type="text/css"/>
8<link href="search/search.css" rel="stylesheet" type="text/css"/>
9<script type="text/javaScript" src="search/search.js"></script>
10<link href="doxygen.css" rel="stylesheet" type="text/css"/>
11</head>
12<body onload='searchBox.OnSelectItem(0);'>
13<!-- Generated by Doxygen 1.6.1 -->
14<script type="text/javascript"><!--
15var searchBox = new SearchBox("searchBox", "search",false,'Search');
16--></script>
17<script type="text/javascript">
18<!--
19function changeDisplayState (e){
20  var num=this.id.replace(/[^[0-9]/g,'');
21  var button=this.firstChild;
22  var sectionDiv=document.getElementById('dynsection'+num);
23  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
24    sectionDiv.style.display='block';
25    button.src='open.gif';
26  }else{
27    sectionDiv.style.display='none';
28    button.src='closed.gif';
29  }
30}
31function initDynSections(){
32  var divs=document.getElementsByTagName('div');
33  var sectionCounter=1;
34  for(var i=0;i<divs.length-1;i++){
35    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
36      var header=divs[i];
37      var section=divs[i+1];
38      var button=header.firstChild;
39      if (button!='IMG'){
40        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
41        button=document.createElement('img');
42        divs[i].insertBefore(button,divs[i].firstChild);
43      }
44      header.style.cursor='pointer';
45      header.onclick=changeDisplayState;
46      header.id='dynheader'+sectionCounter;
47      button.src='closed.gif';
48      section.id='dynsection'+sectionCounter;
49      section.style.display='none';
50      section.style.marginLeft='14px';
51      sectionCounter++;
52    }
53  }
54}
55window.onload = initDynSections;
56-->
57</script>
58<div class="navigation" id="top">
59  <div class="tabs">
60    <ul>
61      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
62      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
[f2ff738751]63      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
[8af59c4aa3]64      <li><a href="annotated.html"><span>Classes</span></a></li>
65      <li class="current"><a href="files.html"><span>Files</span></a></li>
66      <li>
67        <div id="MSearchBox" class="MSearchBoxInactive">
68        <img id="MSearchSelect" src="search/search.png"
69             onmouseover="return searchBox.OnSearchSelectShow()"
70             onmouseout="return searchBox.OnSearchSelectHide()"
71             alt=""/>
72        <input type="text" id="MSearchField" value="Search" accesskey="S"
73             onfocus="searchBox.OnSearchFieldFocus(true)" 
74             onblur="searchBox.OnSearchFieldFocus(false)" 
75             onkeyup="searchBox.OnSearchFieldChange(event)"/>
76        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
77        </div>
78      </li>
79    </ul>
80  </div>
81  <div class="tabs">
82    <ul>
83      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
84      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
85    </ul>
86  </div>
87<h1>src/tspmodel.h</h1><a href="tspmodel_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
88<a name="l00028"></a>00028 <span class="preprocessor">#ifndef TSPMODEL_H</span>
89<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define TSPMODEL_H</span>
90<a name="l00030"></a>00030 <span class="preprocessor"></span>
91<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="globals_8h.html" title="Contains TSPSG global defines.">globals.h</a>&quot;</span>
92<a name="l00032"></a>00032
[a218bf2cb2]93<a name="l00037"></a><a class="code" href="class_c_t_s_p_model.html">00037</a> <span class="keyword">class </span><a class="code" href="class_c_t_s_p_model.html" title="This class implements table model for manipulating a task.">CTSPModel</a>: <span class="keyword">public</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qabstracttablemodel.html">QAbstractTableModel</a>
[8af59c4aa3]94<a name="l00038"></a>00038 {
95<a name="l00039"></a>00039     Q_OBJECT
96<a name="l00040"></a>00040
97<a name="l00041"></a>00041 <span class="keyword">public</span>:
[a218bf2cb2]98<a name="l00042"></a>00042     <a class="code" href="class_c_t_s_p_model.html#a50a24986bc34b37c6c3b7bb52371b837" title="Class constructor.">CTSPModel</a>(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html">QObject</a> *parent = 0);
[8af59c4aa3]99<a name="l00043"></a>00043     <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#a4944812fdf6d348735db401f966b4f4a" title="Resets the table, setting all its elements to 0.">clear</a>();
[a218bf2cb2]100<a name="l00044"></a>00044     <span class="keywordtype">int</span> <a class="code" href="class_c_t_s_p_model.html#ac1942bbffc1313543641881e456f2e55" title="Returns the column count in the table.">columnCount</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &amp;parent = <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a>()) <span class="keyword">const</span>;
101<a name="l00045"></a>00045     <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvariant.html">QVariant</a> <a class="code" href="class_c_t_s_p_model.html#aad200081a43582e766096807c04227dc" title="Returns the data stored under the given role for the item referred to by the index...">data</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &amp;<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qabstracttablemodel.html#index">index</a>, <span class="keywordtype">int</span> role = Qt::DisplayRole) <span class="keyword">const</span>;
102<a name="l00046"></a>00046     Qt::ItemFlags <a class="code" href="class_c_t_s_p_model.html#a77881106624bfc203fb97bffe0d7b585" title="Returns the item flags for the given index.">flags</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &amp;index) <span class="keyword">const</span>;
103<a name="l00047"></a>00047     <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvariant.html">QVariant</a> <a class="code" href="class_c_t_s_p_model.html#a8c716850f6c31fa42b219d7f84038d71" title="Returns the data for the given role and section in the header with the specified...">headerData</a>(<span class="keywordtype">int</span> section, Qt::Orientation orientation, <span class="keywordtype">int</span> role = Qt::DisplayRole) <span class="keyword">const</span>;
104<a name="l00048"></a>00048     <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#ae25b1d25b13488fde89e381152c62549" title="Loads a task from fname.">loadTask</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> &amp;fname);
[8af59c4aa3]105<a name="l00049"></a>00049     quint16 <a class="code" href="class_c_t_s_p_model.html#a4fcde91257e57ba0e9754418cb83148e" title="Returns the number of cities.">numCities</a>() <span class="keyword">const</span>;
106<a name="l00050"></a>00050     <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#ad18e48dd0b0ad56d8e4ae3b1bc039e4a" title="Randomizes the table by setting all its values to random ones.">randomize</a>();
[a218bf2cb2]107<a name="l00051"></a>00051     <span class="keywordtype">int</span> <a class="code" href="class_c_t_s_p_model.html#a419c2b9d40fc2f348b15ae02f442a39b" title="Returns the row count in the table.">rowCount</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &amp;parent = <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a>()) <span class="keyword">const</span>;
108<a name="l00052"></a>00052     <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#aa73d906286cf369d9e6352348e1aca61" title="Saves current task to fname.">saveTask</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> &amp;fname);
109<a name="l00053"></a>00053     <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#a614a0e748bdf52c504a0284c07a977ed" title="Sets the role data for the item at index to value.">setData</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &amp;index, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvariant.html">QVariant</a> &amp;value, <span class="keywordtype">int</span> role = Qt::EditRole);
110<a name="l00054"></a>00054     <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#aff717cb92ce6426033e85716644b9cef" title="Sets number of cities in the current task to n.">setNumCities</a>(<span class="keywordtype">int</span> n);
[8af59c4aa3]111<a name="l00055"></a>00055
112<a name="l00056"></a>00056 signals:
113<a name="l00062"></a>00062     <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#a733908abe1ffabf49ad34ccdabaeeee9" title="This signal is emitted whenever the number of cities in the task changes.">numCitiesChanged</a>(<span class="keywordtype">int</span>);
114<a name="l00063"></a>00063
115<a name="l00064"></a>00064 <span class="keyword">private</span>:
[a218bf2cb2]116<a name="l00065"></a>00065     <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qsettings.html">QSettings</a> *settings;
117<a name="l00066"></a>00066     <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvector.html">QVector&lt;QVector&lt;double&gt;</a> &gt; table;
[8af59c4aa3]118<a name="l00067"></a>00067     quint16 nCities;
119<a name="l00068"></a>00068     <span class="keywordtype">bool</span> loadError(QDataStream::Status);
[a218bf2cb2]120<a name="l00069"></a>00069     <span class="keywordtype">bool</span> loadTSPT(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdatastream.html">QDataStream</a> *);
121<a name="l00070"></a>00070     <span class="keywordtype">bool</span> loadZKT(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdatastream.html">QDataStream</a> *);
[a2e64d518a]122<a name="l00071"></a>00071     <span class="keywordtype">double</span> rand(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>) <span class="keyword">const</span>;
[8af59c4aa3]123<a name="l00072"></a>00072 };
124<a name="l00073"></a>00073
125<a name="l00074"></a>00074 <span class="preprocessor">#endif // TSPMODEL_H</span>
126</pre></div></div>
127<!--- window showing the filter options -->
128<div id="MSearchSelectWindow"
129     onmouseover="return searchBox.OnSearchSelectShow()"
130     onmouseout="return searchBox.OnSearchSelectHide()"
131     onkeydown="return searchBox.OnSearchSelectKey(event)">
[f2ff738751]132<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>
[8af59c4aa3]133
134<!-- iframe showing the search results (closed by default) -->
135<div id="MSearchResultsWindow">
136<iframe src="" frameborder="0" 
137        name="MSearchResults" id="MSearchResults">
138</iframe>
139</div>
140
[f2ff738751]141<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Apr 28 02:47:10 2010 for TSPSG: TSP Solver and Generator by&nbsp;
[8af59c4aa3]142<a href="http://www.doxygen.org/index.html">
143<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
144</body>
145</html>
Note: See TracBrowser for help on using the repository browser.