v->mouse.initPos.y=y;
v->mouse.pos.x=x;
v->mouse.pos.y=y;
-
- GetFixedOGLPos((float) x,y, v->GLDepth,&v->mouse.GLinitPos.x,&v->mouse.GLinitPos.y,&v->mouse.GLinitPos.z);
- GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
+
+ to3D(x,y,&v->mouse.GLinitPos.x,&v->mouse.GLinitPos.y,&v->mouse.GLinitPos.z);
+ to3D( x,y, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
prevX=0;
prevY=0;
v->mouse.finalPos.x=x;
v->mouse.finalPos.y=y;
a=get_mode(v);
- GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLfinalPos.x,&v->mouse.GLfinalPos.y,&v->mouse.GLfinalPos.z);
+ to3D(x,y, &v->mouse.GLfinalPos.x,&v->mouse.GLfinalPos.y,&v->mouse.GLfinalPos.z);
if(singleclick(v))
{
if (v->mouse.t==glMouseLeftButton)
static float x2,y2;
v->mouse.pos.x=x;
v->mouse.pos.y=y;
- GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
+ to3D( x,y, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
x2=v->mouse.GLpos.x;
y2=v->mouse.GLpos.y;
prevX=x2;
sn = (topview_node *) 0;
se = (topview_edge *) 0;
+
+
+
+
for (ind = 0; ind < view->Topview->Nodecount; ind++) {
n = &view->Topview->Nodes[ind];
if (!n->data.Visible)
{
view->refresh.color=1;
}
+void size_change_request(GtkWidget * widget, gpointer user_data)
+{
+ view->refresh.nodesize=1;
+}
void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data)
{
_BB void on_settingsApplyBtn_clicked(GtkWidget * widget,
gpointer user_data);
_BB void color_change_request(GtkWidget * widget, gpointer user_data);
+ _BB void size_change_request(GtkWidget * widget, gpointer user_data);
extern int load_settings_from_graph(Agraph_t * g);
extern int update_graph_from_settings(Agraph_t * g);
c->R = (float) cl.u.RGBA[0];
c->G = (float) cl.u.RGBA[1];
c->B = (float) cl.u.RGBA[2];
- c->A = (float) cl.u.RGBA[3]*A;
+ c->A = (float) cl.u.RGBA[3]*view->defaultnodealpha;
}
np->data.Visible = visible(np->Node, vis, sty);
if(view->refresh.nodesize)
{
- tempStr=agget(t->Nodes[ind].Node, "size");
+ t->Nodes[ind].size = 0;
+ tempStr=agget(t->Nodes[ind].Node, "size");
if(tempStr)
{
if (strlen(tempStr) > 0) /*set node size */
t->Nodes[ind].size = atof(tempStr);
}
+
}
if (t->Nodes[ind].degree > t->maxnodedegree)
t->maxnodedegree = t->Nodes[ind].degree;
}
}
void init_node_size(Agraph_t * g, topview * t)
+{
+ float vsize;
+ int percent;
+ percent = atoi(agget(g, "nodesize"));
+ if (percent == 0)
+ percent = 0.000001;
+ vsize =
+ 0.05 * sqrt((view->bdxRight - view->bdxLeft) *
+ (view->bdyTop - view->bdyBottom));
+ t->init_node_size = vsize * 2 * percent / 100.0 /
+ sqrt(t->Nodecount);
+/* if (t->init_node_size < 1)
+ t->init_node_size=1;*/
+// t->init_zoom = view->zoom;
+ t->init_zoom = -20;
+
+}
+
+void _init_node_size(Agraph_t * g, topview * t)
{
float vsize;
int percent;
0.05 * sqrt((view->bdxRight - view->bdxLeft) *
(view->bdyTop - view->bdyBottom));
t->init_node_size =
- vsize * 2 / percent / 100.0 /
+ vsize * 2 / GetOGLDistance(2) * percent / 100.0 /
sqrt(t->Nodecount);
if (t->init_node_size < 1)
t->init_node_size=1;
-// t->init_zoom = view->zoom;
- t->init_zoom=-20;
+ t->init_zoom = view->zoom;
}
+
static void reset_refresh(ViewInfo* v)
{
v->refresh.color=0;
view->selectedNodeColor.A);
} else { //get the color from node
glColor4f(v->Color.R, v->Color.G, v->Color.B,
- v->node_alpha);
+ v->Color.A);
ddx = 0;
ddy = 0;
ddz = 0;
void refreshViewport(int doClear)
{
Agraph_t *graph = view->g[view->activeGraph];
-
+ view->refresh.color=1;
+ view->refresh.nodesize=1;
+ view->refresh.pos=1;
+ view->refresh.selection=1;
+ view->refresh.visibility=1;
load_settings_from_graph(graph);
update_graph_from_settings(graph);
set_viewport_settings_from_template(view, graph);
static Agiodisc_t gprIoDisc = { iofread, ioputstr, ioflush };
-#ifdef GVDLL
+#ifdef WIN32
static Agdisc_t gprDisc = { 0, 0, &gprIoDisc };
#else
static Agdisc_t gprDisc = { &AgMemDisc, &AgIdDisc, &gprIoDisc };
{
Agraph_t *g;
-#ifdef GVDLL
+#ifdef WIN32
gprDisc.mem = &AgMemDisc;
gprDisc.id = &AgIdDisc;
#endif
{
Agraph_t *g;
-#ifdef GVDLL
+#ifdef WIN32
gprDisc.mem = &AgMemDisc;
gprDisc.id = &AgIdDisc;
#endif