g4tools  5.4.0
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
tools::sg::plots Class Reference
Inheritance diagram for tools::sg::plots:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::plots:
Collaboration graph
[legend]

Classes

class  extra
 

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
virtual bool touched ()
 
virtual void render (render_action &a_action)
 
virtual void pick (pick_action &a_action)
 
virtual void search (search_action &a_action)
 
virtual void bbox (bbox_action &a_action)
 
virtual void event (event_action &a_action)
 
virtual bool write (write_action &a_action)
 
 plots (const base_freetype &a_ttf)
 
virtual ~plots ()
 
 plots (const plots &a_from)
 
plotsoperator= (const plots &a_from)
 
unsigned int number () const
 
unsigned int current_index () const
 
void adjust_size (unsigned int a_ww, unsigned int a_wh)
 
const base_freetypettf () const
 
void clear ()
 
bool has_data ()
 
void touch_plotters ()
 
void next ()
 
bool set_current_plotter (unsigned int a_index)
 
bool set_current (plotter *a_plotter)
 
plottercurrent_plotter ()
 
plotterfind_plotter (unsigned int a_index)
 
void set_regions (unsigned int a_cols=1, unsigned int a_rows=1, bool a_transfer=false)
 
void current_to_one ()
 
void plotters (std::vector< plotter * > &a_vec)
 
void set_line_width (float a_line_width)
 
void set_grids_visibility (bool a_visible=false)
 
void adjust_scales (float a_plotter_scale=1)
 
void configure_grid_PAW (unsigned int a_ww, unsigned int a_wh)
 
void configure_extras_PAW (unsigned int a_ww, unsigned int a_wh)
 
void configure_PAW (unsigned int a_ww, unsigned int a_wh)
 
void delete_extras ()
 
plottercreate_extra_plotter (unsigned int a_cols, unsigned int a_rows, unsigned int a_index)
 
plotterlast_extra_plotter () const
 
void init_sg ()
 
void clear_sg ()
 
- Public Member Functions inherited from tools::sg::node
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const =0
 
virtual nodecopy () const =0
 
virtual unsigned int cls_version () const
 
virtual void get_matrix (get_matrix_action &a_action)
 
virtual bool read (read_action &a_action)
 
virtual void is_visible (visible_action &)
 
virtual void protocol_one_fields (std::vector< field * > &a_fields) const
 
virtual bool draw_in_frame_buffer () const
 
virtual void reset_touched ()
 
 node ()
 
virtual ~node ()
 
void touch ()
 
fieldfield_from_desc (const field_desc &a_desc) const
 
void dump_field_descs (std::ostream &a_out) const
 
fieldfind_field_by_name (const std::string &a_name) const
 

Public Attributes

sf< float > width
 
sf< float > height
 
sf< unsigned int > cols
 
sf< unsigned int > rows
 
sf< bool > view_border
 
sf< float > plotter_scale
 
sf< bool > border_visible
 
sf< float > border_width
 
sf< float > border_height
 
sf< float > border_z
 
sf< float > border_scale
 
sf_vec< colorf, float > border_color
 
sf< float > left_margin
 
sf< float > right_margin
 
sf< float > top_margin
 
sf< float > bottom_margin
 
sf< float > horizontal_spacing
 
sf< float > vertical_spacing
 

Protected Member Functions

void update_if_touched ()
 
void update_sg ()
 
bool copy_plotters (const plots &a_from)
 
void update_current_border ()
 
void update_border ()
 
void update_extras ()
 
- Protected Member Functions inherited from tools::sg::node
 node (const node &)
 
nodeoperator= (const node &)
 
void add_field (field *a_field)
 
bool write_fields (write_action &a_action)
 
bool read_fields (read_action &a_action)
 
field_desc::offset_t field_offset (const field *a_field) const
 
fieldfind_field (const field_desc &a_rdesc) const
 
void check_fields (std::ostream &a_out) const
 

Static Protected Member Functions

static void create_plotter_border (_switch &a_parent, float a_w, float a_h)
 
static void set_plotter_layout (separator &a_sep, size_t a_index, bool a_configure, unsigned int a_cols, unsigned int a_rows, float a_ww_wc, float a_wh_wc, const std::vector< vec2f > &a_origins, const std::vector< vec2f > &a_sizes, float a_scale)
 

Protected Attributes

const base_freetypem_ttf
 
group m_group
 
separator m_sep
 
separator m_border_sep
 
separator m_extras_sep
 
unsigned int m_current
 
std::vector< extram_extras
 
unsigned int m_old_cols
 
unsigned int m_old_rows
 
std::vector< vec2fm_origins
 
std::vector< vec2fm_sizes
 
std::vector< vec2fm_extras_origins
 
std::vector< vec2fm_extras_sizes
 

Detailed Description

Definition at line 16 of file plots.

Constructor & Destructor Documentation

◆ plots() [1/2]

tools::sg::plots::plots ( const base_freetype a_ttf)
inline

Definition at line 155 of file plots.

156  :parent()
157  ,width(1)
158  ,height(1)
159  ,cols(1)
160  ,rows(1)
161  ,view_border(true)
162  ,plotter_scale(1)
163  ,border_visible(false)
164  ,border_width(0)
165  ,border_height(0)
166  ,border_z(0)
167  ,border_scale(1)
168  ,border_color(colorf_grey())
169  ,left_margin(0)
170  ,right_margin(0)
171  ,top_margin(0)
172  ,bottom_margin(0)
174  ,vertical_spacing(0)
175 
176  ,m_ttf(a_ttf)
177  ,m_current(0)
178  ,m_extras()
179  //,m_updater(0)
180  ,m_old_cols(0)
181  ,m_old_rows(0)
182  {
183  add_fields();
184  init_sg();
185  }

◆ ~plots()

virtual tools::sg::plots::~plots ( )
inlinevirtual

Definition at line 186 of file plots.

186  {
187  //delete m_updater;
188  }

◆ plots() [2/2]

tools::sg::plots::plots ( const plots a_from)
inline

Definition at line 190 of file plots.

191  :parent(a_from)
192  ,width(a_from.width)
193  ,height(a_from.height)
194  ,cols(a_from.cols)
195  ,rows(a_from.rows)
196  ,view_border(a_from.view_border)
197  ,plotter_scale(a_from.plotter_scale)
198  ,border_visible(a_from.border_visible)
199  ,border_width(a_from.border_width)
200  ,border_height(a_from.border_height)
201  ,border_z(a_from.border_z)
202  ,border_scale(a_from.border_scale)
203  ,border_color(a_from.border_color)
204  ,left_margin(a_from.left_margin)
205  ,right_margin(a_from.right_margin)
206  ,top_margin(a_from.top_margin)
207  ,bottom_margin(a_from.bottom_margin)
208  ,horizontal_spacing(a_from.horizontal_spacing)
209  ,vertical_spacing(a_from.vertical_spacing)
210 
211  ,m_ttf(a_from.m_ttf)
212  ,m_current(a_from.m_current)
213  ,m_extras(a_from.m_extras)
214  //,m_updater(0)
215  ,m_old_cols(0)
216  ,m_old_rows(0)
217  ,m_origins(a_from.m_origins)
218  ,m_sizes(a_from.m_sizes)
219  ,m_extras_origins(a_from.m_extras_origins)
220  ,m_extras_sizes(a_from.m_extras_sizes)
221  {
222  add_fields();
223  init_sg();
224  //m_updater = a_from.m_updater?a_from.m_updater->copy():0;
225  if(!copy_plotters(a_from)) {}
226  }

