Import Geant4 11.4.0 source tree
This commit is contained in:
+5
-56
@@ -44,9 +44,6 @@ private:
|
||||
}
|
||||
protected: //gstos
|
||||
virtual unsigned int create_gsto(std::ostream&,sg::render_manager& a_mgr) {
|
||||
//unsigned int npt = xyzs.values().size()/3;
|
||||
//::printf("debug : atb_vertices : %lu : create_gsto : %u\n",this,npt);
|
||||
|
||||
std::vector<float> gsto_data;
|
||||
|
||||
if(rgbas.size()) {
|
||||
@@ -67,8 +64,8 @@ protected: //gstos
|
||||
size_t pos_edges = gsto_data.size();
|
||||
append(gsto_data,xyzs.values());
|
||||
append(gsto_data,xyzs.values());
|
||||
float* pxyz = vec_data<float>(xyzs.values());
|
||||
float* pedges = vec_data<float>(gsto_data)+pos_edges;
|
||||
float* pxyz = xyzs.values().data();
|
||||
float* pedges = (gsto_data.data())+pos_edges;
|
||||
size_t npt = xyzs.values().size()/3;
|
||||
size_t ntri = npt/3;
|
||||
for(size_t itri=0;itri<ntri;itri++) {
|
||||
@@ -124,7 +121,7 @@ public:
|
||||
if(do_back.value()) gen_back();
|
||||
if(draw_edges.value()) gen_edges();
|
||||
m_all_a_one = true;
|
||||
{tools_vforcit_npp(float,rgbas.values(),it) {
|
||||
{for(auto it = rgbas.values().cbegin(); it != rgbas.values().cend();) {
|
||||
if(*(it+3)!=1) {m_all_a_one = false;break;}
|
||||
it += 4;
|
||||
}}
|
||||
@@ -142,9 +139,6 @@ public:
|
||||
if(_id) {
|
||||
a_action.begin_gsto(_id);
|
||||
if(rgbas.size()) {
|
||||
#ifdef __APPLE__
|
||||
bool restore_blend = check_set_blend(a_action);
|
||||
#endif
|
||||
if(nms.size()) {
|
||||
size_t npt = xyzs.values().size()/3;
|
||||
bufpos pos_xyzs = 0;
|
||||
@@ -184,7 +178,6 @@ public:
|
||||
|
||||
a_action.color4f(state.m_color);
|
||||
a_action.line_width(state.m_line_width);
|
||||
//a_action.set_lighting(state.m_GL_LIGHTING);
|
||||
}
|
||||
if(do_back.value()) a_action.draw_gsto_vcn(mode.value(),npt,pos_back_xyzs,pos_rgbas,pos_back_nms);
|
||||
a_action.draw_gsto_vcn(mode.value(),npt,pos_xyzs,pos_rgbas,pos_nms);
|
||||
@@ -207,9 +200,6 @@ public:
|
||||
a_action.draw_gsto_vc(mode.value(),npt,pos_xyzs,pos_rgbas);
|
||||
}
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
if(restore_blend) a_action.set_blend(true);
|
||||
#endif
|
||||
} else { //rgbas.empty()
|
||||
if(nms.size()) {
|
||||
size_t npt = xyzs.values().size()/3;
|
||||
@@ -250,9 +240,6 @@ public:
|
||||
// immediate rendering :
|
||||
if(rgbas.size()) {
|
||||
|
||||
#ifdef __APPLE__
|
||||
bool restore_blend = check_set_blend(a_action);
|
||||
#endif
|
||||
|
||||
if(nms.size()) {
|
||||
if(gl::is_line(mode.value())) {
|
||||
@@ -290,9 +277,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
if(restore_blend) a_action.set_blend(true);
|
||||
#endif
|
||||
} else { //rgbas.empty()
|
||||
if(nms.size()) {
|
||||
if(gl::is_line(mode.value())) {
|
||||
@@ -328,15 +312,9 @@ public:
|
||||
,m_nms_pos(0)
|
||||
,m_all_a_one(true)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
add_fields();
|
||||
}
|
||||
virtual ~atb_vertices(){
|
||||
#ifdef TOOLS_MEM
|
||||
mem::decrement(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
atb_vertices(const atb_vertices& a_from)
|
||||
@@ -351,9 +329,6 @@ public:
|
||||
,m_nms_pos(a_from.m_nms_pos)
|
||||
,m_all_a_one(true)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
add_fields();
|
||||
}
|
||||
atb_vertices& operator=(const atb_vertices& a_from){
|
||||
@@ -631,8 +606,8 @@ protected:
|
||||
|
||||
m_edges.resize(2*_xyzs.size(),0);
|
||||
|
||||
float* pxyz = vec_data<float>(xyzs.values());
|
||||
float* pedges = vec_data<float>(m_edges);
|
||||
float* pxyz = xyzs.values().data();
|
||||
float* pedges = m_edges.data();
|
||||
|
||||
size_t npt = xyzs.values().size()/3;
|
||||
size_t ntri = npt/3;
|
||||
@@ -667,32 +642,6 @@ protected:
|
||||
pxyz += 9;
|
||||
}
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
protected:
|
||||
// macOS/Mojave : on this version, points are blended even if alpha is one !
|
||||
bool check_set_blend(render_action& a_action) {
|
||||
bool restore_blend = false;
|
||||
const state& state = a_action.state();
|
||||
if(state.m_GL_BLEND) {
|
||||
/*
|
||||
bool all_a_one = true;
|
||||
tools_vforcit_npp(float,rgbas.values(),it) {
|
||||
if(*(it+3)!=1) {all_a_one = false;break;}
|
||||
it += 4;
|
||||
}
|
||||
if(all_a_one) {
|
||||
a_action.set_blend(false);
|
||||
restore_blend = true;
|
||||
}
|
||||
*/
|
||||
if(m_all_a_one) {
|
||||
a_action.set_blend(false);
|
||||
restore_blend = true;
|
||||
}
|
||||
}
|
||||
return restore_blend;
|
||||
}
|
||||
#endif
|
||||
protected:
|
||||
std::vector<float> m_back_xyzs;
|
||||
std::vector<float> m_back_nms;
|
||||
|
||||
Reference in New Issue
Block a user