Import Geant4 10.4.0 source tree
This commit is contained in:
@@ -639,13 +639,13 @@ private:
|
||||
{"square_filled", marker_square_filled},
|
||||
{"penta_star_line", marker_penta_star_line},
|
||||
{"penta_star_filled", marker_penta_star_filled},
|
||||
{"minus", marker_minus}
|
||||
};
|
||||
a_num = sizeof(list)/sizeof(list[0]);
|
||||
return list;
|
||||
}
|
||||
public:
|
||||
static bool smarker_style(const std::string& a_s,
|
||||
sg::marker_style& a_v){
|
||||
static bool smarker_style(const std::string& a_s,sg::marker_style& a_v){
|
||||
unsigned int number;
|
||||
const MarkerStyle* list = getMarkerStyleList(number);
|
||||
for(unsigned int count=0;count<number;count++) {
|
||||
@@ -868,56 +868,56 @@ public:
|
||||
reset();
|
||||
continue;
|
||||
}
|
||||
std::vector<std::string> words;
|
||||
tools::words(line," ",false,words);
|
||||
size_t wordn = words.size();
|
||||
std::vector<std::string> ws;
|
||||
words(line," ",false,ws);
|
||||
size_t wordn = ws.size();
|
||||
if(!wordn) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(line)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(line)
|
||||
<< " has a bad word count (at least two expected)."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& word0 = words[0];
|
||||
const std::string& word0 = ws[0];
|
||||
if(word0=="color") {
|
||||
if(wordn==2) {
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!find_color(a_cmaps,word1,m_color)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a color."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if (wordn==4) {
|
||||
const std::string& rs = words[1];
|
||||
const std::string& rs = ws[1];
|
||||
float r;
|
||||
if(!tools::to<float>(rs,r)) {
|
||||
if(!to<float>(rs,r)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(rs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(rs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& gs = words[2];
|
||||
const std::string& gs = ws[2];
|
||||
float g;
|
||||
if(!tools::to<float>(gs,g)) {
|
||||
if(!to<float>(gs,g)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(gs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(gs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& bs = words[3];
|
||||
const std::string& bs = ws[3];
|
||||
float b;
|
||||
if(!tools::to<float>(bs,b)) {
|
||||
if(!to<float>(bs,b)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(bs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(bs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -925,42 +925,42 @@ public:
|
||||
m_color.set_value(r,g,b,1);
|
||||
|
||||
} else if (wordn==5) {
|
||||
const std::string& rs = words[1];
|
||||
const std::string& rs = ws[1];
|
||||
float r;
|
||||
if(!tools::to<float>(rs,r)) {
|
||||
if(!to<float>(rs,r)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(rs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(rs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& gs = words[2];
|
||||
const std::string& gs = ws[2];
|
||||
float g;
|
||||
if(!tools::to<float>(gs,g)) {
|
||||
if(!to<float>(gs,g)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(gs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(gs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& bs = words[3];
|
||||
const std::string& bs = ws[3];
|
||||
float b;
|
||||
if(!tools::to<float>(bs,b)) {
|
||||
if(!to<float>(bs,b)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(bs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(bs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& as = words[4];
|
||||
const std::string& as = ws[4];
|
||||
float a;
|
||||
if(!tools::to<float>(as,a)) {
|
||||
if(!to<float>(as,a)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(as)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(as)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -969,8 +969,8 @@ public:
|
||||
|
||||
} else {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(line)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(line)
|
||||
<< " has a bad word count (two or four expected)."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -978,42 +978,42 @@ public:
|
||||
|
||||
} else if(word0=="highlight_color") {
|
||||
if(wordn==2) {
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!find_color(a_cmaps,word1,m_highlight_color)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a color."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if (wordn==4) {
|
||||
const std::string& rs = words[1];
|
||||
const std::string& rs = ws[1];
|
||||
float r;
|
||||
if(!tools::to<float>(rs,r)) {
|
||||
if(!to<float>(rs,r)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(rs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(rs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& gs = words[2];
|
||||
const std::string& gs = ws[2];
|
||||
float g;
|
||||
if(!tools::to<float>(gs,g)) {
|
||||
if(!to<float>(gs,g)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(gs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(gs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& bs = words[3];
|
||||
const std::string& bs = ws[3];
|
||||
float b;
|
||||
if(!tools::to<float>(bs,b)) {
|
||||
if(!to<float>(bs,b)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(bs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(bs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1021,42 +1021,42 @@ public:
|
||||
m_highlight_color.set_value(r,g,b,1);
|
||||
|
||||
} else if (wordn==5) {
|
||||
const std::string& rs = words[1];
|
||||
const std::string& rs = ws[1];
|
||||
float r;
|
||||
if(!tools::to<float>(rs,r)) {
|
||||
if(!to<float>(rs,r)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(rs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(rs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& gs = words[2];
|
||||
const std::string& gs = ws[2];
|
||||
float g;
|
||||
if(!tools::to<float>(gs,g)) {
|
||||
if(!to<float>(gs,g)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(gs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(gs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& bs = words[3];
|
||||
const std::string& bs = ws[3];
|
||||
float b;
|
||||
if(!tools::to<float>(bs,b)) {
|
||||
if(!to<float>(bs,b)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(bs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(bs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& as = words[4];
|
||||
const std::string& as = ws[4];
|
||||
float a;
|
||||
if(!tools::to<float>(as,a)) {
|
||||
if(!to<float>(as,a)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(as)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(as)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1065,8 +1065,8 @@ public:
|
||||
|
||||
} else {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(line)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(line)
|
||||
<< " has a bad word count (two or four expected)."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1074,42 +1074,42 @@ public:
|
||||
|
||||
} else if(word0=="back_color") {
|
||||
if(wordn==2) {
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!find_color(a_cmaps,word1,m_back_color)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a color."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if (wordn==4) {
|
||||
const std::string& rs = words[1];
|
||||
const std::string& rs = ws[1];
|
||||
float r;
|
||||
if(!tools::to<float>(rs,r)) {
|
||||
if(!to<float>(rs,r)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(rs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(rs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& gs = words[2];
|
||||
const std::string& gs = ws[2];
|
||||
float g;
|
||||
if(!tools::to<float>(gs,g)) {
|
||||
if(!to<float>(gs,g)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(gs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(gs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& bs = words[3];
|
||||
const std::string& bs = ws[3];
|
||||
float b;
|
||||
if(!tools::to<float>(bs,b)) {
|
||||
if(!to<float>(bs,b)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(bs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(bs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1117,42 +1117,42 @@ public:
|
||||
m_back_color.set_value(r,g,b,1);
|
||||
|
||||
} else if (wordn==5) {
|
||||
const std::string& rs = words[1];
|
||||
const std::string& rs = ws[1];
|
||||
float r;
|
||||
if(!tools::to<float>(rs,r)) {
|
||||
if(!to<float>(rs,r)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(rs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(rs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& gs = words[2];
|
||||
const std::string& gs = ws[2];
|
||||
float g;
|
||||
if(!tools::to<float>(gs,g)) {
|
||||
if(!to<float>(gs,g)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(gs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(gs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& bs = words[3];
|
||||
const std::string& bs = ws[3];
|
||||
float b;
|
||||
if(!tools::to<float>(bs,b)) {
|
||||
if(!to<float>(bs,b)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(bs)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(bs)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& as = words[4];
|
||||
const std::string& as = ws[4];
|
||||
float a;
|
||||
if(!tools::to<float>(as,a)) {
|
||||
if(!to<float>(as,a)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(as)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(as)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1161,8 +1161,8 @@ public:
|
||||
|
||||
} else {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(line)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(line)
|
||||
<< " has a bad word count (two or four expected)."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1170,13 +1170,13 @@ public:
|
||||
|
||||
} else if( (word0=="line_pattern") || (word0=="line_pattern") ) {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
unsigned long ul;
|
||||
if(!sline_pattern(word1,m_line_pattern)) {
|
||||
if(!to_ulong(word1,ul)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a line pattern."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1185,219 +1185,219 @@ public:
|
||||
}
|
||||
} else if(word0=="marker_style") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!smarker_style(word1,m_marker_style)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a marker_style."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if(word0=="area_style") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!sarea_style(word1,m_area_style)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a area_style."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if(word0=="modeling") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
m_modeling = words[1];
|
||||
m_modeling = ws[1];
|
||||
} else if(word0=="light_model") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
m_light_model = words[1];
|
||||
m_light_model = ws[1];
|
||||
} else if(word0=="tick_modeling") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
m_tick_modeling = words[1];
|
||||
m_tick_modeling = ws[1];
|
||||
} else if(word0=="encoding") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
m_encoding = words[1];
|
||||
m_encoding = ws[1];
|
||||
} else if(word0=="smoothing") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
bool value;
|
||||
if(!check_bool(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_bool(ws[1],a_s,a_out,value)) return false;
|
||||
m_smoothing = value;
|
||||
} else if(word0=="hinting") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
bool value;
|
||||
if(!check_bool(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_bool(ws[1],a_s,a_out,value)) return false;
|
||||
m_hinting = value;
|
||||
} else if(word0=="enforced") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
bool value;
|
||||
if(!check_bool(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_bool(ws[1],a_s,a_out,value)) return false;
|
||||
m_enforced = value;
|
||||
} else if(word0=="cut") {
|
||||
m_cut = "";
|
||||
for(unsigned int wordi=1;wordi<wordn;wordi++) {
|
||||
if(wordi!=1) m_cut += " ";
|
||||
m_cut += words[wordi];
|
||||
m_cut += ws[wordi];
|
||||
}
|
||||
} else if(word0=="options") {
|
||||
m_options = "";
|
||||
for(unsigned int wordi=1;wordi<wordn;wordi++) {
|
||||
if(wordi!=1) m_options += " ";
|
||||
m_options += words[wordi];
|
||||
m_options += ws[wordi];
|
||||
}
|
||||
} else if(word0=="color_mapping") {
|
||||
m_color_mapping = "";
|
||||
for(unsigned int wordi=1;wordi<wordn;wordi++) {
|
||||
if(wordi!=1) m_color_mapping += " ";
|
||||
m_color_mapping += words[wordi];
|
||||
m_color_mapping += ws[wordi];
|
||||
}
|
||||
} else if(word0=="painting") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
if(!spainting_policy(words[1],m_painting)) {
|
||||
if(!spainting_policy(ws[1],m_painting)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(words[1])
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(ws[1])
|
||||
<< " not a painting_policy."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if(word0=="hatching") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
if(!shatching_policy(words[1],m_hatching)) {
|
||||
if(!shatching_policy(ws[1],m_hatching)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(words[1])
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(ws[1])
|
||||
<< " not a hatching_policy."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if(word0=="projection") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
if(!sprojection_type(words[1],m_projection)) {
|
||||
if(!sprojection_type(ws[1],m_projection)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(words[1])
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(ws[1])
|
||||
<< " not a projection_type."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else if(word0=="font") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
font(words[1]);
|
||||
font(ws[1]);
|
||||
} else if(word0=="line_width") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_line_width = value;
|
||||
} else if(word0=="marker_size") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_marker_size = value;
|
||||
} else if(word0=="font_size") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_font_size = value;
|
||||
} else if(word0=="back_shadow") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
if(value<0.F) value = 0.F;
|
||||
m_back_shadow = value;
|
||||
} else if(word0=="multi_node_limit") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
int value = 0;
|
||||
if(!check_int(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_int(ws[1],a_s,a_out,value)) return false;
|
||||
m_multi_node_limit = value;
|
||||
} else if(word0=="divisions") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
int value = 0;
|
||||
if(!check_int(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_int(ws[1],a_s,a_out,value)) return false;
|
||||
m_divisions = value;
|
||||
} else if(word0=="rotation_steps") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
unsigned int value;
|
||||
if(!check_uint(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_uint(ws[1],a_s,a_out,value)) return false;
|
||||
m_rotation_steps = value;
|
||||
} else if(word0=="angle") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_angle = value;
|
||||
} else if(word0=="scale") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_scale = value;
|
||||
} else if(word0=="offset") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_offset = value;
|
||||
} else if(word0=="strip_width") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_strip_width = value;
|
||||
} else if(word0=="spacing") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_spacing = value;
|
||||
} else if(word0=="visible") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
bool value;
|
||||
if(!check_bool(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_bool(ws[1],a_s,a_out,value)) return false;
|
||||
m_visible = value;
|
||||
} else if(word0=="editable") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
bool value;
|
||||
if(!check_bool(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_bool(ws[1],a_s,a_out,value)) return false;
|
||||
m_editable = value;
|
||||
} else if(word0=="automated") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
bool value;
|
||||
if(!check_bool(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_bool(ws[1],a_s,a_out,value)) return false;
|
||||
m_automated = value;
|
||||
} else if(word0=="bar_offset") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_bar_offset = value;
|
||||
} else if(word0=="bar_width") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
float value;
|
||||
if(!check_float(words[1],a_s,a_out,value)) return false;
|
||||
if(!check_float(ws[1],a_s,a_out,value)) return false;
|
||||
m_bar_width = value;
|
||||
|
||||
} else if(word0=="translation") {
|
||||
if (wordn==4) {
|
||||
const std::string& sx = words[1];
|
||||
const std::string& sx = ws[1];
|
||||
float x;
|
||||
if(!tools::to<float>(sx,x)) {
|
||||
if(!to<float>(sx,x)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(sx)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(sx)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& sy = words[2];
|
||||
const std::string& sy = ws[2];
|
||||
float y;
|
||||
if(!tools::to<float>(sy,y)) {
|
||||
if(!to<float>(sy,y)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(sy)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(sy)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
const std::string& sz = words[3];
|
||||
const std::string& sz = ws[3];
|
||||
float z;
|
||||
if(!tools::to<float>(sz,z)) {
|
||||
if(!to<float>(sz,z)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(sz)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(sz)
|
||||
<< " not a number."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1405,7 +1405,7 @@ public:
|
||||
m_translation.set_value(x,y,z);
|
||||
} else {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " in " << sout(a_s)
|
||||
<< " has a bad word count (four expected)."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1413,15 +1413,15 @@ public:
|
||||
|
||||
} else if(word0=="front_face") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(word1=="ccw") {
|
||||
m_front_face = winding_ccw;
|
||||
} else if(word1=="cw") {
|
||||
m_front_face = winding_cw;
|
||||
} else { //ccw
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a winding type."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1429,11 +1429,11 @@ public:
|
||||
|
||||
} else if(word0=="hjust") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!shjust(word1,m_hjust)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a hjust."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1441,11 +1441,11 @@ public:
|
||||
|
||||
} else if(word0=="vjust") {
|
||||
if(!check_2(wordn,a_s,line,a_out)) return false;
|
||||
const std::string& word1 = words[1];
|
||||
const std::string& word1 = ws[1];
|
||||
if(!svjust(word1,m_vjust)) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word1)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word1)
|
||||
<< " not a vjust."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1453,8 +1453,8 @@ public:
|
||||
|
||||
} else {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(word0)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(word0)
|
||||
<< " bad option."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1469,8 +1469,8 @@ protected:
|
||||
const std::string& a_line,std::ostream& a_out) {
|
||||
if(a_n!=2) {
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(a_line)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(a_line)
|
||||
<< " has a bad word count (two expected)."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1480,10 +1480,10 @@ protected:
|
||||
|
||||
static bool check_bool(const std::string& a_w,
|
||||
const std::string& a_s,std::ostream& a_out,bool& a_v){
|
||||
if(!tools::to(a_w,a_v)){
|
||||
if(!to(a_w,a_v)){
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(a_w)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(a_w)
|
||||
<< " not a boolean."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1493,10 +1493,10 @@ protected:
|
||||
|
||||
static bool check_int(const std::string& a_w,
|
||||
const std::string& a_s,std::ostream& a_out,int& a_v) {
|
||||
if(!tools::to<int>(a_w,a_v)){
|
||||
if(!to<int>(a_w,a_v)){
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(a_w)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(a_w)
|
||||
<< " not an int."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1506,10 +1506,10 @@ protected:
|
||||
|
||||
static bool check_uint(const std::string& a_w,
|
||||
const std::string& a_s,std::ostream& a_out,unsigned int& a_v) {
|
||||
if(!tools::to<unsigned int>(a_w,a_v)){
|
||||
if(!to<unsigned int>(a_w,a_v)){
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(a_w)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(a_w)
|
||||
<< " not an unsigned int."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -1519,10 +1519,10 @@ protected:
|
||||
|
||||
static bool check_float(const std::string& a_w,
|
||||
const std::string& a_s,std::ostream& a_out,float& a_v) {
|
||||
if(!tools::to<float>(a_w,a_v)){
|
||||
if(!to<float>(a_w,a_v)){
|
||||
a_out << "style_parser::parse :"
|
||||
<< " in " << tools::sout(a_s)
|
||||
<< " : " << tools::sout(a_w)
|
||||
<< " in " << sout(a_s)
|
||||
<< " : " << sout(a_w)
|
||||
<< " not a float."
|
||||
<< std::endl;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user