Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -10,6 +10,7 @@
#include "render_action"
#include "pick_action"
#include "bbox_action"
#include "visible_action"
namespace tools {
namespace sg {
@@ -54,19 +55,22 @@ public:
virtual void bbox(bbox_action& a_action) {
a_action.add_points(xyzs.values());
}
virtual void is_visible(visible_action& a_action) {
if(_is_visible(a_action)) a_action.increment();
}
public:
vertices()
:parent()
,mode(tools::gl::line_strip()){
#ifdef TOOLS_MEM
tools::mem::increment(s_class().c_str());
mem::increment(s_class().c_str());
#endif
add_fields();
}
virtual ~vertices(){
#ifdef TOOLS_MEM
tools::mem::decrement(s_class().c_str());
mem::decrement(s_class().c_str());
#endif
}
public:
@@ -76,7 +80,7 @@ public:
,xyzs(a_from.xyzs)
{
#ifdef TOOLS_MEM
tools::mem::increment(s_class().c_str());
mem::increment(s_class().c_str());
#endif
add_fields();
}
@@ -100,7 +104,7 @@ public:
xyzs.add(a_y);
xyzs.add(a_z);
}
void add_allocated(unsigned int& a_pos,float a_x,float a_y,float a_z) {
void add_allocated(size_t& a_pos,float a_x,float a_y,float a_z) {
std::vector<float>& v = xyzs.values();
v[a_pos] = a_x;a_pos++;
v[a_pos] = a_y;a_pos++;
@@ -120,8 +124,7 @@ public:
return true;
}
*/
//unsigned int size() const {return xyzs.size();}
unsigned int number() const {return xyzs.size()/3;}
size_t number() const {return xyzs.size()/3;}
void clear() {xyzs.clear();}
bool add_dashed_line(float a_bx,float a_by,float a_bz,
@@ -151,7 +154,22 @@ public:
py += two_sy;
pz += two_sz;
}
return false;
return true;
}
protected:
bool _is_visible(const matrix_action& a_action) {
if(xyzs.empty()) return false;
const state& _state = a_action.state();
pick_action action(a_action.out(),_state.m_ww,_state.m_wh,0,float(_state.m_ww),0,float(_state.m_wh));
action.set_win_size(_state.m_ww,_state.m_wh);
action.set_area(0,float(_state.m_ww),0,float(_state.m_wh));
action.set_stop_at_first(true);
action.matrix_action::operator=(a_action); //IMPORTANT.
int old_cur = action.cur(); //not 0.
action.add__primitive(*this,mode.value(),xyzs.values(),true);
if(action.cur()!=old_cur) return false;
if(!action.node()) return false;
return true;
}
};