glTranslatef(-view->cameras[view->active_camera]->targetx,
-view->cameras[view->active_camera]->targety, 0);
}
-
+ view->clipX1=0;
+ view->clipX2=0;
+ view->clipY1=0;
+ view->clipY2=0;
+ view->clipZ1=0;
+ view->clipZ2=0;
GetOGLPosRef(1, view->h - 5, &(view->clipX1), &(view->clipY1),
&(view->clipZ1));
GetOGLPosRef(view->w - 1, 1, &(view->clipX2), &(view->clipY2),
* AT&T Research, Florham Park NJ *
**********************************************************/
+#include "smyrnadefs.h"
#include "gvprpipe.h"
#include "const.h"
#include <stdio.h>
#include <gvpr.h>
extern GladeXML *xml; //global libglade vars
+
+/* typedef struct {
+ char* def;
+ char *script;
+ char *args;
+ char *attr_name;
+ void* obj;
+ gvpr_arg_type arg_type;
+ } gvprscript;*/
+ //_on_click="(gvpr_no_arg)N{node.color="red"){N.color="blue"}";
+
+
+/*arg_type get_arg_type(char* str)
+{
+
+
+
+}*/
+
+gvprscript* scr_from_string(char* str,void* obj)
+{
+
+
+}
+
+
+
static ssize_t outfn(void *sp, const char *buf, size_t nbyte, void *dp)
{
return 0;
}
#endif
+static void set_refresh(ViewInfo* v,char* script)
+{
+ if(strstr(script,"pos"))
+ v->refresh.pos=1;
+ if(strstr(script,"color"))
+ v->refresh.color=1;
+ if(strstr(script,"visible"))
+ v->refresh.visibility=1;
+ if(strstr(script,"size"))
+ v->refresh.nodesize=1;
+ if(strstr(script,"selected"))
+ v->refresh.selection=1;
+}
int run_gvpr(Agraph_t * srcGraph, int argc, char *argv[])
{
if (rv) { /* error */
fprintf(stderr, "Error in gvpr\n");
- } else if (opts.n_outgraphs) {
+ } else if (opts.n_outgraphs)
+ {
refreshViewport(0);
sprintf(buf, "<%d>", ++count);
if (opts.outgraphs[0] != view->g[view->activeGraph])
for (i = 1; i < opts.n_outgraphs; i++) {
agclose(opts.outgraphs[i]);
}
- } else {
- refreshViewport(0);
+ } else
+ {
+ set_refresh(view,argv[1]);
+ update_graph_from_settings(srcGraph);
+ update_topview(srcGraph, view->Topview, 0);
}
return rv;
}
#ifdef __cplusplus
extern "C" {
#endif
+ extern int run_gvpr(Agraph_t * srcGraph, int argc, char *argv[]);
- extern int run_gvpr(Agraph_t * srcGraph, int, char **);
#ifdef __cplusplus
} /* end extern "C" */
} colorschema;
+ typedef enum { gvpr_no_arg,gvpr_obj_arg,gvpr_string_arg,gvpr_sel_node_arg,gvpr_sel_edge_arg} gvpr_arg_type;
+
typedef struct {
+ char* def;
char *script;
char *args;
char *attr_name; /*attribute name to identify script in the graph */
+ void* obj;
+ gvpr_arg_type arg_type;
} gvprscript;
+ //_on_click="(gvpr_no_arg)N{node.color="red"){N.color="blue"}";
+
typedef struct {
int schemacount;
for (ind = 0; ind < t->Edgecount; ind++)
{
ep = t->Edges + ind;
- if(view->refresh.color)
- {
- if (ecolor && (color_string = agxget(ep->Edge, ecolor))
- && (*color_string != '\0')&& (strlen(color_string)>0))
- setglCompColor(&color, color_string);
- else { /*use color theme */
- getcolorfromschema(view->colschms, ep->length, t->maxedgelen,&color);
- color.tag = 0;}
- ep->Color = color;
-
- }
- ep->data.edgeid = boolAttr(ep->Edge, edgeid, 0);
- if(view->refresh.selection)
- ep->data.Selected = boolAttr(ep->Edge, sel, 0);
- if(view->refresh.visibility)
- ep->data.Visible = visible(ep->Edge, vis, sty);
-
if(view->refresh.pos)
{
ep->x1 = ep->Node1->x;
minedgelen = len;
ep->length = len;
}
+
+ if(view->refresh.color)
+ {
+ if (ecolor && (color_string = agxget(ep->Edge, ecolor))
+ && (*color_string != '\0')&& (strlen(color_string)>0))
+ setglCompColor(&color, color_string);
+ else { /*use color theme */
+ getcolorfromschema(view->colschms, ep->length, t->maxedgelen,&color);
+ color.tag = 0;}
+ ep->Color = color;
+
+ }
+ ep->data.edgeid = boolAttr(ep->Edge, edgeid, 0);
+ if(view->refresh.selection)
+ ep->data.Selected = boolAttr(ep->Edge, sel, 0);
+ if(view->refresh.visibility)
+ ep->data.Visible = visible(ep->Edge, vis, sty);
+
}
if(view->refresh.pos)
{
0.05 * sqrt((view->bdxRight - view->bdxLeft) *
(view->bdyTop - view->bdyBottom));
t->init_node_size =
- vsize * 2 / GetOGLDistance(2) * percent / 100.0 /
+ 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 = view->zoom;
+ t->init_zoom=-20;
}
static void reset_refresh(ViewInfo* v)
settvcolorinfo(g, t);
set_boundaries(t);
settvxdot(view->g[view->activeGraph], view->Topview);
- init_node_size(g, t);
reset_refresh(view);
if (init)/*one time call to calculate right colors*/
{
view->refresh.color=1;
+ view->refresh.pos=1;
settvcolorinfo(g, t);
reset_refresh(view);
+ set_boundaries(t);
}
+ init_node_size(g, t);
+
/*This is a temp code , need to be removed after Xue's demo */
#if UNUSED