Xmipp  v3.23.11-Nereus
Macros | Functions
docfile.cpp File Reference
#include <fstream>
#include <sstream>
#include <cstdio>
#include "core/transformations.h"
#include "docfile.h"
#include "core/args.h"
#include "core/xmipp_funcs.h"
Include dependency graph for docfile.cpp:

Go to the source code of this file.

Macros

#define assign_in_correct_place_of_line2(angle_descr, angle_index)
 

Functions

std::ostream & operator<< (std::ostream &o, const DocLine &line)
 
std::ostream & operator<< (std::ostream &o, const DocFile &doc)
 
int read_Euler_document_file (FileName name, std::string ang1, std::string ang2, std::string ang3, DocFile &doc)
 
void select_images (DocFile &doc, MetaData &sel, int col, bool en_limit0, double limit0, bool en_limitF, double limitF)
 
void get_subset_docfile (DocFile &DFin, MetaData &SF, DocFile &DFout)
 

Macro Definition Documentation

◆ assign_in_correct_place_of_line2

#define assign_in_correct_place_of_line2 (   angle_descr,
  angle_index 
)
Value:
switch (angle_descr[0]) \
{ \
case ('r'): line2.set(0, line1[angle_index]); break; \
case ('t'): line2.set(1, line1[angle_index]); break; \
case ('p'): line2.set(2, line1[angle_index]); break; \
}

Function Documentation

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  o,
const DocLine line 
)

Show a Document Line.

Definition at line 95 of file docfile.cpp.

96 {
97  char aux[30];
98  switch (line.line_type)
99  {
100  case DocLine::DATALINE:
101  // Print a data line
102  sprintf(aux, "%5d ", line.key);
103  o << aux;
104  sprintf(aux, "%-2lu", (unsigned long int)(line.data.size()));
105  o << aux;
106 
107  int imax;
108  imax = line.data.size();
109  for (int i = 0; i < imax; i++)
110 {
111  sprintf(aux, " % 10.5f", line.data[i]);
112  o << aux;
113  }
114 
115  o << std::endl;
116  break;
117 
118  case DocLine::COMMENT:
119  // Print a comment
120  o << line.text << std::endl;
121  break;
122  default:
123  break;
124  }
125 
126  return o;
127 }
#define i

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  o,
const DocFile doc 
)

Show a document file.

A new line is printed at the end.

std::cout << DF;

Definition at line 218 of file docfile.cpp.

219 {
220  std::vector< DocLine >::const_iterator current = doc.m.begin();
221  std::vector< DocLine >::const_iterator last = doc.m.end();
222 
223  while (current != last)
224  {
225  o << *current;
226  current++;
227  }
228 
229  return o;
230 }