]> granicus.if.org Git - graphviz/commitdiff
smyrna bug fixes
authorarif <devnull@localhost>
Thu, 3 Dec 2009 19:16:04 +0000 (19:16 +0000)
committerarif <devnull@localhost>
Thu, 3 Dec 2009 19:16:04 +0000 (19:16 +0000)
warning fixes

26 files changed:
cmd/smyrna/arcball.c
cmd/smyrna/btree.c
cmd/smyrna/draw.c
cmd/smyrna/glexpose.c
cmd/smyrna/gltemplate.c
cmd/smyrna/gui/beacon.c
cmd/smyrna/gui/frmobjectui.c
cmd/smyrna/gui/glcompui.c
cmd/smyrna/gui/topviewsettings.c
cmd/smyrna/gui/topviewsettings.h
cmd/smyrna/gvprpipe.c
cmd/smyrna/main.c
cmd/smyrna/selection.c
cmd/smyrna/smyrna.vcproj
cmd/smyrna/smyrnadefs.h
cmd/smyrna/topview.c
cmd/smyrna/tvnodes.c
cmd/smyrna/viewport.c
lib/glcomp/glcompdefs.h
lib/glcomp/glcompfont.c
lib/glcomp/glcomplabel.c
lib/glcomp/glcomplabel.h
lib/glcomp/glcomptexture.c
lib/glcomp/glutils.c
lib/glcomp/glutils.h
share/gui/smyrna.glade

index 891de959ca8a3d16174c2c1f5dd063fc6a0fda3c..43f46808ef9519f4688f812a9698210f454e9fb3 100644 (file)
@@ -161,6 +161,7 @@ void arcmouseClick(ViewInfo * v)
     view->arcball->isDragging = 1;     // Prepare For Dragging
     view->arcball->LastRot = view->arcball->ThisRot;   // Set Last Static Rotation To Last Dynamic One
     click(view->arcball, &view->arcball->MousePt);
+//    printf ("arcmouse click \n");
 
 }
 
index eb2cee88b11a5f450c947e15889dbd1099459605..4bb597847f8452266e6383fe190e21ad3914091b 100644 (file)
@@ -126,7 +126,8 @@ int print_children(btree_node * n)
     else
        printf("%*s %c(%i)\n", n->rank * 5 + 1, "", n->op, n->rank);
     prev_rank = n->rank;
-    for (i = 0; i < n->child_count; i++) {
+    for (i = 0; i < n->child_count; i++) 
+    {
        print_children(n->childs[i]);
     }
     return 1;
index 29f8f230eb6832bc68a6e98c507be3442952dff9..5fb6fa2ee712b5a5dfd5d4945a3a2d45d4a47c3e 100755 (executable)
@@ -245,7 +245,7 @@ void DrawBeziers(sdot_op* o, int param)
 }
 
 
-//Draws a ellpise made out of points.
+//Draws an ellpise made out of points.
 //void DrawEllipse(xdot_point* xpoint,GLfloat xradius, GLfloat yradius,int filled)
 void DrawEllipse(sdot_op*  o, int param)
 {
@@ -592,11 +592,11 @@ void drawBorders(ViewInfo * view)
                  view->borderColor.G, view->borderColor.A);
        glLineWidth(2);
        glBegin(GL_LINE_STRIP);
-       glVertex3d(view->bdxLeft, view->bdyBottom,0);
-       glVertex3d(view->bdxRight, view->bdyBottom,0);
-       glVertex3d(view->bdxRight, view->bdyTop,0);
-       glVertex3d(view->bdxLeft, view->bdyTop,0);
-       glVertex3d(view->bdxLeft, view->bdyBottom,0);
+       glVertex3d(view->bdxLeft, view->bdyBottom,-0.001);
+       glVertex3d(view->bdxRight, view->bdyBottom,-0.001);
+       glVertex3d(view->bdxRight, view->bdyTop,-0.001);
+       glVertex3d(view->bdxLeft, view->bdyTop,-0.001);
+       glVertex3d(view->bdxLeft, view->bdyBottom,-0.001);
        glEnd();
        glLineWidth(1);
     }
index 55be9fde3b9e47b224256a968a92811cf6a14f98..26ee1916fa2351c9902157745fb788411b5aa84c 100644 (file)
@@ -175,8 +175,8 @@ int glexpose_main(ViewInfo * view)
     glexpose_grid(view);
     draw_fisheye_magnifier(view);
     draw_magnifier(view);
-    glexpose_drawgraph(view);
     drawBorders(view);
+    glexpose_drawgraph(view);
 //      drawRotatingTools();
 //      draw_cube();
     drawRotatingAxis();
