-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added molecular system reader #92
Conversation
size_t id; | ||
size_t instances; | ||
lineStream >> protein >> id >> instances; | ||
if( protein == "" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.empty()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
proteins[id] = protein; | ||
|
||
if( proteinFolder == "" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.empty()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
descriptorFile.close(); | ||
|
||
// Load proteins according to specified positions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for readability you could move the comment-marked blocks to private methods. Would also 'solve' the file.close() at the end of each block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, working on it
if( proteins.find(id) != proteins.end( )) | ||
{ | ||
// Scale to correct units | ||
position *= 10.f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does that magic come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files are in angstrom, others in nanometers... Ask the data providers ;-)
* @return bounding box of the protein | ||
* @param PDB file to import | ||
* @param Position of protein in space | ||
* @param Index of the protein when more than one is loaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doxygen warns here for not finding those param names I suppose :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 otherwise
boost::filesystem::path fileExtension = | ||
dirIter->path( ).extension( ); | ||
if( fileExtension==".swc" || fileExtension==".h5" ) | ||
boost::filesystem::path fileExtension = dirIter->path().extension(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move inside the else{} as it is not used outside, can be const auto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
MorphologyLoader morphologyLoader( geometryParameters ); | ||
|
||
strings filters = { ".swc", ".h5" }; | ||
strings files = _parseFolder( folder, filters ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const strings (multiple occurences)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
std::cout << std::endl;\ | ||
__logging_mtx.unlock();\ | ||
} \ | ||
__logging_mtx.lock();\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a detail, but in general it's a good habit to use RAII style:
std::lock_guard<std::mutex> lock(__logging_mtx);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Thanks.
public: | ||
|
||
/** | ||
* @brief Default constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the default since it takes a parameter :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something seems weird with the commits included in this PR. Rebase maybe?
I know, I did something wrong again. I'll squash them and rebase accordingly |
The MolecularSystemReader class loads proteins and meshes according to parameters defined in a Molecular System Configuration file. This configuration is defined by the following entries: