Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
221aaf0
commit bad7de1
Showing
8 changed files
with
188 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/CMakeLists.txt.user | ||
*.autosave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/******************************************************************************* | ||
Copyright (C) The University of Auckland | ||
OpenCOR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenCOR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://gnu.org/licenses>. | ||
*******************************************************************************/ | ||
|
||
//============================================================================== | ||
// Mesh file reader | ||
//============================================================================== | ||
|
||
#include "meshreader.h" | ||
|
||
//============================================================================== | ||
|
||
#include <QTextStream> | ||
|
||
//============================================================================== | ||
|
||
namespace OpenCOR { | ||
namespace MappingView { | ||
|
||
//============================================================================== | ||
|
||
meshReader::meshReader(QString name): | ||
pFileName(name) | ||
{ | ||
} | ||
|
||
//============================================================================== | ||
|
||
QStringList meshReader::getNodesNames() | ||
{ | ||
QStringList list = QStringList(); | ||
|
||
QFile file(pFileName); | ||
|
||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { | ||
return list; | ||
} | ||
QTextStream in(&file); | ||
while (!in.atEnd()) { | ||
QString line = in.readLine(); | ||
QStringList words = line.split(' '); | ||
words.removeAll(""); | ||
if (words.first()==QString("Node:")) { | ||
list << words[1]; | ||
} | ||
} | ||
|
||
return list; //TODO sort before ? | ||
} | ||
|
||
//============================================================================== | ||
|
||
} // namespace MappingView | ||
} // namespace OpenCOR | ||
|
||
//============================================================================== | ||
// End of file | ||
//============================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/******************************************************************************* | ||
Copyright (C) The University of Auckland | ||
OpenCOR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenCOR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://gnu.org/licenses>. | ||
*******************************************************************************/ | ||
|
||
//============================================================================== | ||
// Mesh file reader | ||
//============================================================================== | ||
|
||
#pragma once | ||
|
||
#include <QFile> | ||
|
||
//============================================================================== | ||
|
||
namespace Ui { | ||
class MappingViewWidget; | ||
} // namespace Ui | ||
|
||
//============================================================================== | ||
|
||
namespace OpenCOR { | ||
namespace MappingView { | ||
|
||
//============================================================================== | ||
|
||
|
||
class meshReader : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
|
||
meshReader(QString); | ||
|
||
QStringList getNodesNames(); | ||
|
||
private: | ||
QString pFileName; | ||
|
||
}; | ||
|
||
//============================================================================== | ||
|
||
} // namespace MappingView | ||
} // namespace OpenCOR | ||
|
||
//============================================================================== | ||
// End of file | ||
//============================================================================== | ||
|