- time_t rawtime;
- struct tm * timeinfo;
- char buffer[80];
- time(&rawtime);
- timeinfo = localtime(&rawtime);
- strftime(buffer, 80, "%a_%d_%b_%y_%H_%M_S", timeinfo);
- std::string date(buffer);
- std::string aux(buffer);
- std::string imageName = "img_" + aux;
+ if (this->m_IDImages.empty()) {
+ time_t rawtime;
+ struct tm * timeinfo;
+ char buffer[80];
+ time(&rawtime);
+ timeinfo = localtime(&rawtime);
+ strftime(buffer, 80, "%H%M%S_%a_%d_%b_%y_", timeinfo);
+ std::string date(buffer);
+ std::string aux(buffer);
+ this->m_IDImages = "img_" + aux;
+ }
+ std::stringstream ss; //create a stringstream
+ ss << pos; //add number to the stream
+ std::string imgType;
+ if (undo) {
+ imgType = "undo";
+ }
+ else
+ {
+ imgType = "redo";
+ }
+ std::string imageName = this->m_IDImages + imgType + ss.str();
+ imageName.append(".mhd");