index 8757fd71dcd8cee94e6442c7336ba49b5e845cee..5d01213b1a6ff523d5fe11a0b201d3567f66fbf7 100755 (executable)
@@ -172,7 +172,6 @@ static void realize(GtkWidget * widget, gpointer data)
 // glEnable (GL_LIGHT0);
 //  glEnable (GL_AUTO_NORMAL);
 //  glEnable (GL_NORMALIZE);
-    glEnable(GL_DEPTH_TEST);
     glEnable(GL_BLEND);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     glDepthFunc(GL_LESS);
@@ -276,6 +275,8 @@ gboolean expose_event(GtkWidget * widget, GdkEventExpose * event,
 static gboolean button_press_event(GtkWidget * widget,
                                   GdkEventButton * event, gpointer data)
 {
+    Agraph_t* g=view->g[view->activeGraph];
+
     begin_x = (float) event->x;
     begin_y = (float) event->y;
     view->widgets->common.functions.mousedown((glCompObj*)view->widgets,(GLfloat) event->x,(GLfloat) event->y,getGlCompMouseType(event->button));
@@ -288,6 +289,7 @@ static gboolean button_press_event(GtkWidget * widget,
        appmouse_middle_click_down(view,(int) event->x,(int) event->y);
 
     expose_event(view->drawing_area, NULL, NULL);
+
     return FALSE;
 }
 
index d73da6810499a3c0ddf824e6343992812d77f3b7..69a2db40cb2b68f139c12f7baf0d0bce731e976a 100644 (file)
@@ -94,8 +94,8 @@ void pick_node_from_coords(float x, float y, float z)
 
     for (ind = 0;( (selnodes)&&(ind < view->Topview->Nodecount)); ind++) {
        n = &view->Topview->Nodes[ind];
-       if (!select_node)
-           break;
+/*     if (!select_node(n))
+           break;*/
 
 
        a = ABS(n->distorted_x - view->mouse.GLpos.x);
index 5cc1c2fdfaa64206df782b149c5bb57af1d2bcb2..7daacd7344ce75d3eaf817806189281f771391ab 100644 (file)
@@ -28,6 +28,8 @@
 #include "frmobjectui.h"
 #include <assert.h>
 #include "sfstr.h"
+#include "gvprpipe.h"
+
 
 
 #ifdef WIN32
index e5b84da0f05d9fc8b034aa55816c7e331d42dc2a..6dfda0a10129dcfc27642c4e3603a9def512c8c8 100644 (file)
@@ -195,10 +195,11 @@ glCompSet *glcreate_gl_topview_menu(void)
     glCompButton *b = NULL;
     /* glCompLabel *l=NULL; */
     glCompImage *i = NULL;
+    glCompLabel* l;
     glCompColor c;
     s->common.callbacks.click = CBglCompMouseRightClick;
 
-    p = glCompPanelNew((glCompObj *) s, 25, 25, 51, 47);
+    p = glCompPanelNew((glCompObj *) s, 25, 25, 45, 47);
     p->common.align = glAlignLeft;
     p->common.data = 0;
 
@@ -240,7 +241,7 @@ glCompSet *glcreate_gl_topview_menu(void)
 
 
 
-    p = glCompPanelNew((glCompObj *) p, 1, 325, 80, 180);
+    p = glCompPanelNew((glCompObj *) p, 1, 325, 45, 180);
     p->common.align = glAlignTop;
     p->common.data = 0;
     p->common.borderWidth = 1;
@@ -330,7 +331,12 @@ glCompSet *glcreate_gl_topview_menu(void)
     glCompImageLoadPng(i, smyrnaPath("mod_3D.png"));
     img3D = i;
     i->common.visible = 0;
+    l=glCompLabelNew((glCompObj *)s,100,5,view->Topview->Graphdata.GraphFileName);
+    glCompLabelSetFontSize(l,24);
     return s;
+
+
+
 }
 
 int getIconsDirectory(char *bf)
index b4efef8d8a22285f7ea23067f448b3d567f63ced..c28799f52054a956a354bf26a0b6e3301dd25f4f 100644 (file)
@@ -45,6 +45,11 @@ void on_settingsApplyBtn_clicked(GtkWidget * widget, gpointer user_data)
 /*     settvcolorinfo(view->g[view->activeGraph],view->Topview);
        init_node_size(view->g[view->activeGraph])*/
 }
+void on_dlgSettings_close (GtkWidget * widget, gpointer user_data)
+{
+    printf ("setting window is being closed\n");
+}
+
 
 
 void on_settingsCancelBtn_clicked(GtkWidget * widget, gpointer user_data)
index bc4abcd9ba6eafce3b547ceccd1e391f69ac5e23..14cac2a31d7d10f6874861ecdd3b170099354407 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
                                         gpointer user_data);
     _BB void color_change_request(GtkWidget * widget, gpointer user_data);
     _BB void size_change_request(GtkWidget * widget, gpointer user_data);
