Import Geant4 11.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2025-06-26 09:17:29 +02:00
parent 20a218bbe1
commit a499fb82e9
1941 changed files with 203285 additions and 95593 deletions
@@ -75,6 +75,16 @@ public:
m_session.to_render(this);
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
void set_device_interactor(sg::device_interactor*) {}
public:
+19
View File
@@ -477,6 +477,7 @@ public:
}
}
}
size_t num = m_cols.size();
if(!num) {
a_out << "tools::rcsv::ntuple::initialize :"
@@ -664,9 +665,27 @@ public:
a_out << "tools::rcsv::ntuple::initialize(booking) :"
<< " zero columns."
<< std::endl;
m_sep = 0;
m_sz = 0;
m_rows = -1;
m_hippo = false;
return false;
}
{tools_vforcit(column_binding,a_bd.columns(),it) {
if(!find_named<read::icol>(m_cols,(*it).name())) {
a_out << "tools::rcsv::ntuple::initialize :"
<< " error : for column binding with name " << sout((*it).name()) << ", no ntuple column found."
<< std::endl;
safe_clear<read::icol>(m_cols);
m_sep = 0;
m_sz = 0;
m_rows = -1;
m_hippo = false;
return false;
}
}}
//a_out << "tools::rroot::ntuple::initialize :"
// << " number of columns " << num << "."
// << std::endl;
+3 -1
View File
@@ -705,8 +705,10 @@ public:
{tools_vforcit(column_binding,a_bd.columns(),it) {
if(!find_named<read::icol>(m_cols,(*it).name())) {
a_out << "tools::rroot::ntuple::initialize :"
<< " warning : for column binding with name " << sout((*it).name()) << ", no ntuple column found."
<< " error : for column binding with name " << sout((*it).name()) << ", no ntuple column found."
<< std::endl;
safe_clear<read::icol>(m_cols);
return false;
}
}}
+68 -51
View File
@@ -104,8 +104,44 @@ protected:
unsigned int m_h;
};
class mouse_down_event : public event {
class position_modifiers {
public:
position_modifiers(int a_x,int a_y,bool a_shift_modifier,bool a_control_modifier)
:m_x(a_x)
,m_y(a_y)
,m_shift_modifier(a_shift_modifier)
,m_control_modifier(a_control_modifier)
{}
virtual ~position_modifiers(){}
public:
position_modifiers(const position_modifiers& a_from)
:m_x(a_from.m_x)
,m_y(a_from.m_y)
,m_shift_modifier(a_from.m_shift_modifier)
,m_control_modifier(a_from.m_control_modifier)
{}
position_modifiers& operator=(const position_modifiers& a_from){
m_x = a_from.m_x;
m_y = a_from.m_y;
m_shift_modifier = a_from.m_shift_modifier;
m_control_modifier = a_from.m_control_modifier;
return *this;
}
public:
int x() const {return m_x;}
int y() const {return m_y;}
bool shift_modifier() const {return m_shift_modifier;}
bool control_modifier() const {return m_control_modifier;}
protected:
int m_x;
int m_y;
bool m_shift_modifier;
bool m_control_modifier;
};
class mouse_down_event : public event, public position_modifiers {
typedef event parent;
typedef position_modifiers parent_pos_mod;
public:
#ifdef TOOLS_SG_EVENT_ID_CAST
static cid id_class() {return parent::id_class()+2;}
@@ -122,33 +158,25 @@ public:
#endif
virtual event* copy() const {return new mouse_down_event(*this);}
public:
mouse_down_event(int a_x,int a_y) //signed because of wall.
:m_x(a_x)
,m_y(a_y)
mouse_down_event(int a_x,int a_y,bool a_shift_modifier,bool a_control_modifier)
:parent_pos_mod(a_x,a_y,a_shift_modifier,a_control_modifier)
{}
virtual ~mouse_down_event(){}
public:
mouse_down_event(const mouse_down_event& a_from)
:event(a_from)
,m_x(a_from.m_x)
,m_y(a_from.m_y)
:parent(a_from)
,parent_pos_mod(a_from)
{}
mouse_down_event& operator=(const mouse_down_event& a_from){
event::operator=(a_from);
m_x = a_from.m_x;
m_y = a_from.m_y;
parent::operator=(a_from);
parent_pos_mod::operator=(a_from);
return *this;
}
public:
int x() const {return m_x;}
int y() const {return m_y;}
protected:
int m_x;
int m_y;
};
class mouse_up_event : public event {
class mouse_up_event : public event, public position_modifiers {
typedef event parent;
typedef position_modifiers parent_pos_mod;
public:
#ifdef TOOLS_SG_EVENT_ID_CAST
static cid id_class() {return parent::id_class()+3;}
@@ -165,33 +193,25 @@ public:
#endif
virtual event* copy() const {return new mouse_up_event(*this);}
public:
mouse_up_event(int a_x,int a_y) //signed because of wall.
:m_x(a_x)
,m_y(a_y)
mouse_up_event(int a_x,int a_y,bool a_shift_modifier,bool a_control_modifier)
:parent_pos_mod(a_x,a_y,a_shift_modifier,a_control_modifier)
{}
virtual ~mouse_up_event(){}
public:
mouse_up_event(const mouse_up_event& a_from)
:event(a_from)
,m_x(a_from.m_x)
,m_y(a_from.m_y)
:parent(a_from)
,parent_pos_mod(a_from)
{}
mouse_up_event& operator=(const mouse_up_event& a_from){
event::operator=(a_from);
m_x = a_from.m_x;
m_y = a_from.m_y;
parent::operator=(a_from);
parent_pos_mod::operator=(a_from);
return *this;
}
public:
int x() const {return m_x;}
int y() const {return m_y;}
protected:
int m_x;
int m_y;
};
class mouse_move_event : public event {
class mouse_move_event : public event, public position_modifiers {
typedef event parent;
typedef position_modifiers parent_pos_mod;
public:
#ifdef TOOLS_SG_EVENT_ID_CAST
static cid id_class() {return parent::id_class()+4;}
@@ -208,11 +228,10 @@ public:
#endif
virtual event* copy() const {return new mouse_move_event(*this);}
public:
mouse_move_event(int a_x,int a_y, //signed because of wall.
mouse_move_event(int a_x,int a_y,bool a_shift_modifier,bool a_control_modifier,
int a_ox,int a_oy,
bool a_touch) //for sliders.
:m_x(a_x)
,m_y(a_y)
:parent_pos_mod(a_x,a_y,a_shift_modifier,a_control_modifier)
,m_ox(a_ox)
,m_oy(a_oy)
,m_touch(a_touch)
@@ -220,17 +239,15 @@ public:
virtual ~mouse_move_event(){}
public:
mouse_move_event(const mouse_move_event& a_from)
:event(a_from)
,m_x(a_from.m_x)
,m_y(a_from.m_y)
:parent(a_from)
,parent_pos_mod(a_from)
,m_ox(a_from.m_ox)
,m_oy(a_from.m_oy)
,m_touch(a_from.m_touch)
{}
mouse_move_event& operator=(const mouse_move_event& a_from){
event::operator=(a_from);
m_x = a_from.m_x;
m_y = a_from.m_y;
parent::operator=(a_from);
parent_pos_mod::operator=(a_from);
m_ox = a_from.m_ox;
m_oy = a_from.m_oy;
@@ -239,14 +256,10 @@ public:
return *this;
}
public:
int x() const {return m_x;}
int y() const {return m_y;}
int ox() const {return m_ox;}
int oy() const {return m_oy;}
bool is_touch() const {return m_touch;}
protected:
int m_x;
int m_y;
int m_ox;
int m_oy; //+ = up.
// etc :
@@ -385,8 +398,9 @@ protected:
key_code m_key;
};
class wheel_rotate_event : public event {
class wheel_rotate_event : public event, public position_modifiers {
typedef event parent;
typedef position_modifiers parent_pos_mod;
public:
#ifdef TOOLS_SG_EVENT_ID_CAST
static cid id_class() {return parent::id_class()+8;}
@@ -403,17 +417,20 @@ public:
#endif
virtual event* copy() const {return new wheel_rotate_event(*this);}
public:
wheel_rotate_event(int a_angle)
:m_angle(a_angle)
wheel_rotate_event(int a_angle,int a_x,int a_y,bool a_shift_modifier,bool a_control_modifier)
:parent_pos_mod(a_x,a_y,a_shift_modifier,a_control_modifier)
,m_angle(a_angle)
{}
virtual ~wheel_rotate_event(){}
public:
wheel_rotate_event(const wheel_rotate_event& a_from)
:event(a_from)
:parent(a_from)
,parent_pos_mod(a_from)
,m_angle(a_from.m_angle)
{}
wheel_rotate_event& operator=(const wheel_rotate_event& a_from){
event::operator=(a_from);
parent::operator=(a_from);
parent_pos_mod::operator=(a_from);
m_angle = a_from.m_angle;
return *this;
}
+5 -5
View File
@@ -5,13 +5,13 @@
#define tools_version
#define TOOLS_MAJOR_VERSION 6
#define TOOLS_MINOR_VERSION 3
#define TOOLS_PATCH_VERSION 3
#define TOOLS_VERSION "6.3.3"
#define TOOLS_VERSION_VRP "v6r3p3"
#define TOOLS_MINOR_VERSION 5
#define TOOLS_PATCH_VERSION 1
#define TOOLS_VERSION "6.5.1"
#define TOOLS_VERSION_VRP "v6r5p1"
namespace tools {
inline unsigned int version() {return 60303;}
inline unsigned int version() {return 60501;}
}
#endif
+27 -7
View File
@@ -60,34 +60,54 @@ public:
}
virtual void mousePressEvent(QMouseEvent* a_event) {
if(!m_interactor) return;
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x060000
tools::sg::mouse_down_event _event(a_event->x(),a_event->y());
tools::sg::mouse_down_event _event(a_event->x(),a_event->y(),shift_modifier,control_modifier);
#else
tools::sg::mouse_down_event _event(a_event->position().x(),a_event->position().y());
tools::sg::mouse_down_event _event(a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier);
#endif
m_interactor->mouse_press(_event);
}
virtual void mouseReleaseEvent(QMouseEvent* a_event) {
if(!m_interactor) return;
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x060000
tools::sg::mouse_up_event _event(a_event->x(),a_event->y());
tools::sg::mouse_up_event _event(a_event->x(),a_event->y(),shift_modifier,control_modifier);
#else
tools::sg::mouse_up_event _event(a_event->position().x(),a_event->position().y());
tools::sg::mouse_up_event _event(a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier);
#endif
m_interactor->mouse_release(_event);
}
virtual void mouseMoveEvent(QMouseEvent* a_event) {
if(!m_interactor) return;
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x060000
tools::sg::mouse_move_event _event(a_event->x(),a_event->y(),0,0,false);
tools::sg::mouse_move_event _event(a_event->x(),a_event->y(),shift_modifier,control_modifier,0,0,false);
#else
tools::sg::mouse_move_event _event(a_event->position().x(),a_event->position().y(),0,0,false);
tools::sg::mouse_move_event _event(a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier,0,0,false);
#endif
m_interactor->mouse_move(_event);
}
virtual void wheelEvent(QWheelEvent* a_event) {
if(!m_interactor) return;
tools::sg::wheel_rotate_event _event(a_event->angleDelta().y());
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x050f00 //5.15.00
tools::sg::wheel_rotate_event _event(a_event->angleDelta().y(),a_event->x(),a_event->y(),shift_modifier,control_modifier);
#else
tools::sg::wheel_rotate_event _event(a_event->angleDelta().y(),a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier);
#endif
m_interactor->wheel_rotate(_event);
}
+27 -7
View File
@@ -59,28 +59,40 @@ public:
}
virtual void mousePressEvent(QMouseEvent* a_event) {
if(!m_interactor) return;
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x060000
tools::sg::mouse_down_event _event(a_event->x(),a_event->y());
tools::sg::mouse_down_event _event(a_event->x(),a_event->y(),shift_modifier,control_modifier);
#else
tools::sg::mouse_down_event _event(a_event->position().x(),a_event->position().y());
tools::sg::mouse_down_event _event(a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier);
#endif
m_interactor->mouse_press(_event);
}
virtual void mouseReleaseEvent(QMouseEvent* a_event) {
if(!m_interactor) return;
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x060000
tools::sg::mouse_up_event _event(a_event->x(),a_event->y());
tools::sg::mouse_up_event _event(a_event->x(),a_event->y(),shift_modifier,control_modifier);
#else
tools::sg::mouse_up_event _event(a_event->position().x(),a_event->position().y());
tools::sg::mouse_up_event _event(a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier);
#endif
m_interactor->mouse_release(_event);
}
virtual void mouseMoveEvent(QMouseEvent* a_event) {
if(!m_interactor) return;
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x060000
tools::sg::mouse_move_event _event(a_event->x(),a_event->y(),0,0,false);
tools::sg::mouse_move_event _event(a_event->x(),a_event->y(),shift_modifier,control_modifier,0,0,false);
#else
tools::sg::mouse_move_event _event(a_event->position().x(),a_event->position().y(),0,0,false);
tools::sg::mouse_move_event _event(a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier,0,0,false);
#endif
m_interactor->mouse_move(_event);
}
@@ -91,7 +103,15 @@ public:
//}
virtual void wheelEvent(QWheelEvent* a_event) {
if(!m_interactor) return;
tools::sg::wheel_rotate_event _event(a_event->angleDelta().y());
bool shift_modifier = a_event->modifiers() & ::Qt::ShiftModifier;
bool control_modifier = a_event->modifiers() & ::Qt::ControlModifier;
#if QT_VERSION < 0x050f00 //5.15.00
tools::sg::wheel_rotate_event _event(a_event->angleDelta().y(),a_event->x(),a_event->y(),shift_modifier,control_modifier);
#else
tools::sg::wheel_rotate_event _event(a_event->angleDelta().y(),a_event->position().x(),a_event->position().y(),shift_modifier,control_modifier);
#endif
m_interactor->wheel_rotate(_event);
}
+12
View File
@@ -76,6 +76,18 @@ public:
if(!m_glarea) return;
m_glarea->update();
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_glarea) {a_w = 0;a_h = 0;return false;}
a_w = (unsigned int)m_glarea->width();
a_h = (unsigned int)m_glarea->height();
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
public:
QWidget* shell() {return m_shell;}
void set_own_shell(bool a_value) {m_own_shell = a_value;}
+11
View File
@@ -80,6 +80,17 @@ public:
m_render_area->repaint(); //immediate.
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_render_area) {a_w = 0;a_h = 0;return false;}
a_w = (unsigned int)m_render_area->width();
a_h = (unsigned int)m_render_area->height();
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
void set_device_interactor(tools::sg::device_interactor* a_interactor) { //we do not have ownership.
if(!m_render_area) return;
m_render_area->set_device_interactor(a_interactor);
+21 -8
View File
@@ -74,7 +74,6 @@ public:
,m_interactor(0)
{
register_class();
// The WS_BORDER is needed. Else probleme of size at startup.
RECT rect;
::GetClientRect(m_parent,&rect);
//printf("debug : glarea : ca : %d %d\n",rect.right-rect.left,rect.bottom-rect.top);
@@ -248,7 +247,9 @@ protected:
glarea* _this = (glarea*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
if(_this->m_interactor) {
tools::sg::mouse_down_event event(LOWORD(a_lparam),HIWORD(a_lparam));
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
tools::sg::mouse_down_event event(LOWORD(a_lparam),HIWORD(a_lparam),shift_modifier,control_modifier);
_this->m_interactor->mouse_press(event);
} else {
RECT rect;
@@ -262,7 +263,9 @@ protected:
glarea* _this = (glarea*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
if(_this->m_interactor) {
tools::sg::mouse_up_event event(LOWORD(a_lparam),HIWORD(a_lparam));
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
tools::sg::mouse_up_event event(LOWORD(a_lparam),HIWORD(a_lparam),shift_modifier,control_modifier);
_this->m_interactor->mouse_release(event);
} else {
RECT rect;
@@ -275,12 +278,16 @@ protected:
case WM_MOUSEMOVE:{
glarea* _this = (glarea*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
WPARAM state = a_wparam;
bool ldown = ((state & MK_LBUTTON)==MK_LBUTTON)?true:false;
if(_this->m_interactor) {
tools::sg::mouse_move_event event(LOWORD(a_lparam),HIWORD(a_lparam),0,0,false);
_this->m_interactor->mouse_move(event);
if(ldown) {
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
tools::sg::mouse_move_event event(LOWORD(a_lparam),HIWORD(a_lparam),shift_modifier,control_modifier,0,0,false);
_this->m_interactor->mouse_move(event);
}
} else {
WPARAM state = a_wparam;
bool ldown = ((state & MK_LBUTTON)==MK_LBUTTON)?true:false;
RECT rect;
::GetClientRect(a_hwnd,&rect);
unsigned int h = rect.bottom-rect.top;
@@ -294,7 +301,13 @@ protected:
glarea* _this = (glarea*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
if(_this->m_interactor) {
tools::sg::wheel_rotate_event event(GET_WHEEL_DELTA_WPARAM(a_wparam));
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
POINT p;
p.x = LOWORD(a_lparam);
p.y = HIWORD(a_lparam);
if(!::ScreenToClient(a_hwnd,&p)) {}
tools::sg::wheel_rotate_event event(GET_WHEEL_DELTA_WPARAM(a_wparam),int(p.x),int(p.y),shift_modifier,control_modifier);
_this->m_interactor->wheel_rotate(event);
}
}
+21 -7
View File
@@ -195,7 +195,9 @@ protected:
pixwin* _this = (pixwin*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
if(_this->m_interactor) {
tools::sg::mouse_down_event event(LOWORD(a_lparam),HIWORD(a_lparam));
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
tools::sg::mouse_down_event event(LOWORD(a_lparam),HIWORD(a_lparam),shift_modifier,control_modifier);
_this->m_interactor->mouse_press(event);
} else {
RECT rect;
@@ -209,7 +211,9 @@ protected:
pixwin* _this = (pixwin*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
if(_this->m_interactor) {
tools::sg::mouse_up_event event(LOWORD(a_lparam),HIWORD(a_lparam));
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
tools::sg::mouse_up_event event(LOWORD(a_lparam),HIWORD(a_lparam),shift_modifier,control_modifier);
_this->m_interactor->mouse_release(event);
} else {
RECT rect;
@@ -222,12 +226,16 @@ protected:
case WM_MOUSEMOVE:{
pixwin* _this = (pixwin*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
WPARAM state = a_wparam;
bool ldown = ((state & MK_LBUTTON)==MK_LBUTTON)?true:false;
if(_this->m_interactor) {
tools::sg::mouse_move_event event(LOWORD(a_lparam),HIWORD(a_lparam),0,0,false);
_this->m_interactor->mouse_move(event);
if(ldown) {
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
tools::sg::mouse_move_event event(LOWORD(a_lparam),HIWORD(a_lparam),shift_modifier,control_modifier,0,0,false);
_this->m_interactor->mouse_move(event);
}
} else {
WPARAM state = a_wparam;
bool ldown = ((state & MK_LBUTTON)==MK_LBUTTON)?true:false;
RECT rect;
::GetClientRect(a_hwnd,&rect);
unsigned int h = rect.bottom-rect.top;
@@ -241,7 +249,13 @@ protected:
pixwin* _this = (pixwin*)::GetWindowLongPtr(a_hwnd,GWLP_USERDATA);
if(_this) {
if(_this->m_interactor) {
tools::sg::wheel_rotate_event event(GET_WHEEL_DELTA_WPARAM(a_wparam));
bool shift_modifier = ::GetKeyState(VK_SHIFT) & 0x8000;
bool control_modifier = ::GetKeyState(VK_CONTROL) & 0x8000;
POINT p;
p.x = LOWORD(a_lparam);
p.y = HIWORD(a_lparam);
if(!::ScreenToClient(a_hwnd,&p)) {}
tools::sg::wheel_rotate_event event(GET_WHEEL_DELTA_WPARAM(a_wparam),int(p.x),int(p.y),shift_modifier,control_modifier);
_this->m_interactor->wheel_rotate(event);
}
}
@@ -58,6 +58,18 @@ public:
void win_render() {m_glarea.wm_paint();}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_glarea.hwnd()) {a_w = 0;a_h = 0;return false;}
RECT wrect;
::GetWindowRect(m_glarea.hwnd(),&wrect);
a_w = wrect.right-wrect.left;
a_h = wrect.bottom-wrect.top;
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent_viewer::width();
a_h = parent_viewer::height();
}
public:
void set_device_interactor(tools::sg::device_interactor* a_interactor) { //we do not have ownership.
@@ -78,6 +78,20 @@ public:
}
void win_render() {parent_render_area::wm_paint();}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!parent_render_area::m_hwnd) {a_w = 0;a_h = 0;return false;}
RECT wrect;
::GetWindowRect(parent_render_area::m_hwnd,&wrect);
a_w = wrect.right-wrect.left;
a_h = wrect.bottom-wrect.top;
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent_viewer::width();
a_h = parent_viewer::height();
}
void set_device_interactor(tools::sg::device_interactor* a_interactor) { //we do not have ownership.
parent_render_area::set_device_interactor(a_interactor);
}
+13
View File
@@ -100,6 +100,19 @@ public:
}
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_win) {a_w = 0;a_h = 0;return false;}
int width,height;
if(!m_session.window_size(m_win,width,height)) {a_w = 0;a_h = 0;return false;}
a_w = (unsigned int)width;
a_h = (unsigned int)height;
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
public:
void set_device_interactor(tools::sg::device_interactor*) {}
protected:
+20 -5
View File
@@ -24,30 +24,32 @@ private:
public:
virtual bool dispatch(XEvent& a_event) {
if(parent::dispatch(a_event)) return true;
bool shift_modifier = a_event.xkey.state & ShiftMask;
bool control_modifier = a_event.xkey.state & ControlMask;
if(a_event.type==ButtonPress && a_event.xbutton.button==1) {
if(!m_viewer.device_interactor()) return false;
tools::sg::mouse_down_event event(a_event.xbutton.x,a_event.xbutton.y);
tools::sg::mouse_down_event event(a_event.xbutton.x,a_event.xbutton.y,shift_modifier,control_modifier);
m_viewer.device_interactor()->mouse_press(event);
return true;
} else if(a_event.type==ButtonRelease && a_event.xbutton.button==1) {
if(!m_viewer.device_interactor()) return false;
tools::sg::mouse_up_event event(a_event.xbutton.x,a_event.xbutton.y);
tools::sg::mouse_up_event event(a_event.xbutton.x,a_event.xbutton.y,shift_modifier,control_modifier);
m_viewer.device_interactor()->mouse_release(event);
return true;
} else if(a_event.type==MotionNotify) {
if(!m_viewer.device_interactor()) return false;
if((a_event.xmotion.state & Button1MotionMask)==Button1MotionMask) {
tools::sg::mouse_move_event event(a_event.xmotion.x,a_event.xmotion.y,0,0,false);
tools::sg::mouse_move_event event(a_event.xmotion.x,a_event.xmotion.y,shift_modifier,control_modifier,0,0,false);
m_viewer.device_interactor()->mouse_move(event);
}
} else if((a_event.type==ButtonPress)&&(a_event.xbutton.button==4)) { // mouse scrollwheel down :
if(!m_viewer.device_interactor()) return false;
tools::sg::wheel_rotate_event event(8); //8=cooking.
tools::sg::wheel_rotate_event event(8,a_event.xbutton.x,a_event.xbutton.y,shift_modifier,control_modifier); //8=cooking.
m_viewer.device_interactor()->wheel_rotate(event);
return true;
} else if((a_event.type==ButtonPress)&&(a_event.xbutton.button==5)) { // mouse scrollwheel up :
if(!m_viewer.device_interactor()) return false;
tools::sg::wheel_rotate_event event(-8); //8=cooking.
tools::sg::wheel_rotate_event event(-8,a_event.xbutton.x,a_event.xbutton.y,shift_modifier,control_modifier); //8=cooking.
m_viewer.device_interactor()->wheel_rotate(event);
return true;
}
@@ -135,6 +137,19 @@ public:
m_out_buffer.clear();
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_win) {a_w = 0;a_h = 0;return false;}
int width,height;
if(!m_session.window_size(m_win,width,height)) {a_w = 0;a_h = 0;return false;}
a_w = (unsigned int)width;
a_h = (unsigned int)height;
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
void set_device_interactor(tools::sg::device_interactor* a_interactor) {m_interactor = a_interactor;}
public:
tools::sg::device_interactor* device_interactor() {return m_interactor;}
+22 -5
View File
@@ -108,6 +108,17 @@ public:
if(m_glarea) OpenGLArea::paint(m_glarea);
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_glarea) {a_w = 0;a_h = 0;return false;}
a_w = (unsigned int)m_glarea->core.width;
a_h = (unsigned int)m_glarea->core.height;
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
public:
void set_device_interactor(tools::sg::device_interactor* a_interactor) {m_interactor = a_interactor;} //we do not have ownership.
protected:
@@ -138,23 +149,29 @@ protected:
_this->m_interactor->key_release(event);
}return;
case ButtonPress:{
bool shift_modifier = xevent->xkey.state & ShiftMask;
bool control_modifier = xevent->xkey.state & ControlMask;
if(xevent->xbutton.button==Button4) { //4=wheel down, or move down double touch on trackpad = zoom in.
tools::sg::wheel_rotate_event event(8); //8=cooking.
tools::sg::wheel_rotate_event event(8,xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier); //8=cooking.
_this->m_interactor->wheel_rotate(event);
} else if(xevent->xbutton.button==Button5) { //5=wheel up, or move up double touch on trackpad = zoom out.
tools::sg::wheel_rotate_event event(-8); //8=cooking.
tools::sg::wheel_rotate_event event(-8,xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier); //8=cooking.
_this->m_interactor->wheel_rotate(event);
} else {
tools::sg::mouse_down_event event(xevent->xbutton.x,xevent->xbutton.y);
tools::sg::mouse_down_event event(xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier);
_this->m_interactor->mouse_press(event);
}
}return;
case ButtonRelease:{
tools::sg::mouse_up_event event(xevent->xbutton.x,xevent->xbutton.y);
bool shift_modifier = xevent->xkey.state & ShiftMask;
bool control_modifier = xevent->xkey.state & ControlMask;
tools::sg::mouse_up_event event(xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier);
_this->m_interactor->mouse_release(event);
}return;
case MotionNotify:{
tools::sg::mouse_move_event event(xevent->xmotion.x,xevent->xmotion.y,0,0,false);
bool shift_modifier = xevent->xkey.state & ShiftMask;
bool control_modifier = xevent->xkey.state & ControlMask;
tools::sg::mouse_move_event event(xevent->xmotion.x,xevent->xmotion.y,shift_modifier,control_modifier,0,0,false);
_this->m_interactor->mouse_move(event);
}return;
default:return;}
+22 -5
View File
@@ -116,6 +116,17 @@ public:
if(m_image_area) ImageArea::paint(m_image_area);
}
bool window_size(unsigned int& a_w,unsigned int& a_h) {
if(!m_image_area) {a_w = 0;a_h = 0;return false;}
a_w = m_image_area->core.width;
a_h = m_image_area->core.height;
return true;
}
void render_area_size(unsigned int& a_w,unsigned int& a_h) {
a_w = parent::width();
a_h = parent::height();
}
void set_device_interactor(tools::sg::device_interactor* a_interactor) {m_interactor = a_interactor;} //we do not have ownership.
protected:
static void resize_cbk(Widget a_widget,XtPointer a_tag,XtPointer){
@@ -157,26 +168,32 @@ protected:
_this->m_interactor->key_release(event);
}return;
case ButtonPress:{
bool shift_modifier = xevent->xkey.state & ShiftMask;
bool control_modifier = xevent->xkey.state & ControlMask;
if(xevent->xbutton.button==Button4) { //4=wheel down, or move down double touch on trackpad = zoom in.
tools::sg::wheel_rotate_event event(8); //8=cooking.
tools::sg::wheel_rotate_event event(8,xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier); //8=cooking.
_this->m_interactor->wheel_rotate(event);
} else if(xevent->xbutton.button==Button5) { //5=wheel up, or move up double touch on trackpad = zoom out.
tools::sg::wheel_rotate_event event(-8); //8=cooking.
tools::sg::wheel_rotate_event event(-8,xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier); //8=cooking.
_this->m_interactor->wheel_rotate(event);
} else if(xevent->xbutton.button==Button1) {
tools::sg::mouse_down_event event(xevent->xbutton.x,xevent->xbutton.y);
tools::sg::mouse_down_event event(xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier);
_this->m_interactor->mouse_press(event);
}
}return;
case ButtonRelease:{
if(xevent->xbutton.button==Button1) {
tools::sg::mouse_up_event event(xevent->xbutton.x,xevent->xbutton.y);
bool shift_modifier = xevent->xkey.state & ShiftMask;
bool control_modifier = xevent->xkey.state & ControlMask;
tools::sg::mouse_up_event event(xevent->xbutton.x,xevent->xbutton.y,shift_modifier,control_modifier);
_this->m_interactor->mouse_release(event);
}
}return;
case MotionNotify:{
if((xevent->xmotion.state & Button1MotionMask)==Button1MotionMask) {
tools::sg::mouse_move_event event(xevent->xmotion.x,xevent->xmotion.y,0,0,false);
bool shift_modifier = xevent->xkey.state & ShiftMask;
bool control_modifier = xevent->xkey.state & ControlMask;
tools::sg::mouse_move_event event(xevent->xmotion.x,xevent->xmotion.y,shift_modifier,control_modifier,0,0,false);
_this->m_interactor->mouse_move(event);
}
}return;
+19
View File
@@ -967,6 +967,25 @@ public:
}
#undef TOOLX_HDF5_NTUPLE_READ_BINDING_CREATE_COL
#undef TOOLX_HDF5_NTUPLE_READ_BINDING_CREATE_VEC_COL
size_t num = m_cols.size();
if(!num) {
a_out << "toolx::hdf5::ntuple::ntuple(read with binding) :"
<< " zero columns."
<< std::endl;
return false;
}
{tools_vforcit(tools::column_binding,a_bd.columns(),it) {
if(!tools::find_named<icol>(m_cols,(*it).name())) {
a_out << "toolx::hdf5::ntuple::ntuple(read with binding) :"
<< " error : for column binding with name " << tools::sout((*it).name()) << ", no ntuple column found."
<< std::endl;
tools::safe_clear<icol>(m_cols);
return false;
}
}}
return true;
}