[Lemon-commits] [lemon_svn] hegyi: r2951 - glemon/trunk
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 21:51:26 CET 2006
Author: hegyi
Date: Thu Sep 21 12:29:29 2006
New Revision: 2951
Modified:
glemon/trunk/all_include.h
glemon/trunk/graph_displayer_canvas-event.cc
glemon/trunk/graph_displayer_canvas.cc
glemon/trunk/graph_displayer_canvas.h
glemon/trunk/gui_reader.cc
glemon/trunk/gui_writer.cc
glemon/trunk/xml.h
glemon/trunk/xymap.h
Log:
According to xy->Point changement.
Modified: glemon/trunk/all_include.h
==============================================================================
--- glemon/trunk/all_include.h (original)
+++ glemon/trunk/all_include.h Thu Sep 21 12:29:29 2006
@@ -14,7 +14,7 @@
#include <lemon/graph_utils.h>
#include <lemon/maps.h>
#include <lemon/error.h>
-#include <lemon/xy.h>
+#include <lemon/dim2.h>
enum {E_WIDTH, E_COLOR, E_TEXT, EDGE_PROPERTY_NUM}; // edge properties;
enum {N_RADIUS, N_COLOR, N_TEXT, NODE_PROPERTY_NUM}; // node properties;
@@ -37,7 +37,7 @@
using namespace lemon;
-typedef xy<double> XY;
+typedef lemon::dim2::Point<double> XY;
typedef ListGraph Graph;
typedef Graph::Node Node;
typedef Graph::Edge Edge;
Modified: glemon/trunk/graph_displayer_canvas-event.cc
==============================================================================
--- glemon/trunk/graph_displayer_canvas-event.cc (original)
+++ glemon/trunk/graph_displayer_canvas-event.cc Thu Sep 21 12:29:29 2006
@@ -134,7 +134,7 @@
double coord_y = new_y - (clicked_y - (mytab.mapstorage).coords[active_node].y);
// write back the new coordinates to the coords map
- (mytab.mapstorage).coords.set(active_node, xy<double>(coord_x, coord_y));
+ (mytab.mapstorage).coords.set(active_node, XY(coord_x, coord_y));
clicked_x=new_x;
clicked_y=new_y;
@@ -234,9 +234,9 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////
//old vector from one to the other node - a
- xy<double> a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
+ XY a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
//new vector from one to the other node - b
- xy<double> b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
+ XY b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
double absa=sqrt(a_v.normSquare());
double absb=sqrt(b_v.normSquare());
@@ -248,25 +248,25 @@
else
{
//old vector from one node to the breakpoint - c
- xy<double> c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
+ XY c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
//unit vector with the same direction to a_v
- xy<double> a_v_u(a_v.x/absa,a_v.y/absa);
+ XY a_v_u(a_v.x/absa,a_v.y/absa);
//normal vector of unit vector with the same direction to a_v
- xy<double> a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
+ XY a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
//unit vector with the same direction to b_v
- xy<double> b_v_u(b_v.x/absb,b_v.y/absb);
+ XY b_v_u(b_v.x/absb,b_v.y/absb);
//normal vector of unit vector with the same direction to b_v
- xy<double> b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
+ XY b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
//vector c in a_v_u and a_v_u_n co-ordinate system
- xy<double> c_a(c_v*a_v_u,c_v*a_v_u_n);
+ XY c_a(c_v*a_v_u,c_v*a_v_u_n);
//new vector from one node to the breakpoint - d - we have to calculate this one
- xy<double> d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
+ XY d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
return XY(d_v.x+fix_node.x,d_v.y+fix_node.y);
}
@@ -305,7 +305,7 @@
window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
// update coordinates
- (mytab.mapstorage).coords.set(active_node, xy<double>(clicked_x, clicked_y));
+ (mytab.mapstorage).coords.set(active_node, XY(clicked_x, clicked_y));
// update all other maps
for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
@@ -790,9 +790,9 @@
(mytab.mapstorage).graph.erase(edge_to_delete);
}
-void GraphDisplayerCanvas::textReposition(xy<double> new_place)
+void GraphDisplayerCanvas::textReposition(XY new_place)
{
- new_place+=(xy<double>(10,10));
+ new_place+=(XY(10,10));
edgetextmap[forming_edge]->property_x().set_value(new_place.x);
edgetextmap[forming_edge]->property_y().set_value(new_place.y);
}
Modified: glemon/trunk/graph_displayer_canvas.cc
==============================================================================
--- glemon/trunk/graph_displayer_canvas.cc (original)
+++ glemon/trunk/graph_displayer_canvas.cc Thu Sep 21 12:29:29 2006
@@ -199,7 +199,7 @@
//initializing edge-text as well, to empty string
- xy<double> text_pos(
+ XY text_pos(
((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5),
((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5));
Modified: glemon/trunk/graph_displayer_canvas.h
==============================================================================
--- glemon/trunk/graph_displayer_canvas.h (original)
+++ glemon/trunk/graph_displayer_canvas.h Thu Sep 21 12:29:29 2006
@@ -9,7 +9,7 @@
#include "nbtab.h"
#include <libgnomecanvasmm.h>
#include <libgnomecanvasmm/polygon.h>
-#include <lemon/xy.h>
+#include <lemon/dim2.h>
///This class is the canvas, on which the graph can be drawn.
class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
@@ -268,7 +268,7 @@
public:
///Moves the text to new place
- void textReposition(xy<double>);
+ void textReposition(XY);
///Activates an edge belonging to an EdgeBase
Modified: glemon/trunk/gui_reader.cc
==============================================================================
--- glemon/trunk/gui_reader.cc (original)
+++ glemon/trunk/gui_reader.cc Thu Sep 21 12:29:29 2006
@@ -1,7 +1,7 @@
#include "gui_reader.h"
#include "xml.h"
#include "mapstorage.h"
-#include <lemon/xy.h>
+#include <lemon/dim2.h>
#include <vector>
bool GuiReader::header(const std::string& line)
@@ -15,7 +15,7 @@
void GuiReader::read(std::istream& is)
{
XmlIo x(is);
- std::map<int, xy<double> > m;
+ std::map<int, XY > m;
x("arrow_pos", m);
if ((int)m.size() != countEdges(mapstorage->graph)) return;
Modified: glemon/trunk/gui_writer.cc
==============================================================================
--- glemon/trunk/gui_writer.cc (original)
+++ glemon/trunk/gui_writer.cc Thu Sep 21 12:29:29 2006
@@ -1,7 +1,7 @@
#include "gui_writer.h"
#include "xml.h"
#include "mapstorage.h"
-#include <lemon/xy.h>
+#include <lemon/dim2.h>
#include <vector>
std::string GuiWriter::header()
@@ -12,7 +12,7 @@
void GuiWriter::write(std::ostream& os)
{
XmlIo x(os);
- std::map<int, xy<double> > m;
+ std::map<int, XY > m;
for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
{
int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e];
Modified: glemon/trunk/xml.h
==============================================================================
--- glemon/trunk/xml.h (original)
+++ glemon/trunk/xml.h Thu Sep 21 12:29:29 2006
@@ -20,7 +20,7 @@
#include <list>
#include <map>
#include <lemon/error.h>
-#include <lemon/xy.h>
+#include <lemon/dim2.h>
namespace lemon {
@@ -409,7 +409,7 @@
///\relates XmlIo
///
template<class T>
- void xml(XmlIo &x,lemon::xy<T> &v)
+ void xml(XmlIo &x,lemon::dim2::Point<T> &v)
{
{ XmlIo::LineTag t(x,"x"); x(v.x); }
{ XmlIo::ContTag t(x,"y"); x(v.y); }
@@ -420,7 +420,7 @@
///\relates XmlIo
///
template<class T>
- void xml(XmlIo &x,lemon::BoundingBox<T> &v)
+ void xml(XmlIo &x,lemon::dim2::BoundingBox<T> &v)
{
if(x.write()) {
if(!v.empty()) {
@@ -431,7 +431,7 @@
else {
v.clear();
while(x.nextTag()=="point") {
- lemon::xy<T> co;
+ lemon::dim2::Point<T> co;
x("point",co);
v.add(co);
}
Modified: glemon/trunk/xymap.h
==============================================================================
--- glemon/trunk/xymap.h (original)
+++ glemon/trunk/xymap.h Thu Sep 21 12:29:29 2006
@@ -2,7 +2,7 @@
#define XYMAP_H
#include <lemon/list_graph.h>
-#include <lemon/xy.h>
+#include <lemon/dim2.h>
template<class M>
class XYMap
@@ -12,7 +12,7 @@
public:
typedef typename M::Key Key;
- typedef lemon::xy<typename M::Value> Value;
+ typedef lemon::dim2::Point<typename M::Value> Value;
XYMap() {}
XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
void setXMap(M &_xmap) { xmap = &_xmap; }
More information about the Lemon-commits
mailing list