-
+    _BB void on_dlgSettings_close (GtkWidget * widget, gpointer user_data);
     extern int load_settings_from_graph(Agraph_t * g);
     extern int update_graph_from_settings(Agraph_t * g);
     extern int show_settings_form(void);
index a79e5735a01dd8548b994b077ed1a720c61a4a10..c55ef0e75afe086c6bfad659ecf1bea21392d7ec 100644 (file)
@@ -24,7 +24,8 @@
 #include <gtk/gtk.h>
 #include "draw.h"
 #include "gui.h"
-
+#include "topviewsettings.h"
+#include "topview.h"
 #include <viewport.h>
 //#include <gltemplate.h> 
 
@@ -52,7 +53,7 @@ extern GladeXML *xml;         //global libglade vars
 gvprscript* scr_from_string(char* str,void* obj)
 {
 
-
+    return NULL;
 }
 
 
index 9b0d949bea1eb67d60d89b5d27200840452c9891..baa19a40bfa7224ae933712ba97e5260ed017e4f 100755 (executable)
@@ -213,6 +213,9 @@ int main(int argc, char *argv[])
     gladewidget = glade_xml_get_widget(xml, "hbox11");
 
     gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
+    gtk_window_set_deletable ((GtkWindow*)glade_xml_get_widget(xml, "dlgSettings"),0);
+    gtk_window_set_deletable ((GtkWindow*)glade_xml_get_widget(xml, "dlgTVFilter"),0);
+    gtk_window_set_deletable ((GtkWindow*)glade_xml_get_widget(xml, "frmTVNodes"),0);
 
 
     create_window(glconfig, gladewidget);
index a3da38d8018311eb7eb283a53b8bae12abb65561..99c03c33bb65ad9456c399dc9b50d09368cb9a63 100755 (executable)
@@ -680,6 +680,63 @@ void rectangle_select(ViewInfo* v)
     if(seledges)
         edge_rectangle_select(v);
 }
+int linesegmentsintersects(float X1, float X2, float Y1, float Y2)
+{
+    //line segment
+    //X1,Y1 point 1
+    //X2,Y3 point 2
+    //rectangle
+    //RX,RY lower left corner of rectangle
+    //RW width of rectangle
+    //RH height of ractangle
+    //returns 1 if line segment is completely in the rect
+    //0 if they intersect
+    //-1 if completely out
+    float x, y, m, iter;
+    float RX, RY, RW, RH;
+    int intersects, in;
+    RX = view->Selection.X;
+    RY = view->Selection.Y;
+    RH=view->Selection.H;
+    RW=view->Selection.W;
+    if ((is_point_in_rectangle(X1, Y1, RX, RY, RW, RH))
+       && (is_point_in_rectangle(X2, Y2, RX, RY, RW, RH)))
+       return 1;
+    if ((is_point_in_rectangle(X1, Y1, RX, RY, RW, RH))
+       || (is_point_in_rectangle(X2, Y2, RX, RY, RW, RH)))
+       return 0;
+    //to be absolute or not to be one
+    if (X1 > X2) {
+       x = X2;
+       y = Y2;
+       X2 = X1;
+       Y2 = Y1;
+       X1 = x;
+       Y1 = y;
+    }
+    x = X1;
+    //iter
+    iter = RW / (float) SELECTION_SEGMENT_DIVIDER;
+    m = (Y2 - Y1) / (X2 - X1);
+
+    in = 1;
+    intersects = 0;
+    while (x <= X2) {
+       x = x + iter;
+       y = Y1 + m * (x - X1);
+       if (!is_point_in_rectangle(x, y, RX, RY, RW, RH))
+           in = 0;
+       else
+           intersects = 1;
+
+    }
+    if (in == 1)
+       return 1;
+    if (intersects == 1)
+       return 0;
+    return -1;
+}
+
 
 
 
index c5b18683a941f7560993942547bc26a7c8c9b94a..c4c019507d8ec8c7dcba7aef89a5b4a5ba5d448e 100644 (file)
                                        >
                                        <Tool
                                                Name="VCCLCompilerTool"
-                                               WarningLevel="4"
+                                               WarningLevel="3"
                                        />
                                </FileConfiguration>
                        </File>
index 3cd4bdc35daed2d237b701f0c0e6c5ed9d24c776..a790263f309297cd7b3e097a8693e7554034abf7 100644 (file)
@@ -658,6 +658,7 @@ typedef struct
        mouse_action_t* mouse_actions;  /*customizable moouse interraction list*/
        int mouse_action_count;
        refresh_filter refresh;
