From 4d9a596c6915d316782a1d7b34e9f8dae79aa1ad Mon Sep 17 00:00:00 2001 From: arif Date: Mon, 15 Feb 2010 17:16:10 +0000 Subject: [PATCH] new smyrna implementation , mm2gv fix, --- cmd/smyrna/draw.c | 12 ++--- cmd/smyrna/glexpose.c | 3 +- cmd/smyrna/gltemplate.c | 1 - cmd/smyrna/gui/appmouse.c | 13 +++-- cmd/smyrna/gui/beacon.c | 2 +- cmd/smyrna/gui/frmobjectui.c | 2 +- cmd/smyrna/gui/menucallbacks.c | 27 ++-------- cmd/smyrna/gui/topviewsettings.c | 5 +- cmd/smyrna/gvprpipe.c | 2 +- cmd/smyrna/polytess.c | 4 +- cmd/smyrna/selection.c | 42 ---------------- cmd/smyrna/selection.h | 2 - cmd/smyrna/smyrna.vcproj | 12 +++-- cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user | 2 +- cmd/smyrna/smyrna_utils.c | 22 ++++++++ cmd/smyrna/smyrna_utils.h | 1 + cmd/smyrna/smyrnadefs.h | 40 ++++++++++++--- cmd/smyrna/tvnodes.c | 48 ------------------ cmd/smyrna/viewport.c | 14 ++++-- cmd/tools/mm2gv.c | 2 +- cmd/tools/mm2gv.vcproj | 2 +- lib/glcomp/glutils.c | 56 ++++++++++++++------- lib/glcomp/glutils.h | 17 +++---- lib/gvc.def | 1 + lib/gvc/gvc.h | 2 +- 25 files changed, 150 insertions(+), 184 deletions(-) diff --git a/cmd/smyrna/draw.c b/cmd/smyrna/draw.c index 06b7910f1..32c1b9d70 100755 --- a/cmd/smyrna/draw.c +++ b/cmd/smyrna/draw.c @@ -444,9 +444,7 @@ void EmbedText(sdot_op* o, int param) } y=o->op.u.text.y; - if (o->font) - glCompDrawText3D(o->font,x,y,view->Topview->global_z,o->op.u.text.width,font_op->op.u.font.size); - else + if (!o->font) { o->font=new_font( view->widgets, @@ -455,9 +453,9 @@ void EmbedText(sdot_op* o, int param) pangotext, font_op->op.u.font.name,font_op->op.u.font.size,0); //new_font(glCompSet * s, char *text, glCompColor * c, glCompFontType type, char *fontdesc, int fs)*/ - - } + glCompDrawText3D(o->font,x,y,view->Topview->global_z,o->op.u.text.width,font_op->op.u.font.size); + } void draw_selection_box(ViewInfo * view) @@ -504,7 +502,7 @@ void draw_magnifier(ViewInfo * view) view->mg.x = mg_x; view->mg.y = mg_y; glLineWidth(4); - local_zoom(view->Topview); +// local_zoom(view->Topview); //drawing the magnifier borders glBegin(GL_LINE_STRIP); glColor4f((GLfloat) 0.3, (GLfloat) 0.1, (GLfloat) 0.8, @@ -796,7 +794,7 @@ void drawCircle(float x, float y, float radius, float zdepth) if (radius < 0.3) radius = (float) 0.4; glBegin(GL_POLYGON); - for (i = 0; i < 360; i = i + 10) { + for (i = 0; i < 360; i = i + 36) { float degInRad = (float) (i * DEG2RAD); glVertex3f((GLfloat) (x + cos(degInRad) * radius), (GLfloat) (y + sin(degInRad) * radius), diff --git a/cmd/smyrna/glexpose.c b/cmd/smyrna/glexpose.c index dca3792d5..f0f657a6b 100644 --- a/cmd/smyrna/glexpose.c +++ b/cmd/smyrna/glexpose.c @@ -262,7 +262,8 @@ int glexpose_drawgraph(ViewInfo * view) // if (GD_TopView(view->g[view->activeGraph])) // { if (!view->Topview->fisheyeParams.active) - drawTopViewGraph(view->g[view->activeGraph]); //view->Topview style dots and straight lines +// drawTopViewGraph(view->g[view->activeGraph]); //view->Topview style dots and straight lines + renderSmGraph(view->g[view->activeGraph],view->Topview); else { drawtopologicalfisheye(view->Topview); } diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index c024aec7c..b24f81009 100755 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -337,7 +337,6 @@ static gboolean key_release_event(GtkWidget * widget, GdkEventKey * event, gpoin // printf ("key is released:%d\n",event->keyval); view->keymap.down=0; view->keymap.keyVal=0; - originate_distorded_coordinates(view->Topview); return FALSE; diff --git a/cmd/smyrna/gui/appmouse.c b/cmd/smyrna/gui/appmouse.c index cfcf6f846..3f5a736d2 100644 --- a/cmd/smyrna/gui/appmouse.c +++ b/cmd/smyrna/gui/appmouse.c @@ -22,6 +22,8 @@ #include "beacon.h" #include "hotkeymap.h" #include "selection.h" +#include "selectionfuncs.h" +#include "topviewfuncs.h" static float prevX=0; @@ -53,11 +55,14 @@ static void apply_actions(ViewInfo* v,int x,int y) if(a==MM_RECTANGULAR_SELECT) { if (!view->mouse.down) - rectangle_select(v); +// rectangle_select(v); + pick_objects_rect(view->g[view->activeGraph]) ; } - if (a==MM_SINGLE_SELECT) - pick_node_from_coords(view->mouse.GLfinalPos.x,view->mouse.GLfinalPos.y,view->mouse.GLfinalPos.z); + if (a==MM_SINGLE_SELECT) + { + pick_object_xyz(view->g[view->activeGraph],view->Topview,view->mouse.GLfinalPos.x,view->mouse.GLfinalPos.y,view->mouse.GLfinalPos.z); + } if (a==MM_FISHEYE_PICK) { @@ -127,8 +132,6 @@ static void appmouse_up(ViewInfo* v,int x,int y) if (v->mouse.t==glMouseRightButton) appmouse_right_click(v,x,y); } - if ((a== MM_FISHEYE_MAGNIFIER) || (a == MM_MAGNIFIER)) //fisheye mag mouse release, stop distortion - originate_distorded_coordinates(v->Topview); apply_actions(v,x,y); view->mouse.dragX = 0; view->mouse.dragY = 0; diff --git a/cmd/smyrna/gui/beacon.c b/cmd/smyrna/gui/beacon.c index 69a2db40c..688c74fcd 100644 --- a/cmd/smyrna/gui/beacon.c +++ b/cmd/smyrna/gui/beacon.c @@ -109,7 +109,7 @@ void pick_node_from_coords(float x, float y, float z) } for (ind = 0; ((seledges)&&(ind < view->Topview->Edgecount)); ind++) { - point3f p1, p2, p3; + glCompPoint p1, p2, p3; e = &view->Topview->Edges[ind]; if (!e->data.Visible) continue; diff --git a/cmd/smyrna/gui/frmobjectui.c b/cmd/smyrna/gui/frmobjectui.c index 7daacd734..a2fa985c6 100644 --- a/cmd/smyrna/gui/frmobjectui.c +++ b/cmd/smyrna/gui/frmobjectui.c @@ -808,7 +808,7 @@ void showAttrsWidget(topview* t) gtk_widget_show(glade_xml_get_widget(xml, "dlgSettings")); gtk_notebook_set_current_page ( (GtkNotebook*)glade_xml_get_widget(xml, "notebook3"),ATTR_NOTEBOOK_IDX); - set_header_text(); +// set_header_text(); filter_attributes("",view->Topview); diff --git a/cmd/smyrna/gui/menucallbacks.c b/cmd/smyrna/gui/menucallbacks.c index 4ec279945..d6366090b 100755 --- a/cmd/smyrna/gui/menucallbacks.c +++ b/cmd/smyrna/gui/menucallbacks.c @@ -188,7 +188,9 @@ void mHideConsoleSlot(GtkWidget * widget, gpointer user_data) //Graph void mNodeListSlot(GtkWidget * widget, gpointer user_data) { - execute_tv_nodes(); + gtk_widget_show(glade_xml_get_widget(xml, "ListForm")); + +// execute_tv_nodes(); } void mNewNodeSlot(GtkWidget * widget, gpointer user_data) @@ -226,29 +228,6 @@ void mGraphPropertiesSlot(GtkWidget * widget, gpointer user_data) void mNodeFindSlot(GtkWidget * widget, gpointer user_data) { - if (view->activeGraph != -1) { - - gtk_dialog_set_response_sensitive((GtkDialog *) - glade_xml_get_widget(xml, - "findDialog"), - 1, 1); - gtk_dialog_set_response_sensitive((GtkDialog *) - glade_xml_get_widget(xml, - "findDialog"), - 2, 1); - - - respond = gtk_dialog_run((GtkDialog *) - glade_xml_get_widget(xml, "findDialog")); - - gtk_widget_hide(glade_xml_get_widget(xml, "findDialog")); - if (respond == 1) - select_with_regex((gchar *) - gtk_entry_get_text((GtkEntry *) - glade_xml_get_widget(xml, - "findText")) - ); - } } diff --git a/cmd/smyrna/gui/topviewsettings.c b/cmd/smyrna/gui/topviewsettings.c index c28799f52..8c971aa22 100644 --- a/cmd/smyrna/gui/topviewsettings.c +++ b/cmd/smyrna/gui/topviewsettings.c @@ -41,9 +41,10 @@ void on_settingsApplyBtn_clicked(GtkWidget * widget, gpointer user_data) { update_graph_from_settings(view->g[view->activeGraph]); set_viewport_settings_from_template(view, view->g[view->activeGraph]); - update_topview(view->g[view->activeGraph], view->Topview, 0); +// update_topview(view->g[view->activeGraph], view->Topview, 0); /* settvcolorinfo(view->g[view->activeGraph],view->Topview); init_node_size(view->g[view->activeGraph])*/ + updateSmGraph(view->g[view->activeGraph],view->Topview); } void on_dlgSettings_close (GtkWidget * widget, gpointer user_data) { @@ -263,13 +264,13 @@ static int get_combobox_widget_to_attribute(char *attribute, float value; attribute=attribute +9; - value = (float) gtk_combo_box_get_active((GtkComboBox *) glade_xml_get_widget(xml, widget_name)); sprintf(buf, "%f", value); agattr(g, AGRAPH, attribute, buf); + printf ("%s %f \n",attribute,value); return 1; diff --git a/cmd/smyrna/gvprpipe.c b/cmd/smyrna/gvprpipe.c index c55ef0e75..7b5540d4c 100644 --- a/cmd/smyrna/gvprpipe.c +++ b/cmd/smyrna/gvprpipe.c @@ -123,7 +123,7 @@ int run_gvpr(Agraph_t * srcGraph, int argc, char *argv[]) { set_refresh(view,argv[1]); update_graph_from_settings(srcGraph); - update_topview(srcGraph, view->Topview, 0); +// update_topview(srcGraph, view->Topview, 0); } return rv; } diff --git a/cmd/smyrna/polytess.c b/cmd/smyrna/polytess.c index eb522d505..a966a52fb 100644 --- a/cmd/smyrna/polytess.c +++ b/cmd/smyrna/polytess.c @@ -126,10 +126,10 @@ static GLUtesselator* Init() // Create a new tessellation object GLUtesselator* tobj = gluNewTess(); // Set callback functions - gluTessCallback(tobj, GLU_TESS_VERTEX, &vertexCallback); + gluTessCallback(tobj, GLU_TESS_VERTEX, (void*)&vertexCallback); gluTessCallback(tobj, GLU_TESS_BEGIN, &glBegin); gluTessCallback(tobj, GLU_TESS_END, &glEnd); - gluTessCallback(tobj, GLU_TESS_COMBINE,&combineCallback); + gluTessCallback(tobj, GLU_TESS_COMBINE,(void*)&combineCallback); return tobj; } diff --git a/cmd/smyrna/selection.c b/cmd/smyrna/selection.c index 99c03c33b..6e6a640ff 100755 --- a/cmd/smyrna/selection.c +++ b/cmd/smyrna/selection.c @@ -564,16 +564,6 @@ int lineintersects(float X1, float X2, float Y1, float Y2) return 0; return -1; } -int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW, - float RH) -{ - if ((X >= RX) && (X <= (RX + RW)) && (Y >= RY) && (Y <= (RY + RH))) - return 1; - else - return 0; - - -} @@ -757,38 +747,6 @@ int linesegmentsintersects(float X1, float X2, float Y1, float Y2) -#ifdef UNUSED -static int line_intersects(float *x, float *y, float *X, float *Y) -{ - //x,y are arrayf of float for two lines parameters theyt hold 4 points with x and y - //limitx and limity are float arrays with two points, thse points are the end points of the second line - //X,Y are the variables to put intersection point coordinates in - pointf pA, pB, pC, pD, pX; - pA.x = x[0]; - pA.y = y[0]; - pB.x = x[1]; - pB.y = y[1]; - pC.x = x[2]; - pC.y = y[2]; - pD.x = x[3]; - pD.y = y[3]; - - if (seg_intersect(pA, pB, pC, pD, &pX)) { - *X = (float) pX.x; - *Y = (float) pX.y; - if ((pX.x >= x[2] - 0.01) && (pX.x < x[3] + 0.01) && - (pX.y >= y[2] - 0.01) && (pX.x < y[3] + 0.01)) { - return 1; - - } - return 0; - - } else - return 0; - -} - -#endif int point_within_ellips_with_coords(float ex, float ey, float ea, float eb, float px, float py) { diff --git a/cmd/smyrna/selection.h b/cmd/smyrna/selection.h index ebc399397..74d01caef 100644 --- a/cmd/smyrna/selection.h +++ b/cmd/smyrna/selection.h @@ -31,8 +31,6 @@ extern "C" { extern int point_within_ellips_with_coords(float ex, float ey, float ea, float eb, float px, float py); - extern int is_point_in_rectangle(float X, float Y, float RX, float RY, - float RW, float RH); extern int SelectBeziers(sdot_op * op); extern int SelectEllipse(sdot_op * op); diff --git a/cmd/smyrna/smyrna.vcproj b/cmd/smyrna/smyrna.vcproj index b98cd27ec..137a294b1 100644 --- a/cmd/smyrna/smyrna.vcproj +++ b/cmd/smyrna/smyrna.vcproj @@ -253,6 +253,10 @@ RelativePath=".\selection.h" > + + @@ -441,6 +445,10 @@ RelativePath=".\selection.c" > + + @@ -457,10 +465,6 @@ RelativePath=".\topfisheyeview.c" > - - diff --git a/cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user b/cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user index c1742dcfa..c13d86073 100644 --- a/cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user +++ b/cmd/smyrna/smyrna.vcproj.RESEARCH.arif.user @@ -11,7 +11,7 @@ B=B; c->A=A; } +glCompPoint getPointFromStr(char* str) +{ + + glCompPoint p; + char* a; + static char bf[512]; + strcpy(bf,str); + p.x=0; + p.y=0; + p.z=0; + a=strtok(bf,","); + if(a) + p.x=atof(a); + a=strtok(NULL,","); + if(a) + p.y=atof(a); + a=strtok(NULL,","); + if(a) + p.z=atof(a); + return p; +} + #if 0 static float interpol(float minv, float maxv, float minc, float maxc, float x) diff --git a/cmd/smyrna/smyrna_utils.h b/cmd/smyrna/smyrna_utils.h index 500c78bf5..e5e3e23e8 100644 --- a/cmd/smyrna/smyrna_utils.h +++ b/cmd/smyrna/smyrna_utils.h @@ -27,5 +27,6 @@ extern float getAttrFloat(Agraph_t* g,void* obj,char* attr_name,float def); extern char* getAttrStr(Agraph_t* g,void* obj,char* attr_name,char* def); extern void setColor(glCompColor* c,GLfloat R,GLfloat G,GLfloat B,GLfloat A); extern void getcolorfromschema(colorschemaset * sc, float l, float maxl,glCompColor * c); +extern glCompPoint getPointFromStr(char* str); #endif diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index 0f23b300a..e54c8769c 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -227,12 +227,18 @@ typedef struct typedef struct { - GtkButton **gtkhostbtn; - int gtkhostbtncount; - GtkColorButton **gtkhostcolor; - int hostactive[MAX_BTN_CNT]; //temporary static, convert to dynamic,realloc - char **hostregex; + + int a; } topviewdata; + typedef struct + { + int node_id; + int edge_id; + int selnode_id; + int seledge_id; + int nodelabel_id; + int edgelabel_id; + }topviewcache; typedef struct xdot_set xdot_set; typedef enum { GEpixels, GEinches, GEmm } GEunit; @@ -385,6 +391,26 @@ typedef struct float offsetz; } graph_data; + + + typedef struct{ + Agrec_t h; + glCompPoint A; + float size; + int selected; + int visible; + int printLabel; + }nodeRec; + typedef struct{ + Agrec_t h; + glCompPoint posTail; + glCompPoint posHead; + int selected; + int visible; + int printLabel; + }edgeRec; + + typedef struct { topview_node *Nodes; topview_edge *Edges; @@ -421,8 +447,11 @@ typedef struct float global_z; attr_list* attributes;/*attribute list*/ attr_list* filtered_attr_list; + + topviewcache cache; int xdotId; + } topview; @@ -624,7 +653,6 @@ typedef struct /*lately added */ int drawnodes; int drawedges; - int drawlabels; int drawnodelabels; int drawedgelabels; diff --git a/cmd/smyrna/tvnodes.c b/cmd/smyrna/tvnodes.c index 2e9ec4f1a..ffbe4ebe2 100755 --- a/cmd/smyrna/tvnodes.c +++ b/cmd/smyrna/tvnodes.c @@ -25,31 +25,6 @@ tv_nodes TV_Nodes; static char buf[255]; int MP_Flag = 0; -#ifdef UNUSED -static -void clear_tv_filter(tv_filter * TV_Filter) -{ - TV_Filter->highlighted = -1; - TV_Filter->visible = -1; - TV_Filter->min_data1 = NULL; - TV_Filter->max_data1 = NULL; - TV_Filter->min_data2 = NULL; - TV_Filter->max_data2 = NULL; - - TV_Nodes.filtered = 0; - -} - -static -tv_filter *create_tv_filter(void) -{ - tv_filter *f; - f = NEW(tv_filter); - clear_tv_filter(f); - return f; -} -#endif - static void init_tv_nodes(tv_nodes * TV_Nodes) { @@ -102,29 +77,6 @@ set_filter(tv_filter * TV_Filter, char *MinData1, char *MaxData1, return 1; } -#ifdef UNUSED -static -int reverse_selection(void) -{ - int i = 0; - for (i; i < view->Topview->Nodecount; i++) { - if (OD_Selected(view->Topview->Nodes[i].Node)) - deselect_node(view->g[view->activeGraph], - view->Topview->Nodes[i].Node); - else - select_node(view->g[view->activeGraph], - view->Topview->Nodes[i].Node); - } - for (i = 0; i < view->Topview->Edgecount; i++) { - if (OD_Selected(view->Topview->Edges[i].Edge)) - deselect_edge(view->g[view->activeGraph], - view->Topview->Edges[i].Edge); - else - select_edge(view->g[view->activeGraph], - view->Topview->Edges[i].Edge); - } -} -#endif static int validate_node(tv_node * TV_Node) diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index 9b586c340..322a3e60e 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -35,6 +35,7 @@ #include "md5.h" #include "arcball.h" #include "hotkeymap.h" +#include "topviewfuncs.h" @@ -79,7 +80,9 @@ void clear_viewport(ViewInfo * view) { /*free topview if there is one */ if (view->activeGraph >= 0) - cleartopview(view->Topview); + { + freeSmGraph(view->g[view->activeGraph],view->Topview); + } if (view->graphCount) agclose(view->g[view->activeGraph]); // init_viewport(view); @@ -286,7 +289,9 @@ void set_viewport_settings_from_template(ViewInfo * view, Agraph_t * g) ("defaultfisheyemagnifierdistort", view, g)); view->drawnodes = atoi(get_attribute_value("drawnodes", view, g)); view->drawedges = atoi(get_attribute_value("drawedges", view, g)); - view->drawlabels = atoi(get_attribute_value("drawlabels", view, g)); + view->drawnodelabels=atoi(get_attribute_value("labelshownodes", view, g)); + view->drawedgelabels=atoi(get_attribute_value("labelshowedges", view, g)); + view->FontSizeConst = 0; //this will be calculated later in topview.c while calculating optimum font size view->glutfont = @@ -643,10 +648,9 @@ void refreshViewport(int doClear) load_settings_from_graph(graph); update_graph_from_settings(graph); set_viewport_settings_from_template(view, graph); - if (doClear) - cleartopview(view->Topview); + view->Topview=initSmGraph(graph); - update_topview(graph, view->Topview, 1); +// update_topview(graph, view->Topview, 1); fill_key(view->orig_key, get_md5_key(graph)); expose_event(view->drawing_area, NULL, NULL); } diff --git a/cmd/tools/mm2gv.c b/cmd/tools/mm2gv.c index 0b1f63792..478d5fd1a 100644 --- a/cmd/tools/mm2gv.c +++ b/cmd/tools/mm2gv.c @@ -469,7 +469,7 @@ int main(int argc, char *argv[]) { Agraph_t *g = 0; SparseMatrix A = NULL; - int dim; + int dim=0; parms_t pv; /* ======================= set parameters ==================== */ diff --git a/cmd/tools/mm2gv.vcproj b/cmd/tools/mm2gv.vcproj index 5ee50e1b1..24197c6cc 100644 --- a/cmd/tools/mm2gv.vcproj +++ b/cmd/tools/mm2gv.vcproj @@ -60,7 +60,7 @@ /> N.x = a.y * (b.z - c.z) + b.y * (c.z - a.z) + c.y * (a.z - b.z); //+ P->N.y = a.z * (b.x - c.x) + b.z * (c.x - a.x) + c.z * (a.x - b.x); //+ @@ -418,7 +418,7 @@ void replacestr(char *source, char **target) #define G_PI 3.1415926535897932384626433832795028841971693993751 #define DEG2RAD G_PI/180 -int rot_spherex(plane J, float tet, point3f P, point3f * P2) +int rot_spherex(plane J, float tet, glCompPoint P, glCompPoint * P2) { if (tet > 0) { tet = 5; @@ -705,6 +705,24 @@ int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint { return ((sideOf(a,b,c) != sideOf(a,b,d)) && (sideOf(c,d,a) != sideOf(c,d,b))); } +GLfloat distBetweenPts(glCompPoint A,glCompPoint B,float R) +{ + GLfloat rv=0; + rv=(A.x-B.x)*(A.x-B.x) + (A.y-B.y)*(A.y-B.y) +(A.z-B.z)*(A.z-B.z); + rv=sqrt(rv); + if (rv <=R) + return 0; + return rv; +} + +int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW,float RH) +{ + if ((X >= RX) && (X <= (RX + RW)) && (Y >= RY) && (Y <= (RY + RH))) + return 1; + else + return 0; +} + @@ -713,7 +731,7 @@ int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint #ifdef DEBUG void main(void) { - point3f LineStart, LineEnd, Point; + glCompPoint LineStart, LineEnd, Point; float Distance; diff --git a/lib/glcomp/glutils.h b/lib/glcomp/glutils.h index 8c93d3603..685e4714a 100644 --- a/lib/glcomp/glutils.h +++ b/lib/glcomp/glutils.h @@ -29,13 +29,10 @@ extern "C" { #endif typedef struct { - float x, y, z; - } point3f; - typedef struct { - point3f u, v; + glCompPoint u, v; } line; typedef struct { - point3f N; /* normal */ + glCompPoint N; /* normal */ double d; /* offset */ } plane; @@ -47,10 +44,10 @@ extern "C" { GLfloat * Z); void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z); void linear_interplotate(float, float, float, float, float, float *); - double point_to_line_dist(point3f p, point3f u, point3f v); - double point_to_lineseg_dist(point3f p, point3f a, point3f b); - int rot_spherex(plane J, float tet, point3f P, point3f * P2); - void make_plane(point3f a, point3f b, point3f c, plane * P); + double point_to_line_dist(glCompPoint p, glCompPoint u, glCompPoint v); + double point_to_lineseg_dist(glCompPoint p, glCompPoint a, glCompPoint b); + int rot_spherex(plane J, float tet, glCompPoint P, glCompPoint * P2); + void make_plane(glCompPoint a, glCompPoint b, glCompPoint c, plane * P); void replacestr(char *source, char **target); extern void glCompCalcWidget(glCompCommon * parent, glCompCommon * child, glCompCommon * ref); @@ -64,6 +61,8 @@ extern "C" { void glCompSelectionBox(glCompSet * s); extern int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint* d); + extern GLfloat distBetweenPts(glCompPoint A,glCompPoint B,float R); + extern int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW,float RH); #ifdef __cplusplus } diff --git a/lib/gvc.def b/lib/gvc.def index a8ec99b32..627aeee8d 100644 --- a/lib/gvc.def +++ b/lib/gvc.def @@ -335,3 +335,4 @@ xdotBB gvFinalize gv_postprocess gvRenderContext +gvflush \ No newline at end of file diff --git a/lib/gvc/gvc.h b/lib/gvc/gvc.h index bd14e6507..47becbb19 100644 --- a/lib/gvc/gvc.h +++ b/lib/gvc/gvc.h @@ -72,8 +72,8 @@ extern void attach_attrs(graph_t *g); /* Parse an html string */ #ifndef WITH_CGRAPH extern char *agstrdup_html(char *s); -#endif extern int aghtmlstr(char *s); +#endif /* Render layout in a specified format to an open FILE */ extern int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out); -- 2.40.0