Import Geant4 11.4.0 source tree
This commit is contained in:
+20
-19
@@ -6,26 +6,26 @@
|
||||
|
||||
#include <tools/sg/viewer>
|
||||
|
||||
#include "GL_manager"
|
||||
#include "GL_action"
|
||||
namespace tools{namespace sg{class render_manager;}}
|
||||
|
||||
namespace toolx {
|
||||
namespace sg {
|
||||
|
||||
class GL_viewer : public tools::sg::viewer {
|
||||
TOOLS_HEADER(GL_viewer,toolx::sg::GL_viewer,tools::sg::viewer)
|
||||
template <class GL_MANAGER,class GL_ACTION>
|
||||
class GL_viewer_T : public tools::sg::viewer {
|
||||
TOOLS_T2_HEADER(GL_MANAGER,GL_ACTION,GL_viewer_T,toolx::sg::GL_viewer_T,tools::sg::viewer)
|
||||
public:
|
||||
void render() {
|
||||
if(!m_ww) return;
|
||||
if(!m_wh) return;
|
||||
|
||||
m_gl_mgr.begin_render(0,0,m_ww,m_wh,
|
||||
m_clear_color.r(),
|
||||
m_clear_color.g(),
|
||||
m_clear_color.b(),
|
||||
m_clear_color.a());
|
||||
if(!m_gl_mgr.begin_render(0,0,m_ww,m_wh,
|
||||
m_clear_color.r(),
|
||||
m_clear_color.g(),
|
||||
m_clear_color.b(),
|
||||
m_clear_color.a())) return;
|
||||
|
||||
GL_action action(m_gl_mgr,m_out,m_ww,m_wh);
|
||||
GL_ACTION action(m_gl_mgr,m_out,m_ww,m_wh);
|
||||
action.state().m_use_gsto = m_use_gsto;
|
||||
|
||||
action.set_do_transparency(false);
|
||||
@@ -33,44 +33,45 @@ public:
|
||||
|
||||
m_sg.render(action);
|
||||
if(!action.end()) { //check that matrices stack are ok.
|
||||
m_out << "toolx::sg::GL_viewer : bad gl_action end." << std::endl;
|
||||
m_out << "toolx::sg::GL_viewer_T : bad gl_action end." << std::endl;
|
||||
} else {
|
||||
if(action.have_to_do_transparency()) {
|
||||
action.set_do_transparency(true);
|
||||
m_sg.render(action);
|
||||
if(!action.end()) { //check that matrices stack are ok.
|
||||
m_out << "toolx::sg::GL_viewer : bad gl_action end." << std::endl;
|
||||
m_out << "toolx::sg::GL_viewer_T : bad gl_action end." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//after_render();
|
||||
|
||||
m_gl_mgr.end_render();
|
||||
}
|
||||
|
||||
public:
|
||||
GL_viewer(std::ostream& a_out,unsigned int a_width,unsigned int a_height)
|
||||
GL_viewer_T(std::ostream& a_out,unsigned int a_width,unsigned int a_height)
|
||||
:parent(a_out,a_width,a_height)
|
||||
,m_gl_mgr(a_out)
|
||||
{}
|
||||
virtual ~GL_viewer(){
|
||||
virtual ~GL_viewer_T(){
|
||||
//WARNING : nodes may refer m_gl_mgr (to handle gstos/texs), then
|
||||
// we have to delete them first.
|
||||
m_sg.clear();
|
||||
}
|
||||
public:
|
||||
GL_viewer(const GL_viewer& a_from)
|
||||
GL_viewer_T(const GL_viewer_T& a_from)
|
||||
:parent(a_from)
|
||||
,m_gl_mgr(a_from.m_gl_mgr)
|
||||
{}
|
||||
GL_viewer& operator=(const GL_viewer& a_from){
|
||||
GL_viewer_T& operator=(const GL_viewer_T& a_from){
|
||||
parent::operator=(a_from);
|
||||
m_gl_mgr = a_from.m_gl_mgr;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
const tools::sg::render_manager& render_manager() const {return m_gl_mgr;}
|
||||
tools::sg::render_manager& render_manager() {return m_gl_mgr;}
|
||||
protected:
|
||||
GL_manager m_gl_mgr;
|
||||
GL_MANAGER m_gl_mgr;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user