Import Geant4 11.4.0 source tree
This commit is contained in:
+1
-58
@@ -5,11 +5,6 @@
|
||||
#define tools_sg_viewer
|
||||
|
||||
#include "group"
|
||||
|
||||
#ifdef TOOLS_MEM
|
||||
#include "../mem"
|
||||
#endif
|
||||
|
||||
#include "cursor_shape"
|
||||
|
||||
namespace tools {
|
||||
@@ -24,10 +19,6 @@ public:
|
||||
}
|
||||
public:
|
||||
virtual void set_size(unsigned int a_w,unsigned int a_h) {
|
||||
//m_out << "debug : tools::sg::viewer::set_size :"
|
||||
// << " ww " << a_w
|
||||
// << " wh " << a_h
|
||||
// << std::endl;
|
||||
size_event e(m_ww,m_wh,a_w,a_h);
|
||||
m_ww = a_w;
|
||||
m_wh = a_h;
|
||||
@@ -37,6 +28,7 @@ public:
|
||||
}
|
||||
|
||||
virtual bool set_cursor_shape(cursor_shape) {return false;}
|
||||
|
||||
public:
|
||||
viewer(std::ostream& a_out,unsigned int a_width,unsigned int a_height)
|
||||
:m_out(a_out)
|
||||
@@ -49,15 +41,9 @@ public:
|
||||
,m_produce_out_file()
|
||||
,m_produce_out_bpp(4)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
virtual ~viewer(){
|
||||
m_sg.clear(); //we must delete node before m_zb_mgr (and any render_manager).
|
||||
#ifdef TOOLS_MEM
|
||||
mem::decrement(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
public:
|
||||
viewer(const viewer& a_from)
|
||||
@@ -72,9 +58,6 @@ public:
|
||||
,m_produce_out_file(a_from.m_produce_out_file)
|
||||
,m_produce_out_bpp(a_from.m_produce_out_bpp)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
viewer& operator=(const viewer& a_from){
|
||||
m_clear_color = a_from.m_clear_color;
|
||||
@@ -99,8 +82,6 @@ public:
|
||||
|
||||
bool screen2aspect(int a_x,int a_y,float& a_wx,float& a_wy) const {
|
||||
// convert screen point in [aspect,1] coordinates.
|
||||
//if(!m_ww) {a_wx = a_wy = 0;return false;}
|
||||
//if(!m_wh) {a_wx = a_wy = 0;return false;}
|
||||
float aspect = float(m_ww)/float(m_wh);
|
||||
float wch = 1;
|
||||
float wcw = wch*aspect;
|
||||
@@ -140,30 +121,6 @@ public:
|
||||
|
||||
void set_produce_out_bpp(unsigned int a_bpp) {m_produce_out_bpp = a_bpp;}
|
||||
unsigned int produce_out_bpp() const {return m_produce_out_bpp;}
|
||||
protected:
|
||||
// iPod : 320 x 480
|
||||
// iPad : 768 x 1024
|
||||
// SGS : API-1 : 320 x 533, API-5 : 480 x 800
|
||||
// SGT : 1024 x 600 ?
|
||||
|
||||
// LRI WILD : borders w = 100 x h = 120. 4x8 screens with 2560x1600 pixels.
|
||||
// LAL ARTS : borders 88x100. 2x4 screens of 1920 x 1080
|
||||
|
||||
//bool is_iPad() const {
|
||||
// if( (m_ww==768) && (m_wh==1024) ) return true;
|
||||
// if( (m_wh==768) && (m_ww==1024) ) return true;
|
||||
// return false;
|
||||
//}
|
||||
//bool is_SGS() const {
|
||||
// //API : 1
|
||||
// //if( (m_ww==320) && (m_wh==533) ) return true;
|
||||
// //if( (m_wh==320) && (m_ww==533) ) return true;
|
||||
//
|
||||
// //API : 5
|
||||
// if( (m_ww==480) && (m_wh==800) ) return true;
|
||||
// if( (m_wh==480) && (m_ww==800) ) return true;
|
||||
// return false;
|
||||
//}
|
||||
|
||||
protected:
|
||||
std::ostream& m_out;
|
||||
@@ -181,19 +138,5 @@ protected:
|
||||
|
||||
}}
|
||||
|
||||
#include "../pointer"
|
||||
|
||||
namespace tools {
|
||||
namespace sg {
|
||||
|
||||
// used with Python and lua :
|
||||
inline viewer* cast_viewer(const std::string& a_s) {
|
||||
void* p;
|
||||
if(!to_pointer(a_s,p)) return 0; //read with %lx and, if failure, with %lu.
|
||||
return (viewer*)p;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user