+       int edgerendertype;
 
     } ViewInfo;
 /*rotation steps*/
index 5609c6d7f457e2de23853195a48258b67c8f136a..714b17a9e80521e27d88349cf69aeb3adcab52d6 100755 (executable)
@@ -385,12 +385,6 @@ static void reset_refresh(ViewInfo* v)
 }
 void update_topview(Agraph_t * g, topview * t, int init)
 {
-    char *info_file;
-    char *str;
-    char buf[512];
-    /* int BUFSIZE = 512; */
-    unsigned char xbuffer[BUFSIZ];
-    FILE *f;
 
     if (init)
        preparetopview(g, t);
@@ -731,6 +725,56 @@ static int drawtopviewnodes(Agraph_t * g)
     endtopviewnodes(g);
     return 1;
 
+}
+static int edgevisible(topview_edge* e)
+{
+    static float x1,y1,x2,y2;
+    static glCompPoint a;
+    static glCompPoint b;
+    static glCompPoint c;
+    static glCompPoint d;
+
+    x1=e->x1/ view->zoom * -1;
+    x2=e->y1/ view->zoom * -1;
+    y1=e->y1/ view->zoom * -1;
+    y2=e->y2/ view->zoom * -1;
+
+    if (
+           ((x1> view->clipX1) && (x1 < view->clipX2) && (y1 > view->clipY1) && (y1 < view->clipY2))
+                   || 
+           ((x2 > view->clipX1)&& (x2< view->clipX2)&& (y2 > view->clipY1)     && (y2 < view->clipY2))
+                   || 
+           (view->active_camera >= 0)
+    
+       )       
+           return 1;
+    if(view->edgerendertype == 0)
+    {
+       a.x=x1;a.y=y1;a.z=0;
+       b.x=x2;b.y=y2;b.z=0;
+       c.x=view->clipX1;c.y=view->clipY1;c.z=0;
+       c.x=view->clipX1;c.y=view->clipY2;c.z=0;
+       if(lines_intersect (&a, &b, &c,&d))
+           return 1;
+       c.x=view->clipX2;c.y=view->clipY1;c.z=0;
+       c.x=view->clipX2;c.y=view->clipY2;c.z=0;
+       if(lines_intersect (&a, &b, &c,&d))
+           return 1;
+       c.x=view->clipX1;c.y=view->clipY1;c.z=0;
+       c.x=view->clipX2;c.y=view->clipY1;c.z=0;
+       if(lines_intersect (&a, &b, &c,&d))
+           return 1;
+       c.x=view->clipX1;c.y=view->clipY2;c.z=0;
+       c.x=view->clipX2;c.y=view->clipY2;c.z=0;
+       if(lines_intersect (&a, &b, &c,&d))
+           return 1;
+       return 0;
+
+    }
+    return 0;
+
+
+
 }
 
 static void drawtopviewedges(Agraph_t * g)
@@ -743,21 +787,13 @@ static void drawtopviewedges(Agraph_t * g)
        return;
     glBegin(GL_LINES);
     set_topview_options();