Member Function Documentation

◆ adjust_scales()

void tools::sg::plots::adjust_scales ( float  a_plotter_scale = 1)
inline

Definition at line 592 of file plots.

592  {
593  // Rescale some plotter parameters (for example margins) according to the number of plots.
594  // We assume that these parameters had been set previously according to one plot per page.
595  // Then this function must be applied after all the styles had been applied (because
596  // a plotting style may set these parameters).
597 
598  float ww_wc = width.value();
599  float wh_wc = height.value();
600  float rw_wc = ww_wc/cols.value();
601  float rh_wc = wh_wc/rows.value();
602 
603  float cooking = 1.2f; //if increased the data area is diminished.
604 
605  float wfac = (rw_wc/ww_wc)*cooking;
606  float hfac = (rh_wc/wh_wc)*cooking;
607 
608  float label_cooking = 1.6f; //if increased the labels are bigger.
609 
610  if((cols.value()>=4)&&(cols.value()>rows.value())) label_cooking = 0.9f;
611 
612  float title_cooking = 1.1f; //extra title cooking.
613 
614  plotter_scale = a_plotter_scale;
615 
617  {size_t _number = m_sep.size();
618  for(size_t index=0;index<_number;index++) {
619  separator* sep = (separator*)m_sep[index];
620  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
621 
622  _plotter->left_margin = _plotter->left_margin * wfac;
623  _plotter->right_margin = _plotter->right_margin * wfac;
624  _plotter->bottom_margin = _plotter->bottom_margin * hfac;
625  _plotter->top_margin = _plotter->top_margin * hfac;
626 
627  _plotter->x_axis().tick_length = _plotter->x_axis().tick_length * wfac;
628  _plotter->y_axis().tick_length = _plotter->y_axis().tick_length * hfac;
629 
630  _plotter->title_to_axis = _plotter->title_to_axis * hfac;
631  _plotter->title_height = _plotter->title_height * hfac * title_cooking;
632 
633  _plotter->x_axis().label_height = _plotter->x_axis().label_height * hfac * label_cooking;
634  _plotter->y_axis().label_height = _plotter->y_axis().label_height * hfac * label_cooking;
635  }}
636  }

◆ adjust_size()

void tools::sg::plots::adjust_size ( unsigned int  a_ww,
unsigned int  a_wh 
)
inline

Definition at line 271 of file plots.

271  {
272  if(!a_ww||!a_wh) return;
273  float aspect = float(a_ww)/float(a_wh);
274  width = height * aspect;
275  }

◆ bbox()

