gui/graph_displayer_canvas-node.cc
changeset 1880 0d6da6e6a775
parent 1837 8dd6160ff699
equal deleted inserted replaced
13:c3c939c17730 14:c784ca1a4b2c
     4 
     4 
     5 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node)
     5 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node)
     6 {
     6 {
     7   Graph::NodeMap<double> * actual_map;
     7   Graph::NodeMap<double> * actual_map;
     8   double min, max;
     8   double min, max;
     9   min=(mainwin.mapstorage).minOfNodeMap(mapname);
     9   min=(mytab.mapstorage).minOfNodeMap(mapname);
    10   max=(mainwin.mapstorage).maxOfNodeMap(mapname);
    10   max=(mytab.mapstorage).maxOfNodeMap(mapname);
    11   actual_map=((mainwin.mapstorage).nodemap_storage)[mapname];
    11   actual_map=((mytab.mapstorage).nodemap_storage)[mapname];
    12 
    12 
    13   if(node==INVALID)
    13   if(node==INVALID)
    14     {
    14     {
    15       for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
    15       for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
    16 	{
    16 	{
    17 	  double v=fabs((*actual_map)[i]);
    17 	  double v=fabs((*actual_map)[i]);
    18 	  int w;
    18 	  int w;
    19 	  if(min==max)
    19 	  if(min==max)
    20 	    {
    20 	    {
    62 int GraphDisplayerCanvas::resetNodeRadius (Node node)
    62 int GraphDisplayerCanvas::resetNodeRadius (Node node)
    63 {
    63 {
    64   double min, max;
    64   double min, max;
    65   min=node_property_defaults[N_RADIUS];
    65   min=node_property_defaults[N_RADIUS];
    66   max=node_property_defaults[N_RADIUS];
    66   max=node_property_defaults[N_RADIUS];
    67   Graph::NodeMap<double> actual_map((mainwin.mapstorage).graph,node_property_defaults[N_RADIUS]);
    67   Graph::NodeMap<double> actual_map((mytab.mapstorage).graph,node_property_defaults[N_RADIUS]);
    68   
    68   
    69   if(node==INVALID)
    69   if(node==INVALID)
    70     {
    70     {
    71       for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
    71       for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
    72 	{
    72 	{
    73 	  double v=fabs(actual_map[i]);
    73 	  double v=fabs(actual_map[i]);
    74 	  int w;
    74 	  int w;
    75 	  if(min==max)
    75 	  if(min==max)
    76 	    {
    76 	    {
   121   //function maps the range of the maximum and
   121   //function maps the range of the maximum and
   122   //the minimum of the nodemap to the range of
   122   //the minimum of the nodemap to the range of
   123   //green in RGB
   123   //green in RGB
   124 
   124 
   125   Graph::NodeMap<double> * actual_map;
   125   Graph::NodeMap<double> * actual_map;
   126   actual_map=((mainwin.mapstorage).nodemap_storage)[mapname];
   126   actual_map=((mytab.mapstorage).nodemap_storage)[mapname];
   127 
   127 
   128   double max, min;
   128   double max, min;
   129 
   129 
   130   max=(mainwin.mapstorage).maxOfNodeMap(mapname);
   130   max=(mytab.mapstorage).maxOfNodeMap(mapname);
   131   min=(mainwin.mapstorage).minOfNodeMap(mapname);
   131   min=(mytab.mapstorage).minOfNodeMap(mapname);
   132 
   132 
   133   if(node==INVALID)
   133   if(node==INVALID)
   134     {
   134     {
   135 
   135 
   136       for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
   136       for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   137 	{
   137 	{
   138 	  Gdk::Color color;
   138 	  Gdk::Color color;
   139 
   139 
   140 	  double w=(*actual_map)[i];
   140 	  double w=(*actual_map)[i];
   141 
   141 
   176 
   176 
   177   //function maps the range of the maximum and
   177   //function maps the range of the maximum and
   178   //the minimum of the nodemap to the range of
   178   //the minimum of the nodemap to the range of
   179   //green in RGB
   179   //green in RGB
   180 
   180 
   181   Graph::NodeMap<double> actual_map((mainwin.mapstorage).graph,node_property_defaults[N_COLOR]);
   181   Graph::NodeMap<double> actual_map((mytab.mapstorage).graph,node_property_defaults[N_COLOR]);
   182 
   182 
   183   double max, min;
   183   double max, min;
   184 
   184 
   185   max=node_property_defaults[N_COLOR];
   185   max=node_property_defaults[N_COLOR];
   186   min=node_property_defaults[N_COLOR];
   186   min=node_property_defaults[N_COLOR];
   187 
   187 
   188   if(node==INVALID)
   188   if(node==INVALID)
   189     {
   189     {
   190 
   190 
   191       for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
   191       for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   192 	{
   192 	{
   193 	  Gdk::Color color;
   193 	  Gdk::Color color;
   194 
   194 
   195 	  double w=actual_map[i];
   195 	  double w=actual_map[i];
   196 
   196 
   233   //EXCEPT when the name of the map is Text, because
   233   //EXCEPT when the name of the map is Text, because
   234   //in that case empty string will be written, because
   234   //in that case empty string will be written, because
   235   //that is the deleter map
   235   //that is the deleter map
   236 
   236 
   237   Graph::NodeMap<double> * actual_map=NULL;
   237   Graph::NodeMap<double> * actual_map=NULL;
   238   actual_map=((mainwin.mapstorage).nodemap_storage)[mapname];
   238   actual_map=((mytab.mapstorage).nodemap_storage)[mapname];
   239 
   239 
   240   if(node==INVALID)
   240   if(node==INVALID)
   241     {
   241     {
   242       for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
   242       for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   243 	{
   243 	{
   244 	  nodemap_to_edit=mapname;
   244 	  nodemap_to_edit=mapname;
   245 	  double number=(*actual_map)[i];
   245 	  double number=(*actual_map)[i];
   246 
   246 
   247 	  std::ostringstream ostr;
   247 	  std::ostringstream ostr;
   270   //in that case empty string will be written, because
   270   //in that case empty string will be written, because
   271   //that is the deleter map
   271   //that is the deleter map
   272 
   272 
   273   if(node==INVALID)
   273   if(node==INVALID)
   274     {
   274     {
   275       for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
   275       for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   276 	{
   276 	{
   277 	  nodemap_to_edit="";
   277 	  nodemap_to_edit="";
   278 	  nodetextmap[i]->property_text().set_value("");
   278 	  nodetextmap[i]->property_text().set_value("");
   279 	}
   279 	}
   280     }
   280     }