-    for (ind = 0; ind < view->Topview->Edgecount; ind++) {
+    for (ind = 0; ind < view->Topview->Edgecount; ind++) 
+    {
        e = view->Topview->Edges + ind;
-       if (((e->x1 / view->zoom * -1 > view->clipX1)
-            && (e->x1 / view->zoom * -1 < view->clipX2)
-            && (e->y1 / view->zoom * -1 > view->clipY1)
-            && (e->y1 / view->zoom * -1 < view->clipY2))
-           || ((e->x2 / view->zoom * -1 > view->clipX1)
-               && (e->x2 / view->zoom * -1 < view->clipX2)
-               && (e->y2 / view->zoom * -1 > view->clipY1)
-               && (e->y2 / view->zoom * -1 < view->clipY2))
-           || (view->active_camera >= 0)) {
-
+       if(edgevisible(e))
+       {
            if (!get_color_from_edge(e))
                continue;
-
            //select_topview_edge(e);
            if (e->Node1->data.Selected == 1) { //tail is selected
                ddx = dx;
@@ -868,9 +904,11 @@ static int drawtopviewedgelabels(Agraph_t * g)
 void drawTopViewGraph(Agraph_t * g)
 {
     
-    glEnable (GL_BLEND);
+/*    glEnable (GL_BLEND);
     glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-    glDisable(GL_DEPTH_TEST);
+    glDisable(GL_DEPTH_TEST);*/
+
+//    glDisable(GL_DEPTH_TEST);
     drawtopviewnodes(g);
     drawtopviewlabels(g);
     drawtopviewedges(g);
@@ -878,6 +916,9 @@ void drawTopViewGraph(Agraph_t * g)
     enddrawcycle(g);
     draw_tv_xdot(view->Topview);
     draw_node_hint_boxes();
+//    glEnable(GL_DEPTH_TEST);
+
+
     if ((view->Selection.Active > 0) && (!view->SignalBlock)) {
        view->Selection.Active = 0;
        drawTopViewGraph(g);
@@ -885,6 +926,7 @@ void drawTopViewGraph(Agraph_t * g)
        glexpose();
        view->SignalBlock = 0;
     }
+
 }
 
 
@@ -1081,7 +1123,6 @@ static void set_boundaries(topview * t)
 
 static int get_color_from_edge(topview_edge * e)
 {
-    GdkColor color;
     int return_value = 1;
     float Alpha = 0;
     GtkHScale *AlphaScale =
index ba5ab525ed2bcc17bef569284ed5af5232d894cd..2e9ec4f1a2113c497501c58576475dc95b028535 100755 (executable)
@@ -132,7 +132,6 @@ int validate_node(tv_node * TV_Node)
     static btree_node *n = 0;
     char *data_attr1;
     char *data_attr2;
-    char *buf;
 //              n=tree_from_filter_string("([IP=\"^10.*\",min=\"0\",max=\"0\"])");
     // get attributes from graph
     data_attr1 = agget(view->g[view->activeGraph], "DataAttribute1");
index 344df235b7457c9c80f840e114889d6bb87af877..f8bd576da5ff7fdb5437c08279733c2b8623da7e 100755 (executable)
@@ -316,6 +316,7 @@ void set_viewport_settings_from_template(ViewInfo * view, Agraph_t * g)
     view->colschms =
        create_color_theme(atoi
                           (get_attribute_value("colortheme", view, g)));
+    view->edgerendertype=atoi(get_attribute_value("edgerender", view, g));
 
 
     if (view->graphCount > 0)
@@ -351,7 +352,6 @@ void init_viewport(ViewInfo * view)
     FILE *input_file2 = NULL;
     static char* path;
     get_data_dir();
-
     input_file = fopen(view->template_file, "rb");
     if (!input_file) {
        fprintf(stderr,
@@ -370,7 +370,7 @@ void init_viewport(ViewInfo * view)
     }
     if (!path)
        path = smyrnaPath("attr_widgets.dot");
-    printf ("%s\n", path);
+//    printf ("%s\n", path);
     input_file2 = fopen(path, "rb");
     if (!input_file2) {
        fprintf(stderr, "default attributes template graph file \"%s\" not found\n",smyrnaPath("attr_widgets.dot"));
@@ -509,6 +509,7 @@ void init_viewport(ViewInfo * view)
     view->refresh.selection=1;
     view->refresh.visibility=1;
     view->refresh.nodesize=1;
+    view->edgerendertype=0;
     /*add default camera */
     //create fontset
 }
index 86f6145b007fcb4312930e7adad1f33258026b96..a4efdd2aff65ee56743787a822e8023ea9b9f5be 100644 (file)
@@ -56,7 +56,7 @@ extern "C" {
 #define        GLCOMPSET_BUTTON_COLOR_ALPHA    (GLfloat)0.6
 #define        GLCOMPSET_BUTTON_THICKNESS              (GLfloat)3
 #define        GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS               (GLfloat)1.7
-#define GLCOMPSET_FONT_SIZE                            (GLfloat)56
+#define GLCOMPSET_FONT_SIZE                            (GLfloat)14
 
 #define        GLCOMPSET_BUTTON_FONT_COLOR_R           (GLfloat)0
 #define        GLCOMPSET_BUTTON_FONT_COLOR_G           (GLfloat)0
@@ -203,6 +203,7 @@ extern "C" {
        float height;
        glCompTexType type;
        int userCount;
+       int fontSize;
        unsigned char *data;    /*data */
     } glCompTex;
 
@@ -291,6 +292,7 @@ extern "C" {
        glCompCommon common;
        int autosize;           /*if 1 label sized is calculated from font */
        char *text;
+       int transparent;
     } glCompLabel;
 
 /*buttons*/
index 573515378877b45ef248269438c4a8536fb1c19d..ef3c5f46fe5c54813308490eb7c63a81ca7f955c 100644 (file)
@@ -205,13 +205,15 @@ glCompFont *new_font(glCompSet * s, char *text, glCompColor * c,glCompFontType t
     font->color.A = c->A;
     font->justify.VJustify = GL_FONTVJUSTIFY;
     font->justify.HJustify = GL_FONTHJUSTIFY;
+    font->type=type;
+    font->is2D=is2D;
 
     if (font->type == gluttext)
        font->glutfont = DEFAULT_GLUT_FONT;
     else
        font->glutfont = (void *) 0;
 
-    font->fontdesc = fontdesc;
+    font->fontdesc = strdup(fontdesc);
     font->size = fs;
     font->transparent = 1;
     font->optimize = GL_FONTOPTIMIZE;
@@ -240,7 +242,7 @@ glCompFont *new_font_from_parent(glCompObj * o, char *text)
 
        font->type = parent->font->type;
        font->glutfont = parent->font->glutfont;
-       font->fontdesc = parent->font->fontdesc;
+       font->fontdesc = strdup(parent->font->fontdesc);
        font->size = parent->font->size;
        font->transparent = parent->font->transparent;
        font->justify.VJustify = parent->font->justify.VJustify;
index dcfb480b69cedae3d42be42db470526bf35667b6..baa52f42b5c42f9c3eeff788c0b0841be33f4c45 100644 (file)
@@ -28,10 +28,11 @@ glCompLabel *glCompLabelNew(glCompObj * par, GLfloat x, GLfloat y,
     p = NEW(glCompLabel);
     glCompInitCommon((glCompObj *) p, par, x, y);
     p->objType = glLabelObj;
+    p->transparent=1;
     //typedef enum {glPanelObj,glbuttonObj,glLabelObj,glImageObj}glObjType;
 
     p->text = strdup(text);
-    p->common.font = new_font_from_parent(par, text);
+    p->common.font = new_font_from_parent((glCompObj*)p, text);
     p->common.functions.draw = glCompLabelDraw;
 
     return p;
@@ -44,23 +45,49 @@ int glCompLabelDraw(glCompLabel * p)
     ref = p->common;
     glCompCalcWidget((glCompCommon *) p->common.parent, &p->common, &ref);
     /*draw background */
-    glCompSetColor(&p->common.color);
-    glBegin(GL_QUADS);
-    glVertex3d(ref.refPos.x, ref.refPos.y, ref.refPos.z);
-    glVertex3d(ref.refPos.x + ref.width, ref.refPos.y, ref.refPos.z);
-    glVertex3d(ref.refPos.x + ref.width, ref.refPos.y + ref.height,
-              ref.refPos.z);
-    glVertex3d(ref.refPos.x, ref.refPos.y + ref.height, ref.refPos.z);
-    glEnd();
+    if(!p->transparent)
+    {
+       glCompSetColor(&p->common.color);
+       glBegin(GL_QUADS);
+       glVertex3d(ref.refPos.x, ref.refPos.y, ref.refPos.z);
+       glVertex3d(ref.refPos.x + ref.width, ref.refPos.y, ref.refPos.z);
+       glVertex3d(ref.refPos.x + ref.width, ref.refPos.y + ref.height,
+                  ref.refPos.z);
+       glVertex3d(ref.refPos.x, ref.refPos.y + ref.height, ref.refPos.z);
+       glEnd();
+    }
     glCompRenderText(p->common.font, (glCompObj *) p);
     return 1;
 
 }
-int glCompLabelSetText(glCompLabel * p, char *text)
+static void update_font(glCompLabel * p,char* text,char* desc,int fs)
 {
-    free(p->text);
+
+    glCompFont* temp=p->common.font;
+    p->common.font=new_font(p->common.compset,text,&p->common.color,temp->type,desc,fs,temp->is2D);
+    if(temp)
+       delete_font(temp);
+    if(p->text)
+       free(p->text);
     p->text = strdup(text);
-    return 1;
+
+
+}
+
+void glCompLabelSetText(glCompLabel * p, char *text)
+{
+    glCompFont* temp=p->common.font;
+    update_font(p,text,temp->fontdesc,temp->size);
+}
+void glCompLabelSetFontSize(glCompLabel * p, int size)
+{
+    glCompFont* temp=p->common.font;
+    update_font(p,p->text,temp->fontdesc,size);
+}
+void glCompLabelSetFontName(glCompLabel * p, char* fontName)
+{
+    glCompFont* temp=p->common.font;
+    update_font(p,p->text,fontName,temp->size);
 }
 
 
index 836e7f643df95aaca1c29dc74c642e5f6526dad4..afa2bfb28fb03efcae22aab3a1905517a94d3bee 100644 (file)
@@ -42,6 +42,10 @@ extern "C" {
     extern void glCompLabelMouseUp(glCompObj * obj, GLfloat x, GLfloat y,
                                   glMouseButtonType t);
 
+    extern void glCompLabelSetText(glCompLabel * p, char *text);
+    extern void glCompLabelSetFontSize(glCompLabel * p, int size);
+    extern void glCompLabelSetFontName(glCompLabel * p, char* fontName);
+
 #ifdef __cplusplus
 }
 #endif
index a4a25cbb8200e38e636ce52f09a738eea8860746..fc24a06a4582501658bcbc025cbf361208b13bde 100644 (file)
@@ -26,7 +26,7 @@ void glCompSetRemoveTexLabel(glCompSet * s, glCompFont * t)
 
 static glCompTex *glCompSetAddNewTexture(glCompSet * s, int width,
                                         int height, unsigned char *data,
-                                        int is2D)
+                                        int is2D,int fs)
 {
     int Er, offset, ind;
     glCompTex *t;
@@ -94,7 +94,7 @@ glCompTex *glCompSetAddNewTexImage(glCompSet * s, int width, int height,
     glCompTex *t;
     if (!data)
        return NULL;
-    t = glCompSetAddNewTexture(s, width, height, data, is2D);
+    t = glCompSetAddNewTexture(s, width, height, data, is2D,-1);
     if (!t)
        return NULL;
     t->type = glTexImage;
@@ -124,7 +124,8 @@ glCompTex *glCompSetAddNewTexLabel(glCompSet * s, char *def, int fs,
        if (s->textures[ind]->type == glTexLabel) {
            if ((strcmp(def, s->textures[ind]->def) == 0)
                && (s->textures[ind]->type == glTexLabel)
-               && (strcmp(text, s->textures[ind]->text) == 0)) {
+               && (strcmp(text, s->textures[ind]->text) == 0)
+               && (s->textures[ind]->fontSize==fs)) {
                s->textures[ind]->userCount++;
                return s->textures[ind];
            }
@@ -135,7 +136,7 @@ glCompTex *glCompSetAddNewTexLabel(glCompSet * s, char *def, int fs,
     data = create_pango_texture(def, fs, text, surface, &width, &height);
     if (!data)                 /*pango error , */
        Er = 1;
-    t = glCompSetAddNewTexture(s, width, height, data, is2D);
+    t = glCompSetAddNewTexture(s, width, height, data, is2D,fs);
     if (!t)
        Er = 1;
     cairo_surface_destroy(surface);
index 9e1e5faecde778dafd986977143745f60a9f9a42..7c84bbe055e607835b74d7a8d01e294dff8a581e 100644 (file)
@@ -161,6 +161,7 @@ float GetOGLDistance(int l)
 
 void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z)
 {
+
     int const WIDTH = 20;
 
     GLint viewport[4];
@@ -171,6 +172,7 @@ void to3D(int x, int y, GLfloat * X, GLfloat * Y, GLfloat * Z)
     GLdouble posX, posY, posZ;
     int idx;
     static float comp;
+
     glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
     glGetDoublev(GL_PROJECTION_MATRIX, projection);
     glGetIntegerv(GL_VIEWPORT, viewport);
@@ -681,6 +683,29 @@ void copy_glcomp_color(glCompColor * source, glCompColor * target)
 }
 
 
+double area2(glCompPoint * p1p, glCompPoint * p2p, glCompPoint * p3p) 
+{
+    double d;
+
+    d = ((p1p->y - p2p->y) * (p3p->x - p2p->x)) -
+        ((p3p->y - p2p->y) * (p1p->x - p2p->x));
+    return d;
+}
+
+
+enum {ISCCW, ISON, ISCW};  /* counterclockwise; collinear; clockwise */ 
+int sideOf (glCompPoint * p1p, glCompPoint * p2p, glCompPoint * p3p) {
+    double d = area2 (p1p,p2p,p3p);
+    if (d < 0) return ISCCW;
+    else if (d > 0) return ISCW;
+    else return ISON;
+}
+
+int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint* d) 
+{
+  return ((sideOf(a,b,c) != sideOf(a,b,d)) && (sideOf(c,d,a) != sideOf(c,d,b))); 
+}
+
 
 
 
index 7278ca11e02dd7faf7faa5f00b6a4aff6844ec59..8c93d36036b1316c736e534bdcced8abbf8c167d 100644 (file)
@@ -63,6 +63,7 @@ extern "C" {
     extern void glCompSetColor(glCompColor * c);
 
     void glCompSelectionBox(glCompSet * s);
+    extern int lines_intersect (glCompPoint* a, glCompPoint* b, glCompPoint* c, glCompPoint* d);
 
 #ifdef __cplusplus
 }
index a71eb2de5c077da56e9ed2725c8e3cae1cbdf99d..98095751bd22637b12119a350dbdf601ae213aed 100755 (executable)
   <property name="focus_on_map">True</property>
   <property name="urgency_hint">False</property>
   <property name="has_separator">False</property>
+  <signal name="delete_event" handler="on_dlgSettings_close" last_modification_time="Thu, 03 Dec 2009 16:39:12 GMT"/>
 
   <child internal-child="vbox">
     <widget class="GtkVBox" id="dialog-vbox5">
                  <property name="width_request">443</property>
                  <property name="height_request">408</property>
                  <property name="visible">True</property>
-                 <property name="n_rows">13</property>
+                 <property name="n_rows">14</property>
                  <property name="n_columns">3</property>
                  <property name="homogeneous">False</property>
                  <property name="row_spacing">0</property>
@@ -2350,6 +2351,54 @@ Rain Forest</property>
                      <property name="y_options"></property>
                    </packing>
                  </child>
+
+                 <child>
+                   <widget class="GtkLabel" id="label132">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Show Edges </property>
+                     <property name="use_underline">False</property>
+                     <property name="use_markup">False</property>
+                     <property name="justify">GTK_JUSTIFY_LEFT</property>
+                     <property name="wrap">False</property>
+                     <property name="selectable">False</property>
+                     <property name="xalign">0</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xpad">5</property>
+                     <property name="ypad">0</property>
+                     <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                     <property name="width_chars">-1</property>
+                     <property name="single_line_mode">False</property>
+                     <property name="angle">0</property>
+                   </widget>
+                   <packing>
+                     <property name="left_attach">0</property>
+                     <property name="right_attach">1</property>
+                     <property name="top_attach">13</property>
+                     <property name="bottom_attach">14</property>
+                     <property name="x_options">fill</property>
+                     <property name="y_options"></property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkComboBoxEntry" id="edgerendercb">
+                     <property name="visible">True</property>
+                     <property name="items" translatable="yes">Always
+When head or tail is within viewport
+</property>
+                     <property name="add_tearoffs">False</property>
+                     <property name="has_frame">True</property>
+                     <property name="focus_on_click">True</property>
+                   </widget>
+                   <packing>
+                     <property name="left_attach">1</property>
+                     <property name="right_attach">2</property>
+                     <property name="top_attach">13</property>
+                     <property name="bottom_attach">14</property>
+                     <property name="x_options">fill</property>
+                     <property name="y_options">fill</property>
+                   </packing>
+                 </child>
                </widget>
                <packing>
                  <property name="x">10</property>
@@ -2959,7 +3008,7 @@ GLUT_BITMAP_HELVETICA_18
 
              <child>
                <widget class="GtkTable" id="table5">
-                 <property name="width_request">397</property>
+                 <property name="width_request">423</property>
                  <property name="height_request">308</property>
                  <property name="visible">True</property>
                  <property name="n_rows">7</property>
@@ -3020,32 +3069,6 @@ GLUT_BITMAP_HELVETICA_18
                    </packing>
                  </child>
 
-                 <child>
-                   <widget class="GtkLabel" id="label51">
-                     <property name="visible">True</property>
-                     <property name="label" translatable="yes">Node Size with Degree</property>
-                     <property name="use_underline">False</property>
-                     <property name="use_markup">False</property>
-                     <property name="justify">GTK_JUSTIFY_LEFT</property>
-                     <property name="wrap">False</property>
-                     <property name="selectable">False</property>
-                     <property name="xalign">0</property>
-                     <property name="yalign">0.5</property>
-                     <property name="xpad">5</property>
-                     <property name="ypad">0</property>
-                     <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-                     <property name="width_chars">-1</property>
-                     <property name="single_line_mode">False</property>
-                     <property name="angle">0</property>
-                   </widget>
-                   <packing>
-                     <property name="left_attach">0</property>
-                     <property name="right_attach">1</property>
-                     <property name="top_attach">2</property>
-                     <property name="bottom_attach">3</property>
-                   </packing>
-                 </child>
-
                  <child>
                    <widget class="GtkLabel" id="label52">
                      <property name="visible">True</property>
@@ -3200,28 +3223,6 @@ Custom</property>
                    </packing>
                  </child>
 
-                 <child>
-                   <widget class="GtkCheckButton" id="settingsChkBox11">
-                     <property name="visible">True</property>
-                     <property name="can_focus">True</property>
-                     <property name="label" translatable="yes"></property>
-                     <property name="use_underline">True</property>
-                     <property name="relief">GTK_RELIEF_NORMAL</property>
-                     <property name="focus_on_click">True</property>
-                     <property name="active">False</property>
-                     <property name="inconsistent">False</property>
-                     <property name="draw_indicator">True</property>
-                   </widget>
-                   <packing>
-                     <property name="left_attach">1</property>
-                     <property name="right_attach">2</property>
-                     <property name="top_attach">2</property>
-                     <property name="bottom_attach">3</property>
-                     <property name="x_options">fill</property>
-                     <property name="y_options"></property>
-                   </packing>
-                 </child>
-
                  <child>
                    <widget class="GtkCheckButton" id="settingsChkBox12">
                      <property name="visible">True</property>