virtual void tools::sg::plots::bbox ( bbox_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 140 of file plots.

140  {
142  m_group.bbox(a_action);
143  }

◆ clear()

void tools::sg::plots::clear ( )
inline

Definition at line 291 of file plots.

291  {
293  {size_t _number = m_sep.size();
294  for(size_t index=0;index<_number;index++) {
295  separator* sep = (separator*)m_sep[index];
296  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
297  _plotter->clear();
298  }}
299  tools_vforit(extra,m_extras,it) {
300  separator* sep = (*it).m_sep;
301  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
302  _plotter->clear();
303  }
304  }

◆ clear_sg()

void tools::sg::plots::clear_sg ( )
inline

Definition at line 919 of file plots.

919  { //used in GL_plots_viewer.
920  m_group.clear();
921  m_sep.clear();
924  }

◆ configure_extras_PAW()

void tools::sg::plots::configure_extras_PAW ( unsigned int  a_ww,
unsigned int  a_wh 
)
inline

Definition at line 770 of file plots.

770  {
771 
772  m_extras_origins.clear();
773  m_extras_sizes.clear();
774 
775  float wvp = float(a_ww); //pixels.
776  float hvp = float(a_wh); //pixels.
777  if( (wvp<=0)||(hvp<=0)||(width.value()<=0)||(height.value()<=0) ) return;
778 
779  tools_vforcit(extra,m_extras,it) {
780  const extra& _extra = *it;
781 
782  unsigned int _cols = _extra.m_cols;
783  unsigned int _rows = _extra.m_rows;
784  if((!_cols)||(!_rows)) continue;
785 
786  float wdata = (width.value()-left_margin.value()-right_margin.value()-(_cols-1)*horizontal_spacing.value())/_cols;
787  float hdata = (height.value()-bottom_margin.value()-top_margin.value()-(_rows-1)*vertical_spacing.value())/_rows;
788 
789  if((wdata<=0)||(hdata<=0)) continue;
790 
791  unsigned int iregion = _extra.m_index;
792  unsigned int row = iregion/_cols;
793  unsigned int col = iregion - row * _cols;
794 
795  float wr,hr,x,y,lm,rm,bm,tm;
796  wr = hr = x = y = 0;
797  lm = rm = bm = tm = 0;
798 
799  if(_cols==1) {
800  wr = width.value();
801  x = 0;
802  lm = left_margin.value();
803  rm = right_margin.value();
804  } else {
805  float wrl = left_margin.value()+wdata+horizontal_spacing.value()/2;
806  float wrr = right_margin.value()+wdata+horizontal_spacing.value()/2;
807  float wri = wdata+horizontal_spacing.value();
808  if(col==0) {
809  wr = wrl;
810  x = 0;
811  lm = left_margin.value();
812  rm = horizontal_spacing.value()/2;
813  } else if(col==(_cols-1)) {
814  wr = wrr;
815  x = width.value() - wrr;
816  lm = horizontal_spacing.value()/2;
817  rm = right_margin.value();
818  } else {
819  wr = wri;
820  x = wrl + (col-1) * wri;
821  lm = horizontal_spacing.value()/2;
822  rm = horizontal_spacing.value()/2;
823  }
824  }
825 
826  if(_rows==1) {
827  hr = height.value();
828  y = 0;
829  tm = top_margin.value();
830  bm = bottom_margin.value();
831  } else {
832  float hrt = top_margin.value()+hdata+vertical_spacing.value()/2; //top
833  float hrb = bottom_margin.value()+hdata+vertical_spacing.value()/2; //bottom
834  float hri = hdata+vertical_spacing.value();
835  if(row==0) { //top row.
836  hr = hrt;
837  y = height.value()-hrt;
838  tm = top_margin.value();
839  bm = vertical_spacing.value()/2;
840  } else if(row==(_rows-1)) {
841  hr = hrb;
842  y = 0;
843  tm = vertical_spacing.value()/2;
844  bm = bottom_margin.value();
845  } else {
846  hr = hri;
847  y = height.value()- (hrt + row * hri);
848  tm = vertical_spacing.value()/2;
849  bm = vertical_spacing.value()/2;
850  }
851  }
852 
853  //m_extras_origins.push_back(vec2f(xo/xfac+x,yo/yfac+y));
854  m_extras_origins.push_back(vec2f(x,y));
855  m_extras_sizes.push_back(vec2f(wr,hr));
856 
857  separator* sep = _extra.m_sep;
858  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
859 
860  //_plotter->width = wr;
861  _plotter->left_margin = lm;
862  _plotter->right_margin = rm;
863 
864  //_plotter->height = hr;
865  _plotter->top_margin = tm;
866  _plotter->bottom_margin = bm;
867 
868  // ignore margins and spacings :
869  //float wr = w/_cols;
870  //float hr = h/_rows;
871  //float x = xo + col * wr;
872  //float y = yo + (rows-1-row) * hr;
873  //viewportRegion->setPositionPercent(x,y);
874  //viewportRegion->setSizePercent(wr,hr);
875 
876  } //tools_vforcit
877  }

◆ configure_grid_PAW()

void tools::sg::plots::configure_grid_PAW ( unsigned int  a_ww,
unsigned int  a_wh 
)
inline

Definition at line 639 of file plots.

639  {
640 
641  m_origins.clear();
642  m_sizes.clear();
643 
644  float wvp = float(a_ww); //pixels.
645  float hvp = float(a_wh); //pixels.
646  if( (wvp<=0)||(hvp<=0)||(width.value()<=0)||(height.value()<=0) ) return;
647 
648  unsigned int _cols = cols.value();
649  unsigned int _rows = rows.value();
650  if((!_cols)||(!_rows)) return;
651 
652  float wdata = (width.value()-left_margin.value()-right_margin.value()-(_cols-1)*horizontal_spacing.value())/_cols;
653  float hdata = (height.value()-bottom_margin.value()-top_margin.value()-(_rows-1)*vertical_spacing.value())/_rows;
654 
655  if((wdata<=0)||(hdata<=0)) return;
656 
657 /*
658  // wpix = w * wvp pixels
659  // hpix = h * hvp pixels
660  // wpix/hpix = cst = (w * wvp) / (h * hvp) = width / height
661  float h,w,xo,yo;
662  h = w = xo = yo = 0;
663  float waspect = wvp/hvp;
664  float paspect = width.value()/height.value();
665  if(waspect>=paspect) {
666  h = 1;
667  w = paspect * h * (hvp/wvp);
668  xo = (1-w)/2;
669  yo = 0;
670  } else {
671  w = 1;
672  h = w * (wvp/hvp)/paspect;
673  xo = 0;
674  yo = (1-h)/2;
675  }
676  float xfac = w / width.value();
677  float yfac = h / height.value();
678 */
679 
680  unsigned int _num = number();
681  for(unsigned int iregion=0;iregion<_num;iregion++) {
682  //iregion = col + row * cols
683  unsigned int row = iregion/_cols;
684  unsigned int col = iregion - row * _cols;
685 
686  float wr,hr,x,y,lm,rm,bm,tm;
687  wr = hr = x = y = 0;
688  lm = rm = bm = tm = 0;
689 
690  if(_cols==1) {
691  wr = width.value();
692  x = 0;
693  lm = left_margin.value();
694  rm = right_margin.value();
695  } else {
696  float wrl = left_margin.value()+wdata+horizontal_spacing.value()/2;
697  float wrr = right_margin.value()+wdata+horizontal_spacing.value()/2;
698  float wri = wdata+horizontal_spacing.value();
699  if(col==0) {
700  wr = wrl;
701  x = 0;
702  lm = left_margin.value();
703  rm = horizontal_spacing.value()/2;
704  } else if(col==(_cols-1)) {
705  wr = wrr;
706  x = width.value() - wrr;
707  lm = horizontal_spacing.value()/2;
708  rm = right_margin.value();
709  } else {
710  wr = wri;
711  x = wrl + (col-1) * wri;
712  lm = horizontal_spacing.value()/2;
713  rm = horizontal_spacing.value()/2;
714  }
715  }
716 
717  if(_rows==1) {
718  hr = height.value();
719  y = 0;
720  tm = top_margin.value();
721  bm = bottom_margin.value();
722  } else {
723  float hrt = top_margin.value()+hdata+vertical_spacing.value()/2; //top
724  float hrb = bottom_margin.value()+hdata+vertical_spacing.value()/2; //bottom
725  float hri = hdata+vertical_spacing.value();
726  if(row==0) { //top row.
727  hr = hrt;
728  y = height.value()-hrt;
729  tm = top_margin.value();
730  bm = vertical_spacing.value()/2;
731  } else if(row==(_rows-1)) {
732  hr = hrb;
733  y = 0;
734  tm = vertical_spacing.value()/2;
735  bm = bottom_margin.value();
736  } else {
737  hr = hri;
738  y = height.value()- (hrt + row * hri);
739  tm = vertical_spacing.value()/2;
740  bm = vertical_spacing.value()/2;
741  }
742  }
743 
744  //m_origins.push_back(vec2f(xo/xfac+x,yo/yfac+y));
745  m_origins.push_back(vec2f(x,y));
746  m_sizes.push_back(vec2f(wr,hr));
747 
748  separator* sep = (separator*)m_sep[iregion];
749  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
750 
751  //_plotter->width = wr;
752  _plotter->left_margin = lm;
753  _plotter->right_margin = rm;
754 
755  //_plotter->height = hr;
756  _plotter->top_margin = tm;
757  _plotter->bottom_margin = bm;
758 
759  // ignore margins and spacings :
760  //float wr = w/_cols;
761  //float hr = h/_rows;
762  //float x = xo + col * wr;
763  //float y = yo + (rows-1-row) * hr;
764  //viewportRegion->setPositionPercent(x,y);
765  //viewportRegion->setSizePercent(wr,hr);
766 
767  }
768  }

◆ configure_PAW()

void tools::sg::plots::configure_PAW ( unsigned int  a_ww,
unsigned int  a_wh 
)
inline

Definition at line 878 of file plots.

878  {
879  configure_grid_PAW(a_ww,a_wh);
880  configure_extras_PAW(a_ww,a_wh);
881  touch();
883  }

◆ copy_plotters()

bool tools::sg::plots::copy_plotters ( const plots a_from)
inlineprotected

Definition at line 995 of file plots.

995  {
997  if(m_sep.size()==a_from.m_sep.size()) {
998  size_t _number = m_sep.size();
999  for(size_t index=0;index<_number;index++) {
1000  separator* _from_sep = (separator*)a_from.m_sep[index];
1001  matrix* _from_matrix = (matrix*)(*_from_sep)[MATRIX()];
1002  //_switch* _border = (_switch*)(*_sep)[BORDER()];
1003  plotter* _from_plotter = (plotter*)(*_from_sep)[PLOTTER()];
1004 
1005  separator* _sep = (separator*)m_sep[index];
1006  matrix* _matrix = (matrix*)(*_sep)[MATRIX()];
1007  plotter* _plotter = (plotter*)(*_sep)[PLOTTER()];
1008 
1009  _matrix->operator=(*_from_matrix);
1010  _plotter->operator=(*_from_plotter);
1011  }
1012  }
1013  if(m_extras_sep.size()==a_from.m_extras_sep.size()) {
1014  size_t _number = m_extras_sep.size();
1015  for(size_t index=0;index<_number;index++) {
1016  separator* _from_sep = (separator*)a_from.m_extras_sep[index];
1017  matrix* _from_matrix = (matrix*)(*_from_sep)[MATRIX()];
1018  plotter* _from_plotter = (plotter*)(*_from_sep)[PLOTTER()];
1019 
1020  separator* _sep = (separator*)m_extras_sep[index];
1021  matrix* _matrix = (matrix*)(*_sep)[MATRIX()];
1022  plotter* _plotter = (plotter*)(*_sep)[PLOTTER()];
1023 
1024  _matrix->operator=(*_from_matrix);
1025  _plotter->operator=(*_from_plotter);
1026  }
1027  }
1028  return true;
1029  }

◆ create_extra_plotter()

plotter* tools::sg::plots::create_extra_plotter ( unsigned int  a_cols,
unsigned int  a_rows,
unsigned int  a_index 
)
inline

Definition at line 894 of file plots.

894  {
895  // Create a plotter with size and position as if in a grid of a_colsxa_rows and at position a_index.
896  // The index numbering being for example for a grid of 3x2 :
897  // 0 1 2
898  // 3 4 5
899  m_extras.push_back(extra(a_cols,a_rows,a_index));
901  separator* sep = m_extras.back().m_sep;
902  return (plotter*)(*sep)[PLOTTER()];
903  }

◆ create_plotter_border()

static void tools::sg::plots::create_plotter_border ( _switch a_parent,
float  a_w,
float  a_h 
)
inlinestaticprotected

Definition at line 1031 of file plots.

1031  {
1032  a_parent.clear();
1033 
1034  group* sep = new group;
1035  a_parent.add(sep);
1036 
1037  a_parent.add(new group()); //empty
1038 
1039  rgba* mat = new rgba();
1040  mat->color = colorf_red();
1041  sep->add(mat);
1042 
1043  draw_style* ds = new draw_style;
1044  ds->style = draw_lines;
1045  ds->line_width = 4;
1046  sep->add(ds);
1047 
1048  vertices* vtxs = new vertices;
1049  vtxs->mode = gl::line_strip();
1050  sep->add(vtxs);
1051 
1052  float dw = a_w*0.5f;
1053  float dh = a_h*0.5f;
1054  vtxs->add(-dw,-dh,0);
1055  vtxs->add( dw,-dh,0);
1056  vtxs->add( dw, dh,0);
1057  vtxs->add(-dw, dh,0);
1058  vtxs->add(-dw,-dh,0);
1059  }

◆ current_index()

unsigned int tools::sg::plots::current_index ( ) const
inline

Definition at line 269 of file plots.

269 {return m_current;}

◆ current_plotter()

plotter& tools::sg::plots::current_plotter ( )
inline

Definition at line 390 of file plots.

390  {
392  separator* sep = (separator*)m_sep[m_current];
393  return *((plotter*)(*sep)[PLOTTER()]);
394  }

◆ current_to_one()

void tools::sg::plots::current_to_one ( )
inline

Definition at line 493 of file plots.

493  {
494  ptbs_t ptbs;current_plotter().transfer_plottables(ptbs);
495  prims_t prims;current_plotter().transfer_primitives(prims);
496  todels_t tdls;current_plotter().transfer_todels(tdls);
497  plotter pl = current_plotter(); //to copy styles.
498 
499  set_regions(1,1,false);
500 
501  plotter& p = current_plotter();
502  p.copy_style(pl); //copy styles.
503 
504  {tools_vforcit(plottable*,ptbs,it) p.add_plottable(*it);}
505  {tools_vforcit(plotprim*,prims,it) p.add_primitive(*it);}
506  {tools_vforcit(node*,tdls,it) p.add_node_todel(*it);}
507 
508  }

◆ delete_extras()

void tools::sg::plots::delete_extras ( )
inline

Definition at line 889 of file plots.

889  {
891  m_extras.clear();
892  }

◆ event()

virtual void tools::sg::plots::event ( event_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 145 of file plots.

145  {
147  m_group.event(a_action);
148  if(a_action.done()) return;
149  }

◆ find_plotter()

plotter* tools::sg::plots::find_plotter ( unsigned int  a_index)
inline

Definition at line 395 of file plots.

395  {
397  if(a_index>=m_sep.size()) return 0;
398  separator* sep = (separator*)m_sep[a_index];
399  return (plotter*)(*sep)[PLOTTER()];
400  }

◆ has_data()

bool tools::sg::plots::has_data ( )
inline

Definition at line 306 of file plots.

306  {
308  {size_t _number = m_sep.size();
309  for(size_t index=0;index<_number;index++) {
310  separator* sep = (separator*)m_sep[index];
311  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
312  if(_plotter->plottables().size()) return true;
313  }}
314  tools_vforit(extra,m_extras,it) {
315  separator* sep = (*it).m_sep;
316  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
317  if(_plotter->plottables().size()) return true;
318  }
319  return false;
320  }

◆ init_sg()

void tools::sg::plots::init_sg ( )
inline

Definition at line 910 of file plots.

910  { // used also in gopaw::base_viewer::clean_gstos().
911  m_group.clear();
912  m_sep.clear();
915  m_group.add(new noderef(m_sep));
916  m_group.add(new noderef(m_border_sep));
917  m_group.add(new noderef(m_extras_sep));
918  }

◆ last_extra_plotter()

plotter* tools::sg::plots::last_extra_plotter ( ) const
inline

Definition at line 904 of file plots.

904  {
905  if(m_extras.empty()) return 0;
906  separator* sep = m_extras.back().m_sep;
907  return (plotter*)(*sep)[PLOTTER()];
908  }

◆ next()

void tools::sg::plots::next ( )
inline

Definition at line 337 of file plots.

337  {
339  size_t _number = m_sep.size();
340  if(m_current>=(uint32(_number)-1)) {
341  m_current = 0;
342  } else {
343  m_current++;
344  }
346  }

◆ node_desc_fields()

virtual const desc_fields& tools::sg::plots::node_desc_fields ( ) const
inlinevirtual

◆ number()

unsigned int tools::sg::plots::number ( ) const
inline

Definition at line 268 of file plots.

268 {return cols*rows;}

◆ operator=()

plots& tools::sg::plots::operator= ( const plots a_from)
inline

Definition at line 227 of file plots.

227  {
228  parent::operator=(a_from);
229  if(&a_from==this) return *this;
230 
231  width = a_from.width;
232  height = a_from.height;
233 
234  cols = a_from.cols;
235  rows = a_from.rows;
236  view_border = a_from.view_border;
237  plotter_scale = a_from.plotter_scale;
238 
239  border_visible = a_from.border_visible;
240  border_width = a_from.border_width;
241  border_height = a_from.border_height;
242  border_z = a_from.border_z;
243  border_scale = a_from.border_scale;
244  border_color = a_from.border_color;
245 
246  left_margin = a_from.left_margin;
247  right_margin = a_from.right_margin;
248  top_margin = a_from.top_margin;
249  bottom_margin = a_from.bottom_margin;
250  horizontal_spacing = a_from.horizontal_spacing;
251  vertical_spacing = a_from.vertical_spacing;
252 
253  m_old_cols = 0;
254  m_old_rows = 0;
255  m_origins = a_from.m_origins;
256  m_sizes = a_from.m_sizes;
257  m_extras_origins = a_from.m_extras_origins;
258  m_extras_sizes = a_from.m_extras_sizes;
259 
260  m_current = a_from.m_current;
261  m_extras = a_from.m_extras;
262 
263  if(!copy_plotters(a_from)) {}
264 
265  return *this;
266  }

◆ pick()

virtual void tools::sg::plots::pick ( pick_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 126 of file plots.

126  {
128  nodekit_pick(a_action,m_group,this);
129  //m_group.pick(a_action);
130  }

◆ plotters()

void tools::sg::plots::plotters ( std::vector< plotter * > &  a_vec)
inline

Definition at line 510 of file plots.

510  { //a_vec do NOT get ownership of sg::plotter objects. Use in G4Analysis.
511  a_vec.clear();
513  size_t _number = m_sep.size();
514  for(size_t index=0;index<_number;index++) {
515  separator* sep = (separator*)m_sep[index];
516  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
517  a_vec.push_back(_plotter);
518  }
519  }

◆ render()

virtual void tools::sg::plots::render ( render_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 122 of file plots.

122  {
124  m_group.render(a_action);
125  }

◆ search()

virtual void tools::sg::plots::search ( search_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 131 of file plots.

131  {
133  parent::search(a_action);
134  if(a_action.done()) return;
135  if(a_action.do_path()) a_action.path_push(this);
136  m_group.search(a_action);
137  if(a_action.done()) return;
138  if(a_action.do_path()) a_action.path_pop();
139  }

◆ set_current()

bool tools::sg::plots::set_current ( plotter a_plotter)
inline

Definition at line 356 of file plots.

356  { //for popup.
358  size_t _number = m_sep.size();
359  for(size_t index=0;index<_number;index++) {
360  separator* sep = (separator*)m_sep[index];
361  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
362  if(_plotter==a_plotter) {
363  m_current = uint32(index);
365  return true;
366  }
367  }
368  return false;
369  }

◆ set_current_plotter()

bool tools::sg::plots::set_current_plotter ( unsigned int  a_index)
inline

Definition at line 348 of file plots.

348  {
350  if(a_index>=m_sep.size()) return false;
351  m_current = a_index;
353  return true;
354  }

◆ set_grids_visibility()

void tools::sg::plots::set_grids_visibility ( bool  a_visible = false)
inline

Definition at line 581 of file plots.

581  {
583  size_t _number = m_sep.size();
584  for(size_t index=0;index<_number;index++) {
585  separator* sep = (separator*)m_sep[index];
586  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
587  _plotter->grid_style().visible = a_visible;
588  }
589  border_visible = true;
590  }

◆ set_line_width()

void tools::sg::plots::set_line_width ( float  a_line_width)
inline

Definition at line 524 of file plots.

524  {
526  size_t _number = m_sep.size();
527  for(size_t index=0;index<_number;index++) {
528  separator* sep = (separator*)m_sep[index];
529  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
530 
531  _plotter->bins_style(0).line_width = a_line_width;
532  _plotter->inner_frame_style().line_width = a_line_width;
533  _plotter->grid_style().line_width = a_line_width;
534  _plotter->x_axis().line_style().width = a_line_width;
535  _plotter->x_axis().ticks_style().width = a_line_width;
536  _plotter->y_axis().line_style().width = a_line_width;
537  _plotter->y_axis().ticks_style().width = a_line_width;
538  _plotter->z_axis().line_style().width = a_line_width;
539  _plotter->z_axis().ticks_style().width = a_line_width;
540  _plotter->colormap_axis().line_style().width = a_line_width;
541  _plotter->colormap_axis().ticks_style().width = a_line_width;
542 
543  // needed if font is hershey :
544  _plotter->title_style().line_width = a_line_width;
545  _plotter->infos_style().line_width = a_line_width;
546  _plotter->title_box_style().line_width = a_line_width;
547 
548  _plotter->x_axis().labels_style().line_width = a_line_width;
549  _plotter->x_axis().mag_style().line_width = a_line_width;
550  _plotter->x_axis().title_style().line_width = a_line_width;
551 
552  _plotter->y_axis().labels_style().line_width = a_line_width;
553  _plotter->y_axis().mag_style().line_width = a_line_width;
554  _plotter->y_axis().title_style().line_width = a_line_width;
555 
556  _plotter->z_axis().labels_style().line_width = a_line_width;
557  _plotter->z_axis().mag_style().line_width = a_line_width;
558  _plotter->z_axis().title_style().line_width = a_line_width;
559 
560  _plotter->colormap_axis().labels_style().line_width = a_line_width;
561  _plotter->colormap_axis().mag_style().line_width = a_line_width;
562  _plotter->colormap_axis().title_style().line_width = a_line_width;
563  }
564  }

◆ set_plotter_layout()

static void tools::sg::plots::set_plotter_layout ( separator a_sep,
size_t  a_index,
bool  a_configure,
unsigned int  a_cols,
unsigned int  a_rows,
float  a_ww_wc,
float  a_wh_wc,
const std::vector< vec2f > &  a_origins,
const std::vector< vec2f > &  a_sizes,
float  a_scale 
)
inlinestaticprotected

Definition at line 1252 of file plots.

1255  {
1256  size_t row = a_index/a_cols;
1257  size_t col = a_index-a_cols*row;
1258 
1259  float rw_wc = a_ww_wc/a_cols;
1260  float rh_wc = a_wh_wc/a_rows;
1261 
1262  matrix* _matrix = (matrix*)(a_sep)[MATRIX()];
1263  plotter* _plotter = (plotter*)(a_sep)[PLOTTER()];
1264 
1265  if(a_configure) {
1266  _plotter->width = a_sizes[a_index].x();
1267  _plotter->height = a_sizes[a_index].y();
1268  float x = -a_ww_wc*0.5f + a_origins[a_index].x() + _plotter->width*0.5f;
1269  float y = -a_wh_wc*0.5f + a_origins[a_index].y() + _plotter->height*0.5f;
1270  _matrix->set_translate(x,y,0);
1271  } else {
1272  float x = -a_ww_wc*0.5f + col * rw_wc + rw_wc * 0.5f;
1273  float y = a_wh_wc*0.5f - row * rh_wc - rh_wc * 0.5f;
1274  _matrix->set_translate(x,y,0);
1275  }
1276  _matrix->mul_scale(a_scale,a_scale,1); //applied first.
1277 
1278  {_switch* _border = (_switch*)(a_sep)[BORDER()];
1279  create_plotter_border(*_border,rw_wc,rh_wc);
1280  //_border->which = view_border.value()?(a_index==m_current?0:1):1;
1281  _border->which = 1;
1282  }
1283 
1284  if(_plotter->shape.value()==plotter::xy) {
1285  _plotter->depth = min_of(rw_wc,rh_wc);
1286  } else {
1287  //if((rw_wc/rh_wc)>=1.0f) {
1288  // _plotter->depth = rh_wc;
1289  //} else {
1290  // _plotter->depth = rh_wc;
1291  //}
1292  _plotter->depth = rh_wc;
1293  }
1294 
1295  if(a_configure) {
1296  } else {
1297  if(_plotter->shape.value()==plotter::xy) {
1298  _plotter->width = rw_wc;
1299  _plotter->height = rh_wc;
1300  } else {
1301  if((rw_wc/rh_wc)>=1.0f) {
1302  _plotter->width = rh_wc;
1303  _plotter->height = rh_wc;
1304  } else {
1305  _plotter->width = rw_wc;
1306  _plotter->height = rw_wc;
1307  }
1308  }
1309  }
1310  }

◆ set_regions()

void tools::sg::plots::set_regions ( unsigned int  a_cols = 1,
unsigned int  a_rows = 1,
bool  a_transfer = false 
)
inline

Definition at line 447 of file plots.

447  {
448  unsigned int oldn = cols*rows;
449 
450  std::vector<ptbs_t> ptbss;
451  std::vector<prims_t> primss;
452  std::vector<todels_t> tdlss;
453  std::vector<plotter> pls;
454 
455  if(a_transfer) {
456  ptbss.resize(oldn);
457  primss.resize(oldn);
458  tdlss.resize(oldn);
459  pls.resize(oldn,plotter(m_ttf));
460  for(unsigned int index=0;index<oldn;index++) {
461  plotter* p = find_plotter(index);
462  p->transfer_plottables(ptbss[index]);
463  p->transfer_primitives(primss[index]);
464  p->transfer_todels(tdlss[index]);
465  pls[index] = *p; //to copy styles.
466  }
467  }
468 
469  cols = a_cols?a_cols:1;
470  rows = a_rows?a_rows:1;
471  if(view_border.value()) {view_border = (number()==1?false:true);}
472  update_sg();
474  clear();
475  if(a_transfer) {
476  //fill new plotters with old data :
477  unsigned int num = min_of(oldn,cols*rows);
478  for(unsigned int index=0;index<num;index++) {
479  plotter* p = find_plotter(index);
480  p->copy_style(pls[index]); //it must not touch p width, height, depth.
481 
482  {const ptbs_t& ptbs = ptbss[index];
483  tools_vforcit(plottable*,ptbs,it) p->add_plottable(*it);}
484  {const prims_t& prims = primss[index];
485  tools_vforcit(plotprim*,prims,it) p->add_primitive(*it);}
486  {const todels_t& todels = tdlss[index];
487  tools_vforcit(node*,todels,it) p->add_node_todel(*it);}
488  }
489  }
490  reset_touched();
491  }

◆ touch_plotters()

void tools::sg::plots::touch_plotters ( )
inline

Definition at line 322 of file plots.

322  { //used in exlib/geant4/session.
324  {size_t _number = m_sep.size();
325  for(size_t index=0;index<_number;index++) {
326  separator* sep = (separator*)m_sep[index];
327  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
328  _plotter->touch();
329  }}
330  tools_vforit(extra,m_extras,it) {
331  separator* sep = (*it).m_sep;
332  plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
333  _plotter->touch();
334  }
335  }

◆ touched()

virtual bool tools::sg::plots::touched ( )
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 65 of file plots.

65  {
66  if(parent::touched()) return true;
67 
68  if(m_sep.empty()) return true;
69  if(m_extras.size()!=m_extras_sep.size()) return true;
70 
71  //{size_t _number = m_sep.size();
72  // for(size_t index=0;index<_number;index++) {
73  // separator* sep = (separator*)m_sep[index];
74  // plotter* _plotter = (plotter*)(*sep)[PLOTTER()];
75  // if(_plotter->shape.touched()) return true;
76  // }}
77 
78  return false;
79  }

◆ ttf()

const base_freetype& tools::sg::plots::ttf ( ) const
inline

Definition at line 282 of file plots.

282 {return m_ttf;}

◆ update_border()

void tools::sg::plots::update_border ( )
inlineprotected

Definition at line 1075 of file plots.

1075  {
1076  m_border_sep.clear();
1077 
1078  if(!border_visible.value()) return;
1079 
1080  if(width.value()<=0) return;
1081  if(height.value()<=0) return;
1082  if(border_width.value()<=0) return;
1083  if(border_height.value()<=0) return;
1084 
1085  // border_scale could be used as an offscreen (inzb_[ps,png,jpeg], gl2s_pdf)
1086  // cooking to avoid seeing a one pixel line at some side (in general left)
1087  // coming from the border.
1088  if(border_scale.value()!=1) {
1089  matrix* _m = new matrix;
1090  _m->set_scale(border_scale.value(),border_scale.value(),1);
1091  m_border_sep.add(_m);
1092  }
1093 
1094  float bw = border_width;
1095  float bh = border_height;
1096 
1097  // do it with four externals back_area.
1098 
1099  float zz = border_z.value();
1100 
1101  // top :
1102  {separator* sep = new separator;
1103  m_border_sep.add(sep);
1104 
1105  float wba = width+2*bw;
1106  float hba = bh;
1107  float x = 0;
1108  float y = height*0.5f+bh*0.5f;
1109 
1110  matrix* _m = new matrix;
1111  _m->set_translate(x,y,zz);
1112  sep->add(_m);
1113 
1114  back_area* b = new back_area;
1115  b->border_visible = false;
1116  b->color = border_color;
1117  b->width = wba;
1118  b->height = hba;
1119  sep->add(b);}
1120 
1121  // bottom :
1122  {separator* sep = new separator;
1123  m_border_sep.add(sep);
1124 
1125  float wba = width+2*bw;
1126  float hba = bh;
1127  float x = 0;
1128  float y = -height*0.5f-bh*0.5f;
1129 
1130  matrix* _m = new matrix;
1131  _m->set_translate(x,y,zz);
1132  sep->add(_m);
1133 
1134  back_area* b = new back_area;
1135  b->border_visible = false;
1136  b->color = border_color;
1137  b->width = wba;
1138  b->height = hba;
1139  sep->add(b);}
1140 
1141  // left :
1142  {separator* sep = new separator;
1143  m_border_sep.add(sep);
1144 
1145  float wba = bw;
1146  float hba = height+2*bh;
1147  float x = -width*0.5f-bw*0.5f;
1148  float y = 0;
1149 
1150  matrix* _m = new matrix;
1151  _m->set_translate(x,y,zz);
1152  sep->add(_m);
1153 
1154  back_area* b = new back_area;
1155  b->border_visible = false;
1156  b->color = border_color;
1157  b->width = wba;
1158  b->height = hba;
1159  sep->add(b);}
1160 
1161  // right :
1162  {separator* sep = new separator;
1163  m_border_sep.add(sep);
1164 
1165  float wba = bw;
1166  float hba = height+2*bh;
1167  float x = width*0.5f+bw*0.5f;
1168  float y = 0;
1169 
1170  matrix* _m = new matrix;
1171  _m->set_translate(x,y,zz);
1172  sep->add(_m);
1173 
1174  back_area* b = new back_area;
1175  b->border_visible = false;
1176  b->color = border_color;
1177  b->width = wba;
1178  b->height = hba;
1179  sep->add(b);}
1180 
1181  }

◆ update_current_border()

void tools::sg::plots::update_current_border ( )
inlineprotected

Definition at line 1061 of file plots.

1061  {
1062  size_t _number = m_sep.size();
1063  for(size_t index=0;index<_number;index++) {
1064  separator* sep = (separator*)m_sep[index];
1065  _switch* _border = (_switch*)(*sep)[BORDER()];
1066  if(index==m_current) {
1067  _border->which = view_border.value()?0:1;
1068  //if(m_updater) m_updater->update(*this,index);
1069  } else {
1070  _border->which = 1;
1071  }
1072  }
1073  }

◆ update_extras()

void tools::sg::plots::update_extras ( )
inlineprotected

Definition at line 1204 of file plots.

1204  {
1205  if(m_extras.size()!=m_extras_sep.size()) {
1206  m_extras_sep.clear();
1207  tools_vforit(extra,m_extras,it) { // same sg layout than grid plotters.
1208  separator* sep = new separator;
1209  m_extras_sep.add(sep);
1210  (*it).m_sep = sep; //*it does not get ownership.
1211 
1212  sep->add(new sg::matrix); //MATRIX()
1213 
1214  //head_light* light = new head_light;
1215  //light->direction = vec3f(1,-1,-10);
1216  //light->on = false;
1217  //sep->add(light); //LIGHT()
1218 
1219  _switch* border = new _switch;
1220  sep->add(border); //BORDER()
1221 
1222  //matrix* tsf = new matrix;
1223  //sep->add(tsf); //TSF()
1224 
1225  sep->add(new plotter(m_ttf)); //PLOTTER()
1226  }
1227  }
1228 
1229  if(width.value()<=0) return;
1230  if(height.value()<=0) return;
1231 
1232  // all window wc :
1233  float ww_wc = width;
1234  float wh_wc = height;
1235 
1236  size_t _number = m_extras.size();
1237 
1238  bool configure = (m_extras_origins.size()==_number)&&(m_extras_sizes.size()==_number)?true:false;
1239 
1240  tools_vforcit(extra,m_extras,it) {
1241  const extra& _extra = *it;
1242  unsigned int index = _extra.m_index;
1243  if(index>=(m_extras_sep.size())) index = 0;
1244 
1245  separator* sep = _extra.m_sep;
1246  set_plotter_layout(*sep,index,configure,_extra.m_cols,_extra.m_rows,
1248  }
1249 
1250  }

◆ update_if_touched()

void tools::sg::plots::update_if_touched ( )
inlineprotected

Definition at line 926 of file plots.

926  {
927  if(touched()) {
928  update_sg();
929  reset_touched();
930  }
931  }

◆ update_sg()

void tools::sg::plots::update_sg ( )
inlineprotected

Definition at line 932 of file plots.

932  {
933 
934  if(m_sep.empty()||(cols.value()!=m_old_cols)||(rows.value()!=m_old_rows)){
935 
936  m_old_cols = cols;
937  m_old_rows = rows;
938 
939  m_sep.clear();
940 
941  unsigned int index = 0;
942  for(unsigned int irow=0;irow<rows;irow++) {
943  for(unsigned int icol=0;icol<cols;icol++) {
944  separator* sep = new separator;
945  m_sep.add(sep);
946 
947  sep->add(new sg::matrix); //MATRIX()
948 
949  //head_light* light = new head_light;
950  //light->direction = vec3f(1,-1,-10);
951  //light->on = false;
952  //sep->add(light); //LIGHT()
953 
954  _switch* border = new _switch;
955  sep->add(border); //BORDER()
956 
957  //matrix* tsf = new matrix;
958  //sep->add(tsf); //TSF()
959 
960  sep->add(new plotter(m_ttf)); //PLOTTER()
961 
962  index++;
963  }
964  }
965 
966  if(m_current>=m_sep.size()) m_current = 0;
967  }
968 
970  update_border();
971 
972  if((width.value()>0)&&(height.value()>0)) {
973  size_t _number = m_sep.size();
974 
975  bool configure = (m_origins.size()==_number)&&(m_sizes.size()==_number)?true:false;
976 
977  // all window wc :
978  float ww_wc = width;
979  float wh_wc = height;
980 
981  // plotter size in window wc :
982  //float rw_wc = ww_wc/cols;
983  //float rh_wc = wh_wc/rows;
984 
985  for(size_t index=0;index<_number;index++) {
986  separator* sep = (separator*)m_sep[index];
987  set_plotter_layout(*sep,index,configure,cols.value(),rows.value(),
988  ww_wc,wh_wc,m_origins,m_sizes,plotter_scale.value());
989  }
990  }
991 
992  update_extras();
993  }

◆ write()

virtual bool tools::sg::plots::write ( write_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 150 of file plots.

150  {
152  return m_group.write(a_action);
153  }

Member Data Documentation

◆ border_color

sf_vec<colorf,float> tools::sg::plots::border_color

Definition at line 31 of file plots.

◆ border_height

sf<float> tools::sg::plots::border_height

Definition at line 28 of file plots.

◆ border_scale

sf<float> tools::sg::plots::border_scale

Definition at line 30 of file plots.

◆ border_visible

sf<bool> tools::sg::plots::border_visible

Definition at line 26 of file plots.

◆ border_width

sf<float> tools::sg::plots::border_width

Definition at line 27 of file plots.

◆ border_z

sf<float> tools::sg::plots::border_z

Definition at line 29 of file plots.

◆ bottom_margin

sf<float> tools::sg::plots::bottom_margin

Definition at line 37 of file plots.

◆ cols

sf<unsigned int> tools::sg::plots::cols

Definition at line 21 of file plots.

◆ height

sf<float> tools::sg::plots::height

Definition at line 20 of file plots.

◆ horizontal_spacing

sf<float> tools::sg::plots::horizontal_spacing

Definition at line 38 of file plots.

◆ left_margin

sf<float> tools::sg::plots::left_margin

Definition at line 34 of file plots.

◆ m_border_sep

separator tools::sg::plots::m_border_sep
protected

Definition at line 1316 of file plots.

◆ m_current

unsigned int tools::sg::plots::m_current
protected

Definition at line 1318 of file plots.

◆ m_extras

std::vector<extra> tools::sg::plots::m_extras
protected

Definition at line 1320 of file plots.

◆ m_extras_origins

std::vector<vec2f> tools::sg::plots::m_extras_origins
protected

Definition at line 1328 of file plots.

◆ m_extras_sep

separator tools::sg::plots::m_extras_sep
protected

Definition at line 1317 of file plots.

◆ m_extras_sizes

std::vector<vec2f> tools::sg::plots::m_extras_sizes
protected

Definition at line 1329 of file plots.

◆ m_group

group tools::sg::plots::m_group
protected

Definition at line 1314 of file plots.

◆ m_old_cols

unsigned int tools::sg::plots::m_old_cols
protected

Definition at line 1323 of file plots.

◆ m_old_rows

unsigned int tools::sg::plots::m_old_rows
protected

Definition at line 1324 of file plots.

◆ m_origins

std::vector<vec2f> tools::sg::plots::m_origins
protected

Definition at line 1326 of file plots.

◆ m_sep

separator tools::sg::plots::m_sep
protected

Definition at line 1315 of file plots.

◆ m_sizes

std::vector<vec2f> tools::sg::plots::m_sizes
protected

Definition at line 1327 of file plots.

◆ m_ttf

const base_freetype& tools::sg::plots::m_ttf
protected

Definition at line 1312 of file plots.

◆ plotter_scale

sf<float> tools::sg::plots::plotter_scale

Definition at line 24 of file plots.

◆ right_margin

sf<float> tools::sg::plots::right_margin

Definition at line 35 of file plots.

◆ rows

sf<unsigned int> tools::sg::plots::rows

Definition at line 22 of file plots.

◆ top_margin

sf<float> tools::sg::plots::top_margin

Definition at line 36 of file plots.

◆ vertical_spacing

sf<float> tools::sg::plots::vertical_spacing

Definition at line 39 of file plots.

◆ view_border

sf<bool> tools::sg::plots::view_border

Definition at line 23 of file plots.

◆ width

sf<float> tools::sg::plots::width

Definition at line 19 of file plots.


The documentation for this class was generated from the following file:
tools::sg::plots::touched
virtual bool touched()
Definition: plots:65
tools::sg::group::search
virtual void search(search_action &a_action)
Definition: group:51
tools::sg::plots::border_visible
sf< bool > border_visible
Definition: plots:26
tools::sg::plots::m_current
unsigned int m_current
Definition: plots:1318
tools::sg::plots::m_group
group m_group
Definition: plots:1314
tools::sg::plots::update_sg
void update_sg()
Definition: plots:932
tools::sg::plots::border_scale
sf< float > border_scale
Definition: plots:30
tools::sg::group::bbox
virtual void bbox(bbox_action &a_action)
Definition: group:42
tools::sg::plotter::transfer_plottables
void transfer_plottables(std::vector< plottable * > &a_to)
Definition: plotter:1627
tools::sg::plots::m_old_cols
unsigned int m_old_cols
Definition: plots:1323
tools::sg::plots::set_plotter_layout
static void set_plotter_layout(separator &a_sep, size_t a_index, bool a_configure, unsigned int a_cols, unsigned int a_rows, float a_ww_wc, float a_wh_wc, const std::vector< vec2f > &a_origins, const std::vector< vec2f > &a_sizes, float a_scale)
Definition: plots:1252
tools::sg::group::event
virtual void event(event_action &a_action)
Definition: group:45
tools::sg::plots::find_plotter
plotter * find_plotter(unsigned int a_index)
Definition: plots:395
tools::sg::plots::current_plotter
plotter & current_plotter()
Definition: plots:390
tools::sg::plotter::xy
@ xy
Definition: plotter:150
tools::sg::plots::bottom_margin
sf< float > bottom_margin
Definition: plots:37
tools::sg::group::size
size_t size() const
Definition: group:243
tools::sg::plots::horizontal_spacing
sf< float > horizontal_spacing
Definition: plots:38
tools::sg::group::write
virtual bool write(write_action &a_action)
Definition: group:67
tools::sg::group::empty
bool empty() const
Definition: group:244
tools::gl::line_strip
mode_t line_strip()
Definition: glprims:19
tools::sg::plots::height
sf< float > height
Definition: plots:20
tools::sg::plots::m_sep
separator m_sep
Definition: plots:1315
tools::sg::plots::configure_extras_PAW
void configure_extras_PAW(unsigned int a_ww, unsigned int a_wh)
Definition: plots:770
tools::sg::plots::m_border_sep
separator m_border_sep
Definition: plots:1316
tools::sg::plots::view_border
sf< bool > view_border
Definition: plots:23
tools::sg::plots
Definition: plots:16
tools::sg::nodekit_pick
void nodekit_pick(pick_action &a_action, node &a_sg, node *a_node)
Definition: nodekit:13
tools::sg::plots::set_regions
void set_regions(unsigned int a_cols=1, unsigned int a_rows=1, bool a_transfer=false)
Definition: plots:447
tools::sg::group::render
virtual void render(render_action &a_action)
Definition: group:24
tools::sg::plotter::transfer_todels
void transfer_todels(std::vector< node * > &a_to)
Definition: plotter:1667
tools::sg::plots::configure_grid_PAW
void configure_grid_PAW(unsigned int a_ww, unsigned int a_wh)
Definition: plots:639
tools::sg::plots::border_z
sf< float > border_z
Definition: plots:29
tools::sg::plots::border_height
sf< float > border_height
Definition: plots:28
tools::sg::plots::top_margin
sf< float > top_margin
Definition: plots:36
tools::sg::plots::left_margin
sf< float > left_margin
Definition: plots:34
tools::sg::group::add
void add(node *a_node)
Definition: group:96
tools::sg::plots::width
sf< float > width
Definition: plots:19
tools::sg::plots::m_old_rows
unsigned int m_old_rows
Definition: plots:1324
tools_vforit
#define tools_vforit(a__T, a__v, a__it)
Definition: forit:13
tools::sg::plots::plotter_scale
sf< float > plotter_scale
Definition: plots:24
tools::sg::plots::m_origins
std::vector< vec2f > m_origins
Definition: plots:1326
tools::sg::plotter::transfer_primitives
void transfer_primitives(std::vector< plotprim * > &a_to)
Definition: plotter:1653
tools::sg::plots::copy_plotters
bool copy_plotters(const plots &a_from)
Definition: plots:995
tools::sg::plots::update_extras
void update_extras()
Definition: plots:1204
tools::sg::plots::m_extras
std::vector< extra > m_extras
Definition: plots:1320
tools::sg::plots::set_current_plotter
bool set_current_plotter(unsigned int a_index)
Definition: plots:348
tools::sg::plots::m_extras_origins
std::vector< vec2f > m_extras_origins
Definition: plots:1328
tools::sg::plots::init_sg
void init_sg()
Definition: plots:910
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::group::clear
void clear()
Definition: group:235
tools::sg::plots::m_extras_sizes
std::vector< vec2f > m_extras_sizes
Definition: plots:1329
tools::sg::plots::clear
void clear()
Definition: plots:291
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::plots::m_ttf
const base_freetype & m_ttf
Definition: plots:1312
tools::sg::plots::update_if_touched
void update_if_touched()
Definition: plots:926
tools::sg::plots::update_border
void update_border()
Definition: plots:1075
tools::sg::plots::m_extras_sep
separator m_extras_sep
Definition: plots:1317
tools::sep
const std::string & sep()
Definition: sep:11
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::sg::plots::border_width
sf< float > border_width
Definition: plots:27
tools::sg::plots::m_sizes
std::vector< vec2f > m_sizes
Definition: plots:1327
tools::min_of
T min_of(const T &a, const T &b)
Definition: mnmx:17
tools::uint32
unsigned int uint32
Definition: typedefs:71
tools::sg::plots::border_color
sf_vec< colorf, float > border_color
Definition: plots:31
tools::sg::plots::rows
sf< unsigned int > rows
Definition: plots:22
tools::sg::plots::number
unsigned int number() const
Definition: plots:268
tools::sg::draw_lines
@ draw_lines
Definition: enums:192
tools::sg::plots::vertical_spacing
sf< float > vertical_spacing
Definition: plots:39
tools::sg::plots::right_margin
sf< float > right_margin
Definition: plots:35
tools::sg::node::touch
void touch()
Definition: node:233
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71
tools::sg::node::reset_touched
virtual void reset_touched()
Definition: node:102
tools::sg::node::node
node()
Definition: node:106
tools::sg::plots::cols
sf< unsigned int > cols
Definition: plots:21
tools::sg::plots::create_plotter_border
static void create_plotter_border(_switch &a_parent, float a_w, float a_h)
Definition: plots:1031
tools::sg::plots::update_current_border
void update_current_border()
Definition: plots:1061