Import Geant4 10.4.0 source tree
This commit is contained in:
@@ -33,7 +33,8 @@ public:
|
||||
virtual const std::string& s_cls() const {return s_class();}
|
||||
public:
|
||||
bmf(){}
|
||||
//bmf(const T& a_value){m_values.push_back(a_value);}
|
||||
bmf(const T& a_value) {m_values.push_back(a_value);}
|
||||
bmf(const std::vector<T>& a_v) {m_values = a_v;}
|
||||
virtual ~bmf(){m_values.clear();}
|
||||
public:
|
||||
bmf(const bmf& a_from):parent(a_from),m_values(a_from.m_values){}
|
||||
@@ -105,13 +106,14 @@ public:
|
||||
if(a_values!=m_values) m_touched = true;
|
||||
m_values = a_values;
|
||||
}
|
||||
|
||||
void set_value(const T& a_value) {
|
||||
m_values.clear();
|
||||
m_values.push_back(a_value);
|
||||
m_touched = true;
|
||||
void set_value(const T& a_value) { //used in ArcheryTune.
|
||||
bool to_resize = m_values.size()==1?false:true;
|
||||
bool is_eq = ( (m_values.size()>=1) && (m_values[0]==a_value) ) ? true : false;
|
||||
if(to_resize) m_values.resize(1);
|
||||
if(to_resize || !is_eq) m_touched = true;
|
||||
m_values[0] = a_value;
|
||||
}
|
||||
|
||||
|
||||
public: //for iv2sg
|
||||
//bool setValues(size_t a_index,size_t a_num,const T* a_vs) {
|
||||
// for(size_t index=0;index<a_num;index++) {
|
||||
@@ -137,11 +139,18 @@ public: //for iv2sg
|
||||
m_values[a_index] = a_value;
|
||||
return true;
|
||||
}
|
||||
bool setValue(const T& a_value) {return set1Value(0,a_value);}
|
||||
bool setValue(const T& a_value) {set_value(a_value);return true;}
|
||||
|
||||
bmf& operator=(const T& a_v){
|
||||
if(!setValue(a_v)) {}
|
||||
return *this;
|
||||
}
|
||||
size_t getNum() const {return m_values.size();}
|
||||
T* getValues(size_t a_start) { //for gopaw.
|
||||
if(a_start>=(m_values.size()+1)) return 0;
|
||||
T* data = vec_data(m_values);
|
||||
return data+a_start;
|
||||
}
|
||||
protected:
|
||||
std::vector<T> m_values;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user