socnetv-0.90/0000755000175000017500000000000011455100156013353 5ustar dimitrisdimitrissocnetv-0.90/socnetv.desktop.in0000644000175000017500000000037611261401575017046 0ustar dimitrisdimitris[Desktop Entry] X-SuSE-translate=true Name=SocNetV GenericName=Social Networks Analysis and Visualisation Comment=Social Networks Visualisation and Analysis. Exec=socnetv Icon=socnetv Categories=Education;Science;Math;Qt; Terminal=false Type=Application socnetv-0.90/Makefile.Release0000644000175000017500000004642511455000123016376 0ustar dimitrisdimitris############################################################################# # Makefile for building: socnetv # Generated by qmake (2.01a) (Qt 4.7.0) on: Tue Oct 12 09:29:39 2010 # Project: socnetv.pro # Template: app ############################################################################# ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -msse -mfpmath=sse -ffast-math -O2 -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -Isrc -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I/usr/include/qt4 -Irelease -I. LINK = g++ LFLAGS = -Wl,-O1 LIBS = $(SUBLIBS) -L/usr/lib -lpthread -lQtWebKit -lQtXml -lQtGui -lQtNetwork -lQtCore AR = ar cqs RANLIB = QMAKE = /usr/bin/qmake-qt4 TAR = tar -cf COMPRESS = gzip -9f COPY = cp -f SED = sed COPY_FILE = $(COPY) COPY_DIR = $(COPY) -r STRIP = strip INSTALL_FILE = install -m 644 -p INSTALL_DIR = $(COPY_DIR) INSTALL_PROGRAM = install -m 755 -p DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p ####### Output directory OBJECTS_DIR = release/ ####### Files SOURCES = src/backgrcircle.cpp \ src/graphicswidget.cpp \ src/edge.cpp \ src/edgeweight.cpp \ src/graph.cpp \ src/htmlviewer.cpp \ src/main.cpp \ src/mainwindow.cpp \ src/matrix.cpp \ src/node.cpp \ src/nodelabel.cpp \ src/nodenumber.cpp \ src/texteditor.cpp \ src/vertex.cpp \ src/parser.cpp \ src/filteredgesbyweightdialog.cpp \ src/webcrawlerdialog.cpp \ src/webcrawler.cpp \ src/datasetselectdialog.cpp release/moc_backgrcircle.cpp \ release/moc_graphicswidget.cpp \ release/moc_edge.cpp \ release/moc_graph.cpp \ release/moc_htmlviewer.cpp \ release/moc_mainwindow.cpp \ release/moc_node.cpp \ release/moc_texteditor.cpp \ release/moc_vertex.cpp \ release/moc_parser.cpp \ release/moc_filteredgesbyweightdialog.cpp \ release/moc_webcrawlerdialog.cpp \ release/moc_webcrawler.cpp \ release/moc_datasetselectdialog.cpp \ release/qrc_src.cpp OBJECTS = release/backgrcircle.o \ release/graphicswidget.o \ release/edge.o \ release/edgeweight.o \ release/graph.o \ release/htmlviewer.o \ release/main.o \ release/mainwindow.o \ release/matrix.o \ release/node.o \ release/nodelabel.o \ release/nodenumber.o \ release/texteditor.o \ release/vertex.o \ release/parser.o \ release/filteredgesbyweightdialog.o \ release/webcrawlerdialog.o \ release/webcrawler.o \ release/datasetselectdialog.o \ release/moc_backgrcircle.o \ release/moc_graphicswidget.o \ release/moc_edge.o \ release/moc_graph.o \ release/moc_htmlviewer.o \ release/moc_mainwindow.o \ release/moc_node.o \ release/moc_texteditor.o \ release/moc_vertex.o \ release/moc_parser.o \ release/moc_filteredgesbyweightdialog.o \ release/moc_webcrawlerdialog.o \ release/moc_webcrawler.o \ release/moc_datasetselectdialog.o \ release/qrc_src.o DIST = /usr/share/qt4/mkspecs/common/g++.conf \ /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \ /usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/default_pre.prf \ /usr/share/qt4/mkspecs/features/release.prf \ /usr/share/qt4/mkspecs/features/debug_and_release.prf \ /usr/share/qt4/mkspecs/features/default_post.prf \ /usr/share/qt4/mkspecs/features/build_pass.prf \ /usr/share/qt4/mkspecs/features/warn_on.prf \ /usr/share/qt4/mkspecs/features/unix/thread.prf \ /usr/share/qt4/mkspecs/features/qt.prf \ /usr/share/qt4/mkspecs/features/moc.prf \ /usr/share/qt4/mkspecs/features/resources.prf \ /usr/share/qt4/mkspecs/features/uic.prf \ /usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \ socnetv.pro QMAKE_TARGET = socnetv DESTDIR = TARGET = socnetv first: all ####### Implicit rules .SUFFIXES: .o .c .cpp .cc .cxx .C .cpp.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .cc.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .cxx.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .C.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .c.o: $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" ####### Build rules all: Makefile.Release $(TARGET) $(TARGET): ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h ui_datasetselectdialog.h $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) qmake: FORCE @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug_and_release -o Makefile.Release socnetv.pro dist: @$(CHK_DIR_EXISTS) release/socnetv1.0.0 || $(MKDIR) release/socnetv1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) release/socnetv1.0.0/ && $(COPY_FILE) --parents src/backgrcircle.h src/graphicswidget.h src/edge.h src/edgeweight.h src/graph.h src/htmlviewer.h src/mainwindow.h src/matrix.h src/node.h src/nodelabel.h src/nodenumber.h src/texteditor.h src/vertex.h src/parser.h src/filteredgesbyweightdialog.h src/webcrawlerdialog.h src/webcrawler.h src/datasetselectdialog.h release/socnetv1.0.0/ && $(COPY_FILE) --parents src/src.qrc release/socnetv1.0.0/ && $(COPY_FILE) --parents src/backgrcircle.cpp src/graphicswidget.cpp src/edge.cpp src/edgeweight.cpp src/graph.cpp src/htmlviewer.cpp src/main.cpp src/mainwindow.cpp src/matrix.cpp src/node.cpp src/nodelabel.cpp src/nodenumber.cpp src/texteditor.cpp src/vertex.cpp src/parser.cpp src/filteredgesbyweightdialog.cpp src/webcrawlerdialog.cpp src/webcrawler.cpp src/datasetselectdialog.cpp release/socnetv1.0.0/ && $(COPY_FILE) --parents src/forms/filteredgesbyweightdialog.ui src/forms/webcrawlerdialog.ui src/forms/datasetselectdialog.ui release/socnetv1.0.0/ && $(COPY_FILE) --parents translations/socnetv_es.ts release/socnetv1.0.0/ && (cd `dirname release/socnetv1.0.0` && $(TAR) socnetv1.0.0.tar socnetv1.0.0 && $(COMPRESS) socnetv1.0.0.tar) && $(MOVE) `dirname release/socnetv1.0.0`/socnetv1.0.0.tar.gz . && $(DEL_FILE) -r release/socnetv1.0.0 clean:compiler_clean -$(DEL_FILE) $(OBJECTS) -$(DEL_FILE) *~ core *.core ####### Sub-libraries distclean: clean -$(DEL_FILE) $(TARGET) -$(DEL_FILE) Makefile.Release check: first mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all compiler_moc_header_make_all: release/moc_backgrcircle.cpp release/moc_graphicswidget.cpp release/moc_edge.cpp release/moc_graph.cpp release/moc_htmlviewer.cpp release/moc_mainwindow.cpp release/moc_node.cpp release/moc_texteditor.cpp release/moc_vertex.cpp release/moc_parser.cpp release/moc_filteredgesbyweightdialog.cpp release/moc_webcrawlerdialog.cpp release/moc_webcrawler.cpp release/moc_datasetselectdialog.cpp compiler_moc_header_clean: -$(DEL_FILE) release/moc_backgrcircle.cpp release/moc_graphicswidget.cpp release/moc_edge.cpp release/moc_graph.cpp release/moc_htmlviewer.cpp release/moc_mainwindow.cpp release/moc_node.cpp release/moc_texteditor.cpp release/moc_vertex.cpp release/moc_parser.cpp release/moc_filteredgesbyweightdialog.cpp release/moc_webcrawlerdialog.cpp release/moc_webcrawler.cpp release/moc_datasetselectdialog.cpp release/moc_backgrcircle.cpp: src/backgrcircle.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/backgrcircle.h -o release/moc_backgrcircle.cpp release/moc_graphicswidget.cpp: src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/graphicswidget.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/graphicswidget.h -o release/moc_graphicswidget.cpp release/moc_edge.cpp: src/edge.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/edge.h -o release/moc_edge.cpp release/moc_graph.cpp: src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/graph.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/graph.h -o release/moc_graph.cpp release/moc_htmlviewer.cpp: src/htmlviewer.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/htmlviewer.h -o release/moc_htmlviewer.cpp release/moc_mainwindow.cpp: src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h \ src/mainwindow.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/mainwindow.h -o release/moc_mainwindow.cpp release/moc_node.cpp: src/node.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/node.h -o release/moc_node.cpp release/moc_texteditor.cpp: src/texteditor.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/texteditor.h -o release/moc_texteditor.cpp release/moc_vertex.cpp: src/vertex.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/vertex.h -o release/moc_vertex.cpp release/moc_parser.cpp: src/parser.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/parser.h -o release/moc_parser.cpp release/moc_filteredgesbyweightdialog.cpp: ui_filteredgesbyweightdialog.h \ src/filteredgesbyweightdialog.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/filteredgesbyweightdialog.h -o release/moc_filteredgesbyweightdialog.cpp release/moc_webcrawlerdialog.cpp: ui_webcrawlerdialog.h \ src/webcrawlerdialog.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/webcrawlerdialog.h -o release/moc_webcrawlerdialog.cpp release/moc_webcrawler.cpp: src/webcrawler.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/webcrawler.h -o release/moc_webcrawler.cpp release/moc_datasetselectdialog.cpp: ui_datasetselectdialog.h \ src/datasetselectdialog.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/datasetselectdialog.h -o release/moc_datasetselectdialog.cpp compiler_rcc_make_all: release/qrc_src.cpp compiler_rcc_clean: -$(DEL_FILE) release/qrc_src.cpp release/qrc_src.cpp: src/src.qrc \ src/images/dm.png \ src/images/colorize.png \ src/images/net2.png \ src/images/help.png \ src/images/exit.png \ src/images/zoomout.png \ src/images/diameter.png \ src/images/diamond.png \ src/images/avdistance.png \ src/images/open.png \ src/images/net3.png \ src/images/erdos.png \ src/images/symmetry.png \ src/images/gridlines.png \ src/images/nodes.png \ src/images/color.png \ src/images/box.png \ src/images/save.png \ src/images/connect.png \ src/images/socnetv.png \ src/images/sw.png \ src/images/zoomin.png \ src/images/forward.png \ src/images/remove.png \ src/images/line.png \ src/images/letters.png \ src/images/triangle.png \ src/images/net.png \ src/images/nodeout.png \ src/images/view.png \ src/images/symmetrize.png \ src/images/saved.png \ src/images/circular.png \ src/images/print.png \ src/images/node.png \ src/images/plines.png \ src/images/nodein.png \ src/images/distance.png \ src/images/nodecolor.png \ src/images/add.png \ src/images/sm.png \ src/images/net1.png \ src/images/webcrawler.png \ src/images/new.png \ src/images/clique.png \ src/images/find.png \ src/images/circle.png \ src/images/disconnect.png \ src/images/resize.png \ src/images/back.png \ src/images/home.png /usr/bin/rcc -name src src/src.qrc -o release/qrc_src.cpp compiler_image_collection_make_all: qmake_image_collection.cpp compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp compiler_moc_source_make_all: compiler_moc_source_clean: compiler_uic_make_all: ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h ui_datasetselectdialog.h compiler_uic_clean: -$(DEL_FILE) ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h ui_datasetselectdialog.h ui_filteredgesbyweightdialog.h: src/forms/filteredgesbyweightdialog.ui /usr/bin/uic-qt4 src/forms/filteredgesbyweightdialog.ui -o ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h: src/forms/webcrawlerdialog.ui /usr/bin/uic-qt4 src/forms/webcrawlerdialog.ui -o ui_webcrawlerdialog.h ui_datasetselectdialog.h: src/forms/datasetselectdialog.ui /usr/bin/uic-qt4 src/forms/datasetselectdialog.ui -o ui_datasetselectdialog.h compiler_yacc_decl_make_all: compiler_yacc_decl_clean: compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean ####### Compile release/backgrcircle.o: src/backgrcircle.cpp src/backgrcircle.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/backgrcircle.o src/backgrcircle.cpp release/graphicswidget.o: src/graphicswidget.cpp src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/mainwindow.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h \ src/node.h \ src/edge.h \ src/nodenumber.h \ src/nodelabel.h \ src/backgrcircle.h \ src/edgeweight.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/graphicswidget.o src/graphicswidget.cpp release/edge.o: src/edge.cpp src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/edge.h \ src/node.h \ src/edgeweight.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/edge.o src/edge.cpp release/edgeweight.o: src/edgeweight.cpp src/edgeweight.h \ src/edge.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/edgeweight.o src/edgeweight.cpp release/graph.o: src/graph.cpp src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/graph.o src/graph.cpp release/htmlviewer.o: src/htmlviewer.cpp src/htmlviewer.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/htmlviewer.o src/htmlviewer.cpp release/main.o: src/main.cpp src/mainwindow.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/main.o src/main.cpp release/mainwindow.o: src/mainwindow.cpp config.h \ src/mainwindow.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h \ src/node.h \ src/edge.h \ src/nodenumber.h \ src/nodelabel.h \ src/edgeweight.h \ src/htmlviewer.h \ src/texteditor.h \ src/backgrcircle.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/mainwindow.o src/mainwindow.cpp release/matrix.o: src/matrix.cpp src/matrix.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/matrix.o src/matrix.cpp release/node.o: src/node.cpp src/node.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/edge.h \ src/nodelabel.h \ src/nodenumber.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/node.o src/node.cpp release/nodelabel.o: src/nodelabel.cpp src/nodelabel.h \ src/node.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/nodelabel.o src/nodelabel.cpp release/nodenumber.o: src/nodenumber.cpp src/nodenumber.h \ src/node.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/nodenumber.o src/nodenumber.cpp release/texteditor.o: src/texteditor.cpp src/texteditor.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/texteditor.o src/texteditor.cpp release/vertex.o: src/vertex.cpp src/vertex.h \ src/graph.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/vertex.o src/vertex.cpp release/parser.o: src/parser.cpp src/parser.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/parser.o src/parser.cpp release/filteredgesbyweightdialog.o: src/filteredgesbyweightdialog.cpp src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/filteredgesbyweightdialog.o src/filteredgesbyweightdialog.cpp release/webcrawlerdialog.o: src/webcrawlerdialog.cpp src/webcrawlerdialog.h \ ui_webcrawlerdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/webcrawlerdialog.o src/webcrawlerdialog.cpp release/webcrawler.o: src/webcrawler.cpp src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/webcrawler.o src/webcrawler.cpp release/datasetselectdialog.o: src/datasetselectdialog.cpp src/datasetselectdialog.h \ ui_datasetselectdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/datasetselectdialog.o src/datasetselectdialog.cpp release/moc_backgrcircle.o: release/moc_backgrcircle.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_backgrcircle.o release/moc_backgrcircle.cpp release/moc_graphicswidget.o: release/moc_graphicswidget.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_graphicswidget.o release/moc_graphicswidget.cpp release/moc_edge.o: release/moc_edge.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_edge.o release/moc_edge.cpp release/moc_graph.o: release/moc_graph.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_graph.o release/moc_graph.cpp release/moc_htmlviewer.o: release/moc_htmlviewer.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_htmlviewer.o release/moc_htmlviewer.cpp release/moc_mainwindow.o: release/moc_mainwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_mainwindow.o release/moc_mainwindow.cpp release/moc_node.o: release/moc_node.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_node.o release/moc_node.cpp release/moc_texteditor.o: release/moc_texteditor.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_texteditor.o release/moc_texteditor.cpp release/moc_vertex.o: release/moc_vertex.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_vertex.o release/moc_vertex.cpp release/moc_parser.o: release/moc_parser.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_parser.o release/moc_parser.cpp release/moc_filteredgesbyweightdialog.o: release/moc_filteredgesbyweightdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_filteredgesbyweightdialog.o release/moc_filteredgesbyweightdialog.cpp release/moc_webcrawlerdialog.o: release/moc_webcrawlerdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_webcrawlerdialog.o release/moc_webcrawlerdialog.cpp release/moc_webcrawler.o: release/moc_webcrawler.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_webcrawler.o release/moc_webcrawler.cpp release/moc_datasetselectdialog.o: release/moc_datasetselectdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_datasetselectdialog.o release/moc_datasetselectdialog.cpp release/qrc_src.o: release/qrc_src.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/qrc_src.o release/qrc_src.cpp ####### Install install: FORCE uninstall: FORCE FORCE: socnetv-0.90/nets/0000755000175000017500000000000011455100156014324 5ustar dimitrisdimitrissocnetv-0.90/nets/network.gw0000644000175000017500000000253711261401574016366 0ustar dimitrisdimitrisLEDA.GRAPH unknown unknown 5 |{1 0 1}| |{2 0 1}| |{3 0 1}| |{4 0 1}| |{5 0 1}| 4 1 2 0 |{edge 3 1 3 1}| 2 3 0 |{edge 3 1 3 1}| 3 4 0 |{edge 3 1 3 1}| 4 5 0 |{edge 3 1 3 1}| # version string GraphWin 1.400000 # scaling wxmin wymin wxmax wymax 0.9821777 -274.8779 -281.2244 274.8779 283.8025 # node label font and size 0 15 # edge label font and size 0 13 # node index format %d # edge index format %d # multi-edge distance 4.793233 # # node infos # x y shape bclr(r,g,b) bwidth r1 r2 clr(r,g,b) ltype lclr(r,g,b) lpos lstr -146.6016 65.93628 0 0 0 0 1.018519 10.18066 10.18066 160 0 0 1 255 255 228 4 1 59.04785 107.677 0 0 0 0 1.018519 10.18066 10.18066 160 0 0 1 255 255 228 4 2 54.97559 -44.01489 0 0 0 0 1.018519 10.18066 10.18066 160 0 0 1 255 255 228 4 3 -145.5835 -44.01489 6 0 0 0 1.018519 20.36133 10.18066 160 0 0 1 255 255 228 4 4 -73.30078 -148.8757 0 0 0 0 1.018519 10.18066 10.18066 160 0 0 1 255 255 228 4 5 # # edge infos # width clr(r,g,b) shape style dir ltype lclr(r,g,b) lpos sanch tanch poly lstr 3.054437 0 0 0 0 0 1 0 0 0 0 3 (0,0) (0,0) 2 (-136.6243,67.96136) (49.07063,105.6519) 1 3.054437 0 0 0 0 0 1 0 0 0 0 3 (0,0) (0,0) 2 (58.77464,97.5) (55.24879,-33.8379) 1 3.054437 0 0 0 0 0 1 0 0 0 0 3 (0,0) (0,0) 2 (44.79492,-44.01489) (-125.2222,-44.01489) 1 3.054437 0 0 0 0 0 1 0 0 0 0 3 (0,0) (0,0) 2 (-140.3645,-51.58607) (-79.07878,-140.4936) 1 socnetv-0.90/nets/jin2-sm.txt0000644000175000017500000000040111324027624016342 0ustar dimitrisdimitris0 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 socnetv-0.90/nets/jin3-sm.txt0000644000175000017500000000037511330246503016351 0ustar dimitrisdimitris0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 socnetv-0.90/nets/lion_share.dot0000644000175000017500000001332711261401574017170 0ustar dimitrisdimitris##"A few people in the field of genetics are using dot to draw "marriage node diagram" pedigree drawings. Here is one I have done of a test pedigree from the FTREE pedigree drawing package (Lion Share was a racehorse)." Contributed by David Duffy. ##Command to get the layout: "dot -Tpng thisfile > thisfile.png" digraph Ped_Lion_Share { # page = "8.2677165,11.692913" ; ratio = "auto" ; mincross = 2.0 ; label = "Pedigree Lion_Share" ; "001" [shape=box , regular=1,style=filled,fillcolor=white ] ; "002" [shape=box , regular=1,style=filled,fillcolor=white ] ; "003" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "004" [shape=box , regular=1,style=filled,fillcolor=white ] ; "005" [shape=box , regular=1,style=filled,fillcolor=white ] ; "006" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "007" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "009" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "014" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "015" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "016" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "ZZ01" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "ZZ02" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "017" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "012" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "008" [shape=box , regular=1,style=filled,fillcolor=white ] ; "011" [shape=box , regular=1,style=filled,fillcolor=white ] ; "013" [shape=box , regular=1,style=filled,fillcolor=white ] ; "010" [shape=box , regular=1,style=filled,fillcolor=white ] ; "023" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "020" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "021" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "018" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "025" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "019" [shape=box , regular=1,style=filled,fillcolor=white ] ; "022" [shape=box , regular=1,style=filled,fillcolor=white ] ; "024" [shape=box , regular=1,style=filled,fillcolor=white ] ; "027" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "026" [shape=box , regular=1,style=filled,fillcolor=white ] ; "028" [shape=box , regular=1,style=filled,fillcolor=grey ] ; "marr0001" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "001" -> "marr0001" [dir=none,weight=1] ; "007" -> "marr0001" [dir=none,weight=1] ; "marr0001" -> "017" [dir=none, weight=2] ; "marr0002" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "001" -> "marr0002" [dir=none,weight=1] ; "ZZ02" -> "marr0002" [dir=none,weight=1] ; "marr0002" -> "012" [dir=none, weight=2] ; "marr0003" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "002" -> "marr0003" [dir=none,weight=1] ; "003" -> "marr0003" [dir=none,weight=1] ; "marr0003" -> "008" [dir=none, weight=2] ; "marr0004" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "002" -> "marr0004" [dir=none,weight=1] ; "006" -> "marr0004" [dir=none,weight=1] ; "marr0004" -> "011" [dir=none, weight=2] ; "marr0005" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "002" -> "marr0005" [dir=none,weight=1] ; "ZZ01" -> "marr0005" [dir=none,weight=1] ; "marr0005" -> "013" [dir=none, weight=2] ; "marr0006" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "004" -> "marr0006" [dir=none,weight=1] ; "009" -> "marr0006" [dir=none,weight=1] ; "marr0006" -> "010" [dir=none, weight=2] ; "marr0007" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "005" -> "marr0007" [dir=none,weight=1] ; "015" -> "marr0007" [dir=none,weight=1] ; "marr0007" -> "023" [dir=none, weight=2] ; "marr0008" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "005" -> "marr0008" [dir=none,weight=1] ; "016" -> "marr0008" [dir=none,weight=1] ; "marr0008" -> "020" [dir=none, weight=2] ; "marr0009" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "005" -> "marr0009" [dir=none,weight=1] ; "012" -> "marr0009" [dir=none,weight=1] ; "marr0009" -> "021" [dir=none, weight=2] ; "marr0010" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "008" -> "marr0010" [dir=none,weight=1] ; "017" -> "marr0010" [dir=none,weight=1] ; "marr0010" -> "018" [dir=none, weight=2] ; "marr0011" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "011" -> "marr0011" [dir=none,weight=1] ; "023" -> "marr0011" [dir=none,weight=1] ; "marr0011" -> "025" [dir=none, weight=2] ; "marr0012" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "013" -> "marr0012" [dir=none,weight=1] ; "014" -> "marr0012" [dir=none,weight=1] ; "marr0012" -> "019" [dir=none, weight=2] ; "marr0013" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "010" -> "marr0013" [dir=none,weight=1] ; "021" -> "marr0013" [dir=none,weight=1] ; "marr0013" -> "022" [dir=none, weight=2] ; "marr0014" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "019" -> "marr0014" [dir=none,weight=1] ; "020" -> "marr0014" [dir=none,weight=1] ; "marr0014" -> "024" [dir=none, weight=2] ; "marr0015" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "022" -> "marr0015" [dir=none,weight=1] ; "025" -> "marr0015" [dir=none,weight=1] ; "marr0015" -> "027" [dir=none, weight=2] ; "marr0016" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "024" -> "marr0016" [dir=none,weight=1] ; "018" -> "marr0016" [dir=none,weight=1] ; "marr0016" -> "026" [dir=none, weight=2] ; "marr0017" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "026" -> "marr0017" [dir=none,weight=1] ; "027" -> "marr0017" [dir=none,weight=1] ; "marr0017" -> "028" [dir=none, weight=2] ; } socnetv-0.90/nets/10actors-colors.dot0000644000175000017500000000022011261401574017764 0ustar dimitrisdimitrisdigraph mydot { node [color=red, shape=box]; a -> b -> c ->d node [color=pink, shape=circle]; d->e->a->f->j->k->l->o [weight=1, color=gray]; } socnetv-0.90/nets/4actors-line-properties.dot0000644000175000017500000000044111261401574021534 0ustar dimitrisdimitris graph graphname { // The label attribute can be used to change the label of a node a [label="Foo"]; // Here, the node shape is changed. b [shape=box]; // These edges both have different line properties a -- b -- c [color=blue]; b -- d [style=dotted]; }socnetv-0.90/nets/Freemans_EIES-2_n48.lst0000644000175000017500000001432511325025576020262 0ustar dimitrisdimitris1 2 4 1 3 2 1 6 2 1 8 2 1 10 2 1 11 2 1 13 3 1 14 3 1 18 2 1 19 3 1 20 2 1 21 3 1 22 2 1 23 2 1 24 2 1 25 2 1 26 3 1 27 2 1 31 2 1 32 2 1 33 2 1 35 2 1 36 2 1 37 2 1 38 2 1 39 3 1 40 2 1 41 2 1 42 3 1 43 2 1 44 4 1 45 3 1 46 3 2 1 4 2 3 2 2 6 2 2 8 1 2 10 2 2 11 2 2 13 3 2 14 4 2 18 2 2 19 3 2 21 2 2 22 2 2 23 2 2 24 2 2 25 2 2 26 2 2 27 2 2 32 2 2 33 2 2 35 2 2 36 2 2 37 2 2 38 2 2 39 2 2 40 2 2 41 2 2 42 2 2 43 3 2 44 4 2 45 4 2 46 2 3 1 3 3 2 1 3 6 4 3 8 1 3 13 2 3 18 2 3 19 4 3 20 4 3 22 4 3 23 1 3 24 2 3 25 2 3 26 2 3 27 1 3 31 1 3 32 2 3 33 2 3 35 2 3 36 4 3 37 2 3 39 2 3 41 1 3 42 1 3 43 1 6 1 2 6 2 2 6 3 2 6 8 2 6 10 2 6 13 2 6 14 2 6 18 3 6 19 2 6 20 2 6 21 1 6 22 2 6 23 2 6 24 2 6 26 2 6 27 4 6 31 1 6 32 2 6 33 2 6 35 2 6 36 2 6 37 2 6 38 2 6 39 2 6 40 2 6 41 2 6 42 2 6 43 2 6 44 2 6 46 2 8 1 3 8 6 2 8 13 2 8 14 3 8 18 2 8 19 2 8 20 1 8 22 2 8 23 1 8 24 2 8 25 2 8 27 1 8 32 2 8 33 2 8 35 2 8 37 2 8 38 1 8 40 1 8 41 2 8 42 2 8 44 2 8 45 2 10 1 4 10 2 2 10 13 3 10 18 2 10 19 2 10 22 2 10 23 2 10 24 2 10 27 2 10 31 2 10 33 2 10 37 3 10 39 2 10 40 2 10 41 2 10 42 3 10 44 4 10 45 2 10 46 3 11 1 3 11 2 2 11 3 1 11 13 2 11 14 2 11 19 1 11 21 3 11 41 2 13 1 3 13 2 2 13 3 2 13 6 2 13 8 2 13 10 2 13 11 1 13 14 1 13 18 2 13 19 4 13 20 1 13 21 2 13 22 2 13 23 2 13 24 2 13 25 2 13 26 2 13 27 2 13 32 2 13 33 2 13 35 2 13 36 2 13 37 2 13 38 2 13 40 2 13 41 1 13 42 2 13 43 2 13 44 2 13 45 4 13 46 2 14 1 3 14 2 4 14 8 2 14 13 2 14 19 2 14 21 2 14 22 1 14 24 1 14 25 2 14 33 2 14 35 2 14 40 3 14 42 1 14 44 2 14 45 4 14 46 2 18 1 3 18 3 2 18 6 3 18 8 2 18 11 1 18 13 2 18 14 1 18 19 2 18 20 3 18 21 2 18 22 1 18 23 2 18 24 2 18 25 2 18 26 2 18 27 2 18 31 2 18 32 4 18 33 2 18 35 2 18 36 4 18 37 2 18 38 2 18 40 2 18 41 2 18 42 3 18 43 2 18 44 2 18 45 1 19 1 3 19 2 2 19 3 2 19 6 2 19 8 2 19 10 2 19 13 4 19 14 2 19 18 2 19 21 2 19 22 2 19 23 2 19 24 2 19 25 2 19 26 2 19 27 2 19 31 2 19 32 2 19 33 2 19 35 2 19 36 1 19 37 2 19 38 2 19 40 2 19 41 2 19 42 2 19 44 3 19 45 3 19 46 2 20 1 2 20 3 1 20 6 2 20 11 1 20 13 1 20 18 3 20 22 2 20 23 1 20 24 1 20 27 2 20 31 2 20 32 3 20 33 2 20 35 1 20 36 1 20 37 1 20 38 2 20 41 1 20 43 1 20 44 2 20 45 2 20 46 2 21 1 3 21 2 3 21 3 1 21 6 2 21 8 1 21 11 3 21 13 3 21 14 2 21 18 1 21 19 2 21 22 1 21 23 1 21 24 2 21 26 2 21 27 2 21 31 1 21 32 1 21 33 2 21 35 2 21 36 1 21 39 2 21 40 4 21 41 2 21 42 2 21 43 2 21 44 3 21 45 3 22 1 3 22 2 2 22 3 4 22 6 3 22 8 3 22 13 3 22 18 2 22 19 2 22 20 3 22 21 2 22 23 3 22 24 4 22 25 4 22 26 2 22 27 3 22 31 3 22 32 3 22 33 3 22 35 4 22 36 3 22 37 3 22 38 3 22 39 2 22 40 2 22 41 3 22 42 4 22 43 3 22 44 3 22 45 2 22 46 2 23 1 3 23 2 2 23 3 2 23 6 3 23 8 1 23 13 2 23 14 2 23 18 2 23 19 2 23 20 2 23 22 3 23 24 2 23 25 2 23 27 2 23 31 4 23 32 1 23 33 2 23 35 2 23 36 2 23 37 2 23 38 2 23 40 1 23 42 3 23 44 3 23 45 1 24 1 2 24 2 2 24 3 2 24 6 2 24 8 3 24 10 2 24 13 3 24 14 1 24 18 2 24 19 2 24 22 3 24 23 2 24 25 2 24 27 2 24 31 2 24 32 2 24 33 4 24 35 3 24 37 2 24 38 2 24 39 2 24 40 1 24 41 1 24 42 2 24 44 2 24 45 2 24 46 2 25 1 3 25 2 2 25 3 3 25 6 1 25 8 2 25 13 3 25 14 2 25 18 1 25 19 3 25 20 1 25 21 1 25 22 3 25 23 2 25 24 3 25 26 1 25 27 1 25 32 3 25 33 3 25 35 3 25 37 2 25 39 1 25 40 2 25 41 1 25 42 2 25 43 2 25 44 2 25 45 2 25 46 1 26 1 4 26 2 2 26 3 2 26 11 1 26 13 2 26 19 2 26 21 1 26 22 2 26 39 2 26 40 2 26 42 2 26 43 2 26 44 4 26 45 1 26 46 2 27 1 2 27 3 2 27 6 4 27 8 1 27 13 2 27 18 2 27 20 2 27 22 2 27 23 2 27 24 1 27 32 2 27 33 2 27 35 3 27 36 2 27 37 2 27 38 2 27 39 2 27 41 2 27 42 2 27 43 1 27 44 2 27 46 2 31 1 1 31 3 2 31 6 1 31 8 1 31 18 2 31 19 2 31 20 2 31 22 2 31 23 2 31 24 2 31 32 1 31 35 3 31 36 1 31 37 3 31 38 2 31 42 1 32 1 2 32 2 2 32 3 2 32 6 2 32 8 2 32 13 2 32 18 3 32 19 2 32 20 2 32 22 3 32 23 1 32 24 2 32 25 2 32 27 2 32 31 1 32 33 3 32 35 4 32 36 2 32 37 3 32 38 3 32 41 2 32 42 3 32 43 1 33 1 3 33 2 3 33 3 2 33 6 2 33 8 2 33 13 3 33 14 1 33 18 2 33 19 3 33 20 2 33 22 2 33 23 3 33 24 4 33 25 3 33 27 2 33 31 2 33 32 2 33 35 3 33 36 2 33 37 2 33 38 3 33 40 1 33 41 2 33 42 2 33 43 1 33 45 1 35 1 2 35 2 2 35 3 2 35 6 3 35 13 2 35 14 3 35 18 2 35 19 2 35 22 3 35 23 2 35 24 3 35 25 2 35 27 3 35 32 3 35 33 3 35 37 4 35 38 2 35 41 2 35 42 4 35 45 2 36 1 3 36 2 2 36 3 4 36 6 3 36 13 2 36 18 4 36 20 1 36 22 3 36 23 1 36 24 1 36 27 3 36 31 1 36 32 2 36 33 1 36 35 1 36 37 2 36 38 2 36 41 2 36 42 3 36 43 2 36 44 2 36 46 2 37 1 3 37 2 2 37 3 2 37 6 2 37 8 3 37 10 2 37 13 3 37 14 2 37 18 2 37 19 3 37 20 2 37 21 2 37 22 3 37 23 2 37 24 3 37 25 2 37 26 2 37 27 2 37 31 4 37 32 3 37 33 3 37 35 4 37 36 2 37 38 3 37 40 2 37 41 3 37 42 3 37 43 2 37 44 2 37 45 2 37 46 2 38 1 2 38 2 2 38 3 2 38 6 3 38 8 1 38 13 3 38 18 3 38 19 2 38 20 2 38 22 3 38 23 2 38 24 3 38 27 2 38 31 3 38 32 3 38 33 3 38 35 3 38 36 3 38 37 3 38 41 1 38 42 2 39 1 4 39 2 1 39 3 2 39 6 1 39 8 1 39 11 1 39 13 1 39 18 1 39 19 1 39 20 1 39 21 2 39 22 2 39 23 1 39 24 1 39 26 3 39 27 2 39 32 1 39 33 1 39 35 2 39 36 1 39 37 2 39 38 1 39 41 2 39 42 2 39 44 3 39 46 1 40 1 3 40 2 2 40 3 2 40 6 2 40 8 2 40 10 2 40 13 3 40 14 3 40 18 2 40 19 2 40 21 4 40 22 1 40 23 2 40 24 2 40 25 2 40 26 2 40 27 2 40 32 1 40 33 2 40 35 2 40 36 1 40 37 2 40 42 2 40 43 2 40 44 2 40 45 2 40 46 2 41 1 3 41 2 2 41 6 3 41 13 2 41 18 1 41 19 1 41 21 2 41 22 2 41 23 2 41 24 2 41 27 3 41 32 2 41 33 2 41 35 3 41 37 2 41 38 1 41 39 2 41 40 1 41 42 2 41 44 2 41 45 2 41 46 2 42 1 3 42 2 2 42 3 2 42 6 3 42 8 2 42 10 2 42 13 3 42 18 3 42 19 2 42 20 3 42 21 2 42 22 4 42 23 3 42 24 2 42 25 2 42 26 2 42 27 2 42 32 3 42 33 2 42 35 4 42 36 2 42 37 4 42 39 2 42 40 2 42 41 2 42 43 2 42 44 3 42 45 2 42 46 4 43 1 3 43 2 3 43 3 1 43 6 2 43 10 2 43 13 3 43 18 2 43 19 2 43 21 2 43 22 2 43 24 2 43 25 2 43 26 2 43 27 2 43 32 2 43 33 2 43 35 2 43 37 2 43 38 2 43 40 3 43 41 2 43 42 3 43 44 3 43 45 3 43 46 2 44 1 4 44 2 4 44 3 2 44 6 2 44 8 2 44 10 3 44 11 2 44 13 2 44 14 2 44 18 2 44 19 3 44 20 2 44 21 3 44 22 2 44 23 3 44 24 2 44 25 2 44 26 3 44 27 2 44 31 2 44 32 2 44 33 2 44 35 2 44 36 2 44 37 2 44 38 2 44 39 2 44 40 2 44 41 2 44 42 3 44 43 2 44 45 4 44 46 3 45 1 4 45 2 4 45 6 2 45 8 2 45 10 2 45 13 4 45 14 4 45 18 2 45 19 3 45 21 2 45 22 1 45 24 3 45 25 2 45 32 1 45 33 2 45 35 3 45 36 1 45 37 1 45 39 2 45 40 2 45 41 1 45 42 3 45 43 2 45 44 4 45 46 3 46 1 3 46 2 2 46 6 1 46 8 1 46 10 2 46 13 3 46 14 2 46 18 2 46 19 2 46 24 2 46 25 2 46 27 1 46 37 2 46 42 4 46 44 3 46 45 3socnetv-0.90/nets/network.dl0000644000175000017500000000065211261401574016344 0ustar dimitrisdimitrisDL N=4 FORMAT = FULLMATRIX DIAGONAL PRESENT LABELS: On the normalization and visualization of author co-citation data:Salton's cosine versus the Jaccard index Caveats for the use of citation indicators in research and journalevaluations Should co-occurrence data be normalized? A rejoinder Home on the range - What and where is the middle in science andtechnology studies? DATA: 0 0 0.158114 0 0.201234 0 1 0 1 0 0 0 0.1 1 1 0socnetv-0.90/nets/Freemans_EIES-1_n48.lst0000644000175000017500000001226011325025576020255 0ustar dimitrisdimitris1 2 4 1 3 2 1 6 2 1 8 2 1 10 2 1 11 2 1 13 2 1 14 2 1 18 2 1 19 2 1 20 2 1 21 2 1 22 2 1 23 2 1 24 2 1 25 2 1 26 3 1 27 2 1 31 2 1 32 2 1 33 2 1 35 2 1 36 2 1 37 2 1 38 2 1 39 3 1 40 2 1 41 2 1 42 2 1 43 2 1 44 4 1 45 2 1 46 2 2 1 4 2 3 2 2 8 1 2 11 3 2 13 3 2 14 4 2 18 1 2 19 3 2 21 2 2 22 2 2 23 2 2 24 3 2 25 2 2 27 1 2 32 2 2 33 3 2 35 2 2 37 2 2 40 2 2 41 1 2 42 2 2 43 3 2 44 4 2 45 4 2 46 2 3 1 3 3 2 1 3 6 4 3 8 1 3 13 2 3 18 2 3 19 4 3 20 4 3 22 4 3 23 1 3 24 2 3 25 2 3 26 2 3 27 1 3 31 1 3 32 2 3 33 2 3 35 2 3 36 4 3 37 2 3 39 2 3 41 1 3 42 1 3 43 1 6 1 2 6 3 2 6 8 2 6 13 2 6 14 2 6 18 2 6 19 2 6 20 2 6 21 2 6 22 2 6 23 2 6 24 1 6 27 4 6 31 1 6 32 2 6 33 2 6 35 2 6 36 2 6 37 2 6 38 2 6 40 2 6 41 2 6 42 2 6 44 2 8 1 3 8 6 2 8 13 2 8 14 3 8 18 2 8 19 2 8 20 1 8 22 2 8 23 1 8 24 2 8 25 2 8 27 1 8 32 2 8 33 2 8 35 2 8 37 2 8 38 1 8 40 1 8 41 2 8 42 2 8 44 2 8 45 2 10 1 3 10 13 2 10 22 2 10 24 1 10 27 2 10 33 1 10 40 2 10 42 2 10 44 2 11 1 3 11 2 2 11 3 1 11 13 2 11 14 2 11 19 1 11 21 3 11 41 2 13 1 2 13 2 2 13 3 2 13 6 2 13 8 2 13 14 1 13 19 2 13 21 2 13 22 2 13 23 2 13 24 2 13 25 2 13 27 1 13 32 2 13 33 2 13 35 1 13 36 1 13 37 2 13 38 2 13 40 2 13 42 2 13 43 2 14 1 3 14 2 4 14 8 2 14 13 2 14 19 1 14 21 2 14 22 1 14 33 1 14 35 3 14 40 3 14 45 4 18 1 2 18 2 1 18 3 3 18 6 3 18 8 2 18 11 1 18 13 2 18 14 2 18 19 2 18 20 3 18 22 1 18 23 2 18 24 2 18 25 2 18 27 2 18 31 2 18 32 3 18 33 2 18 35 2 18 36 4 18 37 2 18 38 2 18 41 2 18 42 2 18 43 2 19 1 1 19 2 3 19 3 2 19 6 1 19 8 1 19 13 3 19 14 1 19 18 1 19 22 2 19 23 1 19 24 2 19 25 2 19 27 1 19 31 2 19 32 2 19 33 2 19 35 2 19 36 1 19 37 2 19 38 2 19 40 2 19 41 1 19 42 1 19 44 1 20 1 1 20 3 1 20 6 2 20 13 1 20 18 3 20 22 2 20 24 1 20 27 2 20 32 2 20 33 2 20 35 2 20 38 2 20 42 2 20 43 2 21 1 3 21 2 3 21 3 1 21 6 2 21 8 1 21 11 3 21 13 3 21 14 2 21 18 1 21 19 1 21 22 1 21 23 1 21 24 1 21 27 2 21 31 1 21 32 1 21 33 1 21 35 1 21 36 1 21 39 2 21 40 4 21 41 2 21 42 2 21 43 2 21 44 3 21 45 3 22 1 3 22 2 2 22 3 4 22 6 2 22 8 3 22 13 3 22 14 2 22 18 1 22 19 2 22 20 3 22 21 1 22 23 3 22 24 4 22 25 3 22 26 2 22 27 3 22 31 2 22 32 3 22 33 3 22 35 4 22 36 3 22 37 3 22 38 3 22 39 2 22 40 1 22 41 2 22 42 4 22 43 3 22 44 2 22 46 1 23 1 3 23 2 2 23 3 2 23 6 3 23 8 1 23 11 1 23 13 2 23 14 2 23 18 2 23 19 2 23 20 1 23 22 3 23 24 2 23 25 2 23 27 2 23 31 4 23 32 1 23 33 2 23 35 1 23 36 2 23 37 2 23 38 2 23 42 3 23 44 2 23 46 1 24 1 2 24 2 2 24 3 2 24 6 1 24 8 3 24 13 3 24 14 1 24 19 2 24 22 3 24 23 2 24 25 3 24 27 1 24 31 2 24 32 2 24 33 4 24 35 3 24 37 3 24 38 2 24 42 2 25 1 3 25 2 2 25 3 3 25 8 2 25 13 3 25 14 2 25 18 1 25 19 2 25 22 3 25 23 2 25 24 2 25 27 1 25 32 3 25 33 3 25 35 3 25 37 2 25 41 1 25 42 1 25 44 2 25 46 1 26 1 4 26 2 1 26 3 2 26 19 2 26 22 2 26 23 1 26 27 1 26 37 1 26 39 2 26 40 2 26 41 1 26 42 2 26 43 2 26 44 4 26 46 2 27 1 2 27 3 2 27 6 4 27 8 1 27 13 2 27 18 2 27 20 2 27 22 2 27 23 2 27 24 1 27 32 1 27 33 2 27 35 3 27 36 2 27 37 2 27 38 2 27 39 2 27 41 2 27 42 2 27 43 1 27 44 2 27 46 2 31 1 1 31 3 2 31 6 1 31 8 1 31 18 2 31 19 2 31 20 2 31 22 2 31 23 2 31 24 2 31 32 1 31 35 3 31 36 1 31 37 3 31 38 2 31 42 1 32 1 2 32 2 2 32 3 2 32 6 2 32 8 2 32 13 2 32 18 3 32 19 2 32 20 2 32 22 3 32 23 1 32 24 2 32 25 2 32 27 2 32 31 1 32 33 3 32 35 4 32 36 2 32 37 3 32 38 3 32 41 2 32 42 3 32 43 1 33 1 3 33 2 3 33 3 2 33 6 2 33 8 2 33 13 3 33 14 1 33 18 2 33 19 3 33 20 2 33 22 2 33 23 3 33 24 4 33 25 3 33 27 2 33 31 2 33 32 2 33 35 3 33 36 2 33 37 2 33 38 3 33 40 1 33 41 2 33 42 2 33 43 1 33 45 1 35 1 2 35 2 2 35 3 2 35 6 3 35 13 2 35 14 3 35 18 2 35 19 2 35 22 3 35 24 3 35 25 2 35 27 3 35 32 3 35 33 3 35 37 4 35 38 2 35 41 2 35 42 4 36 1 2 36 3 4 36 6 3 36 18 4 36 20 1 36 22 2 36 23 1 36 24 1 36 27 2 36 31 1 36 32 2 36 33 2 36 35 1 36 37 1 36 38 2 36 41 1 36 42 2 37 1 2 37 2 2 37 3 2 37 6 2 37 8 2 37 13 3 37 14 2 37 18 2 37 19 2 37 20 2 37 22 3 37 23 2 37 24 3 37 25 2 37 27 3 37 31 4 37 32 3 37 33 3 37 35 4 37 36 2 37 38 3 37 40 2 37 41 2 37 42 4 38 1 2 38 2 2 38 3 2 38 6 2 38 8 1 38 13 2 38 18 3 38 19 2 38 20 2 38 22 3 38 23 2 38 24 3 38 27 2 38 31 2 38 32 4 38 33 3 38 35 3 38 36 3 38 37 4 38 41 1 39 1 4 39 2 1 39 3 2 39 6 1 39 8 1 39 11 1 39 13 1 39 18 1 39 19 1 39 20 1 39 21 2 39 22 2 39 23 1 39 24 1 39 26 3 39 27 2 39 32 1 39 33 1 39 35 2 39 36 1 39 37 2 39 38 1 39 41 2 39 42 2 39 44 3 39 46 1 40 1 2 40 2 2 40 3 1 40 6 2 40 8 1 40 13 2 40 14 2 40 18 1 40 19 1 40 21 4 40 22 1 40 23 1 40 24 1 40 25 1 40 27 1 40 32 1 40 33 1 40 43 2 41 1 3 41 2 2 41 6 3 41 18 1 41 19 1 41 21 1 41 22 2 41 23 2 41 24 2 41 27 3 41 32 2 41 33 2 41 35 3 41 37 2 41 38 1 41 39 2 41 40 1 41 42 2 41 44 2 42 1 2 42 2 2 42 3 2 42 6 2 42 8 2 42 13 2 42 18 2 42 20 2 42 22 3 42 23 2 42 24 2 42 26 2 42 27 2 42 32 2 42 33 2 42 35 4 42 36 2 42 37 3 42 39 2 42 40 2 42 41 2 42 43 2 42 44 2 42 46 3 43 1 3 43 2 4 43 3 1 43 13 4 43 18 2 43 21 2 43 22 2 43 24 2 43 25 2 43 26 2 43 27 2 43 32 2 43 33 2 43 35 2 43 40 2 43 41 1 43 42 2 43 45 2 43 46 1 44 1 4 44 2 4 44 3 2 44 6 2 44 8 2 44 10 2 44 11 1 44 13 2 44 14 2 44 19 2 44 21 2 44 22 2 44 23 2 44 24 1 44 25 2 44 26 3 44 27 2 44 33 1 44 35 2 44 36 2 44 37 2 44 39 2 44 40 2 44 41 2 44 42 2 44 43 2 44 46 1 45 1 3 45 2 3 45 6 1 45 8 2 45 13 3 45 14 4 45 19 1 45 21 2 45 22 1 45 24 1 45 27 1 45 32 1 45 33 1 45 40 2 45 43 3 45 44 3 45 46 1 46 1 2 46 2 2 46 42 3socnetv-0.90/nets/5-actors-plain-list.lst0000644000175000017500000000002711320650146020556 0ustar dimitrisdimitris1 2 3 4 2 3 4 5 3 4 5 1socnetv-0.90/nets/jin1-sm.txt0000644000175000017500000000157311324027624016354 0ustar dimitrisdimitris0 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 socnetv-0.90/nets/6actors-plain.dot0000644000175000017500000000014411261401574017520 0ustar dimitrisdimitrisdigraph mydot { "test-1" -> "test-2" -> "test-3" -> "test-4" -> "test-5" -> "test-6" -> "test-1"; } socnetv-0.90/nets/jin4-sm.txt0000644000175000017500000000040111324027624016344 0ustar dimitrisdimitris0 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 socnetv-0.90/nets/4-actors-sm.csv0000644000175000017500000000003711320621534017111 0ustar dimitrisdimitris0,1,1,2 1,0,2,1 0,0,0,1 1,0,0,0socnetv-0.90/nets/Freemans_EIES-3-messages_n48.lst0000644000175000017500000000714211325025576022067 0ustar dimitrisdimitris1 1 24 1 2 488 1 3 28 1 4 65 1 5 20 1 6 65 1 7 45 1 8 346 1 9 82 1 10 52 1 11 177 1 12 28 1 13 24 1 14 49 1 15 81 1 16 77 1 17 77 1 18 73 1 19 33 1 20 31 1 21 22 1 22 46 1 23 31 1 24 128 1 25 38 1 26 89 1 27 95 1 28 25 1 29 388 1 30 71 1 31 212 1 32 185 2 1 364 2 2 6 2 3 17 2 4 17 2 5 15 2 7 30 2 8 20 2 9 35 2 10 20 2 11 22 2 12 15 2 13 15 2 14 15 2 15 15 2 16 50 2 17 25 2 18 8 2 20 15 2 21 15 2 22 15 2 23 15 2 25 15 2 26 15 2 27 10 2 28 24 2 29 89 2 30 23 2 31 163 2 32 39 3 1 4 3 2 5 3 8 5 4 1 52 4 2 30 4 4 4 4 6 2 4 8 32 4 9 21 4 10 34 4 11 9 4 16 5 4 17 4 4 18 2 4 19 35 4 24 12 4 27 12 4 28 5 4 29 20 4 30 4 4 31 19 4 32 33 5 1 26 5 2 4 5 3 4 5 4 4 5 6 4 5 7 8 5 8 4 5 9 4 5 10 4 5 11 4 5 12 4 5 13 4 5 14 4 5 15 4 5 16 4 5 17 4 5 18 4 5 19 4 5 21 4 5 22 8 5 23 4 5 24 14 5 25 4 5 27 4 5 29 4 5 30 7 5 31 4 5 32 4 6 1 72 6 2 23 6 4 2 6 6 34 6 8 16 6 10 7 6 11 15 6 15 8 6 16 7 6 17 6 6 24 14 6 27 7 6 28 3 6 29 34 6 30 3 6 31 22 7 1 14 7 31 6 8 1 239 8 2 82 8 3 5 8 4 37 8 5 3 8 6 34 8 7 5 8 8 10 8 9 12 8 10 18 8 11 164 8 12 18 8 16 30 8 17 53 8 18 27 8 19 20 8 20 4 8 22 5 8 23 4 8 24 55 8 26 9 8 27 34 8 29 146 8 30 216 8 31 88 8 32 288 9 1 24 9 2 25 9 4 2 9 8 8 9 9 16 9 11 15 9 13 10 9 17 5 9 27 15 9 29 10 9 31 30 9 32 44 10 1 43 10 2 15 10 4 32 10 6 12 10 8 14 10 10 5 10 11 25 10 12 2 10 16 10 10 17 10 10 19 20 10 20 15 10 22 5 10 23 20 10 24 29 10 26 4 10 27 10 10 29 47 10 30 6 10 31 22 10 32 19 11 1 178 11 2 36 11 4 11 11 6 19 11 7 10 11 8 172 11 9 39 11 10 28 11 11 29 11 13 4 11 16 23 11 17 15 11 18 24 11 21 8 11 24 29 11 25 10 11 26 11 11 27 22 11 29 46 11 31 119 11 32 34 12 2 5 12 8 5 12 12 3 12 19 5 12 29 53 12 31 5 12 32 9 13 1 5 13 11 5 13 31 5 14 1 12 14 3 9 14 14 2 14 16 12 14 19 5 14 29 35 14 31 8 15 1 120 15 6 4 15 12 5 15 15 78 15 27 8 15 29 58 15 31 32 16 1 58 16 2 25 16 4 10 16 8 20 16 10 5 16 11 10 16 14 5 16 16 15 16 17 10 16 21 5 16 24 5 16 29 35 16 31 10 17 1 63 17 2 18 17 3 9 17 4 7 17 6 6 17 8 36 17 10 5 17 11 9 17 12 5 17 14 5 17 16 5 17 20 5 17 21 2 17 27 15 17 29 10 17 30 9 17 31 15 17 32 9 18 1 58 18 2 8 18 3 5 18 4 4 18 8 4 18 10 5 18 11 18 18 18 4 18 27 20 18 29 8 18 30 10 18 31 48 19 1 5 19 2 5 19 4 25 19 8 10 19 14 5 19 19 5 19 23 5 19 31 10 20 21 4 20 29 4 21 1 9 21 11 3 21 16 5 21 29 5 22 1 10 22 24 40 22 29 15 22 32 5 23 1 5 23 2 5 23 3 5 23 10 19 23 19 5 23 29 14 23 31 5 24 1 89 24 2 17 24 3 4 24 4 14 24 5 14 24 6 18 24 7 8 24 8 41 24 9 4 24 10 19 24 11 31 24 12 4 24 13 4 24 14 9 24 15 4 24 16 14 24 17 4 24 18 9 24 19 4 24 20 4 24 21 4 24 22 58 24 23 4 24 24 5 24 25 18 24 26 14 24 27 9 24 28 4 24 29 156 24 30 4 24 31 56 24 32 10 25 1 32 25 2 5 25 14 15 25 22 10 25 24 23 25 25 10 25 30 9 25 31 15 26 1 35 26 2 5 26 10 5 26 29 10 26 31 13 27 1 50 27 2 28 27 4 13 27 8 19 27 9 29 27 10 5 27 11 8 27 13 33 27 15 4 27 17 10 27 18 15 27 24 10 27 28 3 27 29 32 27 31 13 27 32 33 28 1 9 28 2 6 28 6 3 28 28 3 28 32 6 29 1 559 29 2 132 29 3 5 29 4 24 29 5 21 29 6 29 29 8 155 29 9 15 29 10 98 29 11 69 29 12 89 29 13 37 29 14 76 29 15 80 29 16 63 29 17 15 29 18 4 29 19 9 29 20 18 29 21 43 29 22 108 29 23 29 29 24 218 29 26 15 29 27 66 29 29 6 29 30 14 29 31 91 29 32 126 30 1 39 30 2 21 30 4 6 30 5 3 30 6 3 30 8 140 30 10 7 30 12 2 30 17 9 30 18 5 30 27 2 30 29 18 30 30 2 30 31 20 30 32 8 31 1 82 31 2 125 31 3 10 31 4 22 31 5 10 31 6 15 31 7 18 31 8 70 31 9 35 31 10 23 31 11 114 31 12 20 31 13 16 31 14 15 31 15 24 31 16 30 31 17 28 31 18 49 31 19 30 31 20 5 31 21 5 31 22 15 31 23 8 31 24 53 31 25 25 31 26 8 31 27 21 31 28 8 31 29 65 31 30 28 31 32 67 32 1 239 32 2 99 32 4 27 32 5 3 32 8 268 32 9 101 32 10 18 32 11 35 32 12 4 32 17 7 32 22 14 32 24 5 32 27 50 32 28 6 32 29 71 32 30 7 32 31 107 32 32 219socnetv-0.90/nets/mexico-power-network.lst0000644000175000017500000000050011424261026021150 0ustar dimitrisdimitris18 8 10 23 21 19 11 21 29 5 9 10 23 8 9 18 11 4 7 6 8 20 5 21 5 4 29 20 7 6 8 9 26 21 6 5 7 4 20 21 8 7 4 6 5 8 20 21 9 5 8 23 29 20 21 11 10 8 18 23 4 5 6 7 21 24 26 25 9 10 37 20 10 18 29 8 11 9 20 25 26 11 19 23 9 10 25 21 36 20 4 5 6 7 8 9 10 24 8 26 26 5 8 24 10 21 19 4 5 6 7 8 9 11 18 36 37 11 37 8 36 25 10 11 8 socnetv-0.90/man/0000755000175000017500000000000011455100156014126 5ustar dimitrisdimitrissocnetv-0.90/man/socnetv.1.gz0000755000175000017500000000425611330246503016321 0ustar dimitrisdimitrisV\Ksocnetv.1X]o6}@>l`=3Imd$BKĆb{)N}hjI8RpyϪ{NV.q.4^hB ڟLW^z>M͇hRMwHVފ\=]ܮIiO4ɖ1Vgx3W?6oUJVr|_\Ow`t`J&/fmSD7覰{Y8Oo-8۱g0"\hh:]8Nk+?&ҫ SڙX/zG59!jE[#lS;O֩`mhq]`7a/cF׫-U|?[~T]a6.!\ dr_!3m $>vam5U0 ޵G vrM0F:"|haBTMm:Dj$)#1;m-v.[QPgdWJ^!ņS vA7:`t[jsxjC!(o^1V!e-G!UV^;RLxEy|=Vٚ k,t8BM'ftysgqx wٛ}S1*zWH,^\5^Z|Zo.f dH!SHaAxM,*נ ݢ%™t96+'_LhQdb#Zph;zثHIHT]G,-ރ} S!&Z\9a[ 0Aۢӌ)KnSo*N4?ugy$|?␓D"'0tQ8'V  efTȿӺwmXE^X<'  p+&Q7gtѵ/ pHkPSSRDƘae8>VhДc2=7{O(-Qd.=(Dvy{뜬[]3|ʗ:7_XAjdChSЈ ۤ* d12SB^%?pc4{5`c/10e ˏ|!y:ͪLWJ}ύ B,\@84nj*-?rMִA'"3Zp u et:J:QJY/~׮ z2aiV8>ev}K0,DSuQyЇ,1.Xw#A_0}+cIhui!SՅ~aa"ؼožW9!lh0i، 54R)\+XʛD P \ 57d u,0U[B&KkB!(dkmx48HZbė{VHy`> uX*`sQ)$ aUa$0Vax6"q%Vr ?n`)3:V?S# R$CQ\dl݋0vQ 纲zcVr}>=\(< +H߽ A^};, }NMM%UHHqÛE 6+'|Ñz:+ c2Zј8YXZ7*]vLV1?RY< H"/ʪZAP?Z!̏IۛNs[`ҺUm쌟3&ZU0< A&Dz[廆wp"PQ֨ i](̈́}sv!V3+81 N2-rkVa+0LfP%".It*0ᦹ2M2X^->-OY߽H~Xq]48H搹$ (ӏJ|=^>|X9Yb{yBJ.ҦLx jߛ {7k!)'V#ܱ'D1m63΍9C5ϩo?>-/#G{dP'℁.9ź SoL- U׼k lN.2= 4.4], ac_qtlib_version, [ AC_TRY_LINK([#include "Qt/qglobal.h"], [ #if QT_VERSION < 0x040400 #error Qt library 4.4 or greater required. #endif ], ac_qtlib_version="yes", [ echo "no; Qt 4.4 or greater is required" exit 1 ]) ]) # Check for IEEE 32bit float optimizations. AC_CACHE_CHECK([for IEEE 32bit float optimizations], ac_float32, [ AC_TRY_RUN([ int main() { return (sizeof(float) == 4 ? 0 : 1); } ], ac_float32="yes", ac_float32="no") ]) if test "x$ac_float32" = "xyes"; then AC_DEFINE(CONFIG_FLOAT32, 1, [Define if IEEE 32bit float optimizations are enabled.]) fi # Check for SSE optimization. if test "x$ac_sse" = "xyes"; then ac_sse_cflags="-msse -mfpmath=sse -ffast-math" CFLAGS="$ac_sse_cflags $CFLAGS" CPPFLAGS="$ac_sse_cflags $CPPFLAGS" AC_CACHE_CHECK([for SSE optimization], ac_sse_check, [ AC_TRY_RUN([ #include #if !defined(__SSE__) #error SSE optimization disabled. #endif int main() { unsigned int a, b, c, d; __asm__ __volatile__ ("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (1)); return ((d & (1 << 25)) ? 0 : 1); } ], ac_sse_check="yes", ac_sse_check="no") ]) ac_sse=$ac_sse_check if test "x$ac_sse" = "xyes"; then ac_cflags="$ac_sse_cflags $ac_cflags" fi fi AC_SUBST(ac_cflags) # A common error message: ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel)." # Check for Qt qmake utility. AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path) if test "x$ac_qmake" = "xno"; then AC_MSG_ERROR([qmake $ac_errmsg]) fi AC_SUBST(ac_qmake) # Check for Qt moc utility. AC_PATH_PROG(ac_moc, moc, [no], $ac_path) if test "x$ac_moc" = "xno"; then AC_MSG_ERROR([moc $ac_errmsg]) fi AC_SUBST(ac_moc) # Check for Qt uic utility. AC_PATH_PROG(ac_uic, uic, [no], $ac_path) if test "x$ac_uic" = "xno"; then AC_MSG_ERROR([uic $ac_errmsg]) fi AC_SUBST(ac_uic) # Checks for libraries. AC_CHECK_LIB(m, main) AC_CHECK_LIB(X11, main) AC_CHECK_LIB(Xext, main) # Checks for header files. #AC_HEADER_STDC #AC_HEADER_SYS_WAIT #AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/stat.h unistd.h signal.h) AC_SUBST(ac_incpath) # Checks for typedefs, structures, and compiler characteristics. # AC_C_CONST # Checks for library functions. AC_CHECK_FUNCS(system) # Finally produce a configure header file and the makefiles. AC_OUTPUT # make clean > /dev/null 2>&1 # Output summary message echo echo " $PACKAGE_NAME $PACKAGE_VERSION" echo echo " Build target . . . . . . . . . . . . . . . . . . .: $ac_debug" echo echo " IEEE 32bit float optimizations . . . . . . . . . .: $ac_float32" echo " SSE optimization support (x86) . . . . . . . . . .: $ac_sse" echo echo " Install prefix . . . . . . . . . . . . . . . . . .: $ac_prefix" echo echo "Now type 'make', followed by 'make install' as root." echo socnetv-0.90/debug/0000755000175000017500000000000011325551614014446 5ustar dimitrisdimitrissocnetv-0.90/Makefile.Debug0000644000175000017500000004547611455000123016051 0ustar dimitrisdimitris############################################################################# # Makefile for building: socnetv # Generated by qmake (2.01a) (Qt 4.7.0) on: Tue Oct 12 09:29:39 2010 # Project: socnetv.pro # Template: app ############################################################################# ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_WEBKIT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -msse -mfpmath=sse -ffast-math -g -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -Isrc -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I/usr/include/qt4 -Idebug -I. LINK = g++ LFLAGS = LIBS = $(SUBLIBS) -L/usr/lib -lpthread -lQtWebKit -lQtXml -lQtGui -lQtNetwork -lQtCore AR = ar cqs RANLIB = QMAKE = /usr/bin/qmake-qt4 TAR = tar -cf COMPRESS = gzip -9f COPY = cp -f SED = sed COPY_FILE = $(COPY) COPY_DIR = $(COPY) -r STRIP = strip INSTALL_FILE = install -m 644 -p INSTALL_DIR = $(COPY_DIR) INSTALL_PROGRAM = install -m 755 -p DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p ####### Output directory OBJECTS_DIR = debug/ ####### Files SOURCES = src/backgrcircle.cpp \ src/graphicswidget.cpp \ src/edge.cpp \ src/edgeweight.cpp \ src/graph.cpp \ src/htmlviewer.cpp \ src/main.cpp \ src/mainwindow.cpp \ src/matrix.cpp \ src/node.cpp \ src/nodelabel.cpp \ src/nodenumber.cpp \ src/texteditor.cpp \ src/vertex.cpp \ src/parser.cpp \ src/filteredgesbyweightdialog.cpp \ src/webcrawlerdialog.cpp \ src/webcrawler.cpp \ src/datasetselectdialog.cpp debug/moc_backgrcircle.cpp \ debug/moc_graphicswidget.cpp \ debug/moc_edge.cpp \ debug/moc_graph.cpp \ debug/moc_htmlviewer.cpp \ debug/moc_mainwindow.cpp \ debug/moc_node.cpp \ debug/moc_texteditor.cpp \ debug/moc_vertex.cpp \ debug/moc_parser.cpp \ debug/moc_filteredgesbyweightdialog.cpp \ debug/moc_webcrawlerdialog.cpp \ debug/moc_webcrawler.cpp \ debug/moc_datasetselectdialog.cpp \ debug/qrc_src.cpp OBJECTS = debug/backgrcircle.o \ debug/graphicswidget.o \ debug/edge.o \ debug/edgeweight.o \ debug/graph.o \ debug/htmlviewer.o \ debug/main.o \ debug/mainwindow.o \ debug/matrix.o \ debug/node.o \ debug/nodelabel.o \ debug/nodenumber.o \ debug/texteditor.o \ debug/vertex.o \ debug/parser.o \ debug/filteredgesbyweightdialog.o \ debug/webcrawlerdialog.o \ debug/webcrawler.o \ debug/datasetselectdialog.o \ debug/moc_backgrcircle.o \ debug/moc_graphicswidget.o \ debug/moc_edge.o \ debug/moc_graph.o \ debug/moc_htmlviewer.o \ debug/moc_mainwindow.o \ debug/moc_node.o \ debug/moc_texteditor.o \ debug/moc_vertex.o \ debug/moc_parser.o \ debug/moc_filteredgesbyweightdialog.o \ debug/moc_webcrawlerdialog.o \ debug/moc_webcrawler.o \ debug/moc_datasetselectdialog.o \ debug/qrc_src.o DIST = /usr/share/qt4/mkspecs/common/g++.conf \ /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \ /usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/default_pre.prf \ /usr/share/qt4/mkspecs/features/debug.prf \ /usr/share/qt4/mkspecs/features/debug_and_release.prf \ /usr/share/qt4/mkspecs/features/default_post.prf \ /usr/share/qt4/mkspecs/features/build_pass.prf \ /usr/share/qt4/mkspecs/features/warn_on.prf \ /usr/share/qt4/mkspecs/features/unix/thread.prf \ /usr/share/qt4/mkspecs/features/qt.prf \ /usr/share/qt4/mkspecs/features/moc.prf \ /usr/share/qt4/mkspecs/features/resources.prf \ /usr/share/qt4/mkspecs/features/uic.prf \ /usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \ socnetv.pro QMAKE_TARGET = socnetv DESTDIR = TARGET = socnetv first: all ####### Implicit rules .SUFFIXES: .o .c .cpp .cc .cxx .C .cpp.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .cc.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .cxx.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .C.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .c.o: $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" ####### Build rules all: Makefile.Debug $(TARGET) $(TARGET): ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h ui_datasetselectdialog.h $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) qmake: FORCE @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug_and_release -o Makefile.Debug socnetv.pro dist: @$(CHK_DIR_EXISTS) debug/socnetv1.0.0 || $(MKDIR) debug/socnetv1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) debug/socnetv1.0.0/ && $(COPY_FILE) --parents src/backgrcircle.h src/graphicswidget.h src/edge.h src/edgeweight.h src/graph.h src/htmlviewer.h src/mainwindow.h src/matrix.h src/node.h src/nodelabel.h src/nodenumber.h src/texteditor.h src/vertex.h src/parser.h src/filteredgesbyweightdialog.h src/webcrawlerdialog.h src/webcrawler.h src/datasetselectdialog.h debug/socnetv1.0.0/ && $(COPY_FILE) --parents src/src.qrc debug/socnetv1.0.0/ && $(COPY_FILE) --parents src/backgrcircle.cpp src/graphicswidget.cpp src/edge.cpp src/edgeweight.cpp src/graph.cpp src/htmlviewer.cpp src/main.cpp src/mainwindow.cpp src/matrix.cpp src/node.cpp src/nodelabel.cpp src/nodenumber.cpp src/texteditor.cpp src/vertex.cpp src/parser.cpp src/filteredgesbyweightdialog.cpp src/webcrawlerdialog.cpp src/webcrawler.cpp src/datasetselectdialog.cpp debug/socnetv1.0.0/ && $(COPY_FILE) --parents src/forms/filteredgesbyweightdialog.ui src/forms/webcrawlerdialog.ui src/forms/datasetselectdialog.ui debug/socnetv1.0.0/ && $(COPY_FILE) --parents translations/socnetv_es.ts debug/socnetv1.0.0/ && (cd `dirname debug/socnetv1.0.0` && $(TAR) socnetv1.0.0.tar socnetv1.0.0 && $(COMPRESS) socnetv1.0.0.tar) && $(MOVE) `dirname debug/socnetv1.0.0`/socnetv1.0.0.tar.gz . && $(DEL_FILE) -r debug/socnetv1.0.0 clean:compiler_clean -$(DEL_FILE) $(OBJECTS) -$(DEL_FILE) *~ core *.core ####### Sub-libraries distclean: clean -$(DEL_FILE) $(TARGET) -$(DEL_FILE) Makefile.Debug check: first mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all compiler_moc_header_make_all: debug/moc_backgrcircle.cpp debug/moc_graphicswidget.cpp debug/moc_edge.cpp debug/moc_graph.cpp debug/moc_htmlviewer.cpp debug/moc_mainwindow.cpp debug/moc_node.cpp debug/moc_texteditor.cpp debug/moc_vertex.cpp debug/moc_parser.cpp debug/moc_filteredgesbyweightdialog.cpp debug/moc_webcrawlerdialog.cpp debug/moc_webcrawler.cpp debug/moc_datasetselectdialog.cpp compiler_moc_header_clean: -$(DEL_FILE) debug/moc_backgrcircle.cpp debug/moc_graphicswidget.cpp debug/moc_edge.cpp debug/moc_graph.cpp debug/moc_htmlviewer.cpp debug/moc_mainwindow.cpp debug/moc_node.cpp debug/moc_texteditor.cpp debug/moc_vertex.cpp debug/moc_parser.cpp debug/moc_filteredgesbyweightdialog.cpp debug/moc_webcrawlerdialog.cpp debug/moc_webcrawler.cpp debug/moc_datasetselectdialog.cpp debug/moc_backgrcircle.cpp: src/backgrcircle.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/backgrcircle.h -o debug/moc_backgrcircle.cpp debug/moc_graphicswidget.cpp: src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/graphicswidget.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/graphicswidget.h -o debug/moc_graphicswidget.cpp debug/moc_edge.cpp: src/edge.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/edge.h -o debug/moc_edge.cpp debug/moc_graph.cpp: src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/graph.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/graph.h -o debug/moc_graph.cpp debug/moc_htmlviewer.cpp: src/htmlviewer.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/htmlviewer.h -o debug/moc_htmlviewer.cpp debug/moc_mainwindow.cpp: src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h \ src/mainwindow.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/mainwindow.h -o debug/moc_mainwindow.cpp debug/moc_node.cpp: src/node.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/node.h -o debug/moc_node.cpp debug/moc_texteditor.cpp: src/texteditor.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/texteditor.h -o debug/moc_texteditor.cpp debug/moc_vertex.cpp: src/vertex.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/vertex.h -o debug/moc_vertex.cpp debug/moc_parser.cpp: src/parser.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/parser.h -o debug/moc_parser.cpp debug/moc_filteredgesbyweightdialog.cpp: ui_filteredgesbyweightdialog.h \ src/filteredgesbyweightdialog.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/filteredgesbyweightdialog.h -o debug/moc_filteredgesbyweightdialog.cpp debug/moc_webcrawlerdialog.cpp: ui_webcrawlerdialog.h \ src/webcrawlerdialog.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/webcrawlerdialog.h -o debug/moc_webcrawlerdialog.cpp debug/moc_webcrawler.cpp: src/webcrawler.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/webcrawler.h -o debug/moc_webcrawler.cpp debug/moc_datasetselectdialog.cpp: ui_datasetselectdialog.h \ src/datasetselectdialog.h /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) src/datasetselectdialog.h -o debug/moc_datasetselectdialog.cpp compiler_rcc_make_all: debug/qrc_src.cpp compiler_rcc_clean: -$(DEL_FILE) debug/qrc_src.cpp debug/qrc_src.cpp: src/src.qrc \ src/images/dm.png \ src/images/colorize.png \ src/images/net2.png \ src/images/help.png \ src/images/exit.png \ src/images/zoomout.png \ src/images/diameter.png \ src/images/diamond.png \ src/images/avdistance.png \ src/images/open.png \ src/images/net3.png \ src/images/erdos.png \ src/images/symmetry.png \ src/images/gridlines.png \ src/images/nodes.png \ src/images/color.png \ src/images/box.png \ src/images/save.png \ src/images/connect.png \ src/images/socnetv.png \ src/images/sw.png \ src/images/zoomin.png \ src/images/forward.png \ src/images/remove.png \ src/images/line.png \ src/images/letters.png \ src/images/triangle.png \ src/images/net.png \ src/images/nodeout.png \ src/images/view.png \ src/images/symmetrize.png \ src/images/saved.png \ src/images/circular.png \ src/images/print.png \ src/images/node.png \ src/images/plines.png \ src/images/nodein.png \ src/images/distance.png \ src/images/nodecolor.png \ src/images/add.png \ src/images/sm.png \ src/images/net1.png \ src/images/webcrawler.png \ src/images/new.png \ src/images/clique.png \ src/images/find.png \ src/images/circle.png \ src/images/disconnect.png \ src/images/resize.png \ src/images/back.png \ src/images/home.png /usr/bin/rcc -name src src/src.qrc -o debug/qrc_src.cpp compiler_image_collection_make_all: qmake_image_collection.cpp compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp compiler_moc_source_make_all: compiler_moc_source_clean: compiler_uic_make_all: ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h ui_datasetselectdialog.h compiler_uic_clean: -$(DEL_FILE) ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h ui_datasetselectdialog.h ui_filteredgesbyweightdialog.h: src/forms/filteredgesbyweightdialog.ui /usr/bin/uic-qt4 src/forms/filteredgesbyweightdialog.ui -o ui_filteredgesbyweightdialog.h ui_webcrawlerdialog.h: src/forms/webcrawlerdialog.ui /usr/bin/uic-qt4 src/forms/webcrawlerdialog.ui -o ui_webcrawlerdialog.h ui_datasetselectdialog.h: src/forms/datasetselectdialog.ui /usr/bin/uic-qt4 src/forms/datasetselectdialog.ui -o ui_datasetselectdialog.h compiler_yacc_decl_make_all: compiler_yacc_decl_clean: compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean ####### Compile debug/backgrcircle.o: src/backgrcircle.cpp src/backgrcircle.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/backgrcircle.o src/backgrcircle.cpp debug/graphicswidget.o: src/graphicswidget.cpp src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/mainwindow.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h \ src/node.h \ src/edge.h \ src/nodenumber.h \ src/nodelabel.h \ src/backgrcircle.h \ src/edgeweight.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/graphicswidget.o src/graphicswidget.cpp debug/edge.o: src/edge.cpp src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/edge.h \ src/node.h \ src/edgeweight.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/edge.o src/edge.cpp debug/edgeweight.o: src/edgeweight.cpp src/edgeweight.h \ src/edge.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/edgeweight.o src/edgeweight.cpp debug/graph.o: src/graph.cpp src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/graph.o src/graph.cpp debug/htmlviewer.o: src/htmlviewer.cpp src/htmlviewer.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/htmlviewer.o src/htmlviewer.cpp debug/main.o: src/main.cpp src/mainwindow.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/main.o src/main.cpp debug/mainwindow.o: src/mainwindow.cpp config.h \ src/mainwindow.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ ui_webcrawlerdialog.h \ src/datasetselectdialog.h \ ui_datasetselectdialog.h \ src/node.h \ src/edge.h \ src/nodenumber.h \ src/nodelabel.h \ src/edgeweight.h \ src/htmlviewer.h \ src/texteditor.h \ src/backgrcircle.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/mainwindow.o src/mainwindow.cpp debug/matrix.o: src/matrix.cpp src/matrix.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/matrix.o src/matrix.cpp debug/node.o: src/node.cpp src/node.h \ src/graphicswidget.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h \ src/edge.h \ src/nodelabel.h \ src/nodenumber.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/node.o src/node.cpp debug/nodelabel.o: src/nodelabel.cpp src/nodelabel.h \ src/node.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/nodelabel.o src/nodelabel.cpp debug/nodenumber.o: src/nodenumber.cpp src/nodenumber.h \ src/node.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/nodenumber.o src/nodenumber.cpp debug/texteditor.o: src/texteditor.cpp src/texteditor.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/texteditor.o src/texteditor.cpp debug/vertex.o: src/vertex.cpp src/vertex.h \ src/graph.h \ src/matrix.h \ src/parser.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/vertex.o src/vertex.cpp debug/parser.o: src/parser.cpp src/parser.h \ src/graph.h \ src/vertex.h \ src/matrix.h \ src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/parser.o src/parser.cpp debug/filteredgesbyweightdialog.o: src/filteredgesbyweightdialog.cpp src/filteredgesbyweightdialog.h \ ui_filteredgesbyweightdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/filteredgesbyweightdialog.o src/filteredgesbyweightdialog.cpp debug/webcrawlerdialog.o: src/webcrawlerdialog.cpp src/webcrawlerdialog.h \ ui_webcrawlerdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/webcrawlerdialog.o src/webcrawlerdialog.cpp debug/webcrawler.o: src/webcrawler.cpp src/webcrawler.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/webcrawler.o src/webcrawler.cpp debug/datasetselectdialog.o: src/datasetselectdialog.cpp src/datasetselectdialog.h \ ui_datasetselectdialog.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/datasetselectdialog.o src/datasetselectdialog.cpp debug/moc_backgrcircle.o: debug/moc_backgrcircle.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_backgrcircle.o debug/moc_backgrcircle.cpp debug/moc_graphicswidget.o: debug/moc_graphicswidget.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_graphicswidget.o debug/moc_graphicswidget.cpp debug/moc_edge.o: debug/moc_edge.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_edge.o debug/moc_edge.cpp debug/moc_graph.o: debug/moc_graph.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_graph.o debug/moc_graph.cpp debug/moc_htmlviewer.o: debug/moc_htmlviewer.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_htmlviewer.o debug/moc_htmlviewer.cpp debug/moc_mainwindow.o: debug/moc_mainwindow.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_mainwindow.o debug/moc_mainwindow.cpp debug/moc_node.o: debug/moc_node.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_node.o debug/moc_node.cpp debug/moc_texteditor.o: debug/moc_texteditor.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_texteditor.o debug/moc_texteditor.cpp debug/moc_vertex.o: debug/moc_vertex.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_vertex.o debug/moc_vertex.cpp debug/moc_parser.o: debug/moc_parser.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_parser.o debug/moc_parser.cpp debug/moc_filteredgesbyweightdialog.o: debug/moc_filteredgesbyweightdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_filteredgesbyweightdialog.o debug/moc_filteredgesbyweightdialog.cpp debug/moc_webcrawlerdialog.o: debug/moc_webcrawlerdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_webcrawlerdialog.o debug/moc_webcrawlerdialog.cpp debug/moc_webcrawler.o: debug/moc_webcrawler.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_webcrawler.o debug/moc_webcrawler.cpp debug/moc_datasetselectdialog.o: debug/moc_datasetselectdialog.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_datasetselectdialog.o debug/moc_datasetselectdialog.cpp debug/qrc_src.o: debug/qrc_src.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/qrc_src.o debug/qrc_src.cpp ####### Install install: FORCE uninstall: FORCE FORCE: socnetv-0.90/Makefile.in0000644000175000017500000000433611261401575015432 0ustar dimitrisdimitrisprefix = @ac_prefix@ qmake = @ac_qmake@ name = socnetv headers = src/backgrcircle.h \ src/graphicswidget.h \ src/edge.h \ src/edgeweight.h \ src/graph.h \ src/htmlviewer.h \ src/mainwindow.h \ src/matrix.h \ src/node.h \ src/nodelabel.h \ src/nodenumber.h \ src/texteditor.h \ src/vertex.h \ src/parser.h sources = src/backgrcircle.cpp \ src/graphicswidget.cpp \ src/edge.cpp \ src/edgeweight.cpp \ src/graph.cpp \ src/htmlviewer.cpp \ src/main.cpp \ src/mainwindow.cpp \ src/matrix.cpp \ src/node.cpp \ src/nodelabel.cpp \ src/nodenumber.cpp \ src/texteditor.cpp \ src/vertex.cpp \ src/parser.cpp forms = all: $(name) $(name).mak: $(name).pro @$(qmake) -o $(name).mak $(name).pro $(name): $(name).mak ${forms} $(sources) $(headers) @make -f $(name).mak install: $(name) src/images/$(name).png @install -d -v -m 0755 $(DESTDIR)$(prefix)/bin @install -d -v -m 0755 $(DESTDIR)$(prefix)/share/pixmaps @install -d -v -m 0755 $(DESTDIR)$(prefix)/share/applications @install -v -m 0755 $(name) $(DESTDIR)$(prefix)/bin/$(name) @install -v -m 0644 src/images/$(name).png $(DESTDIR)$(prefix)/share/pixmaps/$(name).png @install -v -m 0644 $(name).desktop $(DESTDIR)$(prefix)/share/applications/$(name).desktop mkdir -p $(DESTDIR)$(prefix)/share/man/man1 @install -v -m 0644 man/* $(DESTDIR)$(prefix)/share/man/man1 mkdir -p $(DESTDIR)$(prefix)/share/doc/$(name)/manual @install -v -m 0644 manual/* $(DESTDIR)$(prefix)/share/doc/$(name)/manual/ @install -v -m 0644 README NEWS COPYING AUTHORS TODO ChangeLog $(DESTDIR)$(prefix)/share/doc/$(name)/ uninstall: $(DESTDIR)$(prefix)/bin/$(name) @rm -vf $(DESTDIR)$(prefix)/bin/$(name) @rm -vf $(DESTDIR)$(prefix)/share/pixmaps/$(name).png @rm -vf $(DESTDIR)$(prefix)/share/applications/$(name).desktop @rm -rf $(DESTDIR)$(prefix)/share/doc/$(name) @rm -vf $(DESTDIR)$(prefix)$/share/man/man1/$(name).1.gz clean: $(name).mak @make -f $(name).mak clean @rm -f $(name) $(name).mak @rm -rf *.cache *.log *.status socnetv-0.90/INSTALL0000755000175000017500000000201111261401575014405 0ustar dimitrisdimitrisInstallation ============ To install SocNetV you need Qt 4.4+ development libraries. Qt is a C++ toolkit developed by Trolltech and published under GPL. Most modern Linux distros, especially those providing KDE as their default desktop environment, include Qt. So if you have one of openSUSE, Mandriva, Fedora, Kubuntu, Slackware, etc, you dont need to download Qt. It should be already installed. If you have Qt4 installed, all you have to do is to type in the following commands in order to decompress the SocNetV tarball and build it: 1) untar zxfv SocNetV-0.XX.tar.gz 2) cd socnetv-0.XX 3) ./configure 4) make 5) sudo make install Probably you have already done the first 2 steps, so just type in ./configure (yes, it needs a ./ in front of it!). If Qt4 is not installed, the script will let you know... When you finish compiling and installing, run the application typing: socnetv or go to Start Menu > Mathematics > SocNetV. Questions ========= For any questions, email me at: dimitris.kalamaras@gmail.com socnetv-0.90/release/0000755000175000017500000000000011455077630015005 5ustar dimitrisdimitrissocnetv-0.90/COPYING0000755000175000017500000010577011261401575014427 0ustar dimitrisdimitris You may use, distribute and copy SocNetV under the terms of GNU General Public License version 3, which is displayed below. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . socnetv-0.90/socnetv.spec.in0000644000175000017500000001232111331505743016320 0ustar dimitrisdimitris%define name socnetv %define version @PACKAGE_VERSION@ %define release 1 %define prefix @ac_prefix@ %define lastrev %(LANG=en_US.UTF-8 && date +"%a %b %e %Y") %define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0) %define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0) %define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0) %define qmake qmake %define lrelease lrelease #BEGIN BUILDSERVICE COMMANDS %if 0%{?fedora_version} != 0 %define is_suse 0 %define is_mandrake 0 %define is_fedora 1 %define breqr qt4-devel, qt-x11, desktop-file-utils %define qmake /usr/bin/qmake-qt4 %define lrelease /usr/bin/lrelease-qt4 %endif %if 0%{?suse_version} != 0 %define is_suse 1 %define is_mandrake 0 %define is_fedora 0 %define breqr libqt4-devel, libQtWebKit-devel, update-desktop-files %define qmake /usr/bin/qmake %define lrelease /usr/bin/lrelease %endif %if 0%{?mandriva_version} != 0 %define is_suse 0 %define is_mandrake 1 %define is_fedora 0 %define breqr libqt4-devel, desktop-file-utils %define qmake /usr/lib/qt4/bin/qmake %define lrelease /usr/lib/qt4/bin/lrelease %endif #END BUILDSERVICE COMMANDS %if %{is_fedora} %define distr Fedora # %(cat /etc/fedora-release) %define breqr qt4-devel, qt-x11, desktop-file-utils %define qmake /usr/bin/qmake-qt4 %define lrelease /usr/bin/lrelease-qt4 %endif %if %{is_suse} %define distr SUSE # %(head -1 /etc/SuSE-release) %define breqr libqt4-devel, libQtWebKit-devel, update-desktop-files %define qmake /usr/bin/qmake %define lrelease /usr/bin/lrelease %endif %if %{is_mandrake} %define distr Mandriva # %(cat /etc/mandrake-release) %define breqr libqt4-devel, desktop-file-utils %define qmake /usr/lib/qt4/bin/qmake %define lrelease /usr/lib/qt4/bin/lrelease %endif Name: %{name} Version: %{version} Release: %{release} Summary: A Social Networks Analyser and Visualiser License: GPLv3 Group: Productivity/Scientific/Math URL: http://socnetv.sourceforge.net/ Vendor: Dimitris V. Kalamaras #Packager: Dimitris V. Kalamaras # Removed for OBS warnings... Source0: SocNetV-%{version}.tar.bz2 Distribution: %{distr} Prefix: %{prefix} BuildRequires: gcc-c++, %{breqr} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description SocNetV (Social Networks Visualiser) is a flexible and user-friendly tool for Social Networks Analysis and Visualisation. It lets you create new networks (graphs) with a few clicks on a virtual canvas or load networks of various formats (GraphViz, GraphML, Adjacency, Pajek, etc) and modify them to suit your needs. The application can compute network properties, such as density, diameter and distances, as well as node and network centralities. Various layout algorithms (i.e. Spring-embedder, circular and in levels according to centralities) are supported for meaningful visualisations of your networks. Furthermore, simple random networks (lattice, same degree, etc) can be created. Author: Dimitris V. Kalamaras %prep %setup [ -f Makefile.cvs ] && %__make -f Makefile.cvs chmod -R a-x+X COPYING ChangeLog INSTALL NEWS README TODO manual man nets src chmod 644 nets/* find . -type f -name '*~' -delete rm -f config.log config.status Makefile socnetv.spec socnetv.mak %build %configure %__make %install %if %{is_fedora} desktop-file-validate %{name}.desktop #desktop-file-install --add-category="Math" --delete-original --dir=%{buildroot}%{_datadir}/applications %{buildroot}/%{_datadir}/applnk/Edutainment/%{name}.desktop %endif %makeinstall rm -rf %{buildroot}/%{_datadir}/doc/%{name} %clean [ -d %{buildroot} -a "%{buildroot}" != "" ] && %__rm -rf %{buildroot} %files %defattr(-,root,root) %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %{_mandir}/man1/* %doc ChangeLog NEWS README TODO COPYING AUTHORS INSTALL manual %changelog * Thu Jan 28 2010 Dimitris Kalamaras - 0.81-1 - Synced with upstream. - Bugfixes for Windows version * Sat Jan 09 2010 Dimitris Kalamaras - 0.80-1 - Synced with upstream, * Mon Jun 29 2009 Dimitris Kalamaras - 0.70-1 - Synced with upstream * Mon May 27 2009 Dimitris Kalamaras - 0.6.0-1 - Synced with upstream * Thu Feb 26 2009 Dimitris Kalamaras - 0.52-1 - Synced with upstream. - Bugfixes into .spec.in for RPMs (Fedora, openSUSE and Mandriva). * Tue Feb 17 2009 Dimitris Kalamaras - 0.51-3 - Bugfixes into .spec.in for Fedora and Mandriva. - RPM for Fedora * Mon Feb 16 2009 Dimitris Kalamaras - 0.51-2 - Minor changes to RPM * Mon Feb 16 2009 Dimitris Kalamaras - 0.51-1 - Updated to upstream version 0.51 * Fri Feb 13 2009 Dimitris Kalamaras - 0.50-1 - Updated to upstream version 0.50 * Wed Jan 14 2009 Dimitris Kalamaras - 0.49-2 - Package .spec fixes * Tue Jan 13 2009 Dimitris Kalamaras - 0.49-1 - Updated to 0.49 * Wed Sep 17 2008 Dimitris Kalamaras - 0.48-1 - First RPM release socnetv-0.90/NEWS0000755000175000017500000000605711425736636014104 0ustar dimitrisdimitrisSocial Networks Visualiser (SocNetV) SocNetV News -==========- Aug 2010 ======== - Version 0.90 released - New Power Centrality Jan 2010 ======== - Version 0.80 - New List import feature - New Triad Census feature - Various Bug Fixes June 2009 ========= - Version 0.70 - First web crawler implementation May 2009 ======== - Version 0.6 (release) - GraphML becomes native SocNetV load format Feb 2009 ======= - Version 0.51 (bugfix release) - Version 0.50 (released) - Small world creation - Clustering coefficient - Exporting to PDF - Printing works OK. Jan 2009 ======== - Version 0.49 (released) - Ubuntu repository created. Sep 2008 ======== - New logo - New openSUSE package repo. - Version 0.48 released - Version 0.47 released - Version 0.46 released. Lots of bugfixes. New features: - Node sizes may reflect degree. Aug 2008 ======== - New Debian Package - Version 0.45 released. New features: - GraphML initial support. - New man page and updated online documentation. - HtmlViewer renders online help with the help of QtWebKit (openSUSE: libQtWebKit-devel) - New widget for network rotation. - New widget for zooming replaces the old one. - Nodes may have 4 different shapes: circles, diamonds, triangles, boxes and ellipses are supported. - There was a bug in Qt 4.3 QGraphicsView causing redraw delays. Is fixed in Qt 4.4 :) - Cosmetic changes, i.e. new icons, new layout for the left dock. - Code clean-up in MainWindows Class and Matrix. - Deleted obsolete members and functions such as nodeExists(), mousePosGW(), Dijkstra, etc. - Bug-fixes on loading Pajek networks and layout algorithm. May 2008 ======== - Version 0.44 released one year after v.0.43. New features: Ported to Qt4: Code rewritten almost from scratch. Splitted MainWindow/GUI from algorithms via a new Graph Class. Improved GUI with docks. Network zooming via mouse wheel. Spring Embedder: Dynamic network reallocation Thread support. Much faster calculation of distances and centralities (BFS/dijkstra). Betweeness centrality now is much more efficiently calculated. Changed license to GPL3 Layout in circles and levels by centrality. Better graphics and antialiasing (disabled - enable by pressing F8). New centrality index: Eccentricity. Sep 2006 ======== - version 0.43 released with new layout features. June 2006 ========= - version 0.42 released with updated help files. May 2006 ======== - I did some work on the webpages at http://socnetv.sourceforge.net. Hope it is better now. April 2006 ========== March 2006 ========== - version 0.41 released. February 2006 ------------- - version 0.40 released. Efforts to be a pretty trustworthy release. - sourceforge project downloads are more than enough daily, but there is no feedback yet for versions 0.38 and 0.39. - version 0.39 released. Somewhat rushed release. - constant changes in the homepage. - updated links in www.insna.org January 2006 ------------ - version 0.38 released after one year of silence. - The project moved to sourceforge.net - The homepage is http://socnetv.sourceforge.net socnetv-0.90/AUTHORS0000644000175000017500000000053011321657776014442 0ustar dimitrisdimitrisDeveloper: Dimitris Kalamaras See my blog at: http://dimitris.apeiro.gr Translators: - Greek: None - German: Daniel Pinto dos Santos Debian packagers: - Serafeim Zanikolas (>0.43) - Alejandro Garrido Mota (<0.44) Gentoo packager: - Markos Chandras Arch packager: - Tom Tryfonidis socnetv-0.90/Makefile.cvs0000644000175000017500000000041011261401575015604 0ustar dimitrisdimitrisall: configure configure: socnetv.spec.in Makefile.in configure.ac @autoheader @autoconf @rm -rf *.cache clean: @if [ -f Makefile ]; then make clean; fi || true @rm -rvf Makefile configure config.* @rm -rvf *.cache *.log *.status *.pro *.spec *.desktop socnetv-0.90/ChangeLog0000755000175000017500000004345211455077452015154 0ustar dimitrisdimitris****************************************** * Social Networks Visualizer (SocNetV) * ****************************************** ChangeLog: Version 0.90 - Sep XX 2010 Codename: "Worka Worka" -------------------------- - New feature: Power Centrality calculation - New feature: Information Centrality (Stephenson & Zelen) calculation - New feature: radial layout according to Power and Information centralities - New feature: filter (enable/disable) orphan nodes - New feature: import two-mode affiliation networks (in sociomatrix format) - New, faster container for GraphicsWidget Nodes based on QHash - More automagically recreated known data sets - Allow really large networks to be loaded without crashing. Still too slowly though. - Nodes are selectable (but not yet editable) in groups - Fixed bug #518219: Certain Pajek files might crash SocNetV - Fided bug #515756: Ctrl+F after a node removal may crash SocNetV - Fixed bug #515758: Random layout crashes SocNetV, if a node is removed - Updated user manual to new version features. - Removed counts of outLinkedNodes, inLinkedNodes and reciprocalLinkedNodes because they were causing too much overhead when loading large networks. The relevant LCDs were also dropped from the UI. Version 0.81 - Jan 28 2010 Codename: "bugfixes" --------------------------- - New feature: automatic recreation of known data sets. - Now, SocNetV can read two kind of lists: a) weighted lists in the format source1 target1 weight1 source2 target2 weight2 source3 target3 weight3 ... b) simple (unweighted) lists source1 target1 target2 target3 target4... source2 target1 target2 target3 target4... source3 target1 target2 target3 target4... - Fixed bug #507818: "Export as pajek, overwrites the graphml file" - Fixed bug #511418: "List loading crashed SocNetV". - Fixed bug #511420: "Edges do not follow nodes in SocNetV development version for Windows" - Fixed bug #470283: "file saving doesn't automatically give the file an extension" Version 0.80 - January 8 2010 Codename: "supersyntages.gr" ---------------------------- - New statistic: Triad Census. - New statistic: clique numbers for each node. - Initial read support for list formatted files. - Read support for comma separated values (csv) formatted sociomatrix files - Much improved Dot format support. - Faster network load times, thanks to control variables. - Added keyboard shortcuts for Centralities - Refactored Import network menu. The user must define what network format is the file at hand. - Fixed bug #416965: Not displaying nodes when loading GraphViz files - Fixed bug #396124: GBC different in Pajek cp. to SocNetV - Fixed bug #415277: network files were not loaded on startup - Fixed bug #379225: side note: GraphML format did not preserve node labels. - Fixed bug #418023: rewiring parameter typo in Graph:createRandomNetSmallWorld. - Fixed bug #420708: on GraphML output files, not transforming special XML characters, like &, to ampersand codes, like & - Fixed bug #418550: Clear selection when clicking on empty canvas. - Fixed bug #504037: Negative Group Closeness Centrality - Fixed bug #504517: double cliques counting in nondirected networks. - Edited .spec to enable proper Fedora package creation. - Changed ProgressBar behaviour: bars appear only if nodes are more than 300 or edges more than 1000. - New feature: the embedded text editor can be used to copy/paste directly network data - Updated user manual. Version 0.70 - June 30 2009 Codename: "Summertime" ---------------------------- - First web Crawler implementation. Use Shift+C to test it. Doesn't support frames yet... - Multiple nodes can be selected with mouse. Press and hold left mouse button somewhere on the canvas, then move mouse to test it. - Fixed bug #379204 which was crashing SocNetV when creating small worlds above 201 nodes - Fixed bug #381096 crashing SocNetV in Edge Filtering when an edge was reciprocal. - Fixed bug #381094 weight changes not recorded correctly in symmetric edges. - To speed things up, the on-the-fly Clustering Coef. and Average Distance calculation was removed from random network creation routines. - Random Layout is back! - Speed improvement in FindNode method. - Progress Bars now appear whenever a distance-related calculation is happening, so that the user knows what is happening and how long it will take. - Tom Tryfonidis prepared Arch PKGBUILDs for SocNetV. You can install it from AUR. - Reverted to older version name scheme. All versions: 0.XX Version 0.6.0 - May 27 2009 Codename: "Spring" ---------------------------- - GraphML becomes our native load/save format ( partially support for yFiles) - New filter edges by their weights functionality. - The background can be a custom image (via menu View > Background Image) - New rounded rectangle shape for nodes. - Nodenumbers can be displayed inside nodes, once again. Sorry, labels are too difficult to show inside nodes :( - Fresh application iconset in shades of gold and gray. - New version name scheme. Main versions: 0.x Bugfixes: 0.x.y - Project admin, code, bug tracking etc moved to Launchpad/Bazaar. Report bugs to Launchpad. - SocNetV joins the QtDesktop project (http://code.google.com/p/qtdesktop/) Version 0.51 - Feb 16 2009 Codename: "Maria" ------------------------------ - Fixed serious bug in DistanceMatrix method, affecting centralities and layout. - Fixed debug messages output default status to false, so that SocNetV is more responsive. - Officially added DL (Data Language) file format support. This is UCINETs FULMATRIX mode. Version 0.50 - Feb 13 2009 Codename: "Recession (or the ballad of the deranged Greek statesmen)" ------------------------------ -'Small World' random network creation (Watts and Strogatz model). -Clustering Coefficient calculation. -Average Graph Distance (shortest path length) calculation. -Nodes can be linked to themselves with nice bezier curves. -Negative and decimal edge weights are now fully supported. -Dashed lines are nicely used to signify negative edge weights. -Export current network to PDF with one click. -Number and label colors are editable. -Fixed number and label font size problem. -Fixed PNG and BMP export regression. -Fixed Printing regression. Printing is OK now. -New program logo and icon. -Icon for Windows executable. -Code cleanup (no more compile warnings) and minor memory optimisations. -User messages/warnings and menu icons update. Version 0.49 - Jan 13 2009 Codename: "Alexis Grigoropoulos (R.I.P.)" ------------------------------ -Weight numbers can be displayed over links. -DL network format initial support. -Floating point edge weights are now supported... -Bug fix: Show correct new node number instead of %i -Bug fix: Zoom while rotate works (thanks Andre!). -Bug fix: No longer BFS crashes. SocNetV is more reliable. -Bug fix: Changed shortcut of OutDegree to Ctrl+1. -Added GraphML loading Version 0.48 - Sep 30 2008 Codename: "Road to nowhere?" ------------------------------ --Erdos-Renyi random network creation. --Removing symmetric edges, now asks what direction to remove. --New layout method: node sizes according to their indegrees. --No node limit. Load any network you want (make a coffee while waiting :)). --loadPajek() recognizes Arcslists and Matrix edges formats. --Edges are being drawed once (faster loading and node movement). --Graph API simplification and "standardization" --New LCD widget displaying network density and some improvements to the dock. --In-file declared node colors and shapes are used as they should. --Fixed bugs in removeNode methods. --Lots of bugfixes in loadPajek() method. --Documentation update --Progress Bars (F10) appear when creating random nets > 300 nodes. --RPM repository for openSUSE at http://download.opensuse.org/repositories/home:/oxy86/openSUSE_11.0 --SocNetV has a new, modern logo. It still resembles a snail though. ;) Version 0.47 - Sep 12 2008 Codename: "En leukw" ------------------------------ --Fixed bug in adjacency matrix loading/saving. --Edges are drawed once, even the reciprocal ones. This makes network loading faster... --Cosmetic changes in canvas (labels stay above edges, etc). --Fixed another bug in loadPajek(). Version 0.46 - Sep 11 2008 Codename: "Autumn leaves" ------------------------------ --Zoom in and out via mouse wheel work nice. --Nodes (triangles, diamonds) resize as they should. --Node shapes are now saved to Pajek files. --New layout method displaying node sizes according to their outdegrees. --Code cleanup and bugfixes in loading Pajek files. Version 0.45 - Aug 30 2008 Codename: "Changes (I' going through)" ------------------------------ - GraphML initial support. - New man page and updated online documentation. - HtmlViewer renders online help with the help of QtWebKit (openSUSE: libQtWebKit-devel) - New widget for network rotation. - New widget for zooming replaces the old one. - Nodes may have 4 different shapes: circles, diamonds, triangles, boxes and ellipses are supported. - There was a bug in Qt 4.3 QGraphicsView causing redraw delays. Is fixed in Qt 4.4 :) - Cosmetic changes, i.e. new icons, new layout for the left dock. - Code clean-up in MainWindows Class and Matrix. Deleted obsolete members and functions such as nodeExists(), mousePosGW(), Dijkstra, etc. - Fixed bugs on loading Pajek networks and layout algorithm. Version 0.44 - May 1st 2008 Codename: "Strike" ------------------------------ - Changed license to GPL3 - Complete code rewrite, build on Qt 4.x and Graphics View framework. - New, improved graphical user interface (GUI) with docks. - Splitted GUI from algorithms. - Threaded loading of networks. This leaves the GUI responsive when reading a file. - New improved Shortest Path algorithm (BFS/dijkstra). - Centralities are calculated much faster. - Real-time, on-demand, reallocation of nodes (Spring Embedder) which works :). - Layout in circles and levels by centrality. - Simple zoom in/out on the networks. - Better graphics and antialiasing (disabled - enable by pressing F8). - New centrality index: Eccentricity. Version 0.43 - September, 2006 Codename: "Tux" ------------------------------- - NEW LAYOUT: Spring Embedder algorithm - FIX: Actor Numbers are once again displayed outside actors' shapes by default. Version 0.42 - late June, 2006 Codename: "Amused to death" ------------------------------- - NEW: Actor Numbers are displayed inside actors' shapes by default. - NEW: Actors can be added just by double-clicking on the canvas - UPDATE: Help files - UPDATE: Some Options menu items were reformed. - FIX: "View Network File" bug. - FIX: "Diameter error in weighted networks" bug. - FIX: "Segmentation fault in degreeCentrality after remove/add new actor" bug. Version 0.41 - March 08, 2006 Codename: "Conservatification :-)" ----------------------------- - NEW: Actors may have more shapes: boxes, triangles, circles, ellipses, diamonds, etc. - NEW: Can import and export pajek nets with shapes. - FIX: In-Degree/Out-Degree Centralities were implemented. - UPDATE: Dot import improved. - ATTEMPT: Dot export implemented partially. - List import implemented partially. - FIX: in pow(double, double) fixed Version 0.40 - Feb, 18 2006 Codename: "A Greek Big Brother" ------------------------------- - Stress Centrality was implemented. - Fixed bugs in centralities calculation - Simplified layout of centralities' reports. - Fixed circular layout by degree, closeness and betweeness. - Circular layout by centralities shows helpfull red-dashed circles. Version 0.39 - Feb, 05 2006 Codename: "Dazed and Confused" ------------------------------ - Fixed bug on betweeness centrality. - Betweeness and closeness centralities work with undirected graphs. - Graph Centrality was implemented. - Version 0.38 - Feb 2006 Codename: "Back to Metropolis - Back to the village" --------------------------------------------------- - Code has been rewriten from scratch. - Most menus have been redesigned. - Faster loading of large networks (>100 actors). - New network format can be imported (DOT from graphviz). - Sociomatrix viewer has its own nice wigdet. - Support for the X color database (found in rgb.txt). - Window resize causes a nice reposition of all actors and links, maintaining proportion (I think). - Busy cursor when loading networks. - The user may change even the size of the actor numbers and labels. - Dijkstra's algorithm for weighted networks has been implemented. It is fast enough for networks up to 150 actors. - Breadth-First algorithm for non-weighted nets has been implemented ? - Degree Centrality and Layout take weights into account. The user may define negative weights as well. - Negative link weights are displayed as dashed lines. - Weight numbers can be displayed nicely above links. - Can transform all arcs to links with one click. - Circular lattice network generation. - Random same degree network generation. - Quick Tips by pressing F2. - Helpful tips displayed on StatusBar for every meny option. Also a new What's This menu item may become handy. - Bug fixes ("#include math.h" was the most silly of them). - SOME FEATURES FROM PREVIOUS VERSIONS (i.e. COMPONENTS ANALYSIS) WERE DROPPED. VERSION 0.37 (codename "Evros Iceman - You're in the army now...") ------------ - Now uniform random network is really a random process. - Bug fixes. - Changing node label is now an "on the fly" process. - Filtering edges by their weights is now supported. - Layout by centrality is now more comprehensive: A background circle is drawn for every centrality value. - Arcs/Edges calculation is now correct. - Directed networks/centralities/layout were flawed. Still it is... VERSION 0.36 (codename "fine") ------------ - Bug Fixes - Acceleration Keys work fine. - Messages are multilingual now. Only Spanish support for now. - Context Menu appears when right-clicking on canvas. - Layouts by closeness and betweeness centralities now work fine. - Exporting networks to BMP and PNG format is now supported. VERSION 0.35 (Jan 22 2005) ------------ - Bug fixes. - d-regular network support - Multilingual support. - Spanish menu support. Thanks to David De Ugarte. Set locale "es" et voila! Version 0.34 (JAN 14 2005) ------------ - Countless bug fixes, ie: Blank name when blank network is created. Loading a network file after Creating New Network had undesirable effectes. ASSERT: "i < ..." when nodes <-> edges When removing a link it keeps on reporting it. - Random network creation - Row index form (beta) - Betweeness and closeness centralities now work fine. version 0.33 (22 May 2004) ------------------------- - Countless bug fixes. - Betweeness centrality. - New layouts, by centrality (did not work!). - Edges' weights can be changed by right-clicking on the edge and selecting the relevant command. - Matrix algebra: inverse, power, determinant, etc. version 0.32 (15 May 2004) --------------------------- - Countless Bug Fixes. - With a click on the "display database" menu option, you can view (and print if you like) the complete Database. - New Transformation: edges <-> nodes - Re-reading Wasserman and Faust is always good. Now reachability works well. Distance is really ok. Centralities (informational, etc) are implemented, too. version 0.31 (May 2004) ------------------------ - Countless Bug Fixes. - Clicking on a link causes the StatusBar to display info about the specific link. - Thanks to QT examples, a simple Help viewer has been incorporated. version 0.3 (March 2004) ----------- - Somewhat improved memory mngmt; at least, there are no more segmentation faults :) - Changed internal representation of links: Every link has a source A and a target actor B. The source actor A is 'OutLinked' with the target B, while the latter is 'InLinked' from the source actor A. This relationship is denoted as A->B. If the target actor B of a link (A->B) is also OutLinked with the source, i.e. B->A, then this (two-way) link is an edge. This relationship is denoted as A<->B. Else the (one-way) link is just an arc. Thus, this representation is compatible to PAJEK's arcs and edges (or at least what I assume that PAJEK does). - SocNetV can write adjacency matrix ("sociomatrix") to a text file. - SocNetV can write PAJEK-formatted network in a file. It saves the on-screen node coordinates as well. - Some interesting node/actor data are displayed in the Status Bar. Also, tooltips w/ coordinates are known to emerge when you leave the mouse pointer on the canvas. - Right-clicking on a node causes a node-specific menu to popup. - The statistics menu tries to be more relevant to its name! Now it is populated by : density, distance, reachability, diameter, centralities. - The user can remove any node by the appropriate (context) menu command. Edges can also be removed using the relevant menu command. There is no mouse interactivity with the edges at the moment. (April 2004) - Network components (maximal linked subnets) can be calculated. It can also paint the nodes of each component with the same color. version 0.2 ----------- - Somewhat improved mouse interactivity with vertices. - Now SocNetV can read even adjacency-matrix network files :-) - New features: network layout options, rudimentary descr. statistics, etc - New menu (still inactive): Transform Menu version 0.1 ----------- - First Version of SocNetV (Feb 2004, in the end of an inexpectably heavy winter). Initially i planned to name it something like 'nwd' or snail (social network analysis in Linux), although I cannot even remember what 'nwd' was supposed to meant! - SocNetV should normally read plain PAJEK-formatted network files. At this point, only vertices and edges are supported. Also you can read but you cannot write :( - Efforts to add mouse interactivity to vertices. - Separate text editor to view and tickle with the text files. - SocNetV is unable to directly save network files, although this can be done using the esoteric text editor. x socnetv-0.90/src/0000755000175000017500000000000011455100156014142 5ustar dimitrisdimitrissocnetv-0.90/src/matrix.h0000755000175000017500000001112011434417714015625 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 matrix.h - description ------------------- copyright : (C) 2005-2010 by dimitris kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef MATRIX_H #define MATRIX_H using namespace std; #include //used for qDebug function #include #include class Row { public: Row (int Actors=3000) { cell=new float [m_Actors=Actors]; Q_CHECK_PTR( cell ); m_outEdges=0; } ~Row() {delete [] cell;} Row& operator =(Row & a) { if (this != &a){ if (a.m_Actors!=m_Actors) { delete [] cell; cell=new float[m_Actors=a.m_Actors]; Q_CHECK_PTR( cell); } for (int i=0;i. * ********************************************************************************/ #ifndef VERTEX_H #define VERTEX_H #include #include #include #include #include using namespace std; class QPointF; class Graph; typedef map imap_f; typedef QHash ihash_s; typedef QHash ihash_i; typedef QList ilist; class Vertex : public QObject{ Q_OBJECT public: Vertex( Graph* parent, int v1, int val, int size, QString color, QString numColor, int numSize, QString label, QString labelColor, int labelSize, QPointF p, QString shape); Vertex(int v1); ~Vertex(); long int name(); void setName (long int ); void setEnabled (bool flag ); bool isEnabled (); void addLinkTo (long int target, float weight); /* Adds an outLink to target with weight w */ void addLinkFrom(long int source, float weight); void changeLinkWeightTo (long int target, float weight); void removeLinkTo (long int target); /* Removes edge to vertex t */ void removeLinkFrom(long int source); /* Removes edge from vertex s */ long int outDegree(); /* Returns the number of outward directed graph edges from this vertex */ long int inDegree(); /* Returns the number of inward directed graph edges from this vertex */ long int localDegree(); /* Returns true if there is a reciprocal link from this vertex */ bool isReciprocalLinked() { return m_reciprocalLinked;} void setReciprocalLinked(bool reciprocal) { m_reciprocalLinked=reciprocal;} /* Returns true if there is an outLink from this vertex */ bool isOutLinked() { return m_outLinked;} void setOutLinked(bool outLinked) { m_outLinked=outLinked;} float isLinkedTo(long int V); /* Returns the weight of the link to vertex V, otherwise zero*/ /* Returns true if there is an outLink from this vertex */ bool isInLinked() { return m_inLinked;} void setInLinked(bool inLinked) { m_inLinked=inLinked;} float isLinkedFrom (long int v); bool isIsolated() { return !(m_outLinked | m_inLinked) ; } void setIsolated(bool isolated) {m_isolated = isolated; } void filterEdgesByWeight(float m_threshold, bool overThreshold); // void filterEdgesByColor(float m_threshold, bool overThreshold); void setSize(int ); int size(); void setShape(QString); QString shape(); void setColor(QString); QString color(); void setNumberColor (QString); QString numberColor(); void setNumberSize (int); int numberSize(); void setLabel (QString); QString label(); void setLabelColor (QString); QString labelColor(); void setLabelSize(int); int labelSize(); void setX(float ); float x(); void setY(float ); float y(); QPointF pos (); void setOutLinkColor(long int, QString); QString outLinkColor(int); void setDelta (float c){ m_delta=c;} /* Sets vertex pair dependancy */ float delta() { return m_delta;} /* Returns vertex pair dependancy */ void clearPs() ; void appendToPs(long int vertex ) ; ilist Ps(void); void setODC (float c){ m_ODC=c;} /* Sets vertex Out-Degree Centrality*/ void setSODC (float c ) { m_SODC=c;} /* Sets standard vertex Out-Degree Centrality*/ float ODC() { return m_ODC;} /* Returns vertex Out-Degree Centrality*/ float SODC() { return m_SODC;} /* Returns standard vertex Out-Degree Centrality*/ void setIDC (float c){ m_IDC=c;} /* Sets vertex In-Degree Centrality*/ void setSIDC (float c ) { m_SIDC=c;} /* Sets standard vertex In-Degree Centrality*/ float IDC() { return m_IDC;} /* Returns vertex In-Degree Centrality*/ float SIDC() { return m_SIDC;} /* Returns standard vertex In-Degree Centrality*/ void setCC (float c){ m_CC=c;} /* sets vertex Closeness Centrality*/ void setSCC (float c ) { m_SCC=c;} /* sets standard vertex Closeness Centrality*/ float CC() { return m_CC;} /* Returns vertex Closeness Centrality*/ float SCC() { return m_SCC; } /* Returns standard vertex Closeness Centrality*/ void setBC(float c){ m_BC=c;} /* sets s vertex Betweeness Centrality*/ void setSBC (float c ) { m_SBC=c;} /* sets standard vertex Betweeness Centrality*/ float BC() { return m_BC;} /* Returns vertex Betweeness Centrality*/ float SBC() { return m_SBC; } /* Returns standard vertex Betweeness Centrality*/ void setGC (float c){ m_GC=c;} /* sets vertex Graph Centrality*/ void setSGC (float c ) { m_SGC=c;} /* sets standard vertex Graph Centrality*/ float GC() { return m_GC;} /* Returns vertex Graph Centrality*/ float SGC() { return m_SGC; } /* Returns standard vertex Graph Centrality*/ void setSC (float c){ m_SC=c;} /* sets vertex Stress Centrality*/ void setSSC (float c ) { m_SSC=c;} /* sets standard vertex Stress Centrality*/ float SC() { return m_SC;} /* Returns vertex Stress Centrality*/ float SSC() { return m_SSC; } /* Returns standard vertex Stress Centrality*/ void setEC(float dist) { m_EC=dist;} /* Sets max Geodesic Distance to all other vertices*/ void setSEC(float c) {m_SEC=c;} float EC() { return m_EC;} /* Returns max Geodesic Distance to all other vertices*/ float SEC() { return m_SEC;} void setPC (float c){ m_PC=c;} /* sets vertex Power Centrality*/ void setSPC (float c ) { m_SPC=c;} /* sets standard vertex Power Centrality*/ float PC() { return m_PC;} /* Returns vertex Power Centrality*/ float SPC() { return m_SPC; } /* Returns standard vertex Power Centrality*/ void setIC (float c){ m_IC=c;} /* sets vertex Information Centrality*/ void setSIC (float c ) { m_SIC=c;} /* sets standard vertex Information Centrality*/ float IC() { return m_IC;} /* Returns vertex Information Centrality*/ float SIC() { return m_SIC; } /* Returns standard vertex Information Centrality*/ float CLC() { return m_CLC; } void setCLC(float clucof) { m_CLC=clucof; m_hasCLC=TRUE; } bool hasCLC() { return m_hasCLC; } imap_f m_outEdges; //holds all edges starting from this vertex. imap_f m_inEdges; //holds all edges starting from this vertex. ihash_i m_enabled_outEdges; signals: void setEdgeVisibility ( int, int, bool); protected: private: Graph *parentGraph; ilist myPs; long int m_name, m_outLinks, m_inLinks; int m_value, m_size, m_labelSize, m_numberSize; bool m_inLinked, m_outLinked, m_reciprocalLinked, m_enabled, m_hasCLC, m_isolated; QString m_color, m_numberColor, m_label, m_labelColor, m_shape; //QString *outLinkColors; ihash_s outLinkColors; //FIXME vertice coords double m_x, m_y; float m_CLC; float m_delta, m_EC, m_SEC; float m_ODC, m_SODC, m_IDC, m_SIDC, m_CC, m_SCC, m_BC, m_SBC, m_GC, m_SGC, m_SC, m_SSC; float m_PC, m_SPC, m_SIC, m_IC; }; #endif socnetv-0.90/src/filteredgesbyweightdialog.cpp0000644000175000017500000000502611423751762022103 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 filteredgesbyweightdialog.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "filteredgesbyweightdialog.h" #include #include FilterEdgesByWeightDialog::FilterEdgesByWeightDialog (QWidget *parent) : QDialog (parent) { ui.setupUi(this); connect ( ui.buttonBox,SIGNAL(accepted()), this, SLOT(gatherData()) ); (ui.buttonBox) -> button (QDialogButtonBox::Ok) -> setDefault(true); (ui.overThresholdBt)-> setChecked(true); } void FilterEdgesByWeightDialog::gatherData(){ qDebug()<< "Dialog: gathering Data!..."; bool overThreshold=false; float my_threshold = static_cast ( (ui.weightThreshold)->value() ); if ( ui.overThresholdBt -> isChecked() ) { qDebug()<< "Dialog: We will filter edges weighted more than threshold: " << my_threshold; overThreshold = true; } else { qDebug()<< "Dialog: We will filter edges weighted less than threshold: " << my_threshold; overThreshold = false; } qDebug()<< "Dialog: emitting userChoices" ; emit userChoices( my_threshold, overThreshold ); } socnetv-0.90/src/texteditor.cpp0000755000175000017500000002440711423751762017065 0ustar dimitrisdimitris/**************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop texteditor.cpp ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com *****************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include #include "texteditor.h" TextEditor::TextEditor(const QString &fileName) { qDebug("TextEditor()"); textEdit = new QTextEdit; setCentralWidget(textEdit); createActions(); createMenus(); createToolBars(); createStatusBar(); readSettings(); connect(textEdit->document(), SIGNAL(contentsChanged()), this, SLOT(documentWasModified())); resize( 640,400 ); if (!fileName.isEmpty()) loadFile(fileName); else setCurrentFile(""); } void TextEditor::closeEvent(QCloseEvent *event) { if (maybeSave()) { writeSettings(); event->accept(); } else { event->ignore(); } } void TextEditor::newFile() { if (maybeSave()) { textEdit->clear(); setCurrentFile(""); } } void TextEditor::open() { if (maybeSave()) { QString fileName = QFileDialog::getOpenFileName(this); if (!fileName.isEmpty()) loadFile(fileName); } } bool TextEditor::save() { if (curFile.isEmpty()) { return saveAs(); } else { return saveFile(curFile); } } bool TextEditor::saveAs() { QString fileName = QFileDialog::getSaveFileName(this); if (fileName.isEmpty()) return false; return saveFile(fileName); } void TextEditor::documentWasModified() { setWindowModified(textEdit->document()->isModified()); } void TextEditor::createActions() { newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this); newAct->setShortcut(tr("Ctrl+N")); newAct->setStatusTip(tr("Create a new file")); connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this); openAct->setShortcut(tr("Ctrl+O")); openAct->setStatusTip(tr("Open an existing file")); connect(openAct, SIGNAL(triggered()), this, SLOT(open())); saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this); saveAct->setShortcut(tr("Ctrl+S")); saveAct->setStatusTip(tr("Save the document to disk")); connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); saveAsAct = new QAction(tr("Save &As..."), this); saveAsAct->setStatusTip(tr("Save the document under a new name")); connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); exitAct = new QAction(tr("E&xit"), this); exitAct->setShortcut(tr("Ctrl+Q")); exitAct->setStatusTip(tr("Exit the application")); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this); cutAct->setShortcut(tr("Ctrl+X")); cutAct->setStatusTip(tr("Cut the current selection's contents to the " "clipboard")); connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut())); copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this); copyAct->setShortcut(tr("Ctrl+C")); copyAct->setStatusTip(tr("Copy the current selection's contents to the " "clipboard")); connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy())); pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this); pasteAct->setShortcut(tr("Ctrl+V")); pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current " "selection")); connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste())); aboutAct = new QAction(tr("&About"), this); aboutAct->setStatusTip(tr("Show the application's About box")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); aboutQtAct = new QAction(tr("About &Qt"), this); aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); cutAct->setEnabled(false); copyAct->setEnabled(false); connect(textEdit, SIGNAL(copyAvailable(bool)), cutAct, SLOT(setEnabled(bool))); connect(textEdit, SIGNAL(copyAvailable(bool)), copyAct, SLOT(setEnabled(bool))); } void TextEditor::createMenus() { fileMenu = menuBar()->addMenu(tr("&File")); fileMenu->addAction(newAct); fileMenu->addAction(openAct); fileMenu->addAction(saveAct); fileMenu->addAction(saveAsAct); fileMenu->addSeparator(); fileMenu->addAction(exitAct); editMenu = menuBar()->addMenu(tr("&Edit")); editMenu->addAction(cutAct); editMenu->addAction(copyAct); editMenu->addAction(pasteAct); menuBar()->addSeparator(); helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(aboutAct); helpMenu->addAction(aboutQtAct); } void TextEditor::createToolBars() { fileToolBar = addToolBar(tr("File")); fileToolBar->addAction(newAct); fileToolBar->addAction(openAct); fileToolBar->addAction(saveAct); editToolBar = addToolBar(tr("Edit")); editToolBar->addAction(cutAct); editToolBar->addAction(copyAct); editToolBar->addAction(pasteAct); } void TextEditor::createStatusBar() { statusBar()->showMessage(tr("Ready")); } void TextEditor::readSettings() { QSettings settings("Trolltech", "Application Example"); QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); QSize size = settings.value("size", QSize(400, 400)).toSize(); resize(size); move(pos); } void TextEditor::writeSettings() { QSettings settings("Trolltech", "Application Example"); settings.setValue("pos", pos()); settings.setValue("size", size()); } bool TextEditor::maybeSave() { if (textEdit->document()->isModified()) { QMessageBox::StandardButton ret; ret = QMessageBox::warning(this, tr("TextEditor"), tr("The document has been modified.\n" "Do you want to save your changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); if (ret == QMessageBox::Save) return save(); else if (ret == QMessageBox::Cancel) return false; } return true; } void TextEditor::loadFile(const QString &fileName) { QFile file(fileName); if (!file.open(QFile::ReadOnly | QFile::Text)) { QMessageBox::warning(this, tr("Application"), tr("Cannot read file %1:\n%2.") .arg(fileName) .arg(file.errorString())); return; } QTextStream in(&file); QApplication::setOverrideCursor(Qt::WaitCursor); textEdit->setPlainText(in.readAll()); QApplication::restoreOverrideCursor(); setCurrentFile(fileName); statusBar()->showMessage(tr("File loaded"), 2000); } bool TextEditor::saveFile(const QString &fileName) { QFile file(fileName); if (!file.open(QFile::WriteOnly | QFile::Text)) { QMessageBox::warning(this, tr("TextEditor"), tr("Cannot write file %1:\n%2.") .arg(fileName) .arg(file.errorString())); return false; } QTextStream out(&file); QApplication::setOverrideCursor(Qt::WaitCursor); out << textEdit->toPlainText(); QApplication::restoreOverrideCursor(); setCurrentFile(fileName); statusBar()->showMessage(tr("File saved"), 2000); return true; } void TextEditor::setCurrentFile(const QString &fileName) { curFile = fileName; textEdit->document()->setModified(false); setWindowModified(false); QString shownName; if (curFile.isEmpty()) shownName = "untitled.txt"; else shownName = strippedName(curFile); setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("TextEditor"))); } QString TextEditor::strippedName(const QString &fullFileName) { return QFileInfo(fullFileName).fileName(); } void TextEditor::about() { QMessageBox::about( this, "SocNetV Editor", " Part of Social Network Visualizer" "

Developer:
Dimitris V. Kalamaras
" "
email: dimitris.kalamaras@gmail.com" "

Note: This text editor was adapted from Trolltech's application example." "

This program is free software; you can redistribute it and/or modify" "
it under the terms of the GNU General Public License as published by" "
the Free Software Foundation; either version 3 of the License, or" "
(at your option) any later version.

" "

This program is distributed in the hope that it will be useful," "
but WITHOUT ANY WARRANTY; without even the implied warranty of" "
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" "
GNU General Public License for more details.

" "

You should have received a copy of the GNU General Public License" "
along with this program; if not, write to the Free Software" "
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

"); } socnetv-0.90/src/edge.cpp0000755000175000017500000002711111423751762015571 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 edge.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include #include #include #include #include //used for qDebug messages #include #include "graphicswidget.h" #include "edge.h" #include "node.h" #include "edgeweight.h" static const double Pi = 3.14159265; static double TwoPi = 2.0 * Pi; Edge::Edge( GraphicsWidget *gw, Node *from, Node *to, float weight, int nodeSize, QString color, bool reciprocal, bool drawArrows, bool bez): graphicsWidget(gw) { qDebug("Edge: Edge()"); Q_UNUSED(nodeSize); graphicsWidget->scene()->addItem(this); //Without this, edges don not appear on the screen... from->addOutLink( this ); //adds this Edge to sourceNode to->addInLink( this ); //adds this Edge to targetNode source=from; //saves the sourceNode target=to; //Saves the targetNode m_color=color; m_drawArrows=drawArrows; m_reciprocal=reciprocal; m_startOffset=source->size(); //used to offset edge from the centre of node m_endOffset=target->size(); //used to offset edge from the centre of node qDebug("Edge() m_startOffset %i",(int) m_startOffset); qDebug("Edge() m_endOffset %i",(int) m_endOffset); m_arrowSize=5; //controls the width of the edge arrow eFrom = source->nodeNumber() ; eTo = target->nodeNumber() ; m_weight = weight ; m_Bezier = bez; adjust(); } void Edge::showArrows(bool drawArrows){ prepareGeometryChange(); m_drawArrows=drawArrows; } void Edge::removeRefs(){ //FIXME Need to disconnect signals from node to this "erased" edge qDebug("Edge: removeRefs()"); source->deleteOutLink(this); target->deleteInLink(this); } void Edge::remove(){ qDebug("Edge: remove(), calling removeRefs()"); removeRefs(); this->hide(); } void Edge::setColor( QString str) { m_color=str; prepareGeometryChange(); } QString Edge::color() { return m_color; } /* Called from MW when user wants to change an edge's weight. Updates both the width and the EdgeWeight */ void Edge::setWeight( float w) { m_weight = w; foreach (EdgeWeight *wgt, weightList) ///update the edgeWeight of this edge as well. wgt->setPlainText (QString::number(w)); } float Edge::weight() { return m_weight; } void Edge::setStartOffset(int offset){ m_startOffset=offset; } void Edge::setEndOffset(int offset){ m_endOffset=offset; } Node *Edge::sourceNode() const { return source; } void Edge::setSourceNode(Node *node) { source = node; adjust(); } Node *Edge::targetNode() const { return target; } void Edge::setTargetNode(Node *node){ target = node; adjust(); } int Edge::sourceNodeNumber () { return eFrom; } int Edge::targetNodeNumber() { return eTo; } //Called from EdgeWeight objects to 'connect' them to this edge. void Edge::addWeight (EdgeWeight* canvasWeight ) { weightList.push_back( canvasWeight) ; } void Edge::clearWeightList(){ weightList.clear(); } /* -leaves some empty space (offset) from node -make the edge weight appear on the centre of the edge */ void Edge::adjust(){ qDebug("Edge: adjust()"); if (!source || !target) return; QLineF line(mapFromItem(source, 0, 0), mapFromItem(target, 0, 0)); QPointF edgeOffset; if (source!=target) { qreal length = line.length(); edgeOffset = QPointF((line.dx() * m_endOffset) / length, (line.dy() *m_endOffset) / length); } else edgeOffset = QPointF(0, 0); prepareGeometryChange(); sourcePoint = line.p1() + edgeOffset; targetPoint = line.p2() - edgeOffset; qDebug()<<"----Edge: adjust() "<< sourcePoint.x()<< " "<setPos( (source->x()+target->x())/2.0, (source->y()+target->y())/2.0 ); } /* Returns the shape of this edge as a QPainterPath in local coordinates. The shape is used for many things, including collision detection, hit tests, and for the QGraphicsScene::items() functions. The default implementation calls boundingRect() to return a simple rectangular shape, but subclasses can reimplement this function to return a more accurate shape for non-rectangular items. For example, a round item may choose to return an elliptic shape for better collision detection */ QPainterPath Edge::shape () const { //qDebug()<<"Edge::shape()"; //too many debug messages... QPainterPath path; //path.addRegion(boundingRegion(QTransform())); path.addRect(boundingRect()); return path; } /* Defines the outer bounds of the edge as a rectangle; All painting will be restricted to inside the edge's bounding rect. Qt uses this bounding rect to determine whether the edge requires redrawing. */ QRectF Edge::boundingRect() const { if (!source || !target) return QRectF(); qreal penWidth = 1; qreal extra = ( penWidth + m_arrowSize) / 2.0; QRectF a = QRectF ( sourcePoint, QSizeF( targetPoint.x() - sourcePoint.x(), targetPoint.y() - sourcePoint.y()) ).normalized().adjusted(-extra, -extra, extra, extra); //qDebug()<<"Edge::boundingRect() extra = " << extra << "QSizeF width "<< a.width() << " QSizeF height "<< a.height(); if (source==target) { //self-edge has different bounding rect. return QRectF ( sourcePoint-QPointF(30,30), QSizeF(60,30)).normalized().adjusted(-extra, -extra, extra, extra); } return a; } void Edge::makeReciprocal(){ qDebug("Edge::makeReciprocal()"); prepareGeometryChange(); m_reciprocal= true; } void Edge::unmakeReciprocal(){ qDebug("Edge::unmakeReciprocal()"); prepareGeometryChange(); m_reciprocal= false; } void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *){ if (!source || !target) return; Q_UNUSED(option); // painter->setClipRect( option->exposedRect ); qDebug()<x() <<","<< (sourceNode())->y() << ") to node "<x() <<","<< (targetNode())->y() << ") of weight "<< m_weight; //Define the path upon which we' ll draw the line QPainterPath line(sourcePoint); //Construct the path if (source!=target) { if ( !m_Bezier){ qDebug("*** Edge::paint(). Constructing a line"); line.lineTo(targetPoint); } else { qDebug("*** Edge::paint(). Constructing a bezier curve"); } } else { //self-link QPointF c1 = QPointF( targetPoint.x() -30, targetPoint.y() -30 ); QPointF c2 = QPointF( targetPoint.x() +30, targetPoint.y() -30 ); qDebug()<<"*** Edge::paint(). Constructing a bezier self curve c1 "< 0) painter->setPen(QPen(QColor(m_color), width(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); else painter->setPen(QPen(QColor(m_color), width(), Qt::DashLine, Qt::RoundCap, Qt::RoundJoin)); //Draw the arrows only if we have different nodes. if (m_drawArrows && source!=target) { angle = 0; line_length = line.length(); line_dx = targetPoint.x()-sourcePoint.x(); line_dy = targetPoint.y()-sourcePoint.y(); if ( line.length() >0 ) angle = ::acos( line_dx / line_length ); qDebug() << " acos() " << ::acos( line_dx / line_length ) ; if ( line_dy >= 0) angle = TwoPi - angle; qDebug() << "*** Edge::paint(). Constructing arrows. First Arrow at target node" << "target-source: " << line_dx << " length: " << line_length << " angle: "<< angle; QPointF destArrowP1 = targetPoint + QPointF(sin(angle - Pi / 3) * m_arrowSize, cos(angle - Pi / 3) * m_arrowSize); QPointF destArrowP2 = targetPoint + QPointF(sin(angle - Pi + Pi / 3) * m_arrowSize, cos(angle - Pi + Pi / 3) * m_arrowSize); qDebug() << "*** Edge::paint() destArrowP1 " << destArrowP1.x() << "," << destArrowP1.y() << " destArrowP2 " << destArrowP2.x() << "," << destArrowP2.y(); painter->setBrush(QColor(m_color)); QPolygonF destP; destP << targetPoint << destArrowP1 << destArrowP2; line.addPolygon ( destP); //painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2); if (m_reciprocal) { qDebug("**** Edge::paint() This edge is SYMMETRIC! So, we need to create Arrow at src node as well"); QPointF srcArrowP1 = sourcePoint + QPointF(sin(angle +Pi / 3) * m_arrowSize, cos(angle +Pi / 3) * m_arrowSize); QPointF srcArrowP2 = sourcePoint + QPointF(sin(angle +Pi - Pi / 3) * m_arrowSize, cos(angle +Pi - Pi / 3) * m_arrowSize); qDebug() << "*** Edge::paint() srcArrowP1 " << srcArrowP1.x() << "," << srcArrowP1.y() << " srcArrowP2 " << srcArrowP2.x() << "," << srcArrowP2.y(); QPolygonF srcP; srcP << sourcePoint<< srcArrowP1<< srcArrowP2; line.addPolygon ( srcP); // painter->drawPolygon(QPolygonF() << line.p1() << srcArrowP1 << srcArrowP2); } else qDebug("*** Edge::paint() This edge is not symmetric. Therefore, I do not have anything else to do..."); } else { qDebug()<< "*** Edge::paint(). This edge is self-link - CONTINUE!"; } qDebug()<< "### Edge::paint(). DrawPath now...."; painter->drawPath(line); } /** Controls the width of the edge; is a function of edge weight */ float Edge::width(){ if ( fabs(m_weight) > 0 && fabs(m_weight) <=5) { qDebug()<< "Edge::width() will return "<< fabs(m_weight); return fabs(m_weight); } else if (fabs(m_weight) > 5 && fabs(m_weight) <=10) { return 6; } else if (fabs(m_weight) >10 && fabs(m_weight) <=20) { return 7; } else if (fabs(m_weight) >20 && fabs(m_weight)<=30) { return 8; } else if ( fabs(m_weight) > 30 ) return 9; return 1; // Default, if m_weight in (-1, 1) space } /** handles the events of a click on an edge*/ void Edge::mousePressEvent(QGraphicsSceneMouseEvent *event) { qDebug("Edge: pressEvent() emitting edgeClicked"); graphicsWidget->edgeClicked(this); if ( event->button()==Qt::LeftButton ) { qDebug("Edge: edge pressEvent() left click > "); // graphicsWidget->startNodeMovement(0); } if ( event->button()==Qt::RightButton ) { qDebug("Edge: Right-click on an edge, at %i, %i", event->screenPos().x(), event->screenPos().y()); graphicsWidget->openEdgeContextMenu(); } } socnetv-0.90/src/htmlviewer.cpp0000755000175000017500000001131411423751762017051 0ustar dimitrisdimitris/**************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop htmlviewer.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com *****************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "htmlviewer.h" #include #include HTMLViewer::HTMLViewer( const QString& manPath, QWidget* parent) :QMainWindow( parent ), pathCombo( 0 ) { view = new QWebView(this); view->load(QUrl(manPath)); this->setCentralWidget( view); QMenu* file = new QMenu( this ); file = menuBar()->addMenu(tr("&File")); fileOpen = new QAction(QIcon(":/images/open.png"), tr("&Open"), this); fileOpen->setShortcut(tr("Ctrl+O")); fileOpen->setStatusTip(tr("Opens another helpfile")); connect(fileOpen, SIGNAL(activated()), this, SLOT(openFile())); filePrint = new QAction(QIcon(":/images/print.png"), tr("&Print"), this); filePrint->setShortcut(tr("Ctrl+P")); filePrint->setStatusTip(tr("Prints out the actual network")); connect(filePrint, SIGNAL(activated()), this, SLOT(print())); fileQuit = new QAction(QIcon(":/images/exit.png"), tr("E&xit"), this); fileQuit->setShortcut(tr("Ctrl+X")); fileQuit->setStatusTip(tr("Close Manual")); connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); QIcon icon_back( ":/images/back.png" ); QIcon icon_forward( ":/images/forward.png" ); QIcon icon_home( ":/images/home.png" ); fileBack= new QAction(icon_back, tr("&Back"), this); fileBack->setShortcut(tr("Ctrl+B")); fileBack->setStatusTip(tr("&Backward") ); connect(fileBack, SIGNAL(activated()), view, SLOT(back())); fileForward= new QAction(icon_forward, tr("&Forward"), this); fileForward->setShortcut(tr("Ctrl+F")); fileForward->setStatusTip(tr("&Forward") ); connect(fileForward, SIGNAL(activated()), view, SLOT(forward())); fileHome= new QAction(icon_home, tr("&Home"), this); fileHome->setShortcut(tr("Ctrl+H")); fileHome->setStatusTip(tr("&Home") ); connect(fileHome, SIGNAL(activated()), view, SLOT(reload())); file->addAction( fileOpen); // file->addAction( filePrint); file->addSeparator(); file->addAction( fileQuit); QMenu* go = new QMenu( this ); go = menuBar()->addMenu(tr("&Go")); go->addAction( fileBack ); go->addAction( fileForward ); go->addAction( fileHome); // QMenu* help = new QMenu( this ); // help= menuBar()->addMenu(tr("&Help")); // help->addAction( tr("&About"), this, SLOT( about() ) ); // help->addAction( tr("About &Qt"), this, SLOT( aboutQt() ) ); QToolBar* toolbar = new QToolBar( this ); addToolBar( Qt::TopToolBarArea, toolbar); pathCombo = new QComboBox( toolbar ); connect( pathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( pathSelected( const QString & ) ) ); pathCombo->addItem(manPath); toolbar->addAction(fileBack); toolbar->addAction(fileForward); toolbar->addAction(fileHome); toolbar->addWidget( pathCombo ); view->setFocus(); this-> resize(700,650); } HTMLViewer::~HTMLViewer() { } void HTMLViewer::openFile() { #ifndef QT_NO_FILEDIALOG QString fn = QFileDialog::getOpenFileName( this, QString::null, QString::null ); if ( !fn.isEmpty() ) view->load(QUrl(fn)); #endif } void HTMLViewer::pathSelected( const QString &_path ) { view->load(QUrl(_path)); } socnetv-0.90/src/graphicswidget.cpp0000755000175000017500000006062211444336706017675 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 graphicswidget.cpp description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "graphicswidget.h" #include #include #include #include #include #include #include "mainwindow.h" #include "node.h" #include "edge.h" #include "nodenumber.h" #include "nodelabel.h" #include "backgrcircle.h" #include "edgeweight.h" /** Constructor method. Called when a GraphicsWidget object is created in MW */ GraphicsWidget::GraphicsWidget( QGraphicsScene *sc, MainWindow* par) : QGraphicsView ( sc,par) { setScene(sc); secondDoubleClick=FALSE; dynamicMovement=FALSE; moving=0; timerId=0; layoutType=0; m_nodeLabel=""; zoomIndex=3; m_currentScaleFactor = 1; m_currentRotationAngle = 0; markedNodeExists=false; //used in findNode() } /** http://thesmithfam.org/blog/2007/02/03/qt-improving-qgraphicsview-performance/#comment-7215 */ void GraphicsWidget::paintEvent ( QPaintEvent * event ){ QPaintEvent *newEvent=new QPaintEvent(event->region().boundingRect()); QGraphicsView::paintEvent(newEvent); delete newEvent; } /** Clears the scene */ void GraphicsWidget::clear() { int i=0; nodeHash.clear(); QList allItems=scene()->items(); foreach (QGraphicsItem *item, allItems ) { (item)->hide(); scene()->removeItem (item); i++; } } /** Adds a new node onto the scene Called from Graph::createVertex method when: we load files or the user presses "Add Node" button or the user double clicks (mouseDoubleClickEvent() calls Graph::createVertex */ void GraphicsWidget::drawNode( int num, int size, QString nodeColor, QString numberColor, int numberSize, QString nodeLabel, QString labelColor, int labelSize, QPointF p, QString shape, bool showLabels, bool numberInsideNode, bool showNumbers ) { qDebug()<< "GW: drawNode(): drawing new node at: " << p.x() << ", "<< p.y() ; if (numberInsideNode) size = size +3; Node *jim= new Node ( this, num, size, nodeColor, shape, numberInsideNode, m_labelDistance, m_numberDistance, p ); //Drawing node label - label will be moved by the node movement (see last code line in this method) NodeLabel *labelJim = new NodeLabel (jim, labelSize, nodeLabel, scene() ); labelJim -> setDefaultTextColor (labelColor); labelJim -> setTextInteractionFlags(Qt::TextEditorInteraction); if (showLabels) { //qDebug()<< "GW: drawNode: display label " << nodeLabel.toAscii() << " for node " << num; } else { //qDebug()<<"GW: drawNode: hiding label for node " << num; labelJim->hide(); } // drawing node number - label will be moved by the node movement (see last code line in this method) if (numberInsideNode) numberSize = size-2; NodeNumber *numberJim = new NodeNumber ( jim, numberSize, QString::number(num), scene() ); numberJim -> setDefaultTextColor (numberColor); if (!showNumbers){ numberJim->hide(); } nodeHash.insert(num, jim);//add new node to a container to ease finding, edge creation etc jim -> setPos( p.x(), p.y()); //finally, move the node where it belongs! } /** Draws an edge from source to target Node. This is used when we do not have references to nodes - only nodeNumbers: a) when we load a network file (check = FALSE) b) when the user clicks on the AddLink button on the MW. */ void GraphicsWidget::drawEdge(int i, int j, float weight, bool reciprocal, bool drawArrows, QString color, bool bezier){ qDebug()<<"GW: drawEdge ("<< i<< ","<< j<< ") with weight "<nodeNumber()<< " to node " << nodeHash.value(j)->nodeNumber() << " weight " << weight << " nodesize " << m_nodeSize << " edgecolor "<< color ; Edge *edge=new Edge (this, nodeHash.value(i), nodeHash.value(j), weight, m_nodeSize, color, reciprocal, drawArrows, bezier); edge -> setZValue(253); //Edges have lower z than nodes. Nodes always appear above edges. // Keep it here so that it doesnt interfere with dashed lines. edge->setBoundingRegionGranularity(0.05); // Slows down the universe...Keep it 0.05... //edge->setCacheMode (QGraphicsItem::DeviceCoordinateCache); //Also slows down the universe... QString edgeName = QString::number(i) + QString(">")+ QString::number(j); qDebug()<<"GW: drawEdge() - adding new edge between "<x() + (nodeHash.value(j))->x() ) / 2.0; double y = ( (nodeHash.value(i))->y() + (nodeHash.value(j))->y() ) / 2.0; EdgeWeight *edgeWeight = new EdgeWeight (edge, 7, QString::number(weight), scene() ); edgeWeight-> setPos(x,y); edgeWeight-> setDefaultTextColor (color); edgeWeight-> hide(); qDebug()<< "Scene items now: "<< scene()->items().size() << " - GW items now: "<< items().size(); } /** Called from Graph to make an existing arc symmetric (reciprocal) */ void GraphicsWidget::drawEdgeReciprocal(int source, int target){ qDebug("GW: drawEdgeReciprocal ()"); QString edgeName = QString::number(source) + QString(">")+ QString::number(target); qDebug("GW: making existing edge between %i and %i reciprocal. Name: "+edgeName.toAscii(), source, target ); edgesMap [edgeName]->makeReciprocal(); } /** Called from Graph to unmake an existing symmetric (reciprocal) edge to one-directed only. */ void GraphicsWidget::unmakeEdgeReciprocal(int source, int target){ qDebug("GW: unmakeEdgeReciprocal ()"); QString edgeName = QString::number(source) + QString(">")+ QString::number(target); qDebug("GW: removing edge between %i and %i. Name: "+edgeName.toAscii(), source, target ); edgesMap [edgeName]->unmakeReciprocal(); } /** Called when the user middle-clicks on two nodes consecutively. . It saves the source & target nodes that were clicked On the second middle-click, it emits the userMiddleClicked() signal to MW, which will notify activeGraph, which in turn will signal back to drawEdge()... */ void GraphicsWidget::startEdge(Node *node){ if (secondDoubleClick){ qDebug("GW: startEdge(): this is the second double click. Emitting userMiddleClicked() to create edge"); secondNode=node; emit userMiddleClicked(firstNode->nodeNumber(), secondNode->nodeNumber(), 1.0); ( (MainWindow*)parent() )->setCursor(Qt::ArrowCursor); secondDoubleClick=FALSE; } else{ qDebug("GW: startEdge(): this is the first double click."); firstNode=node; secondDoubleClick=TRUE; ( (MainWindow*)parent() )->setCursor( Qt::PointingHandCursor); } } /** This is called from each node when the user clicks on it. It emits the selectedNode signal to MW which is used to - display node info on the status bar - notify context menus for the clicked node. */ void GraphicsWidget::nodeClicked(Node *node){ qDebug ("GW: Emitting selectedNode()"); emit selectedNode(node); } /** This is called from each edge when the user clicks on it. It emits the selectedEdge signal to MW which is used to - display edge info on the status bar - notify context menus for the clicked edge. */ void GraphicsWidget::edgeClicked(Edge *edge){ qDebug ("GW: Emitting selectedEdge()"); emit selectedEdge(edge); } /** Called from each node when they move. Updates - node coordinates in activeGraph (via updateNodeCoords() signal) */ void GraphicsWidget::nodeMoved(int number, int x, int y){ //qDebug ("GW: nodeMoved() for %i with %i, %i. Emitting updateNodeCoords() signal", number, x,y); emit updateNodeCoords(number, x, y); } /** Called from activeGraph to update node coordinates on the canvas */ void GraphicsWidget::moveNode(int number, int x, int y){ qDebug ("GW: updateNode() %i with %i, %i", number, x,y); nodeHash.value(number)->setPos(x,y); } /** Called from Graph signal eraseNode(int) */ void GraphicsWidget::eraseNode(long int doomedJim){ qDebug() << "GW: Deleting node "<< doomedJim; QList list=scene()->items(); qDebug("GW: Scene items= %i - View items : %i",scene()->items().size(), items().size()); for (QList::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it)->type()==TypeNode) { Node *jim=(Node*) (*it); if ( jim->nodeNumber()==doomedJim) { qDebug() << "GW: found doomedJim " << jim->nodeNumber() << " Demanding node->die() :)" ; jim->die(); delete *it; break; } } } qDebug("GW: Scene items now= %i - View items now= %i ", scene()->items().size(), items().size() ); } /** Called from MainWindow when erasing edges using vertex numbers */ void GraphicsWidget::eraseEdge(int sourceNode, int targetNode){ qDebug("GW: Scene items= %i - View items : %i",scene()->items().size(), items().size()); QList list=scene()->items(); for (QList::iterator it=list.begin(); it!= list.end() ; it++){ if ( (*it)->type()==TypeEdge ) { Edge *edge=(Edge*) (*it); if ( edge->sourceNodeNumber()==sourceNode && edge->targetNodeNumber()==targetNode ) { removeItem(edge); break; } } } qDebug("GW: Scene items now= %i - View items now= %i ", scene()->items().size(), items().size() ); } /** Called from Node::die() to removeItem from nodeHash... */ void GraphicsWidget::removeItem( Node *node){ vector::iterator it; long int i=node->nodeNumber(); foreach ( Node *candidate, nodeHash) { if ( candidate->nodeNumber() == i ) nodeHash.remove( i ); } node->deleteLater (); qDebug() << "GW items now: " << items().size(); } /** Called from Node::die() to remove Edge edge ... */ void GraphicsWidget::removeItem( Edge * edge){ edge->remove(); delete (edge); } void GraphicsWidget::removeItem( NodeLabel *nodeLabel){ qDebug() << "GW items now: " << items().size(); delete (nodeLabel); qDebug() << "GW items now: " << items().size(); } void GraphicsWidget::removeItem( NodeNumber *nodeNumber){ delete (nodeNumber); } /** Accepts initial node color from MW. It is called from MW on startup and when user changes it. */ void GraphicsWidget::setInitNodeColor(QString color){ qDebug("GW setting initNodeColor"); m_nodeColor=color; } /** Sets initial edge color. Called from MW on startup and when user changes it. */ void GraphicsWidget::setInitLinkColor(QString color){ qDebug("GW setting initLinkColor"); m_linkColor=color; } /** Sets the color of an node. Called from MW when the user changes the color of a node (right-clicking). */ bool GraphicsWidget::setNodeColor(long int nodeNumber, QString color){ QList list=scene()->items(); for (QList::iterator it=list.begin(); it!= list.end() ; it++){ if ( (*it)->type()==TypeNode) { Node *node=(Node*) (*it); if ( node->nodeNumber()==nodeNumber ) { node->setColor(color); return true; } } } return false; } /** Makes node label appear inside node. Called from MW on user request. */ void GraphicsWidget::setNumbersInsideNodes(bool numIn){ qDebug("GW setting initNumberDistance"); foreach ( Node *m_node, nodeHash) { m_node->setNumberInside(numIn); if (numIn) this->setInitNodeSize(m_nodeSize+2); else this->setInitNodeSize(m_nodeSize-2); } } /** Changes/Sets the color of an edge. Called from MW when the user changes the color of an edge (right-clicking). */ bool GraphicsWidget::setEdgeColor(int source, int target, QString color){ QList list=scene()->items(); for (QList::iterator it=list.begin(); it!= list.end() ; it++){ if ( (*it)->type()==TypeEdge) { Edge *edge=(Edge*) (*it); if ( edge->sourceNodeNumber()==source && edge->targetNodeNumber()==target ) { edge->setColor(color); return true; } } } return false; } /** Changes/Sets the weight of an edge. Called from MW when the user changes the weight of an edge (right-clicking). */ bool GraphicsWidget::setEdgeWeight(int source, int target, float weight){ QList list=scene()->items(); for (QList::iterator it=list.begin(); it!= list.end() ; it++){ if ( (*it)->type()==TypeEdge) { Edge *edge=(Edge*) (*it); if ( edge->sourceNodeNumber()==source && edge->targetNodeNumber()==target ) { edge->setWeight(weight); edge->update(); return true; } } } return false; } /** Sets initial node size from MW. It is Called from MW on startup and when user changes it. */ void GraphicsWidget::setInitNodeSize(int size){ qDebug("GW setting initNodeSize"); m_nodeSize=size; } /** Sets initial number distance from node Called from MW on startup and when user changes it. */ void GraphicsWidget::setInitNumberDistance(int numberDistance){ qDebug("GW setting initNumberDistance"); m_numberDistance=numberDistance; } /** Passes initial label distance from node It is called from MW on startup and when user changes it. */ void GraphicsWidget::setInitLabelDistance(int labelDistance){ qDebug("GW setting initLabelDistance"); m_labelDistance=labelDistance; } /** * Changes the visibility of an GraphicsView edge (number, label, edge, etc) */ void GraphicsWidget::setEdgeVisibility(int source, int target, bool visible){ QString edgeName = QString::number( source ) + QString(">")+ QString::number( target ); if (visible) { if ( edgesMap.contains (edgeName) ) { qDebug()<<"GW: setEdgeVisibility(). Making edge between "<< source << " and "<< target << " VISIBLE."; edgesMap [edgeName] -> show(); } else { } } else { if ( edgesMap.contains (edgeName) ) { qDebug()<<"GW: setEdgeVisibility(). Making edge between "<< source << " and "<< target << " NOT VISIBLE."; edgesMap [edgeName] -> hide(); } } } /** * Changes the visibility of a Node */ void GraphicsWidget::setNodeVisibility(long int number, bool visible){ qDebug() << "GW: setNodeVisibility() for "<< number; QList list = scene()->items(); for (QList::iterator item=list.begin();item!=list.end(); item++) { if ( (*item)->type() == TypeNode){ if ( Node *node = qgraphicsitem_cast(*item) ) if ( node->nodeNumber() == number ) { if (visible){ qDebug() << "GW: setNodeVisibility(): Node numbered " << number << " found! Will be visible now..."; (*item)->show(); } else { qDebug() << "GW: setNodeVisibility(): Node numbered " << number << " found! Invisible now..."; (*item)->hide(); } } } } // qDebug() << "GW: setNodeVisibility() for "<< number; // foreach ( Node *candidate, nodeHash) { // if (candidate->nodeNumber() == number ) { // if (visible) { // qDebug() << "GW: setNodeVisibility(): Node numbered " << number << " found! Will be visible now..."; // candidate->show(); // candidate->update(); // } // else{ // qDebug() << "GW: setNodeVisibility(): Node numbered " << number << " found! Invisible now..."; // candidate->hide(); // } // // break; // } // // } } /* * Used by findNode. * Returns, if found, the node with label or number 'text' */ Node* GraphicsWidget::hasNode( QString text ){ vector::iterator it; bool ok = false; foreach ( Node *candidate, nodeHash) { if ( candidate->nodeNumber()==text.toInt(&ok, 10) || candidate->labelText().contains (text, Qt::CaseInsensitive) ) { qDebug() << "GW: hasNode(): Node " << text << " found!"; markedNodeExists=true; return candidate; break; } } return markedNode; //dummy return. We check markedNodeExists flag first... } /** Marks (by double-sizing and highlighting) or unmarks a node, given its number or label. Called by MW:slotFindNode() */ bool GraphicsWidget::setMarkedNode(QString nodeText){ qDebug ("GW: setMarkedNode()"); if (markedNodeExists) { markedNode->setSelected(false); //unselect it, so that it restores its color markedNode->setSize(originalNodeSize); //restore its size markedNodeExists=false; return true; } markedNode = hasNode (nodeText); if (!markedNodeExists) return false; markedNode->setSelected(true); //select it, so that it changes color originalNodeSize=markedNode->size(); // save its original size markedNode->setSize(2*originalNodeSize-1); //now, make it larger return true; } /** * Changes the visibility of all items of certain type (i.e. number, label, edge, etc) */ void GraphicsWidget::setAllItemsVisibility(int type, bool visible){ QList list = scene()->items(); for (QList::iterator item=list.begin();item!=list.end(); item++) { if ( (*item)->type() == type){ if (visible) (*item)->show(); else (*item)->hide(); } } } void GraphicsWidget::addBackgrCircle( int x0, int y0, int radius){ BackgrCircle *circ=new BackgrCircle (this, x0, y0, radius); circ->show(); } void GraphicsWidget::addBackgrHLine( int y0){ BackgrCircle *circ=new BackgrCircle (this, y0, this->width()); circ->show(); } /** * Removes all items of certain type (i.e. number, label, edge, etc) */ void GraphicsWidget::removeAllItems(int type){ qDebug()<< "GW: removeAllItems"; QList list = scene()->items(); for (QList::iterator item=list.begin();item!=list.end(); item++) { if ( (*item)->type() == type){ BackgrCircle *bgcircle = qgraphicsitem_cast (*item); qDebug()<< "GW: removeAllItems - located element"; bgcircle->die(); bgcircle->deleteLater (); delete *item; } } } void GraphicsWidget::clearBackgrCircles(){ qDebug()<< "GW: clearBackgrCircles"; this->removeAllItems(TypeBackgrCircle); } /** Starts a new node when the user double-clicks somewhere Emits userDoubleClicked to MW slot addNodeWithMouse() which - displays node info on MW status bar and - calls Graph::createVertex(), which in turn calls this->drawNode()... Yes, we make a full circle! :) */ void GraphicsWidget::mouseDoubleClickEvent ( QMouseEvent * e ) { if ( QGraphicsItem *item= itemAt(e->pos() ) ) { if (Node *node = qgraphicsitem_cast(item)) { Q_UNUSED(node); qDebug() << "GW: mouseDoubleClickEvent() double click on a node detected!" << " Cant create new one!"; return; } } QPointF p = mapToScene(e->pos()); qDebug()<< " GW: mouseDoubleClickEvent():double click detected on empty space. " << " Emitting signal to MW to create a new vertex in graph. e->pos() " << e->pos().x() << ", "<< e->pos().y() << ", "<< p.x() << ", " <items().size(), items().size()); } void GraphicsWidget::mousePressEvent( QMouseEvent * e ) { QPointF p = mapToScene(e->pos()); if ( QGraphicsItem *item= itemAt(e->pos() ) ) { if (Node *node = qgraphicsitem_cast(item)) { Q_UNUSED(node); qDebug() << "GW: mousePressEvent() single click detected on a node at pos " << e->pos().x() << ","<< e->pos().y() << " or "<< p.x() << ","<(item)) { Q_UNUSED(edge); qDebug() << "GW: mousePressEvent() single click detected on an edge at pos " << e->pos().x() << ","<< e->pos().y() << " or "<< p.x() << ","<scene()->clearSelection(); QGraphicsView::mousePressEvent(e); } } //void GraphicsWidget::mouseReleaseEvent( QMouseEvent * e ) { //QPointF p = mapToScene(e->pos()); //qDebug() << "GW: mouseReleaseEvent() detected at " //<< e->pos().x() << ","<< e->pos().y() << " or "<< p.x() << ","<pos() ) ) { //if (Node *node = qgraphicsitem_cast(item)) { //Q_UNUSED(node); //QGraphicsView::mouseReleaseEvent(e); //return; //} //} //else{ //qDebug() << "GW: mouseReleaseEvent(). No item here. Maybe end a selection rectangle? " //<< "I will save this pos"; //endPoint = //} //} /** On the event of a right-click on a node, the node calls this function to emit a signal to MW to open a context menu at the mouse position. Node is already passed with selectedNode(Node *) signal The position of the menu is determined by QMouse:pos()... */ void GraphicsWidget::openNodeContextMenu(){ qDebug("GW: emitting openNodeMenu()"); emit openNodeMenu(); } /** On the event of a right-click on an edge, the edge calls this function to emit a signal to MW to open a context menu at the mouse position. Edge is already passed with selectedNode(Node *) signal The position of the menu is determined by QMouse:pos()... */ void GraphicsWidget::openEdgeContextMenu(){ qDebug("GW: emitting openEdgeMenu()"); emit openEdgeMenu(); } /** Calls the scaleView() when the user spins the mouse wheel It passes delta as new m_scale */ void GraphicsWidget::wheelEvent(QWheelEvent *e) { qDebug("GW: Mouse wheel event"); qDebug() << "GW: delta = " << e->delta(); float m_scale = e->delta() / qreal(600); qDebug("GW: m_scale = %f", m_scale); if ( m_scale > 0) zoomIn(); else if ( m_scale < 0) zoomOut(); else m_scale=1; } /** Called from MW magnifier widgets */ void GraphicsWidget::zoomOut (){ if (zoomIndex > 0) { zoomIndex--; changeZoom(zoomIndex); } qDebug("GW: ZoomOut() index %i", zoomIndex); emit zoomChanged(zoomIndex); } /** Called from MW magnifier widgets */ void GraphicsWidget::zoomIn(){ qDebug("GW: ZoomIn()"); if (zoomIndex < 6) { zoomIndex++; changeZoom(zoomIndex); } qDebug("GW: ZoomIn() index %i", zoomIndex); emit zoomChanged(zoomIndex); } /** Initiated from MW zoomCombo widget to zoom in or out. */ void GraphicsWidget::changeZoom(int value) { double scaleFactor = 0.25; scaleFactor *= (value + 1); m_currentScaleFactor = scaleFactor; QMatrix oldMatrix = matrix(); resetMatrix(); // translate(oldMatrix.dx(), oldMatrix.dy()); this->scale(scaleFactor, scaleFactor); rotate(m_currentRotationAngle); } void GraphicsWidget::rot(int angle){ qDebug("rotating"); m_currentRotationAngle = angle; resetMatrix(); scale(m_currentScaleFactor, m_currentScaleFactor); rotate(angle); } /** Resizing the view causes a repositioning of the nodes maintaining the same pattern*/ void GraphicsWidget::resizeEvent( QResizeEvent *e ) { Q_UNUSED(e); // qDebug ("GraphicsWidget: resizeEvent"); // int w=e->size().width(); // int h=e->size().height(); // int w0=e->oldSize().width(); // int h0=e->oldSize().height(); // qreal fX= (double)(w)/(double)(w0); // qreal fY= (double)(h)/(double)(h0); // foreach (QGraphicsItem *item, scene()->items()) { // qDebug ("item will move by %f, %f", fX, fY); // if (Node *node = qgraphicsitem_cast(item) ) { // qDebug("Node original position %f, %f", item->x(), item->y()); // qDebug("Node will move to %f, %f",item->x()*fX, item->y()*fY); // node->setPos(mapToScene(item->x()*fX, item->y()*fY)); // } // else item->setPos(mapToScene(item->x()*fX, item->y()*fY)); // } // emit windowResized(w, h); } /** Destructor. */ GraphicsWidget::~GraphicsWidget(){ } socnetv-0.90/src/src.qrc0000755000175000017500000000323711321564634015457 0ustar dimitrisdimitris images/new.png images/open.png images/save.png images/saved.png images/exit.png images/add.png images/remove.png images/print.png images/help.png images/color.png images/colorize.png images/find.png images/letters.png images/line.png images/node.png images/nodes.png images/sm.png images/dm.png images/socnetv.png images/net.png images/net1.png images/net2.png images/net3.png images/box.png images/circle.png images/diamond.png images/symmetry.png images/plines.png images/zoomin.png images/zoomout.png images/connect.png images/disconnect.png images/resize.png images/nodecolor.png images/view.png images/diameter.png images/distance.png images/back.png images/forward.png images/home.png images/sw.png images/erdos.png images/circular.png images/clique.png images/triangle.png images/avdistance.png images/symmetrize.png images/nodeout.png images/nodein.png images/gridlines.png images/webcrawler.png socnetv-0.90/src/node.cpp0000755000175000017500000004117311423751762015616 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 node.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "node.h" #include #include #include #include #include //for QT_VERSION #include #include "graphicswidget.h" #include "edge.h" #include "nodelabel.h" #include "nodenumber.h" #include //sqrt Node::Node( GraphicsWidget* gw, int num, int size, QString col, QString shape, bool numIn, int ldist, int ndist, QPointF p ) : graphicsWidget (gw) { Q_UNUSED(p); graphicsWidget->scene()->addItem(this); //Without this nodes don't appear on the screen... //ItemSendsGeometryChanges introduced in Qt 4.6... #if QT_VERSION >= 0x040600 setFlags(ItemSendsGeometryChanges | ItemIsSelectable | ItemIsMovable); setCacheMode(QGraphicsItem::DeviceCoordinateCache); //QT < 4.6 if a cache mode is set, nodes do not respond to hover events #else setFlags(ItemIsSelectable | ItemIsMovable ); //Without this, the node cannot move nor be selected ... setCacheMode(QGraphicsItem::NoCache); //QT < 4.6 if a cache mode is set, nodes do not respond to hover events #endif setAcceptsHoverEvents(true); m_num=num; m_size=size; m_hasLabel=false; m_hasNumber=false; m_isNumberInside = numIn; m_shape=shape; m_col_str=col; m_col=QColor(col); m_nd=ndist; m_ld=ldist; m_poly_t=new QPolygon(3); m_poly_d=new QPolygon(4); qDebug()<< "Node: constructor: initial position at: " << this->x()<<", "<y() << " Will move at: "<< p.x()<<", "<mouseGrabberItem() == this) { newPos = pos(); return; } qreal xvel = 0; qreal yvel = 0; double dist =0; qreal c=15.0; qreal weight_coefficient=10; //affects speed and line length. Try 10... if (dynamicMovement){ // Sum up all pushing forces (i.e. imagine nodes are electrons) foreach (QGraphicsItem *item, scene()->items()) { Node *node = qgraphicsitem_cast(item); if (!node) continue; QLineF line(mapFromItem(node, 0, 0) , QPointF(0, 0) ); qreal dx = line.dx(); qreal dy = line.dy(); dist = (dx * dx + dy * dy); if (dist > 0) { xvel += (dx * c) / dist; yvel += (dy * c) / dist; } } // Now subtract all pulling forces (i.e. springs) double weight = (inEdgeList.size() + 1) * weight_coefficient; // double weight1 = (outEdgeList.size() + 1) * 20; qDebug("Node: edge weight %f", weight); foreach (Edge *edge, inEdgeList) { QPointF pos; if (edge->sourceNode() == this) //get other node's coordinates pos = mapFromItem(edge->targetNode(), 0, 0); else pos = mapFromItem(edge->sourceNode(), 0, 0); xvel += pos.x() / weight; yvel += pos.y() / weight; } foreach (Edge *edge, outEdgeList) { QPointF pos; if (edge->sourceNode() == this) pos = mapFromItem(edge->targetNode(), 0, 0); else pos = mapFromItem(edge->sourceNode(), 0, 0); xvel += pos.x() / weight; yvel += pos.y() / weight; } if (qAbs(xvel) < 0.1 && qAbs(yvel) < 0.1) xvel = yvel = 0; } QRectF sceneRect = scene()->sceneRect(); newPos = pos() + QPointF(xvel, yvel); newPos.setX(qMin(qMax(newPos.x(), sceneRect.left() + 10), sceneRect.right() - 10)); newPos.setY(qMin(qMax(newPos.y(), sceneRect.top() + 10), sceneRect.bottom() - 10)); } /** The vertices behave as atomic particles or celestial bodies, exerting attractive and repulsive forces on one another; the forces induce movement. Our algorithm will resemble molecular or planetary simulations, some- times called n -body problems. Following Eades, however, we know that we need not have a faithful simulation; we can apply unrealistic forces in an unrealistic manner. So, like Eades, we make only vertices that are neighbours attract each other, but all vertices repel each other. This is consistent with the asymmetry of our two guidelines above. */ void Node::calculateForcesFruchterman(bool dynamicMovement){ if (!scene() || scene()->mouseGrabberItem() == this) { newPos = pos(); return; } qreal xvel = 0; qreal yvel = 0; qreal c=1, ca=600; qreal dx = 0, dy=0; double l=0, dist=0; QLineF line; if (dynamicMovement){ l=c*sqrt(ca/10); // Sum up all forces pushing this item away (i.e. electron) foreach (QGraphicsItem *item, scene()->items()) { Node *node = qgraphicsitem_cast(item); if (!node) continue; QLineF line(mapFromItem(node, 0, 0) , QPointF(0, 0)); // line.setP1(mapFromItem(node, 0, 0)); // line.setP2(QPointF(0, 0)); dx = line.dx(); dy = line.dy(); dist = sqrt(dx * dx + dy * dy); //Euclidean distance qDebug("NODE: FR().... Repelling forces xvel = %f, yvel = %f", l*l / dist, l*l / dist); if (dist > 0) { xvel += ( dx * l ) / dist; yvel += ( dy * l ) / dist; } } qDebug("NODE: FR().... Repelling forces SUM xvel = %f, yvel = %f", xvel, yvel); // Now subtract all forces pulling items together foreach (Edge *edge, inEdgeList) { line.setP1(mapFromItem(edge->sourceNode(), 0, 0)); line.setP2(QPointF(0, 0)); dx = line.dx(); dy = line.dy(); dist = (dx * dx + dy * dy); //Euclidean distance ^2 qDebug("NODE: FR().... Attracting forces xvel = %f, yvel = %f", dist /l, dist /l); if (dist > 0) { xvel += dist /l; yvel += dist / l; } } qDebug("NODE: FR().... Attracting forces SUM xvel = %f, yvel = %f", xvel, yvel); // Now subtract all forces pulling items together foreach (Edge *edge, outEdgeList) { line.setP1(QPointF(0, 0)); line.setP2(mapFromItem(edge->sourceNode(), 0, 0)); dx = line.dx(); dy = line.dy(); dist = (dx * dx + dy * dy); //Euclidean distance ^2 qDebug("NODE: FR().... Attracting forces xvel = %f, yvel = %f", dist /l, dist /l); if (dist > 0) { xvel += dist /l; yvel += dist / l; /* xvel += dx+log (dist /10); yvel += dy+log (dist / 10);*/ } } qDebug("NODE: FR().... Attracting forces SUM xvel = %f, yvel = %f", xvel, yvel); if (qAbs(xvel) < 0.1 && qAbs(yvel) < 0.1) xvel = yvel = 0; qDebug("NODE: FR().... TOTAL SUM xvel = %f, yvel = %f", xvel, yvel); } QRectF sceneRect = scene()->sceneRect(); newPos = this->pos() + QPointF(xvel, yvel); newPos.setX(qMin(qMax(newPos.x(), sceneRect.left() + 10), sceneRect.right() - 10)); newPos.setY(qMin(qMax(newPos.y(), sceneRect.top() + 10), sceneRect.bottom() - 10)); qDebug("NODE: FR().... NEW NODE POSITION x = %f, y = %f", newPos.x(), newPos.y()); } /** Used by MW::slotChangeNodeColor */ void Node::setColor(QString str) { prepareGeometryChange(); m_col=QColor(str); } /** Used by MW::slotFindNode() */ void Node::setColor(QColor color){ m_col=color; } QString Node::color () { return m_col_str; } /** Sets the size of the node */ void Node::setSize(int size){ qDebug("Node: setSize()"); prepareGeometryChange(); m_size=size; foreach (Edge *edge, inEdgeList) { qDebug("Node: updating edges in inEdgeList"); edge->setEndOffset(size); } foreach (Edge *edge, outEdgeList) { qDebug("Node: updating edges in outEdgeList"); edge->setStartOffset(size); } setShape(m_shape); } /** Used by MainWindow::findNode() and Edge::Edge() */ int Node::size(){ qDebug("size()"); return m_size; } /** Called every time the user needs to change the shape of an node. */ void Node::setShape(QString shape) { qDebug("Node: setShape()"); prepareGeometryChange(); m_shape=shape; qDebug ("Node: setShape(): node is at x=%f and y=%f", x(), y()); } /* * Returns the shape of the node as a path (an accurate outline of the item's shape) * Used by the collision algorithm in collidesWithItem() */ QPainterPath Node::shape() const { //qDebug ("Node: shape()"); return (*m_path); } /* * Returns the bounding rectangle of the node * That is the rectangle where all painting will take place. */ QRectF Node::boundingRect() const { qreal adjust = 6; return QRectF(-m_size -adjust , -m_size-adjust , 2*m_size+adjust , 2*m_size +adjust); } /** Does the actual painting. Called by GraphicsView in every update() */ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) { // painter->setClipRect( option->exposedRect ); //if the node is being dragged aroung, darken it! if (option->state & QStyle::State_Selected) { //qDebug()<< " node : selected "; painter->setBrush(m_col.dark(150)); } else if (option->state & QStyle::State_MouseOver) { //qDebug()<< " node : mouse over"; painter->setBrush(m_col.dark(150)); setZValue(255); } //else if (option->state & QStyle::State_Sunken) { //qDebug()<< " node : sunken "; //setZValue(255); //painter->setBrush(m_col_dark.dark(160)); //} else { //no, just paint it with the usual color. //qDebug()<< " node : nothing"; setZValue(254); painter->setBrush(m_col); } painter->setPen(QPen(Qt::black, 0)); m_path = new QPainterPath; if ( m_shape == "circle") { m_path->addEllipse (-m_size, -m_size, 2*m_size, 2*m_size); } else if ( m_shape == "ellipse") { m_path->addEllipse(-m_size, -m_size, 2*m_size, 1.5* m_size); } else if ( m_shape == "box" || m_shape == "rectangle" ) { //rectangle: for GraphML compliance m_path->addRect (-m_size , -m_size , 1.8*m_size , 1.8*m_size ); } else if (m_shape == "roundrectangle" ) { //roundrectangle: GraphML only m_path->addRoundedRect (-m_size , -m_size , 1.8*m_size , 1.8*m_size, 60.0, 60.0, Qt::RelativeSize ); } else if ( m_shape == "triangle") { m_poly_t -> setPoints (3, 0,-m_size, -m_size,m_size, m_size,+m_size); m_path->addPolygon(*m_poly_t); m_path->closeSubpath(); } else if ( m_shape == "diamond"){ m_poly_d -> setPoints (4, 0,-m_size, -m_size,0, 0,+m_size, +m_size,0); m_path->addPolygon(*m_poly_d); m_path->closeSubpath(); } painter->drawPath (*m_path); } /** Removes the node */ void Node::die() { qDebug () << "Node: die() node= "<< nodeNumber(); foreach (Edge *edge, inEdgeList) { qDebug("Node: removing edges in inEdgeList"); edge->remove(); graphicsWidget->removeItem(edge); } foreach (Edge *edge, outEdgeList) { qDebug("Node: removing edges in outEdgeList"); edge->remove(); graphicsWidget->removeItem(edge); } this->deleteNumber(); this->deleteLabel(); inEdgeList.clear(); outEdgeList.clear(); this->hide(); graphicsWidget->removeItem(this); } void Node::setLabelText ( QString label) { prepareGeometryChange(); m_label->setPlainText(label); m_hasLabel=true; } QString Node::labelText ( ) { if (m_hasLabel) { return m_label->toPlainText(); } else return ""; } void Node::setNumberInside (bool numIn){ m_isNumberInside = numIn; //Move its graphic number QPointF myPos = this->pos(); if ( m_hasNumber ) { if (!m_isNumberInside) { //move it outside m_number -> setZValue(254); m_number -> setPos( myPos.x()+m_nd, myPos.y() ); } else { //move it inside node this->setSize(m_size+2); //increase size to display nicely the number m_number -> setZValue(255); m_number->setPos( myPos.x() - m_size-2, myPos.y() - m_size-2 ); } } } /** * Propagates the changes to connected elements, i.e. edges, numbers, etc. * Checks if the node is inside the scene. */ QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value) { QPointF newPos = value.toPointF(); switch (change) { case ItemPositionHasChanged : { foreach (Edge *edge, inEdgeList) //Move each inEdge of this node edge->adjust(); foreach (Edge *edge, outEdgeList) //Move each outEdge of this node edge->adjust(); //Move its graphic number if ( m_hasNumber ) { if (!m_isNumberInside) { //move it outside m_number -> setZValue(254); m_number -> setPos( m_size+m_nd, 0); } else { //move it inside node m_number -> setZValue(255); m_number -> setPos( - m_size, - m_size-3); } } if (m_hasLabel) { m_label->setPos( -2, m_ld+m_size); } if ( newPos.x() !=0 && newPos.y() != 0 ){ graphicsWidget->nodeMoved(nodeNumber(), (int) newPos.x(), (int) newPos.y()); } else qDebug()<< "Node: ItemChange(): Not emitting nodeMoved. Node "<< nodeNumber()<<" is at 0,0"; break; } case ItemEnabledHasChanged:{ return 0; } case ItemVisibleChange: { return 0; } default: { break; } }; return QGraphicsItem::itemChange(change, value); } /** handles the events of a click on a node */ void Node::mousePressEvent(QGraphicsSceneMouseEvent *event) { qDebug("Node: >> pressEvent() emitting nodeClicked"); // emit nodeClicked(this); graphicsWidget->nodeClicked(this); if ( event->button()==Qt::LeftButton ) { qDebug("Node: pressEvent() left click > startNodeMovement"); // emit startNodeMovement(0); // graphicsWidget->startNodeMovement(0); } if ( event->button()==Qt::RightButton ) { qDebug("Node: Right-click on node, at %i, %i", event->screenPos().x(), event->screenPos().y()); // emit openNodeContextMenu(); graphicsWidget->openNodeContextMenu(); /** Update commented out - caused segmentation fault when removing node */ // update(); // QGraphicsItem::mousePressEvent(event); } if ( event->button()==Qt::MidButton) { qDebug("Node: Middle-Click on a node. Calling GraphicsWidget startEdge()"); // emit startEdge(this); graphicsWidget->startEdge(this); } } void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { update(); QGraphicsItem::mouseReleaseEvent(event); } void Node::addInLink( Edge *edge ) { qDebug() << "Node: addInLink() for "<< m_num; inEdgeList.push_back( edge); //qDebug ("Node: %i inEdgeList has now %i edges", m_num, inEdgeList.size()); } void Node::deleteInLink( Edge *link ){ qDebug () << "Node: deleteInLink for "<< m_num; //qDebug ("Node: %i inEdgeList has %i edges", m_num, inEdgeList.size()); inEdgeList.remove( link); //qDebug ("Node: %i inEdgeList has now %i edges", m_num, inEdgeList.size()); } void Node::addOutLink( Edge *edge ) { qDebug("Node: addOutLink()"); outEdgeList.push_back( edge); // qDebug ("Node: outEdgeList has now %i edges", outEdgeList.size()); } void Node::deleteOutLink(Edge *link){ qDebug () << "Node: deleteOutLink() from " << m_num; // qDebug ("Node: %i outEdgeList has %i edges", m_num, outEdgeList.size()); outEdgeList.remove( link); // qDebug ("Node: %i outEdgeList has now %i edges", m_num, outEdgeList.size()); } void Node::addLabel (NodeLabel* gfxLabel ) { //qDebug("NODE: add label"); m_label=gfxLabel ; m_hasLabel=true; } NodeLabel* Node::label(){ return m_label; } void Node::deleteLabel(){ qDebug ("Node: deleteLabel "); m_hasLabel=false; m_label->hide(); graphicsWidget->removeItem(m_label); } void Node::clearLabel(){ m_hasLabel=false; } void Node::addNumber (NodeNumber *gfxNum ) { m_number=gfxNum ; m_hasNumber=true; } void Node::deleteNumber( ){ qDebug ("Node: deleteNumber "); m_number->hide(); graphicsWidget->removeItem(m_number); } // Node::~Node(){ // /* qDebug("~Node() calling hide()"); // this->hide(); // qDebug("hide() ok!");*/ // // } // socnetv-0.90/src/graph.h0000755000175000017500000003767411444336706015452 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 graph.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef GRAPH_H #define GRAPH_H #include #include #include #include #include //FYI: stack is a wrapper around in C++, see: www.cplusplus.com/reference/stl/stack #include #include "vertex.h" #include "matrix.h" #include "parser.h" #include "webcrawler.h" using namespace std; class QPointF; class QDateTime; /** This is the main class for a Graph, used in conjuction with Vertex, Parser and Matrix objects. Graph class has the interface and the various network algorithms Vertex class holds each vertex data (colors, strings, statistics, etc) Matrix class holds the adjacency matrix of the network. Parser class loads files of networks. */ typedef QList Vertices; typedef map imap_i; typedef map imap_f; typedef QHash hash_si; class Graph: public QObject{ Q_OBJECT public slots: /** Slots to signals from Parser */ void createVertex( int i, int size, QString nodeColor, QString numColor, int numSize, QString label, QString lColor, int lSize, QPointF p, QString nodeShape, bool signalMW );//Main vertex creation call void setFileType(int, QString, int,int, bool); void removeDummyNode(int); /** Slots to signals from GraphicsWidget and Parser*/ void createEdge (int, int, float, QString, int, bool, bool); //GW and Parser. void createEdge (int, int, float, int, bool, bool); //GW void createEdge (int, int); //WebCrawler void nodeMovement(int state, int type, int cW, int cH); //Called by MW to start movement void slotSetEdgeVisibility( int, int, bool); //auxiliary createVertex functions void createVertex(int i, QPointF p); //Called by GW void createVertex(int i, int canvasWidth, int canvasHeight); //Called by MW void createVertex(QString label, int i) ; //Called by WebCrawler /** Slots to signals from MainWindow */ void setCanvasDimensions(int w, int h); void filterOrphanVertices ( bool ); //Called by MW to filter orphan vertices void filterEdgesByWeight (float, bool); //Called by MW to filter edges over/under a weight void webCrawl( QString, int, int, bool); //Called by MW to start a web crawler... signals: /** Signals to MainWindow */ void updateProgressDialog(int ); void graphChanged(); //call to update MW widgets void selectedVertex(int); //notifies MW who is the selected node void signalFileType (int, QString, int,int, bool); //notifies MW what we have loaded. void statusMessage (QString message); //updates statusbar message /** Signals to GraphicsWidget */ void drawNode( int ,int, QString, QString, int, QString, QString, int, QPointF, QString, bool, bool, bool); //call GW to draw a node void eraseNode (long int); //erase node from GW void drawEdge(int, int, float, bool, bool, QString, bool); //call GW to draw an edge void eraseEdge(int, int); //emited from removeEdge() to GW to clear the edge item. void setEdgeVisibility ( int, int, bool); // emitted from each Vertex void setVertexVisibility(long int, bool); //notifies GW to disable a node void drawEdgeReciprocal(int, int); //call GW to draw the edge as symmetric one void addBackgrCircle(int, int, int); //call GW to draw a circular layout line somewhere. void addBackgrHLine (int); //call GW to draw a horizontal layout line somewhere. void moveNode(int, int, int); public: /* INIT AND CLEAR*/ Graph(); //Creates a new graph. void clear(); //Clears m_graph ~Graph(); //destroy object void setSocNetV_Version (QString ver) { VERSION = ver; } void setShowLabels(bool toggle); void setShowNumbersInsideNodes(bool toggle); /*FILES (READ AND WRITE)*/ bool loadGraph ( QString, bool, int maxWidth, int maxHeight, int format, int two_sm_mode); //Our almost universal network loader. :) bool saveGraph( QString fileName, int fileType, QString networkName, int maxWidth, int maxHeight ); bool saveGraphToPajekFormat (QString fileName,QString networkName, int maxWidth, int maxHeight); bool saveGraphToAdjacencyFormat (QString fileName, int maxWidth, int maxHeight); bool saveGraphToDotFormat (QString fileName, QString networkName, int maxWidth, int maxHeight); bool saveGraphToGraphMLFormat (QString fileName,QString networkName, int maxWidth, int maxHeight); /* VERTICES */ int lastVertexNumber(); //Returns the number of the last vertex int firstVertexNumber(); //Returns the number of the first vertex int hasVertex(long int ); //Checks if a vertex exists int hasVertex(QString); //Checks if a vertex with a label exists void removeVertex (long int ); //removes given vertex from m_graph void setInitVertexSize (long int); //Changes the init size used in new vertices. void setVertexSize(long int v, int ); //Changes the size.of vertex v void setInitVertexShape (QString); //Changes the init shape used in new vertices. void setVertexShape(int v, QString shape); //Changes the shape.of vertex v QString shape(int v); //returns the shape of this vertex void setInitVertexColor (QString color); //Changes the init color used in new vertices void setVertexColor(long int v, QString color); //Changes the color.of vertex v void setInitVertexNumberColor ( QString color); //Changes the init number color in new vertices void setInitVertexNumberSize (int size); //Changes the init number size in new vertices void setInitVertexLabelSize(int newSize); //Changes the init size of new vertices labels void setVertexLabelSize(int v, int newSize); //Changes the size of a vertex label void setInitVertexLabelColor(QString color); //Changes the init color used by all new vertices' labels void setVertexLabel(int v, QString label); //Changes the label.of vertex v void setVertexLabelColor(int v1, QString color); QString label(int); void updateVertCoords(int v, int x, int y); //Updates vertex v with coords x,y int vertices() ; //Returns the sum of vertices inside m_graph int edgesFrom (int i) ; //Returns the number of edges starting from v1 (outDegree) int edgesTo (int i) ; //Returns the number of edges ending to v1 (inDegree) int verticesWithOutEdges(); //Returns the sum of vertices having outEdges int verticesWithInEdges(); //Returns the sum of vertices having inEdges int verticesWithReciprocalEdges(); //Returns the sum of vertices having reciprocal edges /* EDGES */ float hasEdge (int v1, int v2); //Checks if edge between v1 and v2 exists. Returns weight or -1 void removeEdge (int v1, int v2); //removes the edge between v1 and v2 void setEdgeWeight (int v1, int v2, float w); //Sets the edge weight between v1 and v2 void setInitEdgeColor(QString); void setEdgeColor(long int s, long int t, QString color); //Changes the color of edge (s,t). QString edgeColor (long int s, long int t); //Returns the edgeColor int totalEdges (); //Returns the sum of edges inside m_graph float density(); //Returns ratio of present edges to total possible edges. bool symmetricEdge(int v1, int v2); //Returns TRUE if (v1, v2) is symmetric. bool isSymmetric(); //Returns TRUE if symmetricAdjacencyMatrix=TRUE void symmetrize(); //Symmetrize all edges so that the network is undirected. void createAdjacencyMatrix(bool); void invertAdjacencyMatrix(); /* PRINT OUT TO FILES*/ void writeDataSetToFile(QString ); // Writes a known dataset to a file. void writeAdjacencyMatrixTo(QTextStream& os); //Exports the adjacency matrix to a given textstream void writeAdjacencyMatrix(const char*, const char*); //Writes the adjacency matrix to a given file. void writeInvertAdjacencyMatrix(const char*, const char*); void writeDistanceMatrix(const char*, const char*, const char*);//Writes the distance matrix to a file friend QTextStream& operator << (QTextStream& os, Graph& m); // void writeCentralityInDegree(const QString, bool); //Writes the in-degree centralities to a file void writeCentralityOutDegree(const QString, const bool); //Writes the out-degree centralities to a file void writeCentralityCloseness(const QString, const bool); //Writes the closeness centralities to a file void writeCentralityBetweeness(const QString, const bool); //Writes the betweeness centralities to a file void writeCentralityGraph(const QString, const bool); //Writes the Graph centralities to a file void writeCentralityPower(const QString, const bool); //Writes the Power centralities to a file void writeCentralityStress(const QString, const bool); //Writes the Stress centralities to a file void writeCentralityEccentricity(const QString, const bool); //Writes the Eccentr centralities to a file void writeCentralityInformation(const QString); //Writes the Information centralities to a file void writeNumberOfCliques(const QString fileName, const bool considerWeights); void writeClusteringCoefficient(const QString, const bool); //Writes the clustering coefficients to a file void writeTriadCensus(const QString, const bool); //Writes the triad census to a file /* DISTANCES & CENTRALITIES */ int distance( int, int); //Returns the geodesic distance between two vertices int diameter(); //Returns the diameter of the graph (maximum shortest path). float averageGraphDistance(); //Returns the average shortest path length (average geodesic). void createDistanceMatrix(bool); //Creates the distance matrix and calculates the centralities, if bool is true. void centralityInDegree(bool); //Calculates the inDegree centrality of each vertex void centralityOutDegree(bool); //Calculates the outDegree centrality of each vertex void centralityInformation(); float numberOfTriples(int v1); //Returns the number of triples at vertex v1 float numberOfCliques(int v1); //Calculates the number of cliques (triangles) of vertex v1 float numberOfCliques(); //Calculates the number of cliques (triangles) of the whole graph float clusteringCoefficient(int v1); float clusteringCoefficient (); bool triadCensus(); void examine_MAN_label(int, int, int, Vertex*, Vertex*, Vertex* ); // void eccentr_JordanCenter(); // TODO /* LAYOUTS */ void layoutRandom(double maxWidth, double maxHeight); void layoutRadialCentrality(double x0, double y0, double maxRadius, int CentralityType); void layoutLayeredCentrality(double maxWidth, double maxHeight, int CentralityType); void layoutForceDirectedSpringEmbedder(bool dynamicMovement); void layoutForceDirectedFruchtermanReingold(bool dynamicMovement); /**RANDOM NETWORKS*/ void createRandomNetErdos (int, double); //Creates a uniform random network void createRandomNetRingLattice (int, int, double, double, double); //Creates a ring lattice network void createSameDegreeRandomNetwork (int, int); //Creates a random network with the same degree in all nodes void createRandomNetSmallWorld (int, int, double, double, double, double); //Creates a small world network int factorial (int); // for (n 2)p edges calculation /* index stores the real position of each vertex inside m_graph. It starts at zero (0). We need to know the place of a vertex inside m_graph after adding or removing many vertices */ imap_i index; // Stores the number of vertices at distance n from a given vertex imap_i sizeOfNthOrderNeighborhood; /* maps have O(logN) lookup complexity */ /* Consider using tr1::hashmap which has O(1) lookup, but this is not ISO C++ yet :( */ protected: void timerEvent(QTimerEvent *event); // Called from nodeMovement when a timerEvent occurs private: /** List of pointers to the vertices. A vertex stores all the info: links, colours, etc */ Vertices m_graph; Parser parser; //file loader threaded class. WebCrawler crawler; /** private member functions */ void addVertex ( int v1, int val, int size, QString color, QString numColor, int numSize, QString label, QString labelColor, int labelSize, QPointF p, QString shape ); // adds a vertex to m_graph void addEdge (int v1, int v2, float w, QString color, int reciprocal); //adds an edge between v1 and v2, weight w, colored /** methods used by createDistanceMatrix() */ void BFS(int, bool); //Breadth-first search void minmax(float C, Vertex *v, float &max, float &min, int &maxNode, int &minNode) ; //helper void resolveClasses(float C, hash_si &discreteClasses, int &classes); //helper void resolveClasses(float C, hash_si &discreteClasses, int &classes, int name); //helper /** used in resolveClasses and createDistanceMatrix() */ hash_si discreteIDCs, discreteODCs, discreteCCs, discreteBCs, discreteSCs, discreteGCs, discreteECs, discretePCs, discreteICs; int *eccentricities; bool calculatedIDC, calculatedODC, calculatedCentralities, dynamicMovement; QList triadTypeFreqs; //stores triad type frequencies Matrix TM, DM, sumM, invAM, AM, invM; stack Stack; float meanDegree, varianceDegree; float minIDC, maxIDC, sumIDC, groupIDC; float minODC, maxODC, sumODC, groupODC; float minCC, maxCC, nomCC, denomCC, sumCC, groupCC, maxIndexCC; float minBC, maxBC, nomBC, denomBC, sumBC, groupBC, maxIndexBC; float minGC, maxGC, nomGC, denomGC, sumGC, groupGC, maxIndexGC; float minPC, maxPC, sumPC, groupPC, maxIndexPC; float minSC, maxSC, nomSC, denomSC, sumSC, groupSC, maxIndexSC; float minEC, maxEC, nomEC, denomEC, sumEC, groupEC, maxIndexEC; float minIC, maxIC, nomIC, denomIC, sumIC, groupIC, maxIndexIC; float minCLC, maxCLC, averageCLC, averageIC; int maxNodeCLC, minNodeCLC; int classesIDC, maxNodeIDC, minNodeIDC; int classesODC, maxNodeODC, minNodeODC; int classesCC, maxNodeCC, minNodeCC; int classesBC, maxNodeBC, minNodeBC; int classesGC, maxNodeGC, minNodeGC; int classesPC, maxNodePC, minNodePC; int classesSC, maxNodeSC, minNodeSC; int classesEC, maxNodeEC, minNodeEC; int classesIC, maxNodeIC, minNodeIC; int sizeOfComponent; /** General & initialisation variables */ long int m_totalEdges, m_totalVertices, graphDiameter, initVertexSize; int initVertexLabelSize, initVertexNumberSize; int isolatedVertices; float averGraphDistance, nonZeroDistancesCounter; int outEdgesVert, inEdgesVert, reciprocalEdgesVert; int timerId, layoutType, canvasWidth, canvasHeight; bool order, initShowLabels, initNumbersInsideNodes; bool adjacencyMatrixCreated, symmetricAdjacencyMatrix, graphModified, distanceMatrixCreated; bool m_undirected; QString VERSION, networkName, initEdgeColor, initVertexColor, initVertexNumberColor, initVertexLabelColor, initVertexShape; QDateTime actualDateTime; }; #endif socnetv-0.90/src/edge.h0000755000175000017500000000637611444336706015250 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 edge.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef EDGE_H #define EDGE_H using namespace std; #include #include #include //declares pair construct class GraphicsWidget; class QGraphicsSceneMouseEvent; class Node; class EdgeWeight; static const int TypeEdge= QGraphicsItem::UserType+2; class Edge : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES (QGraphicsItem) public: Edge(GraphicsWidget *, Node*, Node*, float, int, QString, bool, bool, bool); enum { Type = UserType + 2 }; int type() const { return Type; } Node *sourceNode() const; void setSourceNode(Node *node); Node *targetNode() const; void setTargetNode(Node *node); void setStartOffset(int ); void setEndOffset(int ); void removeRefs(); int sourceNodeNumber(); int targetNodeNumber(); void setWeight( float w) ; float weight(); void setColor( QString str) ; QString color() ; void addWeight (EdgeWeight* canvasWeight ) ; void clearWeightList(); float width(); void showArrows(bool); void toggleAntialiasing(bool); void makeReciprocal(); void unmakeReciprocal(); QPainterPath shape() const; public slots: void adjust (); void remove(); protected: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void mousePressEvent(QGraphicsSceneMouseEvent *event); private: GraphicsWidget *graphicsWidget; Node *source, *target; QPointF sourcePoint, targetPoint; qreal m_arrowSize, m_startOffset, m_endOffset; list weightList; QString m_color; int eFrom, eTo; float m_weight; int tox1, tox2, toy1, toy2, size; double rad, theta, theta1, theta2; qreal angle, line_length, line_dx, line_dy; bool m_Bezier, m_drawArrows, m_reciprocal; }; #endif socnetv-0.90/src/webcrawlerdialog.h0000644000175000017500000000363311423751762017647 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 webcrawlerdialog.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef WEBCRAWLERDIALOG_H #define WEBCRAWLERDIALOG_H #include #include "ui_webcrawlerdialog.h" class WebCrawlerDialog: public QDialog { Q_OBJECT public: WebCrawlerDialog (QWidget *parent = 0); public slots: void gatherData (); signals: void userChoices( QString, int, int, bool); private: Ui::WebCrawlerDialog ui; }; #endif socnetv-0.90/src/edgeweight.h0000755000175000017500000000376111423751762016453 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop edgeweight.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef EDGEWEIGHT_H #define EDGEWEIGHT_H #include #include "edge.h" static const int TypeEdgeWeight = QGraphicsItem::UserType+5; class EdgeWeight: public QGraphicsTextItem { public: EdgeWeight(Edge * , int, QString, QGraphicsScene * ); void removeRefs(); void move(double x, double y); enum { Type = UserType + 5 }; int type() const { return Type; } ~EdgeWeight(); private: }; #endif socnetv-0.90/src/mainwindow.h0000755000175000017500000003203611454777761016523 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 mainwindow.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef APP_H #define APP_H #include #include /** SocNetV specific includes*/ #include #include "graphicswidget.h" #include "graph.h" #include "filteredgesbyweightdialog.h" #include "webcrawlerdialog.h" #include "datasetselectdialog.h" static const QString VERSION="0.90"; /** * This Class is the base class. It sets up the main * window and provides a menubar, toolbar and statusbar. * For the main view, an instance of class GraphicsWidget is * created which creates a graphics widget. */ using namespace std; class QMenu; class QAction; class QCheckBox; class QProgressDialog; class Edge; class Node; class QPushButton; class QLCDNumber; class QSlider; class QComboBox; class QGroupBox; class QTabWidget; class QSpinBox; class MainWindow : public QMainWindow { Q_OBJECT public: /**PUBLIC FUNCTIONS NOT VISIBLE BY OTHER WIDGETS NOR BY SLOT/LINK MECHANISM */ GraphicsWidget *graphicsWidget; MainWindow(const QString &f); ~MainWindow(); void initActions(); void initMenuBar(); void initToolBar(); void initToolBox(); void initStatusBar(); void initNet(); void initView(); void createFortuneCookies(); void createTips(); void makeThingsLookRandom(); bool showLabels(); bool showNumbersInsideNodes(); bool showNumbers(); // Main network file loader method bool loadNetworkFile ( QString, int ); int activeLinks(); int activeNodes(); void openContextMenu(const QPointF & mPos); void changeAllNodesSize(int size); QString initNodeColor; int clickedJimNumber; //it is public because we need to be visible from activegraph. void createProgressBar(); void destroyProgressBar(); public slots: //FILE MENU void slotCreateNew(); void slotChooseFile(); void slotImportGraphML(); void slotImportPajek(); void slotImportSM(); void slotImportDot(); void slotImportGML(); void slotImportDL(); void slotImportEdgeList(); void slotImportTwoModeSM(); void slotFileSave(); void slotFileSaveAs(); void slotFileClose(); void slotPrintView(); bool slotExportBMP(); bool slotExportPNG(); bool slotExportPDF(); void slotExportPajek(); void slotExportSM(); bool slotExportDL(); bool slotExportGW(); bool slotExportList(); //NETWORK MENU void slotOpenTextEditor(); void slotViewNetworkFile(); void slotViewAdjacencyMatrix(); void slotShowDataSetSelectDialog(); void slotRecreateDataSet(QString); void slotCreateRandomNetErdos(); void slotCreateSameDegreeRandomNetwork(); void slotCreateGaussianRandomNetwork(); void slotCreateRandomNetRingLattice(); void slotCreateSmallWorldRandomNetwork(); void slotShowWebCrawlerDialog(); void slotWebCrawl(QString, int, int, bool); //EDIT MENU void slotFindNode(); void slotAddLink(); void slotRemoveNode(); void slotRemoveLink(); void slotChangeNodeLabel(); void slotChangeNodeColor(); void slotChangeNodeValue(); void slotChangeNodeSize(); void slotChangeNodeBox(); void slotChangeNodeCircle(); void slotChangeNodeTriangle(); void slotChangeNodeDiamond(); void slotChangeNodeEllipse(); void slotChangeLinkLabel(); void slotChangeLinkColor(); void slotChangeLinkWeight(); void slotFilterNodes(); void slotFilterOrphanNodes(); void slotShowFilterEdgesDialog(); void slotTransformNodes2Links(); void slotSymmetrize(); // LAYOUT MENU void slotColorationStrongStructural(); void slotColorationRegular(); void slotLayoutRandom(); void slotLayoutRandomCircle(); void slotLayoutRadialCentralityOutDegree(); void slotLayoutRadialCentralityInDegree(); void slotLayoutRadialCentralityCloseness(); void slotLayoutRadialCentralityBetweeness(); void slotLayoutRadialCentralityPower(); void slotLayoutRadialCentralityInformation(); void slotLayoutRadialCentralityStress(); void slotLayoutRadialCentralityGraph(); void slotLayoutRadialCentralityEccentr(); void slotLayoutLayeredCentralityInDegree(); void slotLayoutLayeredCentralityOutDegree(); void slotLayoutLayeredCentralityCloseness(); void slotLayoutLayeredCentralityBetweeness(); void slotLayoutLayeredCentralityInformation(); void slotLayoutSpringEmbedder(); void layoutSpringEmbedder (int); void slotLayoutFruchterman(); void layoutFruchterman(int); void slotLayoutNodeSizeProportionalOutEdges(bool); void slotLayoutNodeSizeProportionalInEdges(bool); //STATISTICS MENU void slotViewDistanceMatrix(); void slotGraphDistance(); void slotAverageGraphDistance(); void slotDiameter(); void slotNumberOfCliques(); void slotClusteringCoefficient(); void slotTriadCensus(); void slotCheckSymmetry(); void slotInvertAdjMatrix(); void slotCentralityOutDegree(); void slotCentralityInDegree(); void slotCentralityCloseness(); void slotCentralityBetweeness(); void slotCentralityInformation(); void slotCentralityGraph(); void slotCentralityStress(); void slotCentralityPower(); void slotCentralityEccentricity(); //OPTIONS MENU void slotDisplayNodeNumbers(bool toggle); void slotDisplayNodeLabels(bool toggle); void slotDisplayNumbersInsideNodes(bool toggle); void slotChangeAllNodesSize(); void slotChangeAllNodesShape(); void slotChangeNumbersSize(); void slotChangeLabelsSize(); void slotDrawLinksThickAsWeights(); void slotDrawLinksBezier(bool toggle); void slotDisplayLinksWeightNumbers(bool toggle); void slotDisplayLinks(bool toggle); void slotDisplayLinksArrows(bool toggle); void slotBackgroundColor (); void slotAllNodesColor(); void slotAllLinksColor(); void slotAllNumbersColor(); void slotAllLabelsColor(); //VIEW MENU void slotAntialiasing(bool ); void slotShowProgressBar(bool toggle); void slotPrintDebug(bool toggle); void slotViewToolBar(bool toggle); void slotViewStatusBar(bool toggle); void slotBackgroundImage(bool toggle); //HELP MENU void slotTips(); void slotHelp(); void slotHelpAbout(); void slotAboutQt(); //PUBLICLY AVAILABLE SLOTS. CALLED FROM GRAPHICSVIEW void nodeInfoStatusBar(Node*); void linkInfoStatusBar (Edge*); void openNodeContextMenu(); void openLinkContextMenu() ; void windowInfoStatusBar(int, int); void graphChanged(); //Called by graphicswidget to update node coords in activeGraph void updateNodeCoords(int no, int x, int y); //Called when user pushes the New Node button on the MW void addNode(); //Called by graphicswidget when the user middle-clicks void addLink (int v1, int v2, float weight); //Called by graphicswidget when the user double-clicks void addNodeWithMouse(int, QPointF); //Called by Graph on saving file. int is the network type saved. void networkSaved(int); //Called by Graph to display some message to the user void statusMessage(const QString); //Called by Graph to update what the selected node is. void selectedNode (const int); //Called from Graph when a network file is loaded. void fileType(int, QString , int, int, bool); protected: void resizeEvent( QResizeEvent * ); void closeEvent( QCloseEvent* ce ); // void myMessageOutput(QtMsgType type, const char *msg); signals: private: QGraphicsScene *scene; FilterEdgesByWeightDialog m_filterEdgesByWeightDialog; WebCrawlerDialog m_WebCrawlerDialog; DataSetSelectDialog m_datasetSelectDialog; Graph activeGraph; QPrinter *printer; QToolBar *toolBar; QComboBox *zoomCombo; QTabWidget *toolBox; QProgressDialog *progressDialog; Node *clickedJim; Node *markedNode; Edge *clickedLink; QMenu *importSubMenu, *exportSubMenu, *editMenu, *statMenu, *helpMenu; QMenu *optionsMenu, *colorOptionsMenu, *linkOptionsMenu, *nodeOptionsMenu, *viewOptionsMenu; QMenu *editNodeMenu, *editLinkMenu, *centrlMenu, *layoutMenu; QMenu *networkMenu, *randomNetworkMenu, *filterMenu; QMenu *randomLayoutMenu, *circleLayoutMenu, *levelLayoutMenu, *physicalLayoutMenu; QMenu *colorationMenu; QCheckBox *moveSpringEmbedderBx, *moveFruchtermanBx, *moveKamandaBx, *nodeSizeProportional2OutDegreeBx, *nodeSizeProportional2InDegreeBx ; QSpinBox *rotateSpinBox ; QPushButton *addNodeBt, *addLinkBt, *removeNodeBt, *removeLinkBt; QAction *fileNew, *fileOpen, *fileSave, *fileSaveAs,*fileClose, *printNetwork,*fileQuit; QAction *exportBMP, *exportPNG, *exportPajek, *exportPDF, *exportDL, *exportGW, *exportSM, *exportList; QAction *importPajek,*importSM, *importList, *importDot , *importDL, *importTwoModeSM; QAction *viewNetworkFileAct, *openTextEditorAct, *viewSociomatrixAct, *recreateDataSetAct; QAction *createUniformRandomNetworkAct, *createGaussianRandomNetworkAct, *createLatticeNetworkAct; QAction *createSmallWorldRandomNetworkAct, *createSameDegreeRandomNetworkAct; QAction *displayNodeNumbersAct, *displayNodeLabelsAct, *displayNumbersInsideNodesAct; QAction *findNodeAct,*addNodeAct, *addLinkAct, *removeNodeAct, *removeLinkAct; QAction *changeNumbersSizeAct, *changeNodeLabelAct, *changeNodeColorAct, *changeNodeValueAct, *changeNodeSizeAct; QAction *changeLabelsSizeAct, *changeAllNodesSizeAct, *changeAllNodesShapeAct; QAction *changeNodeBoxAct, *changeNodeCircleAct, *changeNodeTriangleAct, *changeNodeDiamondAct, *changeNodeEllipseAct; QAction *changeLinkLabelAct, *changeLinkColorAct, *changeLinkWeightAct; QAction *filterNodesAct, *filterOrphanNodesAct, *filterEdgesAct, *transformNodes2LinksAct, *symmetrizeAct; QAction *changeBackColorAct, *changeAllNodesColorAct, *changeAllLinksColorAct, *changeAllNumbersColorAct, *changeAllLabelsColorAct; QAction *drawLinksWeightsAct, *displayLinksWeightNumbersAct, *displayLinksAct, *displayLinksArrowsAct, *drawLinksBezier; QAction *backgroundImageAct, *viewToolBar, *viewStatusBar, *helpAboutApp, *helpAboutQt, *helpApp, *tipsApp; QAction *netDensity, *symmetryAct, *graphDistanceAct, *averGraphDistanceAct, *distanceMatrixAct, *diameterAct; QAction *cliquesAct, *clusteringCoefAct, *triadCensusAct, *invertAdjMatrixAct; QAction *cOutDegreeAct, *cInDegreeAct, *cClosenessAct, *cBetweenessAct, *cInformationAct, *cGraphAct, *cStressAct, *cPowerAct, *cEccentAct; QAction *randLayoutAct, *randCircleLayoutAct, *circleOutDegreeLayoutAct, *circleInDegreeLayoutAct, *circleClosenessLayoutAct; QAction *antialiasingAct; QAction *webCrawlerAct; QAction *circleStressLayoutAct, *circleGraphLayoutAct,*circleClearBackgrCirclesAct, *circleEccentrLayoutAct, *circlePowerLayoutAct; QAction *circleBetweenessLayoutAct, *circleInformationLayoutAct, *levelClosenessLayoutAct; QAction *levelInDegreeLayoutAct, *levelOutDegreeLayoutAct, *levelBetweenessLayoutAct, *levelInformationLayoutAct; QAction *strongColorationAct, *regularColorationAct, *showProgressBarAct, *printDebugAct; QAction *springLayoutAct, *FRLayoutAct, *nodeSizeProportionalOutDegreeAct, *nodeSizeProportionalInDegreeAct; QAction *zoomInAct, *zoomOutAct ; QString fileName, networkName, previous_fileName; QStringList fileNameNoPath, fortuneCookie, rgbValues; QStringList tempFileNameNoPath, colorList, tips; int statusBarDuration, minDuration, progressCounter; int maxNodes; int initNodeSize, labelDistance, numberDistance,initNumberSize, initLabelSize; int totalLinks, fortuneCookiesCounter, tipsCounter; //QString VERSION; bool pajekFileLoaded, adjacencyFileLoaded, dotFileLoaded, graphMLFileLoaded, fileLoaded; int fileFormat; bool networkModified; bool bezier, linkClicked, nodeClicked, markedNodeExists, showProgressBar, firstTime; QString initLinkColor, initNumberColor, initNodeShape, initLabelColor; QColor initBackgroundColor; QPointF cursorPosGW; //Carries the position of the cursor in graphicsWidget coordinates QLCDNumber *inLinksLCD, *outLinksLCD , *selectedNodeLCD, *clucofLCD; QLCDNumber *nodesLCD, *edgesLCD, *densityLCD; QDateTime actualDateTime, actualDate, actualTime; QTime eTime; //used to time algorithms. }; #endif socnetv-0.90/src/webcrawler.h0000644000175000017500000000456211423751762016471 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 webcrawler.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef WEBCRAWLER_H #define WEBCRAWLER_H using namespace std; #include class Reader : public QThread { Q_OBJECT public: void createNode(QString url, bool enqueue_to_frontier); void createEdge (int source, int target); public slots: void load(); signals: void signalCreateNode(QString url, int no); void signalCreateEdge (int source, int target); protected: void run(); }; class WebCrawler : public QThread { Q_OBJECT public: void load(QString seed, int maxNodes, int maxRecursion, bool goOut); void terminateReaderQuit (); public slots: void slotCreateNode(QString url, int no); void slotCreateEdge (int source, int target); signals: void createNode(QString url, int no); void createEdge (int source, int target); protected: void run(); private: QString url; Reader reader; }; #endif socnetv-0.90/src/nodenumber.cpp0000755000175000017500000000405111423751762017021 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 nodenumber.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "nodenumber.h" #include "node.h" #include NodeNumber::NodeNumber( Node *jim , int size, QString labelText, QGraphicsScene *scene ) :QGraphicsTextItem(0,scene) { source=jim; jim -> addNumber(this); setParentItem(jim); //auto disables child items like this, when node is disabled. setPlainText( labelText ); setFont( QFont ("Times", size, QFont::Black, FALSE) ); setZValue(254); } void NodeNumber::removeRefs(){ source->deleteNumber(); } NodeNumber::~NodeNumber(){ } socnetv-0.90/src/mainwindow.cpp0000755000175000017500000066732711454777761017077 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 - mainwindow.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "mainwindow.h" #include "graphicswidget.h" #include "node.h" #include "edge.h" #include "nodenumber.h" #include "nodelabel.h" #include "edgeweight.h" #include "htmlviewer.h" #include "texteditor.h" #include "filteredgesbyweightdialog.h" #include "backgrcircle.h" #include "vertex.h" bool printDebug=false; void myMessageOutput( QtMsgType type, const char *msg ) { if (printDebug) switch ( type ) { case QtDebugMsg: fprintf( stderr, "Debug: %s\n", msg ); break; case QtWarningMsg: fprintf( stderr, "Warning: %s\n", msg ); break; case QtFatalMsg: fprintf( stderr, "Fatal: %s\n", msg ); abort(); // deliberately core dump case QtCriticalMsg: fprintf( stderr, "Critical: %s\n", msg ); abort(); // deliberately core dump } } /** MainWindow contruction method **/ MainWindow::MainWindow(const QString & m_fileName) { qInstallMsgHandler( myMessageOutput ); setWindowIcon (QIcon(":/images/socnetv.png")); /** inits that invoke all other construction parts **/ initActions(); //register and construct menu Actions initMenuBar(); //construct menu initToolBar(); //build the toolbar initStatusBar(); //and now add the status bar. initToolBox(); //finally, build the toolbox colorList = QColor::colorNames(); //and fill a stringList with all X-supported color names //set MW minimum size, before creating scene and canvas, so that we may have a clue about their sizes.. this->setMinimumSize(800,600); initView(); //create the canvas //Connect some signals to/from the canvas and the Graph connect( graphicsWidget, SIGNAL( selectedNode(Node*) ), this, SLOT( nodeInfoStatusBar(Node*) ) ); connect( graphicsWidget, SIGNAL( selectedEdge(Edge*) ), this, SLOT ( linkInfoStatusBar(Edge*) ) ); connect( graphicsWidget, SIGNAL( windowResized(int, int)), this, SLOT( windowInfoStatusBar(int,int)) ); connect( graphicsWidget, SIGNAL( userDoubleClicked(int, QPointF) ), this, SLOT( addNodeWithMouse(int,QPointF) ) ) ; connect( graphicsWidget, SIGNAL( userMiddleClicked(int, int, float) ), this, SLOT( addLink(int, int, float) ) ); connect( graphicsWidget, SIGNAL( openNodeMenu() ), this, SLOT( openNodeContextMenu() ) ) ; connect( graphicsWidget, SIGNAL( openEdgeMenu() ), this, SLOT( openLinkContextMenu() ) ) ; connect( graphicsWidget, SIGNAL(updateNodeCoords(int, int, int)), this, SLOT( updateNodeCoords(int, int, int) ) ); connect( graphicsWidget, SIGNAL(zoomChanged(int)), zoomCombo, SLOT( setCurrentIndex(int)) ); connect( &activeGraph, SIGNAL( addBackgrCircle(int, int, int) ), graphicsWidget, SLOT( addBackgrCircle(int, int, int) ) ) ; connect( &activeGraph, SIGNAL( addBackgrHLine(int) ), graphicsWidget, SLOT( addBackgrHLine(int) ) ) ; connect( &activeGraph, SIGNAL( moveNode(int, int, int) ), graphicsWidget, SLOT( moveNode(int, int, int) ) ) ; connect( &activeGraph, SIGNAL( drawNode( int ,int, QString, QString, int, QString, QString, int, QPointF, QString, bool, bool, bool) ), graphicsWidget, SLOT( drawNode( int ,int, QString, QString, int, QString, QString, int, QPointF, QString, bool, bool, bool) ) ) ; connect( &activeGraph, SIGNAL( eraseEdge(int, int)), graphicsWidget, SLOT( eraseEdge(int, int) ) ); connect( &activeGraph, SIGNAL( graphChanged() ), this, SLOT( graphChanged() ) ) ; connect( &activeGraph, SIGNAL( signalFileType(int , QString , int , int, bool) ), this, SLOT( fileType(int , QString , int , int, bool) ) ) ; connect( &activeGraph, SIGNAL( drawEdge( int, int, float, bool, bool, QString, bool)), graphicsWidget, SLOT( drawEdge( int, int,float, bool, bool, QString, bool) ) ) ; connect( &activeGraph, SIGNAL( drawEdgeReciprocal(int, int) ), graphicsWidget, SLOT( drawEdgeReciprocal(int, int) ) ); connect( &activeGraph, SIGNAL( statusMessage (QString) ), this, SLOT( statusMessage (QString) ) ) ; connect( &activeGraph, SIGNAL( selectedVertex(int) ), this, SLOT( selectedNode(int) ) ) ; connect( &activeGraph, SIGNAL( eraseNode(long int) ), graphicsWidget, SLOT( eraseNode(long int) ) ); //connect some signals/slots with MW widgets connect( addNodeBt,SIGNAL(clicked()), this, SLOT( addNode() ) ); connect( addLinkBt,SIGNAL(clicked()), this, SLOT( slotAddLink() ) ); connect( removeNodeBt,SIGNAL(clicked()), this, SLOT( slotRemoveNode() ) ); connect( removeLinkBt,SIGNAL(clicked()), this, SLOT( slotRemoveLink() ) ); connect( zoomCombo, SIGNAL(currentIndexChanged(const int &)), graphicsWidget, SLOT( changeZoom(const int &)) ); connect( zoomOutAct, SIGNAL(triggered()), graphicsWidget, SLOT( zoomOut() ) ); connect( zoomInAct, SIGNAL(triggered()), graphicsWidget, SLOT( zoomIn() ) ); connect( rotateSpinBox, SIGNAL(valueChanged(int)), graphicsWidget, SLOT( rot(int) ) ); connect( &m_filterEdgesByWeightDialog, SIGNAL( userChoices( float, bool) ), &activeGraph, SLOT( filterEdgesByWeight (float, bool) ) ); connect( &m_WebCrawlerDialog, SIGNAL( userChoices( QString, int, int, bool) ), this, SLOT( slotWebCrawl( QString, int, int, bool) ) ); connect( &m_datasetSelectDialog, SIGNAL( userChoices( QString) ), this, SLOT( slotRecreateDataSet(QString) ) ); connect( &activeGraph, SIGNAL( setEdgeVisibility ( int, int, bool) ), graphicsWidget, SLOT( setEdgeVisibility ( int, int, bool) ) ); connect( &activeGraph, SIGNAL( setVertexVisibility(long int, bool) ), graphicsWidget, SLOT( setNodeVisibility (long int , bool) ) ); connect( circleClearBackgrCirclesAct, SIGNAL(activated()), graphicsWidget, SLOT(clearBackgrCircles())); //create an horizontal layout for the toolbox and the canvas. This will be our MW layout. QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(toolBox); //add them layout->addWidget(graphicsWidget); //create a dummy widget, for the above layout QWidget *widget = new QWidget; widget->setLayout(layout); setCentralWidget(widget); //now set this as central widget of MW /* initialise default network parameters */ initNet(); /** DEFAULTING HERE DOES NOT CHANGE BOOL VALUE **/ /** EVERY TIME INITNET IS CALLED **/ bezier=false; firstTime=true; graphicsWidget->setInitNodeColor(initNodeColor); graphicsWidget->setInitNumberDistance(numberDistance); graphicsWidget->setInitLabelDistance(labelDistance); graphicsWidget->setInitNodeSize(initNodeSize); graphicsWidget->setBackgroundBrush(QBrush(initBackgroundColor)); //Qt::gray /**Try to load a GraphML network file on exec time*/ if (!m_fileName.isEmpty()) { fileName=m_fileName; fileNameNoPath=fileName.split ("/"); loadNetworkFile(fileName, 0 ); } if (firstTime) { createFortuneCookies(); createTips(); } graphicsWidget->setFocus(); statusMessage( tr("Welcome to Social Networks Visualizer, Version ")+VERSION); } MainWindow::~MainWindow() { delete printer; delete scene; delete graphicsWidget; } /** initializes all QActions of the application */ void MainWindow::initActions(){ printer = new QPrinter; /** File menu actions */ fileNew = new QAction(QIcon(":/images/new.png"), tr("&New"), this); fileNew->setShortcut(tr("Ctrl+N")); fileNew->setStatusTip(tr("Creates a new network")); fileNew->setToolTip(tr("New network (Ctrl+N)")); fileNew->setWhatsThis(tr("New\n\nCreates a new network")); connect(fileNew, SIGNAL(activated()), this, SLOT(slotCreateNew())); fileOpen = new QAction(QIcon(":/images/open.png"), tr("&Open"), this); fileOpen->setShortcut(tr("Ctrl+O")); fileOpen->setToolTip(tr("Open network (Ctrl+O)")); fileOpen->setStatusTip(tr("Open a GraphML-formatted file of an existing network")); fileOpen->setWhatsThis(tr("Open\n\nOpens a file of an existing network in GraphML format")); connect(fileOpen, SIGNAL(activated()), this, SLOT(slotImportGraphML())); importPajek = new QAction( QIcon(":/images/open.png"), tr("&Pajek"), this); importPajek->setStatusTip(tr("Import a Pajek-formatted file")); importPajek->setWhatsThis(tr("Import Pajek \n\n Imports a network from a Pajek-formatted file")); connect(importPajek, SIGNAL(activated()), this, SLOT(slotImportPajek())); importSM = new QAction( QIcon(":/images/open.png"), tr("&Adjacency Matrix"), this); importSM->setStatusTip(tr("Import an Adjacency matrix file")); importSM->setWhatsThis(tr("Import Sociomatrix \n\n Imports a network from an Adjacency matrix-formatted file")); connect(importSM, SIGNAL(activated()), this, SLOT(slotImportSM())); importDot = new QAction( QIcon(":/images/open.png"), tr("&Dot"), this); importDot->setStatusTip(tr("Import an dot file")); importDot->setWhatsThis(tr("Import Sociomatrix \n\n Imports a network from an dot matrix-formatted file")); connect(importDot, SIGNAL(activated()), this, SLOT(slotImportDot())); importDL = new QAction( QIcon(":/images/open.png"), tr("&DL..."), this); importDL->setStatusTip(tr("Import network to a DL-formatted file")); importDL->setWhatsThis(tr("Import DL\n\nImport network to a DL-formatted")); connect(importDL, SIGNAL(activated()), this, SLOT(slotImportDL())); importList = new QAction( QIcon(":/images/open.png"), tr("&List"), this); importList->setStatusTip(tr("Import network from a List-formatted file. ")); importList->setWhatsThis(tr("Import List\n\nImport a network from a List-formatted file")); connect(importList, SIGNAL(activated()), this, SLOT(slotImportEdgeList())); importTwoModeSM = new QAction( QIcon(":/images/open.png"), tr("&Two Mode Sociomatrix"), this); importTwoModeSM->setStatusTip(tr("Imports a two mode sociomatrix (affiliation network) file")); importTwoModeSM->setWhatsThis(tr("Import Sociomatrix \n\n Imports a two mode network from a sociomatrix file. Two-mode networks are described by affiliation network matrices, where A(i,j) codes the events/organizations each actor is affiliated with.")); connect(importTwoModeSM, SIGNAL(activated()), this, SLOT(slotImportTwoModeSM())); fileSave = new QAction(QIcon(":/images/save.png"), tr("&Save"), this); fileSave->setShortcut(tr("Ctrl+S")); fileSave->setToolTip(tr("Save network (Ctrl+S)")); fileSave->setStatusTip(tr("Saves the actual network to the current file")); fileSave->setWhatsThis(tr("Save.\n\nSaves the actual network")); connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); fileSaveAs = new QAction(QIcon(":/images/save.png"), tr("Save &As..."), this); fileSaveAs->setShortcut(tr("Ctrl+Shift+S")); fileSaveAs->setStatusTip(tr("Saves the actual network under a new filename")); fileSaveAs->setWhatsThis(tr("Save As\n\nSaves the actual network under a new filename")); connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); exportBMP = new QAction(QIcon(":/images/save.png"), tr("&BMP..."), this); exportBMP->setStatusTip(tr("Export network to a BMP image")); exportBMP->setWhatsThis(tr("Export BMP \n\n Export network to a BMP image")); connect(exportBMP, SIGNAL(activated()), this, SLOT(slotExportBMP())); exportPNG = new QAction( QIcon(":/images/save.png"), tr("&PNG..."), this); exportPNG->setStatusTip(tr("Export network to a PNG image")); exportPNG->setWhatsThis(tr("Export PNG \n\n Export network to a PNG image")); connect(exportPNG, SIGNAL(activated()), this, SLOT(slotExportPNG())); exportPDF = new QAction( QIcon(":/images/save.png"), tr("&PDF..."), this); exportPDF->setStatusTip(tr("Export network to a PDF file")); exportPDF->setWhatsThis(tr("Export PDF\n\n Export network to a PDF document")); connect(exportPDF, SIGNAL(activated()), this, SLOT(slotExportPDF())); exportSM = new QAction( QIcon(":/images/save.png"), tr("&Adjacency Matrix"), this); exportSM->setStatusTip(tr("Export network to an adjacency matrix file")); exportSM->setWhatsThis(tr("Export Sociomatrix \n\n Export network to a adjacency matrix-formatted file")); connect(exportSM, SIGNAL(activated()), this, SLOT(slotExportSM())); exportPajek = new QAction( QIcon(":/images/save.png"), tr("&Pajek"), this); exportPajek->setStatusTip(tr("Export network to a Pajek-formatted file")); exportPajek->setWhatsThis(tr("Export Pajek \n\n Export network to a Pajek-formatted file")); connect(exportPajek, SIGNAL(activated()), this, SLOT(slotExportPajek())); exportList = new QAction( QIcon(":/images/save.png"), tr("&List"), this); exportList->setStatusTip(tr("Export network to a List-formatted file. ")); exportList->setWhatsThis(tr("Export List\n\nExport network to a List-formatted file")); connect(exportList, SIGNAL(activated()), this, SLOT(slotExportList())); exportDL = new QAction( QIcon(":/images/save.png"), tr("&DL..."), this); exportDL->setStatusTip(tr("Export network to a DL-formatted file")); exportDL->setWhatsThis(tr("Export DL\n\nExport network to a DL-formatted")); connect(exportDL, SIGNAL(activated()), this, SLOT(slotExportDL())); exportGW = new QAction( QIcon(":/images/save.png"), tr("&GW..."), this); exportGW->setStatusTip(tr("Export network to a GW-formatted file")); exportGW->setWhatsThis(tr("Export\n\nExport network to a GW formatted file")); connect(exportGW, SIGNAL(activated()), this, SLOT(slotExportGW())); fileClose = new QAction( tr("&Close"), this); fileClose->setStatusTip(tr("Closes the actual network")); fileClose->setWhatsThis(tr("Close \n\nCloses the actual network")); connect(fileClose, SIGNAL(activated()), this, SLOT(slotFileClose())); printNetwork = new QAction(QIcon(":/images/print.png"), tr("&Print"), this); printNetwork->setShortcut(tr("Ctrl+P")); printNetwork->setStatusTip(tr("Prints whatever is viewable on the canvas.")); printNetwork->setWhatsThis(tr("Printing \n\n This function prints whatever is viewable on the canvas. \nTo print the whole network, you might want to zoom-out.")); connect(printNetwork, SIGNAL(activated()), this, SLOT(slotPrintView())); fileQuit = new QAction(QIcon(":/images/exit.png"), tr("E&xit"), this); fileQuit->setShortcut(tr("Ctrl+Q")); fileQuit->setStatusTip(tr("Quits the application")); fileQuit->setWhatsThis(tr("Exit\n\nQuits the application")); connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); openTextEditorAct = new QAction(QIcon(""), tr("Open Text Editor"),this); openTextEditorAct ->setShortcut(tr("Shift+F5")); openTextEditorAct->setStatusTip(tr("Opens the SocNetV text editor. You can copy/paste network data, save and then import them...")); openTextEditorAct->setWhatsThis(tr("Open Text Editor\n\nOpens the SocNetV text editor where you can copy paste network data, of any supported format, and save to a file. Then you can import that file to SocNetV...")); connect(openTextEditorAct, SIGNAL(activated()), this, SLOT(slotOpenTextEditor())); viewNetworkFileAct = new QAction(QIcon(":/images/net2.png"), tr("View Loaded File"),this); viewNetworkFileAct ->setShortcut(tr("F5")); viewNetworkFileAct->setStatusTip(tr("Displays the loaded network file")); viewNetworkFileAct->setWhatsThis(tr("View Loaded File\n\nDisplays the file of the loaded network")); connect(viewNetworkFileAct, SIGNAL(activated()), this, SLOT(slotViewNetworkFile())); viewSociomatrixAct = new QAction(QIcon(":/images/sm.png"), tr("View Adjacency Matrix"), this); viewSociomatrixAct ->setShortcut(tr("F6")); viewSociomatrixAct->setStatusTip(tr("Displays the adjacency matrix of the active network. See manual or online help for more...")); viewSociomatrixAct->setWhatsThis(tr("View Adjacency Matrix\n\nDisplays the adjacency matrix of the active network. \n\n The adjacency matrix of a network is a matrix where each element a(i,j) is equal to the weight of the link from node i to node j. If the nodes are not connected, then a(i,j)=0. ")); connect(viewSociomatrixAct, SIGNAL(activated()), this, SLOT(slotViewAdjacencyMatrix())); recreateDataSetAct = new QAction(QIcon(":/images/sm.png"), tr("Create Known Data Sets"), this); recreateDataSetAct ->setShortcut(tr("F7")); recreateDataSetAct->setStatusTip(tr("Recreates a variety of known data sets.")); recreateDataSetAct->setWhatsThis(tr("Known Data Sets\n\nRecreates some of the most widely used data sets in network analysis studies")); connect(recreateDataSetAct, SIGNAL(activated()), this, SLOT(slotShowDataSetSelectDialog())); createUniformRandomNetworkAct = new QAction(QIcon(":/images/erdos.png"), tr("Erdos-Renyi G(n,p)"), this); createUniformRandomNetworkAct ->setShortcut(tr("Shift+U")); createUniformRandomNetworkAct->setStatusTip(tr("Creates a random network where each edge is included with a given probability")); createUniformRandomNetworkAct->setWhatsThis(tr("Uniform \n\nCreates a random network of G(n, p) model by connecting nodes randomly. Each edge is included in the graph with equal probability p, independently of the other edges")); connect(createUniformRandomNetworkAct, SIGNAL(activated()), this, SLOT(slotCreateRandomNetErdos())); createLatticeNetworkAct = new QAction( QIcon(":/images/net1.png"), tr("Ring Lattice"), this); createLatticeNetworkAct ->setShortcut(tr("Shift+L")); createLatticeNetworkAct->setStatusTip(tr("Creates a ring lattice random network")); createLatticeNetworkAct->setWhatsThis(tr("Ring Lattice \n\nA ring lattice or a physicist's lattice is a graph with N nodes each connected to K neighbors, K / 2 on each side.")); connect(createLatticeNetworkAct, SIGNAL(activated()), this, SLOT(slotCreateRandomNetRingLattice())); createSameDegreeRandomNetworkAct = new QAction(QIcon(":/images/net.png"), tr("Same Degree"), this); createSameDegreeRandomNetworkAct->setStatusTip(tr("Creates a random network where all nodes have the same degree.")); createSameDegreeRandomNetworkAct->setWhatsThis(tr("Same Degree \n\nCreates a random network where all nodes have the same degree ")); connect(createSameDegreeRandomNetworkAct, SIGNAL(activated()), this, SLOT(slotCreateSameDegreeRandomNetwork())); createGaussianRandomNetworkAct = new QAction(tr("Gaussian"), this); createGaussianRandomNetworkAct->setStatusTip(tr("Creates a Gaussian distributed random network")); createGaussianRandomNetworkAct->setWhatsThis(tr("Gaussian \n\nCreates a random network of Gaussian distribution")); connect(createGaussianRandomNetworkAct, SIGNAL(activated()), this, SLOT(slotCreateGaussianRandomNetwork())); createSmallWorldRandomNetworkAct = new QAction(QIcon(":/images/sw.png"), tr("Small World"), this); createSmallWorldRandomNetworkAct->setShortcut(tr("Shift+W")); createSmallWorldRandomNetworkAct->setStatusTip(tr("Creates a random network with small world properties")); createSmallWorldRandomNetworkAct->setWhatsThis(tr("Small World \n\nA Small World, according to the Watts and Strogatz model, is a random network with short average path lengths and high clustering coefficient.")); connect(createSmallWorldRandomNetworkAct, SIGNAL(activated()), this, SLOT(slotCreateSmallWorldRandomNetwork())); webCrawlerAct = new QAction(QIcon(":/images/webcrawler.png"), tr("Web Crawler"), this); webCrawlerAct->setShortcut(tr("Shift+C")); webCrawlerAct->setStatusTip(tr("Creates a network from all links found in a given website")); webCrawlerAct->setWhatsThis(tr("Web Crawler \n\nA Web crawler is a built-in bot, which starts with a given URL (website or webpage) to visit. As the algorithm crawls this webpage, it identifies all the links in the page and adds them to a list of URLs (called frontier). Then, all the URLs from the frontier are recursively visited. You must provide maximum recursion level (how many URLs from the frontier will be visited) and maximum running time, along with the initial web address...")); connect(webCrawlerAct, SIGNAL(activated()), this, SLOT(slotShowWebCrawlerDialog())); /** Edit menu actions */ findNodeAct = new QAction(QIcon(":/images/find.png"), tr("Find Node"), this); findNodeAct->setShortcut(tr("Ctrl+F")); findNodeAct->setStatusTip(tr("Finds and highlights a node by number or label. Press Ctrl+F again to undo.")); findNodeAct->setWhatsThis(tr("Find Node\n\nFinds a node with a given number or label and doubles its size. Ctrl+F again resizes back the node")); connect(findNodeAct, SIGNAL(activated()), this, SLOT(slotFindNode()) ); addNodeAct = new QAction(QIcon(":/images/add.png"), tr("Add Node"), this); addNodeAct->setShortcut(tr("Ctrl+A")); addNodeAct->setStatusTip(tr("Adds a node")); addNodeAct->setWhatsThis(tr("Add Node\n\nAdds a node to the network")); connect(addNodeAct, SIGNAL(activated()), this, SLOT(addNode())); removeNodeAct = new QAction(QIcon(":/images/remove.png"),tr("Remove Node"), this); removeNodeAct ->setShortcut(tr("Ctrl+Shift+A")); removeNodeAct->setStatusTip(tr("Removes a node")); removeNodeAct->setWhatsThis(tr("Remove Node\n\nRemoves a node from the network")); connect(removeNodeAct, SIGNAL(activated()), this, SLOT(slotRemoveNode())); changeNodeLabelAct = new QAction(QIcon(":/images/letters.png"), tr("Change Label"), this); changeNodeLabelAct->setStatusTip(tr("Changes the Label of a node")); changeNodeLabelAct->setWhatsThis(tr("Change Label\n\nChanges the label of a node")); connect(changeNodeLabelAct, SIGNAL(activated()), this, SLOT(slotChangeNodeLabel())); changeNodeColorAct = new QAction(QIcon(":/images/colorize.png"), tr("Change Color"), this); changeNodeColorAct->setStatusTip(tr("Changes the color of a node")); changeNodeColorAct->setWhatsThis(tr("Change Color\n\nChanges the Color of a node")); connect(changeNodeColorAct, SIGNAL(activated()), this, SLOT(slotChangeNodeColor())); changeNodeSizeAct = new QAction(QIcon(":/images/resize.png"),tr("Change Size"), this); changeNodeSizeAct->setStatusTip(tr("Changes the actual size of a node")); changeNodeSizeAct->setWhatsThis(tr("Change Size\n\nChanges the actual size of a node")); connect(changeNodeSizeAct, SIGNAL(activated()), this, SLOT(slotChangeNodeSize())); changeNodeValueAct = new QAction(tr("Change Value"), this); changeNodeValueAct->setStatusTip(tr("Changes the value of a node")); changeNodeValueAct->setWhatsThis(tr("Change Value\n\nChanges the value of a node")); connect(changeNodeValueAct, SIGNAL(activated()), this, SLOT(slotChangeNodeValue())); changeAllNodesSizeAct = new QAction(QIcon(":/images/resize.png"), tr("Change all Nodes Size"), this); changeAllNodesSizeAct->setStatusTip(tr("This option lets you change the size of all nodes")); changeAllNodesSizeAct->setWhatsThis(tr("Nodes Size\n\nThis option lets you change the size of all nodes")); connect(changeAllNodesSizeAct, SIGNAL(activated()), this, SLOT(slotChangeAllNodesSize()) ); changeAllNodesShapeAct = new QAction( tr("Change all Nodes Shape"), this); changeAllNodesShapeAct->setStatusTip(tr("This option lets you change the shape of all nodes")); changeAllNodesShapeAct->setWhatsThis(tr("Nodes Shape\n\nThis option lets you change the shape of all nodes")); connect(changeAllNodesShapeAct, SIGNAL(activated()), this, SLOT(slotChangeAllNodesShape()) ); changeNodeBoxAct = new QAction(QIcon(":/images/box.png"), tr("Change Node Shape to Box"),this); changeNodeBoxAct->setStatusTip(tr("This option lets you change the shape of a node to a box")); changeNodeBoxAct->setWhatsThis(tr("Node as a box\n\nThis option lets you change the shape of a node to a box")); connect(changeNodeBoxAct, SIGNAL(activated()), this, SLOT(slotChangeNodeBox()) ); changeNodeTriangleAct = new QAction( tr("Change Node Shape to Triangle"), this); changeNodeTriangleAct->setStatusTip(tr("This option lets you change the shape of a node to a box")); changeNodeTriangleAct->setWhatsThis(tr("Node as a box\n\nThis option lets you change the shape of a node to a box")); connect(changeNodeTriangleAct, SIGNAL(activated()), this, SLOT(slotChangeNodeTriangle()) ); changeNodeCircleAct = new QAction(QIcon(":/images/circle.png"), tr("Change Node Shape to Circle"), this); changeNodeCircleAct->setStatusTip(tr("This option lets you change the shape of a node to a box")); changeNodeCircleAct->setWhatsThis(tr("Node as a box\n\nThis option lets you change the shape of a node to a box")); connect(changeNodeCircleAct, SIGNAL(activated()), this, SLOT(slotChangeNodeCircle()) ); changeNodeDiamondAct = new QAction(QIcon(":/images/diamond.png"), tr("Change Node Shape to Diamond"), this); changeNodeDiamondAct->setStatusTip(tr("This option lets you change the shape of a node to a box")); changeNodeDiamondAct->setWhatsThis(tr("Node as a box\n\nThis option lets you change the shape of a node to a box")); connect(changeNodeDiamondAct, SIGNAL(activated()), this, SLOT(slotChangeNodeDiamond()) ); changeNodeEllipseAct = new QAction( tr("Change Node Shape to Ellipse"), this); changeNodeEllipseAct->setStatusTip(tr("This option lets you change the shape of a node to a box")); changeNodeEllipseAct->setWhatsThis(tr("Node as a box\n\nThis option lets you change the shape of a node to a box")); connect(changeNodeEllipseAct, SIGNAL(activated()), this, SLOT(slotChangeNodeEllipse()) ); changeNumbersSizeAct = new QAction( tr("Change all Numbers Size"), this); changeNumbersSizeAct->setStatusTip(tr("It lets you change the font size of the numbers of all nodes")); changeNumbersSizeAct->setWhatsThis(tr("Numbers Size\n\nChanges the size of the numbers of all nodes")); connect(changeNumbersSizeAct, SIGNAL(activated()), this, SLOT(slotChangeNumbersSize()) ); changeLabelsSizeAct = new QAction( tr("Change all Labels Size"), this); changeLabelsSizeAct->setStatusTip(tr("You can change the font size of the labels of all nodes")); changeLabelsSizeAct->setWhatsThis(tr("Labels Size\n\nChange the fontsize of the labels of all nodes")); connect(changeLabelsSizeAct, SIGNAL(activated()), this, SLOT(slotChangeLabelsSize()) ); addLinkAct = new QAction(QIcon(":/images/plines.png"), tr("Add Link"),this); addLinkAct->setShortcut(tr("Ctrl+L")); addLinkAct->setStatusTip(tr("Adds a Link to a Node")); addLinkAct->setWhatsThis(tr("Add Link\n\nAdds a Link to the network")); connect(addLinkAct, SIGNAL(activated()), this, SLOT(slotAddLink())); removeLinkAct = new QAction(QIcon(":/images/disconnect.png"), tr("Remove"), this); removeLinkAct ->setShortcut(tr("Ctrl+Shift+L")); removeLinkAct->setStatusTip(tr("Removes a Link")); removeLinkAct->setWhatsThis(tr("Remove Link\n\nRemoves a Link from the network")); connect(removeLinkAct, SIGNAL(activated()), this, SLOT(slotRemoveLink())); changeLinkLabelAct = new QAction(QIcon(":/images/letters.png"), tr("Change Label"), this); changeLinkLabelAct->setStatusTip(tr("Changes the Label of a Link")); changeLinkLabelAct->setWhatsThis(tr("Change Label\n\nChanges the label of a Link")); connect(changeLinkLabelAct, SIGNAL(activated()), this, SLOT(slotChangeLinkLabel())); changeLinkLabelAct->setEnabled(false); changeLinkColorAct = new QAction(QIcon(":/images/colorize.png"),tr("Change Color"), this); changeLinkColorAct->setStatusTip(tr("Changes the Color of a Link")); changeLinkColorAct->setWhatsThis(tr("Change Color\n\nChanges the Color of a Link")); connect(changeLinkColorAct, SIGNAL(activated()), this, SLOT(slotChangeLinkColor())); changeLinkWeightAct = new QAction(tr("Change Weight"), this); changeLinkWeightAct->setStatusTip(tr("Changes the Weight of a Link")); changeLinkWeightAct->setWhatsThis(tr("Change Value\n\nChanges the Weight of a Link")); connect(changeLinkWeightAct, SIGNAL(activated()), this, SLOT(slotChangeLinkWeight())); filterNodesAct = new QAction(tr("Filter Nodes"), this); filterNodesAct -> setEnabled(false); filterNodesAct->setStatusTip(tr("Filters Nodes of some value out of the network")); filterNodesAct->setWhatsThis(tr("Filter Nodes\n\nFilters Nodes of some value out of the network.")); connect(filterNodesAct, SIGNAL(activated()), this, SLOT(slotFilterNodes())); filterOrphanNodesAct = new QAction(tr("Filter Orphan Nodes"), this); filterOrphanNodesAct -> setEnabled(true); filterOrphanNodesAct -> setCheckable(true); filterOrphanNodesAct -> setChecked(false); filterOrphanNodesAct -> setStatusTip(tr("Filters Nodes with no edges")); filterOrphanNodesAct -> setWhatsThis(tr("Filter Orphan Nodes\n\n Enables or disables displaying of orphan nodes. Orphan nodes are those with no edges...")); connect(filterOrphanNodesAct, SIGNAL(activated()), this, SLOT(slotFilterOrphanNodes())); filterEdgesAct = new QAction(tr("Filter Links"), this); filterEdgesAct -> setEnabled(true); filterEdgesAct -> setStatusTip(tr("Filters Links of some weight out of the network")); filterEdgesAct -> setWhatsThis(tr("Filter Links\n\nFilters Link of some specific weight out of the network.")); connect(filterEdgesAct , SIGNAL(activated()), this, SLOT(slotShowFilterEdgesDialog())); changeBackColorAct = new QAction(QIcon(":/images/color.png"), tr("Change Background Color"), this); changeBackColorAct->setStatusTip(tr("Click to change the background color")); changeBackColorAct->setWhatsThis(tr("Background\n\nChanges background color")); connect(changeBackColorAct, SIGNAL(activated()), this, SLOT(slotBackgroundColor())); changeAllNodesColorAct = new QAction(QIcon(":/images/nodecolor.png"), tr("Change all Nodes Colors"), this); changeAllNodesColorAct->setStatusTip(tr("Click to choose a new color for all nodes.")); changeAllNodesColorAct->setWhatsThis(tr("All Nodes\n\nChanges all nodes color at once.")); connect(changeAllNodesColorAct, SIGNAL(activated()), this, SLOT(slotAllNodesColor()) ); changeAllNumbersColorAct = new QAction( tr("Change all Numbers Colors"), this); changeAllNumbersColorAct->setStatusTip(tr("Click to change the color of all numbers.")); changeAllNumbersColorAct->setWhatsThis(tr("Numbers\n\nChanges the color of all numbers.")); connect(changeAllNumbersColorAct, SIGNAL(activated()), this, SLOT(slotAllNumbersColor())); changeAllLabelsColorAct = new QAction( tr("Change all Labels Colors"), this); changeAllLabelsColorAct->setStatusTip(tr("Click to change the color of all node labels.")); changeAllLabelsColorAct->setWhatsThis(tr("Numbers\n\nChanges the color of all node labels.")); connect(changeAllLabelsColorAct, SIGNAL(activated()), this, SLOT(slotAllLabelsColor())); changeAllLinksColorAct = new QAction( tr("Change all Links Colors"), this); changeAllLinksColorAct->setStatusTip(tr("Click to change the color of all links.")); changeAllLinksColorAct->setWhatsThis(tr("Background\n\nChanges all links color")); connect(changeAllLinksColorAct, SIGNAL(activated()), this, SLOT(slotAllLinksColor())); transformNodes2LinksAct = new QAction( tr("Transform Nodes to Links"),this); transformNodes2LinksAct->setStatusTip(tr("Transforms the network so that nodes become links and vice versa")); transformNodes2LinksAct->setWhatsThis(tr("Transform Nodes LinksAct\n\nTransforms network so that nodes become links and vice versa")); connect(transformNodes2LinksAct, SIGNAL(activated()), this, SLOT(slotTransformNodes2Links())); symmetrizeAct= new QAction(QIcon(":/images/symmetrize.png"), tr("Symmetrize Links"), this); symmetrizeAct->setShortcut(tr("Shift+R")); symmetrizeAct->setStatusTip(tr("Makes all edges reciprocal (thus, a symmetric graph).")); symmetrizeAct->setWhatsThis(tr("Symmetrize Edges\n\nTransforms all arcs to double links (edges). The result is a symmetric network")); connect(symmetrizeAct, SIGNAL(activated()), this, SLOT(slotSymmetrize())); /** Layout menu actions */ strongColorationAct = new QAction ( tr("Strong Structural"), this); strongColorationAct -> setStatusTip( tr("Nodes are assigned the same color if they have identical in and out neighborhoods") ); strongColorationAct -> setWhatsThis( tr("Click this to colorize nodes; Nodes are assigned the same color if they have identical in and out neighborhoods")); connect(strongColorationAct, SIGNAL(activated() ), this, SLOT(slotColorationStrongStructural()) ); regularColorationAct = new QAction ( tr("Regular"), this); regularColorationAct -> setStatusTip( tr("Nodes are assigned the same color if they have neighborhoods of the same set of colors") ); regularColorationAct -> setWhatsThis( tr("Click this to colorize nodes; Nodes are assigned the same color if they have neighborhoods of the same set of colors")); connect(regularColorationAct, SIGNAL(activated() ), this, SLOT(slotColorationRegular()) ); randLayoutAct = new QAction( tr("Random"),this); randLayoutAct -> setShortcut(tr("Ctrl+0")); randLayoutAct -> setStatusTip(tr("Repositions all nodes in random places")); randLayoutAct -> setWhatsThis(tr("Random Layout\n\n Repositions all nodes in random places")); connect(randLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRandom())); randCircleLayoutAct = new QAction(tr("Random Circle"), this); randCircleLayoutAct ->setStatusTip(tr("Repositions the nodes randomly on a circle")); randCircleLayoutAct->setWhatsThis(tr("Random Circle Layout\n\n Repositions the nodes randomly on a circle")); connect(randCircleLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRandomCircle())); circleInDegreeLayoutAct = new QAction( tr("In-Degree"), this); circleInDegreeLayoutAct ->setShortcut(tr("Ctrl+Alt+1")); circleInDegreeLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More In-Degree Central Nodes are positioned towards the centre.")); circleInDegreeLayoutAct->setWhatsThis(tr("Circle In-Degree Centrality Layout\n\n Repositions the nodes on circles of different radius. More In-Degree Central Nodes are positioned towards the centre.")); connect(circleInDegreeLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityInDegree())); circleOutDegreeLayoutAct = new QAction( tr("Out-Degree"), this); circleOutDegreeLayoutAct ->setShortcut(tr("Ctrl+Alt+2")); circleOutDegreeLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More Out-Degree Central Nodes are positioned towards the centre.")); circleOutDegreeLayoutAct->setWhatsThis(tr("Circle Out-Degree Centrality Layout\n\n Repositions the nodes on circles of different radius. More Out-Degree Central Nodes are positioned towards the centre.")); connect(circleOutDegreeLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityOutDegree())); circleClosenessLayoutAct = new QAction( tr("Closeness"), this); circleClosenessLayoutAct ->setShortcut(tr("Ctrl+Alt+3")); circleClosenessLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More Closeness Central Nodes are positioned towards the centre.")); circleClosenessLayoutAct->setWhatsThis(tr("Circle Closeness Centrality Layout\n\n Repositions the nodes on circles of different radius. More Closeness Central Nodes are positioned towards the centre.")); connect(circleClosenessLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityCloseness())); circleBetweenessLayoutAct = new QAction( tr("Betweeness"), this); circleBetweenessLayoutAct ->setShortcut(tr("Ctrl+Alt+4")); circleBetweenessLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More Betweeness Central Nodes are positioned towards the centre.")); circleBetweenessLayoutAct->setWhatsThis(tr("Circle Betweeness Centrality Layout\n\n Repositions the nodes on circles of different radius. More Betweeness Central Nodes are positioned towards the centre.")); connect(circleBetweenessLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityBetweeness())); circleStressLayoutAct = new QAction( tr("Stress"), this); circleStressLayoutAct ->setShortcut(tr("Ctrl+Alt+5")); circleStressLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More Stressed Central Nodes are positioned towards the centre.")); circleStressLayoutAct->setWhatsThis(tr("Circle Stress Centrality Layout\n\n Repositions the nodes on circles of different radius. Nodes having greater Stress Centrality are situated towards the centre.")); connect(circleStressLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityStress() ) ); circleGraphLayoutAct = new QAction( tr("Graph"), this); circleGraphLayoutAct ->setShortcut(tr("Ctrl+Alt+6")); circleGraphLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More Graph centralized nodes are positioned towards the centre.")); circleGraphLayoutAct->setWhatsThis(tr("Circle Graph Centrality Layout\n\n Repositions the nodes on circles of different radius. Nodes having greater Graph Centrality are situated towards the centre.")); connect(circleGraphLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityGraph() ) ); circleEccentrLayoutAct = new QAction( tr("Eccentricity"), this); circleEccentrLayoutAct ->setShortcut(tr("Ctrl+Alt+7")); circleEccentrLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. Nodes of large eccentricity are positioned towards the centre.")); circleEccentrLayoutAct ->setWhatsThis(tr("Circle Eccentricity Centrality Layout\n\n Repositions the nodes on circles of different radius. Nodes having greater Eccentricity Centrality are situated towards the centre.")); connect(circleEccentrLayoutAct , SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityEccentr() ) ); circlePowerLayoutAct = new QAction( tr("Power"), this); circlePowerLayoutAct ->setShortcut(tr("Ctrl+Alt+8")); circlePowerLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More power central nodes are positioned towards the centre.")); circlePowerLayoutAct ->setWhatsThis(tr("Circle Power Centrality Layout\n\n Repositions the nodes on circles of different radius. More power central nodes are positioned towards the centre.")); connect(circlePowerLayoutAct , SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityPower() ) ); circleInformationLayoutAct = new QAction( tr("Information"), this); circleInformationLayoutAct ->setEnabled(true); circleInformationLayoutAct ->setShortcut(tr("Ctrl+Alt+9")); circleInformationLayoutAct ->setStatusTip(tr("Repositions the nodes on circles of different radius. More Information Central Nodes are situated towards the centre.")); circleInformationLayoutAct->setWhatsThis(tr("Circle Information Centrality Layout\n\n Repositions the nodes on circles of different radius. More Information Central Nodes are positioned towards the centre.")); connect(circleInformationLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutRadialCentralityInformation())); circleClearBackgrCirclesAct = new QAction(QIcon(":/images/gridlines.png"), tr("Remove Layout GuideLines"), this); circleClearBackgrCirclesAct ->setStatusTip(tr("Removes all layout guideLines from the canvas.")); circleClearBackgrCirclesAct->setWhatsThis(tr("Remove GuideLines\n\n Removes any guidelines (circles or horizontal lines) created for the network layout.")); levelInDegreeLayoutAct = new QAction( tr("In-Degree"),this); levelInDegreeLayoutAct ->setShortcut(tr("Ctrl+Shift+1")); levelInDegreeLayoutAct ->setStatusTip(tr("Repositions the nodes on layers or levels of different height. More In-Degree Central Nodes are situated on higher layers.")); levelInDegreeLayoutAct->setWhatsThis(tr("Level In-Degree Centrality Layout\n\n Repositions the nodes on layers of different height. More In-Degree Central Nodes are situated on higher layers.")); connect(levelInDegreeLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutLayeredCentralityInDegree())); levelOutDegreeLayoutAct = new QAction( tr("Out-Degree"),this); levelOutDegreeLayoutAct ->setShortcut(tr("Ctrl+Shift+2")); levelOutDegreeLayoutAct ->setStatusTip(tr("Repositions the nodes on levels of different height. More Out-Degree Central Nodes are situated on higher levels.")); levelOutDegreeLayoutAct ->setWhatsThis(tr("Level Out-Degree Centrality Layout\n\n Repositions the nodes on levels of different height. More Out-Degree Central Nodes are situated on higher levels.")); connect(levelOutDegreeLayoutAct , SIGNAL(activated()), this, SLOT(slotLayoutLayeredCentralityOutDegree())); levelClosenessLayoutAct = new QAction( tr("Closeness"), this); levelClosenessLayoutAct ->setShortcut(tr("Ctrl+Shift+3")); levelClosenessLayoutAct ->setStatusTip(tr("Repositions the nodes on levels of different height. More Closeness Central Nodes are situated on higher levels.")); levelClosenessLayoutAct->setWhatsThis(tr("level Closeness Centrality Layout\n\n Repositions the nodes on levels of different height. More Closeness Central Nodes are situated on higher levels.")); connect(levelClosenessLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutLayeredCentralityCloseness())); levelBetweenessLayoutAct = new QAction( tr("Betweeness"), this); levelBetweenessLayoutAct ->setShortcut(tr("Ctrl+Shift+4")); levelBetweenessLayoutAct ->setStatusTip(tr("Repositions the nodes on levels of different height. More Betweeness Central Nodes are situated on higher levels.")); levelBetweenessLayoutAct->setWhatsThis(tr("level Betweeness Centrality Layout\n\n Repositions the nodes on levels of different height. More Betweeness Central Nodes are situated on higher levels.")); connect(levelBetweenessLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutLayeredCentralityBetweeness())); levelInformationLayoutAct = new QAction( tr("Informational"), this); levelInformationLayoutAct ->setShortcut(tr("Ctrl+Shift+9")); levelInformationLayoutAct -> setEnabled(false); levelInformationLayoutAct ->setStatusTip(tr("Repositions the nodes on levels of different height. More Informational Central Nodes are situated on higher levels.")); levelInformationLayoutAct->setWhatsThis(tr("Level Informational Centrality Layout\n\n Repositions the nodes on levels of different height. More Informational Central Nodes are situated on higher levels.")); connect(levelInformationLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutLayeredCentralityInformation())); springLayoutAct= new QAction(tr("Spring Embedder"), this); springLayoutAct->setShortcut(tr("Alt+1")); springLayoutAct->setStatusTip(tr("All nodes repel each other while the connected ones are attracted as if connected by springs.")); springLayoutAct->setWhatsThis(tr("Spring Embedder Layout\n\n In this model, nodes are regarded as physical bodies (i.e. electrons) which exert repelling forces to each other, while edges are springs connecting adjacents nodes. Non-adjacent nodes repel each other while connected nodes are The algorithm continues until the system retains an equilibrium state in which all forces cancel each other. ")); connect(springLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutSpringEmbedder())); FRLayoutAct= new QAction( tr("Fruchterman-Reingold"), this); FRLayoutAct->setShortcut(tr("Alt+2")); FRLayoutAct->setEnabled(true); FRLayoutAct->setStatusTip(tr("Repelling forces between all nodes, and attracting forces between adjacent nodes.")); FRLayoutAct->setWhatsThis(tr("Fruchterman-Reingold Layout\n\n Embeds a layout all nodes according to a model in which repelling forces are used between every pair of nodes, while attracting forces are used only between adjacent nodes. The algorithm continues until the system retains its equilibrium state where all forces cancel each other.")); connect(FRLayoutAct, SIGNAL(activated()), this, SLOT(slotLayoutFruchterman())); zoomInAct = new QAction(QIcon(":/images/zoomin.png"), tr("Zoom &in"), this); zoomInAct->setShortcut(tr("Ctrl++")); zoomInAct->setToolTip(tr("Zoom in (Ctrl++)")); zoomInAct->setStatusTip(tr("Zooms inside the actual network.")); zoomInAct->setWhatsThis(tr("Zoom In.\n\nZooms in. What else did you expect?")); zoomOutAct = new QAction(QIcon(":/images/zoomout.png"), tr("Zoom &out"), this); zoomOutAct->setShortcut(tr("Ctrl+-")); zoomOutAct->setToolTip(tr("Zoom out (Ctrl+-)")); zoomOutAct->setStatusTip(tr("Zooms out of the actual network.")); zoomOutAct->setWhatsThis(tr("Zoom out.\n\nZooms out. What else did you expect?")); nodeSizeProportionalOutDegreeAct= new QAction(QIcon(":/images/nodeout.png"),tr("NodeSize = F (OutDegree)"), this); nodeSizeProportionalOutDegreeAct->setShortcut(tr("Alt+3")); nodeSizeProportionalOutDegreeAct->setStatusTip(tr("Resizes all nodes according to their out edges.")); nodeSizeProportionalOutDegreeAct->setWhatsThis(tr("NodeSize = F (OutDegree) \n\n Adjusts the size of each node according to their out-edges (OutDegree). The more out-likned a node is, the bigger will appear...")); nodeSizeProportionalOutDegreeAct->setCheckable(true); nodeSizeProportionalOutDegreeAct->setChecked(false); connect(nodeSizeProportionalOutDegreeAct, SIGNAL(triggered(bool)), this, SLOT(slotLayoutNodeSizeProportionalOutEdges(bool))); nodeSizeProportionalInDegreeAct= new QAction(QIcon(":/images/nodein.png"),tr("NodeSize = F (InDegree)"), this); nodeSizeProportionalInDegreeAct->setShortcut(tr("Alt+4")); nodeSizeProportionalInDegreeAct->setStatusTip(tr("Resizes all nodes according to their in edges.")); nodeSizeProportionalInDegreeAct->setWhatsThis(tr("NodeSize = F (InDegree) \n\n This method adjusts the size of each node according to their in-edges (InDegree). The more in-linked a node is, the bigger will appear...")); nodeSizeProportionalInDegreeAct->setCheckable(true); nodeSizeProportionalInDegreeAct->setChecked(false); connect(nodeSizeProportionalInDegreeAct, SIGNAL(triggered(bool)), this, SLOT(slotLayoutNodeSizeProportionalInEdges(bool))); /** Statistics menu actions */ symmetryAct = new QAction(QIcon(":/images/symmetry.png"), tr("Network Symmetry"), this); symmetryAct ->setShortcut(tr("Shift+S")); symmetryAct->setStatusTip(tr("Tests if the network is symmetric or not")); symmetryAct->setWhatsThis(tr("Network Symmetry\n\n A network is symmetric when all edges are reciprocal, or, in mathematical language, when the adjacency matrix is symmetric.")); connect(symmetryAct, SIGNAL(activated()), this, SLOT(slotCheckSymmetry())); invertAdjMatrixAct = new QAction(QIcon(":/images/symmetry.png"), tr("Invert Adjacency Matrix"), this); invertAdjMatrixAct ->setShortcut(tr("Shift+I")); invertAdjMatrixAct->setStatusTip(tr("Inverts the adjacency matrix")); invertAdjMatrixAct->setWhatsThis(tr("Invert Adjacency Matrix \n\n Inverts the adjacency matrix using linear algebra methods.")); connect(invertAdjMatrixAct, SIGNAL(activated()), this, SLOT(slotInvertAdjMatrix())); graphDistanceAct = new QAction(QIcon(":/images/distance.png"), tr("Graph Distance"), this); graphDistanceAct ->setShortcut(tr("Ctrl+G")); graphDistanceAct->setStatusTip(tr("Calculates the length of the shortest path between two nodes...")); graphDistanceAct->setWhatsThis(tr("Graph Distance\n\n The graph distance (or geodesic distance) of two nodes is the length (number of edges) of the shortest path between them.")); connect(graphDistanceAct, SIGNAL(activated()), this, SLOT(slotGraphDistance())); distanceMatrixAct = new QAction(QIcon(":/images/dm.png"), tr("Distance &Matrix"),this); distanceMatrixAct ->setShortcut(tr("Ctrl+M")); distanceMatrixAct->setStatusTip(tr("Displays the matrix of graph distances between all nodes")); distanceMatrixAct->setWhatsThis(tr("Distance Matrix\n\n A distance matrix is a NxN matrix, where the (i,j) element is the graph distance from node i to node j.")); connect(distanceMatrixAct, SIGNAL(activated()), this, SLOT( slotViewDistanceMatrix() ) ); diameterAct = new QAction(QIcon(":/images/diameter.png"), tr("Diameter"),this); diameterAct ->setShortcut(tr("Ctrl+D")); diameterAct->setStatusTip(tr("Calculates and displays the diameter of the network.")); diameterAct->setWhatsThis(tr("Diameter\n\n The Diameter of a network is the maximum graph distance (maximum shortest path length) between any two nodes of the network.")); connect(diameterAct, SIGNAL(activated()), this, SLOT(slotDiameter())); averGraphDistanceAct = new QAction(QIcon(":/images/avdistance.png"), tr("Average Graph Distance"),this); averGraphDistanceAct ->setShortcut(tr("Ctrl+B")); averGraphDistanceAct->setStatusTip(tr("Calculates and displays the average shortest path length.")); averGraphDistanceAct->setWhatsThis(tr("Average Graph Distance\n\n This the average length of all shortest paths between the connected pair of nodes of the network.")); connect(averGraphDistanceAct, SIGNAL(activated()), this, SLOT(slotAverageGraphDistance())); cliquesAct = new QAction(QIcon(":/images/triangle.png"), tr("Number of Cliques"),this); cliquesAct->setShortcut(tr("Ctrl+T")); cliquesAct->setStatusTip(tr("Calculates and displays the number of cliques (triangles) of each node v.")); cliquesAct->setWhatsThis(tr("Triangles\n\n A triangle is a complete subgraph of three nodes of G. This method calculates the number of triangles of each node v is defined as delta(v) = |{{u, w} in E : {v, u} in E and {v, w} in E}|. \n ")); connect(cliquesAct, SIGNAL(activated()), this, SLOT(slotNumberOfCliques() ) ); clusteringCoefAct = new QAction(QIcon(":/images/clique.png"), tr("Clustering Coefficient"),this); clusteringCoefAct ->setShortcut(tr("Ctrl+C")); clusteringCoefAct->setStatusTip(tr("Calculates and displays the average Clustering Coefficient of the network.")); clusteringCoefAct->setWhatsThis(tr("Clustering Coefficient\n\n The Clustering Coefficient of a vertex quantifies how close the vertex and its neighbors are to being a clique. \n ")); connect(clusteringCoefAct, SIGNAL(activated()), this, SLOT(slotClusteringCoefficient() ) ); triadCensusAct = new QAction(QIcon(":/images/clique.png"), tr("Triad Census"),this); triadCensusAct->setShortcut(tr("Ctrl+Shift+T")); triadCensusAct->setStatusTip(tr("Conducts a triad census for the active network.")); triadCensusAct->setWhatsThis(tr("Triad Census\n\n A triad census counts all the different kinds of observed triads within a network and codes them according to their number of mutual, asymmetric and non-existent dyads. \n ")); connect(triadCensusAct, SIGNAL(activated()), this, SLOT(slotTriadCensus() ) ); cInDegreeAct = new QAction(tr("InDegree"), this); cInDegreeAct->setStatusTip(tr("Calculates and displays InDegree Centralities")); cInDegreeAct->setShortcut(tr("Ctrl+1")); cInDegreeAct->setWhatsThis(tr("InDegree Centrality\n\n For each node k, this the number of arcs ending at k. Most in-degree central node might be considered more prominent among others. ")); connect(cInDegreeAct, SIGNAL(activated()), this, SLOT(slotCentralityInDegree())); cOutDegreeAct = new QAction(tr("OutDegree"),this); cOutDegreeAct->setShortcut(tr("Ctrl+2")); cOutDegreeAct->setStatusTip(tr("Calculates and displays OutDegree Centralities")); cOutDegreeAct->setWhatsThis(tr("OutDegree Centrality\n\n For each node k, this is the number of arcs starting from it. This is oftenly a measure of activity.")); connect(cOutDegreeAct, SIGNAL(activated()), this, SLOT(slotCentralityOutDegree())); cClosenessAct = new QAction(tr("Closeness"), this); cClosenessAct->setShortcut(tr("Ctrl+3")); cClosenessAct->setStatusTip(tr("Calculates and displays Closeness Centralities")); cClosenessAct->setWhatsThis(tr("Closeness Centrality\n\n For each node k, this the invert sum of the shortest distances between k and every other node. It is interpreted as the ability to access information through the \"grapevine\" of network members. Nodes with high closeness are those who can reach many other nodes in few steps. ")); connect(cClosenessAct, SIGNAL(activated()), this, SLOT(slotCentralityCloseness())); cBetweenessAct = new QAction(tr("Betweeness"), this); cBetweenessAct->setShortcut(tr("Ctrl+4")); cBetweenessAct->setStatusTip(tr("Calculates and displays Betweeness Centralities")); cBetweenessAct->setWhatsThis(tr("Betweeness Centrality\n\n For each node k, this is the ratio of all geodesics between pairs of nodes which run through k. It reflects how often an node lies on the geodesics between the other nodes of the network. It can be interpreted as a measure of control. A node which is lies between many others is assumed to have a higher likelihood of being able to control information flow in the network. \n\n Note that betweeness centrality assumes that all geodesics have equal weight or are equally likely to be chosen for the flow of information between any two nodes. This is reasonable only on \"regular\" networks where all nodes have similar degrees. On networks with significant degree variance you might want to try informational centrality instead.")); connect(cBetweenessAct, SIGNAL(activated()), this, SLOT(slotCentralityBetweeness())); cGraphAct = new QAction(tr("Graph"),this); cGraphAct->setShortcut(tr("Ctrl+5")); cGraphAct->setStatusTip(tr("Calculates and displays Graph Centralities")); cGraphAct->setWhatsThis(tr("Graph Centrality\n\n For each node k, this is the invert of the maximum of all geodesic distances from k to all other nodes in the network. Nodes with high GC have short distances to all other nodes in the graph. ")); connect(cGraphAct, SIGNAL(activated()), this, SLOT(slotCentralityGraph())); cStressAct = new QAction(tr("Stress"), this); cStressAct->setShortcut(tr("Ctrl+6")); cStressAct->setStatusTip(tr("Calculate and display Stress Centrality")); cStressAct->setWhatsThis(tr("Stress Centrality\n\n For each node k, this is the total number of geodesics between all other nodes which run through k. When one node falls on all other geodesics between all the remaining (N-1) nodes, then we have a star graph with maximum Stress Centrality")); connect(cStressAct, SIGNAL(activated()), this, SLOT(slotCentralityStress())); cEccentAct = new QAction(tr("Eccentricity"), this); cEccentAct->setShortcut(tr("Ctrl+7")); cEccentAct->setStatusTip(tr("Calculate and display Eccentricity Centrality")); cEccentAct->setWhatsThis(tr("Stress Centrality\n\n For each node k, this is the largest geodesic distance (k,t) from every other vertex t. Therefore, EC(u) reflects how far, at most, is each node from every other node.")); connect(cEccentAct, SIGNAL(activated()), this, SLOT(slotCentralityEccentricity())); cPowerAct = new QAction(tr("Power"), this); cPowerAct->setShortcut(tr("Ctrl+8")); cPowerAct->setStatusTip(tr("Calculate and display Power Centrality (aka Gil-Schmidt Power Centrality index)")); cPowerAct->setWhatsThis(tr("Power Centrality\n\n For each node k, this index sums its degree (with weight 1), with the size of the 2nd-order neighbourhood (with weight 2), and in general, with the size of the kth order neighbourhood (with weight k). Thus, for each node in the network the most important other nodes are its immediate neighbours and then in decreasing importance the nodes of the 2nd-order neighbourhood, 3rd-order neighbourhood etc. For each node, the sum obtained is normalised by the total numbers of nodes in the same component minus 1. Power centrality has been devised by Gil-Schmidt. ")); connect(cPowerAct, SIGNAL(activated()), this, SLOT(slotCentralityPower())); cInformationAct = new QAction(tr("Information"), this); cInformationAct->setShortcut(tr("Ctrl+9")); cInformationAct->setEnabled(true); cInformationAct->setStatusTip(tr("Calculate and display Information Centrality")); cInformationAct->setWhatsThis(tr("Information Centrality\n\n Information centrality counts all paths between nodes weighted by strength of tie and distance. This centrality measure developed by Stephenson and Zelen (1989) focuses on how information might flow through many different paths. \n\n Note: To compute this index, SocNetV drops all isolated nodes.")); connect(cInformationAct, SIGNAL(activated()), this, SLOT(slotCentralityInformation())); /** Options menu actions */ displayNodeNumbersAct = new QAction( tr("Display Num&bers"), this ); displayNodeNumbersAct->setStatusTip(tr("Toggles displaying of node numbers")); displayNodeNumbersAct->setWhatsThis(tr("Display Numbers\n\nEnables/disables node numbers")); displayNodeNumbersAct->setCheckable (true); displayNodeNumbersAct->setChecked(true); connect(displayNodeNumbersAct, SIGNAL(toggled(bool)), this, SLOT(slotDisplayNodeNumbers(bool))); displayNodeLabelsAct= new QAction(tr("Display Labels"), this ); displayNodeLabelsAct->setStatusTip(tr("Toggles displaying of node labels")); displayNodeLabelsAct->setWhatsThis(tr("Display Labels\n\nEnables/disables node labels")); displayNodeLabelsAct->setCheckable (true); displayNodeLabelsAct->setChecked(false); connect(displayNodeLabelsAct, SIGNAL(toggled(bool)), this, SLOT(slotDisplayNodeLabels(bool))); displayNumbersInsideNodesAct= new QAction(tr("Display Numbers Inside Nodes"), this ); displayNumbersInsideNodesAct->setStatusTip(tr("Toggles displaying numbers inside nodes")); displayNumbersInsideNodesAct->setWhatsThis(tr("Display Numbers Inside Nodes\n\nTurns on/off displaying nodenumbers inside nodes")); displayNumbersInsideNodesAct->setCheckable (true); displayNumbersInsideNodesAct->setChecked(false); connect(displayNumbersInsideNodesAct, SIGNAL(toggled(bool)), this, SLOT(slotDisplayNumbersInsideNodes(bool))); displayLinksAct = new QAction(tr("Display Links"), this); displayLinksAct->setStatusTip(tr("Toggle to display or not links")); displayLinksAct->setWhatsThis(tr("Display Links\n\nClick to enable or disable displaying of links")); displayLinksAct->setCheckable(true); displayLinksAct->setChecked(true); connect(displayLinksAct, SIGNAL(toggled(bool)), this, SLOT(slotDisplayLinks(bool)) ); displayLinksWeightNumbersAct = new QAction(tr("Display Weight Numbers"), this); displayLinksWeightNumbersAct->setStatusTip(tr("Toggles displaying of numbers of links weights")); displayLinksWeightNumbersAct->setWhatsThis(tr("Display Weight Numbers\n\nClick to enable or disable displaying numbers of links weight")); displayLinksWeightNumbersAct->setCheckable(true); displayLinksWeightNumbersAct->setChecked(false); connect(displayLinksWeightNumbersAct, SIGNAL(toggled(bool)), this, SLOT(slotDisplayLinksWeightNumbers(bool)) ); displayLinksArrowsAct = new QAction( tr("Display Arrows"),this); displayLinksArrowsAct->setStatusTip(tr("Toggles displaying of arrows in the end of links")); displayLinksArrowsAct->setWhatsThis(tr("Display Arrows\n\nClick to enable or disable displaying of arrows in the end of links")); displayLinksArrowsAct->setCheckable(true); displayLinksArrowsAct->setChecked(true); connect(displayLinksArrowsAct, SIGNAL(toggled(bool)), this, SLOT(slotDisplayLinksArrows(bool)) ); drawLinksWeightsAct = new QAction( tr("Thickness=Weight"), this); drawLinksWeightsAct->setStatusTip(tr("Draws links as thick as their weights (if specified)")); drawLinksWeightsAct->setWhatsThis(tr("Draw As Thick As Weights\n\nClick to toggle having all links as thick as their weight (if specified)")); drawLinksWeightsAct->setCheckable(true); drawLinksWeightsAct->setChecked(false); drawLinksWeightsAct->setEnabled(false); connect(drawLinksWeightsAct, SIGNAL(toggled(bool)), this, SLOT(slotDrawLinksThickAsWeights()) ); drawLinksBezier = new QAction( tr("Bezier Curves"), this); drawLinksBezier->setStatusTip(tr("Draws links as Bezier curves")); drawLinksBezier->setWhatsThis(tr("Links Bezier\n\nEnables/Disables drawing Links as Bezier curves.")); drawLinksBezier->setCheckable(true); drawLinksBezier->setChecked (false); drawLinksBezier->setEnabled(false); connect(drawLinksBezier, SIGNAL(toggled(bool)), this, SLOT(slotDrawLinksBezier(bool)) ); /** Options > View menu actions */ antialiasingAct = new QAction(tr("Anti-Aliasing"), this); antialiasingAct ->setShortcut(tr("F8")); antialiasingAct ->setStatusTip(tr("Enables/disables anti-aliasing")); antialiasingAct ->setWhatsThis(tr("Enable or disable Anti-Aliasing\n\n Anti-aliasing is a technique which makes nodes, lines and text, smoother and fancier. But it comes at the cost of speed...")); antialiasingAct ->setCheckable(true); antialiasingAct ->setChecked (true); connect(antialiasingAct , SIGNAL(toggled(bool)), this, SLOT(slotAntialiasing(bool))); showProgressBarAct = new QAction(tr("Progress Bars"), this); showProgressBarAct ->setShortcut(tr("F10")); showProgressBarAct->setStatusTip(tr("Enables/disables Progress Bars")); showProgressBarAct->setWhatsThis(tr("Enable or disable Progress Bars\n\nProgress Bars may appear during time-cost operations. Enabling progressBar has a significant cpu cost but lets you know about the progress of a given operation.")); showProgressBarAct->setCheckable(true); showProgressBarAct->setChecked (true); connect(showProgressBarAct, SIGNAL(toggled(bool)), this, SLOT(slotShowProgressBar(bool))); printDebugAct = new QAction(tr("Debug Messages"), this); printDebugAct ->setShortcut(tr("F9")); printDebugAct->setStatusTip(tr("Enables/disables printing debug messages to stdout")); printDebugAct->setWhatsThis(tr("Enables or disable Debug Messages\n\nPrinting debug messages to strerr. Enabling has a significant cpu cost but lets you know what SocNetV is actually doing.")); printDebugAct->setCheckable(true); printDebugAct->setChecked (false); printDebug=false; connect(printDebugAct, SIGNAL(toggled(bool)), this, SLOT(slotPrintDebug(bool))); viewToolBar = new QAction(tr("Toolbar"), this); viewToolBar->setStatusTip(tr("Enables/disables the toolbar")); viewToolBar->setWhatsThis(tr("Enable or disable Toolbar\n\nThe toolbar is the widget right below the menu, and carries useful icons. You can disable it if you like...")); viewToolBar->setCheckable(true); viewToolBar->setChecked(true); connect(viewToolBar, SIGNAL(toggled(bool)), this, SLOT(slotViewToolBar(bool))); viewStatusBar = new QAction(tr("Statusbar"), this); viewStatusBar->setStatusTip(tr("Enables/disables the statusbar")); viewStatusBar->setWhatsThis(tr("Enable or disable Statusbar\n\nThe statusbar is the widget at the bottom of the window, where messages appear. You might want to disable it...")); viewStatusBar->setCheckable(true); viewStatusBar->setChecked(true); connect(viewStatusBar, SIGNAL(toggled(bool)), this, SLOT(slotViewStatusBar(bool))); backgroundImageAct = new QAction(tr("Background Image"), this); backgroundImageAct->setStatusTip(tr("Enables/disables displaying a user-defined custom image in the background")); backgroundImageAct->setWhatsThis(tr("Enable or disable background image\n\n If you enable it, you will be asked for a image file, which will be displayed in the background instead of plain color..")); backgroundImageAct->setCheckable(true); backgroundImageAct->setChecked(false); connect(backgroundImageAct, SIGNAL(toggled(bool)), this, SLOT(slotBackgroundImage(bool))); /** Help menu actions */ helpApp = new QAction(QIcon(":/images/help.png"), tr("Manual"), this); helpApp ->setShortcut(tr("F1")); helpApp->setStatusTip(tr("Read the manual...")); helpApp->setWhatsThis(tr("Manual\n\nDisplays the documentation of SocNetV")); connect(helpApp, SIGNAL(activated()), this, SLOT(slotHelp())); tipsApp = new QAction(tr("Tip of the Day"), this); tipsApp->setStatusTip(tr("Read useful tips")); tipsApp->setWhatsThis(tr("Quick Tips\n\nDisplays some useful and quick tips")); connect(tipsApp, SIGNAL(activated()), this, SLOT(slotTips())); helpAboutApp = new QAction(tr("About SocNetV"), this); helpAboutApp->setStatusTip(tr("About SocNetV")); helpAboutApp->setWhatsThis(tr("About\n\nBasic information about SocNetV")); connect(helpAboutApp, SIGNAL(activated()), this, SLOT(slotHelpAbout())); helpAboutQt = new QAction(tr("About Qt"), this); helpAboutQt->setStatusTip(tr("About Qt")); helpAboutQt->setWhatsThis(tr("About\n\nAbout Qt")); connect(helpAboutQt, SIGNAL(activated()), this, SLOT(slotAboutQt() ) ); } /** Creates and populates the MenuBar */ void MainWindow::initMenuBar() { /** menuBar entry networkMenu */ networkMenu = menuBar()->addMenu(tr("&Network")); networkMenu -> addAction(fileNew); networkMenu -> addAction(fileOpen); importSubMenu = new QMenu(tr("Import ...")); importSubMenu -> addAction(importPajek); importSubMenu -> addAction(importSM); importSubMenu -> addAction(importTwoModeSM); importSubMenu -> addAction(importList); importSubMenu -> addAction(importDL); networkMenu ->addMenu (importSubMenu); networkMenu -> addSeparator(); networkMenu -> addAction (openTextEditorAct); networkMenu -> addAction (viewNetworkFileAct); networkMenu -> addSeparator(); networkMenu -> addAction (viewSociomatrixAct); networkMenu -> addSeparator(); networkMenu -> addAction (recreateDataSetAct); networkMenu -> addSeparator(); randomNetworkMenu = new QMenu(tr("Create Random Network...")); networkMenu ->addMenu (randomNetworkMenu); randomNetworkMenu -> addAction (createSmallWorldRandomNetworkAct); randomNetworkMenu -> addAction (createUniformRandomNetworkAct ); // createGaussianRandomNetworkAct -> addTo(randomNetworkMenu); randomNetworkMenu -> addAction (createLatticeNetworkAct); randomNetworkMenu -> addAction (createSameDegreeRandomNetworkAct); networkMenu->addSeparator(); networkMenu -> addAction(webCrawlerAct); networkMenu -> addSeparator(); networkMenu -> addAction(fileSave); networkMenu -> addAction(fileSaveAs); networkMenu -> addSeparator(); exportSubMenu = networkMenu -> addMenu(tr("Export...")); exportSubMenu -> addAction (exportBMP); exportSubMenu -> addAction (exportPNG); exportSubMenu -> addAction (exportPDF); exportSubMenu -> addSeparator(); exportSubMenu -> addAction (exportSM); exportSubMenu -> addAction (exportPajek); // exportList->addTo(exportSubMenu); // exportDL->addTo(exportSubMenu); // exportGW->addTo(exportSubMenu); networkMenu -> addSeparator(); networkMenu -> addAction(printNetwork); networkMenu -> addSeparator(); networkMenu -> addAction(fileClose); networkMenu -> addAction(fileQuit); /** menuBar entry editMenu */ editMenu = menuBar()->addMenu(tr("&Edit")); editNodeMenu = new QMenu(tr("Node...")); editNodeMenu -> setIcon(QIcon(":/images/node.png")); editMenu -> addMenu ( editNodeMenu ); editNodeMenu -> addAction (findNodeAct); editNodeMenu -> addAction (addNodeAct); editNodeMenu -> addAction (removeNodeAct); editNodeMenu -> addSeparator(); editNodeMenu -> addAction (changeNodeLabelAct); editNodeMenu -> addAction (changeNodeColorAct); editNodeMenu -> addAction (changeNodeSizeAct); editNodeMenu -> addAction (changeNodeValueAct); editNodeMenu -> addSeparator(); editNodeMenu -> addAction (changeAllNodesSizeAct); editNodeMenu -> addAction (changeAllNodesShapeAct); editNodeMenu -> addAction (changeNumbersSizeAct); editNodeMenu -> addAction (changeLabelsSizeAct); editLinkMenu = new QMenu(tr("Link...")); editLinkMenu -> setIcon(QIcon(":/images/line.png")); editMenu-> addMenu (editLinkMenu); editLinkMenu -> addAction(addLinkAct); editLinkMenu -> addAction(removeLinkAct); editLinkMenu -> addAction(changeLinkLabelAct); editLinkMenu -> addAction(changeLinkColorAct); editLinkMenu -> addAction(changeLinkWeightAct); editMenu ->addSeparator(); filterMenu = new QMenu ( tr("Filter...")); editMenu ->addMenu(filterMenu); filterMenu -> addAction(filterNodesAct ); filterMenu -> addAction(filterOrphanNodesAct ); filterMenu -> addAction(filterEdgesAct ); editMenu ->addSeparator(); // transformNodes2LinksAct -> addTo (editMenu); editMenu -> addAction (symmetrizeAct); editNodeMenu -> addSeparator(); colorOptionsMenu=new QMenu(tr("Colors")); colorOptionsMenu -> setIcon(QIcon(":/images/colorize.png")); editMenu -> addMenu (colorOptionsMenu); colorOptionsMenu -> addAction (changeBackColorAct); colorOptionsMenu -> addAction (changeAllNodesColorAct); colorOptionsMenu -> addAction (changeAllLinksColorAct); colorOptionsMenu -> addAction (changeAllNumbersColorAct); colorOptionsMenu -> addAction (changeAllLabelsColorAct); /** menuBar entry layoutMenu */ layoutMenu = menuBar()->addMenu(tr("&Layout")); // colorationMenu = new QPopupMenu(); // layoutMenu -> insertItem (tr("Colorization"), colorationMenu); // strongColorationAct -> addTo(colorationMenu); // regularColorationAct-> addTo(colorationMenu); // layoutMenu->insertSeparator(); randomLayoutMenu = new QMenu(tr("Random...")); layoutMenu -> addMenu (randomLayoutMenu ); randomLayoutMenu -> addAction(randLayoutAct); randomLayoutMenu -> addAction( randCircleLayoutAct ); circleLayoutMenu = new QMenu(tr("Radial by centrality...")); circleLayoutMenu -> setIcon(QIcon(":/images/circular.png")); layoutMenu -> addMenu (circleLayoutMenu); circleLayoutMenu -> addAction (circleInDegreeLayoutAct); circleLayoutMenu -> addAction (circleOutDegreeLayoutAct); circleLayoutMenu -> addAction (circleClosenessLayoutAct); circleLayoutMenu -> addAction (circleBetweenessLayoutAct); circleLayoutMenu -> addAction (circleStressLayoutAct); circleLayoutMenu -> addAction (circleGraphLayoutAct); circleLayoutMenu -> addAction (circleEccentrLayoutAct); circleLayoutMenu -> addAction (circlePowerLayoutAct); circleLayoutMenu -> addAction (circleInformationLayoutAct); levelLayoutMenu = new QMenu (tr("Layered by centrality...")); levelLayoutMenu -> setIcon(QIcon(":/images/net3.png")); layoutMenu -> addMenu (levelLayoutMenu); levelLayoutMenu ->addAction ( levelInDegreeLayoutAct ); levelLayoutMenu ->addAction ( levelOutDegreeLayoutAct ); levelLayoutMenu ->addAction ( levelClosenessLayoutAct ); levelLayoutMenu ->addAction ( levelBetweenessLayoutAct ); levelLayoutMenu ->addAction ( levelInformationLayoutAct ); layoutMenu->addSeparator(); physicalLayoutMenu = new QMenu (tr("Physical...")); layoutMenu -> addMenu (physicalLayoutMenu); physicalLayoutMenu -> addAction (springLayoutAct); physicalLayoutMenu -> addAction (FRLayoutAct); layoutMenu->addSeparator(); layoutMenu->addAction(nodeSizeProportionalOutDegreeAct); layoutMenu->addAction(nodeSizeProportionalInDegreeAct); layoutMenu->addSeparator(); layoutMenu -> addAction (circleClearBackgrCirclesAct); /** menuBar entry: statistics menu */ statMenu = menuBar()->addMenu(tr("&Statistics")); statMenu -> addAction (symmetryAct); statMenu -> addAction (invertAdjMatrixAct); // statMenu -> addAction (netDensity); statMenu -> addSeparator(); statMenu -> addAction (graphDistanceAct); statMenu -> addAction (averGraphDistanceAct); statMenu -> addAction (distanceMatrixAct); statMenu -> addAction (diameterAct); statMenu -> addSeparator(); statMenu -> addAction (cliquesAct); statMenu -> addAction (clusteringCoefAct); statMenu -> addSeparator(); statMenu -> addAction (triadCensusAct); statMenu->addSeparator(); centrlMenu = new QMenu(tr("Centralities...")); statMenu->addMenu(centrlMenu); centrlMenu -> addAction (cInDegreeAct); centrlMenu -> addAction (cOutDegreeAct); centrlMenu -> addAction (cClosenessAct); centrlMenu -> addAction (cBetweenessAct); centrlMenu -> addAction (cGraphAct); centrlMenu -> addAction (cStressAct); centrlMenu -> addAction (cEccentAct); centrlMenu -> addAction (cPowerAct); centrlMenu -> addAction (cInformationAct); /** menuBar entry optionsMenu */ optionsMenu = menuBar()->addMenu(tr("&Options")); nodeOptionsMenu=new QMenu(tr("Nodes...")); nodeOptionsMenu -> setIcon(QIcon(":/images/nodes.png")); optionsMenu -> addMenu (nodeOptionsMenu); nodeOptionsMenu -> addAction (displayNodeNumbersAct); nodeOptionsMenu -> addAction (displayNodeLabelsAct); nodeOptionsMenu -> addAction (displayNumbersInsideNodesAct); linkOptionsMenu=new QMenu(tr("Links...")); linkOptionsMenu -> setIcon(QIcon(":/images/line.png")); optionsMenu -> addMenu (linkOptionsMenu); linkOptionsMenu -> addAction (displayLinksAct); linkOptionsMenu -> addAction (displayLinksWeightNumbersAct); linkOptionsMenu -> addAction (displayLinksArrowsAct ); linkOptionsMenu -> addSeparator(); linkOptionsMenu -> addAction (drawLinksWeightsAct); linkOptionsMenu -> addAction (drawLinksBezier); viewOptionsMenu = new QMenu (tr("&View...")); viewOptionsMenu -> setIcon(QIcon(":/images/view.png")); optionsMenu -> addMenu (viewOptionsMenu); viewOptionsMenu-> addAction (backgroundImageAct); viewOptionsMenu-> addAction (antialiasingAct); viewOptionsMenu-> addAction (printDebugAct); viewOptionsMenu-> addAction (showProgressBarAct); viewOptionsMenu-> addAction (viewToolBar); viewOptionsMenu-> addAction (viewStatusBar); /** menuBar entry helpMenu */ helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu -> addAction (helpApp); helpMenu -> addAction (tipsApp); helpMenu -> addSeparator(); helpMenu-> addAction (helpAboutApp); helpMenu-> addAction (helpAboutQt); } /** Initializes the toolbar */ void MainWindow::initToolBar(){ toolBar = addToolBar("operations"); toolBar -> addAction (fileNew); toolBar -> addAction (fileOpen); toolBar -> addAction (fileSave); toolBar -> addAction (printNetwork); toolBar -> addSeparator(); toolBar -> addAction(zoomInAct); //Create zooming widget zoomCombo = new QComboBox; QStringList scales; scales << tr("25%") << tr("50%") << tr("75%") << tr("100%") << tr("125%") << tr("150%")<addItems(scales); zoomCombo->setCurrentIndex(3); toolBar -> addWidget(zoomCombo); toolBar -> addAction(zoomOutAct); toolBar -> addSeparator(); QLabel *labelRotateSpinBox= new QLabel; labelRotateSpinBox ->setText(tr("Rotation:")); rotateSpinBox = new QSpinBox; rotateSpinBox ->setRange(-360, 360); rotateSpinBox->setSingleStep(1); rotateSpinBox->setValue(0); QGroupBox *rotateGroup = new QGroupBox(); QHBoxLayout *rotateGroupLayout = new QHBoxLayout(rotateGroup); rotateGroupLayout->addWidget(labelRotateSpinBox); rotateGroupLayout->addWidget(rotateSpinBox); toolBar -> addWidget(rotateGroup); toolBar -> addSeparator(); toolBar -> addAction ( QWhatsThis::createAction (this)); } //Creates a dock widget for instant menu access void MainWindow::initToolBox(){ toolBox = new QTabWidget; toolBox->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Ignored)); //create widgets for the buttons group/tab addNodeBt= new QPushButton(QIcon(":/images/add.png"),tr("&Add Node")); addNodeBt->setFocusPolicy(Qt::NoFocus); addNodeBt->setToolTip(tr("Add a new node to the network (Ctrl+A). \n\n Alternately, you can create a new node \nin a specific position by double-clicking \non that spot of the canvas.")); removeNodeBt= new QPushButton(QIcon(":/images/remove.png"),tr("&Remove Node")); removeNodeBt->setFocusPolicy(Qt::NoFocus); removeNodeBt->setToolTip(tr("Remove a node from the network (Ctrl+Shift+A). \n\n Alternately, you can remove a node \nby right-clicking on it.")); addLinkBt= new QPushButton(QIcon(":/images/connect.png"),tr("Add &Link")); addLinkBt->setFocusPolicy(Qt::NoFocus); addLinkBt->setToolTip(tr("Add a new link to the network (Ctrl+L).\n\n Alternately, you can create a new link between two \nnodes by middle-clicking on them consequetively.")); removeLinkBt= new QPushButton(QIcon(":/images/disconnect.png"),tr("Remove Link")); removeLinkBt->setFocusPolicy(Qt::NoFocus); removeLinkBt->setToolTip(tr("Remove a link from the network \n\n Alternately, you can remove a link \nby right-clicking on it.")); //create a layout for these widgets QGridLayout *buttonsGrid = new QGridLayout; buttonsGrid -> addWidget(addNodeBt, 0,0); buttonsGrid -> addWidget(removeNodeBt, 0,1); buttonsGrid -> addWidget(addLinkBt,1,0); buttonsGrid -> addWidget(removeLinkBt,1,1); buttonsGrid -> setRowStretch(2,1); //fix vertical stretch //create a box with a title & a frame. Inside, display the vertical layout of widgets QGroupBox *buttonsGroup= new QGroupBox(tr("")); buttonsGrid->setSpacing(0); buttonsGrid->setMargin(10); buttonsGroup->setLayout(buttonsGrid); toolBox->addTab(buttonsGroup, tr("Edit")); //create widgets for Properties/Statistics group/tab QLabel *labelNodesLCD = new QLabel; labelNodesLCD->setText(tr("Total Nodes")); QLabel *labelEdgesLCD = new QLabel; labelEdgesLCD->setText(tr("Total Links")); nodesLCD=new QLCDNumber(7); nodesLCD->setSegmentStyle(QLCDNumber::Flat); nodesLCD->setToolTip(tr("Counts how many nodes (vertices) exist in the whole network.")); edgesLCD=new QLCDNumber(7); edgesLCD->setSegmentStyle(QLCDNumber::Flat); edgesLCD->setToolTip(tr("Counts how many links (in and out) exist in the whole network.")); QLabel *labelDensityLCD = new QLabel; labelDensityLCD->setText(tr("Density")); densityLCD=new QLCDNumber(7); densityLCD->setSegmentStyle(QLCDNumber::Flat); densityLCD->setToolTip(tr("The density of a network is the ratio of existing links to all possible links (n(n-1)) between nodes.")); //create a grid layout QGridLayout *propertiesGrid = new QGridLayout(); propertiesGrid -> setColumnMinimumWidth(0, 10); propertiesGrid -> setColumnMinimumWidth(1, 10); propertiesGrid -> addWidget(labelNodesLCD, 0,0); propertiesGrid -> addWidget(labelEdgesLCD, 0,1); propertiesGrid -> addWidget(nodesLCD,1,0); propertiesGrid -> addWidget(edgesLCD,1,1); propertiesGrid -> addWidget(labelDensityLCD, 2,0); propertiesGrid -> addWidget(densityLCD,2,1); QLabel *dummyLabel = new QLabel; dummyLabel-> setText (" "); QLabel *labelNode = new QLabel; labelNode-> setText (tr("Active Node")); QLabel *labelSelectedNodeLCD = new QLabel; labelSelectedNodeLCD -> setText (tr("Node Number:")); labelSelectedNodeLCD -> setToolTip (tr("This is the number of the last selected node.")); selectedNodeLCD =new QLCDNumber(7); selectedNodeLCD ->setSegmentStyle(QLCDNumber::Flat); QLabel *labelInLinksLCD = new QLabel; labelInLinksLCD -> setText (tr("Node In-Degree:")); labelInLinksLCD -> setToolTip (tr("This is the number of edges ending at the node you clicked on.")); inLinksLCD=new QLCDNumber(7); inLinksLCD -> setSegmentStyle(QLCDNumber::Flat); inLinksLCD -> setToolTip (tr("This is the number of edges ending at the node you clicked on.")); QLabel *labelOutLinksLCD = new QLabel; labelOutLinksLCD -> setText (tr("Node Out-Degree:")); labelOutLinksLCD -> setToolTip (tr("This is the number of edges starting from the node you clicked on.")); outLinksLCD=new QLCDNumber(7); outLinksLCD -> setSegmentStyle(QLCDNumber::Flat); outLinksLCD -> setToolTip (tr("This is the number of edges starting from the node you clicked on.")); QLabel *labelClucofLCD = new QLabel; labelClucofLCD -> setText (tr("Clustering Coef.")); labelClucofLCD -> setToolTip (tr("The Clustering Coefficient quantifies how close the clicked vertex and its neighbors are to being a clique. \nThe value is the proportion of links between the vertices within the neighbourhood of the clicked vertex,\n divided by the number of links that could possibly exist between them. \n\n WARNING: This value is displayed for each node when you click on it,\n but only if you have computed CluCof from the menu Statistics > Clustering Coefficient ")); clucofLCD = new QLCDNumber(7); clucofLCD -> setSegmentStyle(QLCDNumber::Flat); clucofLCD -> setToolTip (tr("The Clustering Coefficient quantifies how close the clicked vertex and its neighbors are to being a clique. \nThe value is the proportion of links between the vertices within the neighbourhood of the clicked vertex,\n divided by the number of links that could possibly exist between them. \n\n WARNING: This value is displayed for each node when you click on it,\n but only if you have computed CluCof from the menu Statistics > Clustering Coefficient ")); propertiesGrid -> addWidget(dummyLabel, 6,0); propertiesGrid -> addWidget(labelNode, 7,0); propertiesGrid -> addWidget(labelSelectedNodeLCD , 8,0); propertiesGrid -> addWidget(selectedNodeLCD ,8,1); propertiesGrid -> addWidget(labelInLinksLCD, 9,0); propertiesGrid -> addWidget(inLinksLCD, 9,1); propertiesGrid -> addWidget(labelOutLinksLCD, 10,0); propertiesGrid -> addWidget(outLinksLCD,10,1); propertiesGrid -> addWidget(labelClucofLCD, 11,0); propertiesGrid -> addWidget(clucofLCD,11,1); propertiesGrid -> setRowStretch(12,1); //fix stretch //create a box with title QGroupBox *networkPropertiesGroup = new QGroupBox(tr("")); networkPropertiesGroup -> setLayout (propertiesGrid); toolBox->addTab( networkPropertiesGroup, tr("Statistics")); toolBox->setMinimumWidth(buttonsGroup->sizeHint().width()); // create some more widgets for the final tab: "Layout" moveSpringEmbedderBx = new QCheckBox(tr("Spring Embedder") ); moveSpringEmbedderBx->setToolTip(tr("Embeds a spring-gravitational model on the network, where \neach node is regarded as physical object reppeling all \nother nodes, while springs between connected nodes attact them. \nThe result is \nconstant movement. This is a very SLOW process on networks with N > 100!")); moveFruchtermanBx = new QCheckBox(tr("Fruchterman-Reingold") ); moveFruchtermanBx ->setEnabled(false); moveFruchtermanBx->setToolTip(tr("In Fruchterman-Reingold model, the vertices behave as atomic particles or celestial bodies, exerting attractive and repulsive forces to each other. Again, only vertices that are neighbours attract each other but, unlike Spring Embedder, all vertices repel each other. ")); moveKamandaBx= new QCheckBox(tr("Kamanda-Kwei") ); moveKamandaBx->setEnabled(false); moveKamandaBx->setToolTip(tr("!")); nodeSizeProportional2OutDegreeBx = new QCheckBox(tr("NodeSize = F (OutDegree)") ); nodeSizeProportional2OutDegreeBx ->setEnabled(true); nodeSizeProportional2OutDegreeBx->setToolTip(tr("If you enable this, all nodes will be resized so that their size reflect their out-degree (the amount of links from them). To put it simply, more out-linked nodes will be bigger...")); nodeSizeProportional2InDegreeBx = new QCheckBox(tr("NodeSize = F (InDegree)") ); nodeSizeProportional2InDegreeBx ->setEnabled(true); nodeSizeProportional2InDegreeBx->setToolTip(tr("If you enable this, all nodes will be resized so that their size reflect their in-degree (the amount of links to them from other nodes). To put it simply, more in-linked nodes will be bigger...")); QGridLayout *layoutGroupLayout = new QGridLayout(); layoutGroupLayout -> addWidget(moveSpringEmbedderBx, 0,0); layoutGroupLayout -> addWidget(moveKamandaBx, 1,0); layoutGroupLayout -> addWidget(nodeSizeProportional2OutDegreeBx, 2,0); layoutGroupLayout -> addWidget(nodeSizeProportional2InDegreeBx, 3,0); layoutGroupLayout -> setRowStretch(4,1); //fix stretch //create a box with title QGroupBox *layoutGroup= new QGroupBox(tr("")); layoutGroup->setLayout (layoutGroupLayout ); toolBox->addTab(layoutGroup, tr("Layout")); connect(moveSpringEmbedderBx, SIGNAL(stateChanged(int)),this, SLOT(layoutSpringEmbedder(int))); connect(moveFruchtermanBx, SIGNAL(stateChanged(int)),this, SLOT(layoutFruchterman(int))); connect(nodeSizeProportional2OutDegreeBx , SIGNAL(clicked(bool)),this, SLOT(slotLayoutNodeSizeProportionalOutEdges(bool))); connect(nodeSizeProportional2InDegreeBx , SIGNAL(clicked(bool)),this, SLOT(slotLayoutNodeSizeProportionalInEdges(bool))); } //FIXME this is a bug: Graph calls GraphicsWidget which calls this to call Graph! void MainWindow::updateNodeCoords(int nodeNumber, int x, int y){ // qDebug("MW: updateNodeCoords() for %i with x %i and y %i", nodeNumber, x, y); activeGraph.updateVertCoords(nodeNumber, x, y); } /** Initializes the status bar */ void MainWindow::initStatusBar() { statusBarDuration=2000; statusMessage( tr("Ready.")); } /** Initializes the scene and its graphicsWidget, the main widget of SocNetV */ void MainWindow::initView() { qDebug ("MW initView()"); //create a scene scene=new QGraphicsScene(); //create a view widget for this scene graphicsWidget=new GraphicsWidget(scene, this); graphicsWidget->setViewportUpdateMode( QGraphicsView::MinimalViewportUpdate ); // FullViewportUpdate // MinimalViewportUpdate //SmartViewportUpdate //BoundingRectViewportUpdate //QGraphicsView can cache pre-rendered content in a QPixmap, which is then drawn onto the viewport. graphicsWidget->setCacheMode(QGraphicsView::CacheNone); //CacheBackground | CacheNone graphicsWidget->setRenderHint(QPainter::Antialiasing, true); graphicsWidget->setRenderHint(QPainter::TextAntialiasing, true); graphicsWidget->setRenderHint(QPainter::SmoothPixmapTransform, false); //Optimization flags: // By enabling the flag below, QGraphicsView will completely disable its implicit clipping graphicsWidget->setOptimizationFlag(QGraphicsView::DontClipPainter, false); //if items do restore their state, it's not needed for graphicsWidget to do the same... graphicsWidget->setOptimizationFlag(QGraphicsView::DontSavePainterState, false); //Disables QGraphicsView's antialiasing auto-adjustment of exposed areas. graphicsWidget->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing, false); //"QGraphicsScene applies an indexing algorithm to the scene, to speed up item discovery functions like items() and itemAt(). Indexing is most efficient for static scenes (i.e., where items don't move around). For dynamic scenes, or scenes with many animated items, the index bookkeeping can outweight the fast lookup speeds." So... scene->setItemIndexMethod(QGraphicsScene::BspTreeIndex); //NoIndex (for anime) | BspTreeIndex graphicsWidget->setTransformationAnchor(QGraphicsView::AnchorUnderMouse); graphicsWidget->setResizeAnchor(QGraphicsView::AnchorViewCenter); // sets dragging the mouse over the scene while the left mouse button is pressed. graphicsWidget->setDragMode(QGraphicsView::RubberBandDrag); graphicsWidget->setFocusPolicy(Qt::StrongFocus); graphicsWidget->setFocus(); this->resize(900,600); //set minimum size of canvas graphicsWidget->setMinimumSize( (qreal) ( this->width()-toolBox->sizeHint().width() -30) , (qreal) ( this->height()-statusBar()->sizeHint().height() -toolBar->sizeHint().height() -menuBar()->sizeHint().height() -20 ) ); qDebug ("MW initView(): now window size %i, %i, graphicsWidget size %i, %i, scene %f,%f",this->width(),this->height(), graphicsWidget->width(),graphicsWidget->height(), graphicsWidget->scene()->width(), graphicsWidget->scene()->height()); } /** Resizes the scene when the window is resized. */ void MainWindow::resizeEvent( QResizeEvent * ){ qDebug ("MW resizeEvent():INITIAL window size %i, %i, graphicsWidget size %i, %i, scene %f,%f",this->width(),this->height(), graphicsWidget->width(),graphicsWidget->height(), graphicsWidget->scene()->width(), graphicsWidget->scene()->height()); //the area of the scene displayed by the CanvasView scene->setSceneRect(0, 0, (qreal) ( graphicsWidget->width() ), (qreal) (graphicsWidget->height() ) ); qDebug ("MW resizeEvent(): now window size %i, %i, graphicsWidget size %i, %i, scene %f,%f",this->width(),this->height(), graphicsWidget->width(),graphicsWidget->height(), graphicsWidget->scene()->width(), graphicsWidget->scene()->height()); } /** Initializes the default network parameters. Also used when erasing a network to start a new one */ void MainWindow::initNet(){ qDebug("MW: initNet() START INITIALISATION"); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); initNodeSize=4; initNodeColor="gold"; initLinkColor="grey"; //"black"; initLabelColor="darkblue"; initLabelSize=8; initNumberColor="black"; initNumberSize=8; initNodeShape="circle"; initBackgroundColor="white"; //"gainsboro"; minDuration=3000; //dialogue duration - obsolete maxNodes=5000; //Max nodes used by createRandomNetwork dialogues labelDistance=8; numberDistance=5; totalLinks=0; networkName=""; previous_fileName=fileName; fileName=""; pajekFileLoaded=false; adjacencyFileLoaded=false; fileFormat = -1; dotFileLoaded=false; fileLoaded=false; networkModified=false; fileSave->setIcon(QIcon(":/images/saved.png")); fileSave->setEnabled(true); markedNodeExists=false; //used by slotFindNode() cursorPosGW=QPointF(-1,-1); clickedJimNumber=-1; linkClicked=false; nodeClicked=false; /** Clear previous network data */ activeGraph.clear(); activeGraph.setSocNetV_Version(VERSION); activeGraph.setInitVertexShape(initNodeShape); activeGraph.setInitVertexSize(initNodeSize); activeGraph.setInitVertexColor(initNodeColor); activeGraph.setInitVertexNumberSize(initNumberSize); activeGraph.setInitVertexNumberColor(initNumberColor); activeGraph.setInitVertexLabelColor(initLabelColor); activeGraph.setInitVertexLabelSize(initLabelSize); activeGraph.setInitEdgeColor(initLinkColor); activeGraph.setShowLabels(this->showLabels()); activeGraph.setShowNumbersInsideNodes( this->showNumbersInsideNodes()); /** Clear scene **/ graphicsWidget->clear(); //Clear LCDs nodesLCD->display(activeGraph.vertices()); edgesLCD->display(activeGraph.totalEdges()); densityLCD->display(activeGraph.density()); inLinksLCD->display(0); outLinksLCD->display(0); clucofLCD->display(0); selectedNodeLCD->display(0); nodeSizeProportional2OutDegreeBx->setChecked(false); nodeSizeProportional2InDegreeBx->setChecked(false); displayLinksWeightNumbersAct->setChecked(false); //displayLinksArrowsAct->setChecked(false); //FIXME: USER PREFS EMITTED TO GRAPH? filterOrphanNodesAct->setChecked(false); // re-init orphan nodes menu item //set window title setWindowTitle(tr("Social Network Visualizer ")+VERSION); QApplication::restoreOverrideCursor(); statusMessage( tr("Ready")); qDebug("MW: initNet() INITIALISATION END"); } /* * Slot called by Graph::statusMessage to display some message to the user */ void MainWindow::statusMessage(const QString message){ statusBar()->showMessage( message, statusBarDuration ); } /** Closes the application. Asks to write any unsaved network data. */ void MainWindow::closeEvent( QCloseEvent* ce ) { if ( !networkModified ) { ce->accept(); return; } switch( QMessageBox::information( this, "Save file", tr("Do you want to save the changes") + tr(" to the network file?"), tr("Yes"), tr("No"), tr("Cancel"), 0, 1 ) ) { case 0: slotFileSave(); ce->accept(); break; case 1: ce->accept(); break; case 2: default: // just for sanity ce->ignore(); break; } } /** Creates a new network */ void MainWindow::slotCreateNew() { slotFileClose(); } /** Prompts the user a directory dialogue to choose a file from. Loads the specified file, calling loadNetworkFile() */ void MainWindow::slotChooseFile() { if (firstTime && fileFormat == -1 ) { QMessageBox::information( this, "SocNetV", tr("Attention: \n")+ tr("This menu option is suitable only for loading a network file with data in GraphML format, which is the default file format of SocNetV. \n")+ tr("If you want to import other supported network formats (i.e. Pajek, UCINET, dot, etc), ")+ tr("please use the options in the Import sub menu. \n")+ tr("\n This warning message will not appear again."), "OK", 0 ); firstTime=false; } if ( fileFormat == -1 ) fileFormat = 1; bool a_file_was_already_loaded=fileLoaded; previous_fileName=fileName; QString m_fileName, fileType_string; int m_fileFormat=fileFormat; statusMessage( tr("Choose a network file...")); switch (m_fileFormat){ case 1: //GraphML fileType_string = tr("GraphML (*.graphml *.xml);;All (*)"); break; case 2: //Pajek fileType_string = tr("Pajek (*.net *.paj *.pajek);;All (*)"); break; case 3: //Adjacency fileType_string = tr("Adjacency (*.txt *.csv *.sm *.adj);;All (*)"); break; case 4: //Dot fileType_string = tr("GraphViz (*.dot);;All (*)"); break; case 5: //GML fileType_string = tr("GML (*.gml);;All (*)"); break; case 6: //DL fileType_string = tr("DL (*.dl);;All (*)"); break; case 7: // Weighted List fileType_string = tr("List (*.lst *.list);;All (*)"); break; case 8: // Simple List fileType_string = tr("List (*.lst *.list);;All (*)"); break; case 9: // Two mode sm fileType_string = tr("Two-Mode Sociomatrix (*.txt *.2sm *.aff *.csv *.sm);;All (*)"); break; default: //All fileType_string = tr("All (*);;GraphML (*.graphml);;GraphViz (*.dot);;Adjacency (*.txt *.csv *.net *.adj *.sm);;Pajek (*.net *.pajek *.paj);;DL (*.dl *.net)"); break; } m_fileName = QFileDialog::getOpenFileName( this, tr("Select one file to open"), "", fileType_string ); if (!m_fileName.isEmpty()) { qDebug()<<"MW: file selected: " << m_fileName; fileNameNoPath=m_fileName.split ("/" ); if ( loadNetworkFile ( m_fileName, m_fileFormat ) ) { fileName=m_fileName; previous_fileName=fileName; setWindowTitle("SocNetV "+ VERSION +" - "+fileNameNoPath.last()); QString message=tr("Loaded network: ")+fileNameNoPath.last(); statusMessage( message ); } else { statusMessage( tr("Error loading requested file. Aborted.")); QMessageBox::critical( this, "SocNetV", tr("Error! \n")+ tr("Sorry, the selected file is not in GraphML format, which is the default file format of SocNetV. \n")+ tr("If you want to import other network formats (i.e. Pajek, UCINET, dot, etc), ")+ tr("please use the options in the Import sub menu. \n"), "OK", 0 ); } } else { statusMessage( tr("Opening aborted")); //if a file was previously opened, get back to it. if (a_file_was_already_loaded) { fileLoaded=true; fileName=previous_fileName; } } } /** Saves the network in the same file */ void MainWindow::slotFileSave() { statusMessage( tr("Saving file...")); if (!fileLoaded && !networkModified ) { statusMessage( QString(tr("No network loaded.")) ); return; } if ( fileName.isEmpty() ) { slotFileSaveAs(); return; } int maxWidth=scene->width(); int maxHeight=scene->height(); fileNameNoPath=fileName.split ("/"); if (pajekFileLoaded) { if ( activeGraph.saveGraph(fileName, 1, networkName, maxWidth,maxHeight) ) networkSaved(1); else networkSaved(0); } else if (adjacencyFileLoaded) { if ( activeGraph.saveGraph(fileName, 2, networkName, maxWidth,maxHeight) ) networkSaved(2); else networkSaved(0); } else if (graphMLFileLoaded || ( !fileLoaded && networkModified) ) { //new file or GraphML if ( activeGraph.saveGraph(fileName, 4, networkName, maxWidth,maxHeight) ) networkSaved(4); else networkSaved(0); } else { switch( QMessageBox::information( this, "GraphML File Format", tr("This network will be saved in GraphML format. \n")+ tr("Is this OK? \n\n") + tr("If not, press Cancel, then go to Network > Export menu..."), "Yes", "No",0,1 ) ) { case 0: if ( activeGraph.saveGraph(fileName, 4, networkName, maxWidth,maxHeight) ) networkSaved(4); else networkSaved(0); break; case 1: statusMessage( tr("Save aborted...") ); break; } } } /** Saves the network in a new file */ void MainWindow::slotFileSaveAs() { statusMessage( tr("Saving network under new filename...")); QString fn = QFileDialog::getSaveFileName(this, tr("Save GraphML Network to File Named..."), 0, tr("GraphML (*.graphml *.xml);;All (*)") ); if (!fn.isEmpty()) { if ( QFileInfo(fn).suffix().isEmpty() ){ QMessageBox::information(this, "Missing Extension ",tr("File extension was missing! \nI am appending a standard .graphml to the given filename."), "OK",0); fn.append(".graphml"); } fileName=fn; fileNameNoPath=fileName.split ("/"); adjacencyFileLoaded=false; pajekFileLoaded=false; graphMLFileLoaded=false; slotFileSave(); } else { statusMessage( tr("Saving aborted")); return; } statusMessage( tr("Ready.")); } /* * Called from Graph when we try to save file */ void MainWindow::networkSaved(int saved_ok) { if (saved_ok <= 0) { graphChanged(); statusMessage( tr("Error! Could not save this file... ")+fileNameNoPath.last()+tr(".") ); } else { fileSave->setIcon(QIcon(":/images/saved.png")); fileSave->setEnabled(false); fileLoaded=true; networkModified=false; setWindowTitle( fileNameNoPath.last() ); statusMessage( tr("Network saved under filename: ")+fileNameNoPath.last()+tr(".") ); switch (saved_ok){ case 1: adjacencyFileLoaded=false; pajekFileLoaded=true; graphMLFileLoaded=false; break; case 2: adjacencyFileLoaded=true; pajekFileLoaded=false; graphMLFileLoaded=false; break; case 3: adjacencyFileLoaded=false; pajekFileLoaded=false; graphMLFileLoaded=false; break; case 4: adjacencyFileLoaded=false; pajekFileLoaded=false; graphMLFileLoaded=true; break; } } } /** Closes the network. Saves it if necessary. Used by createNew. */ void MainWindow::slotFileClose() { statusMessage( tr("Closing file...")); if (networkModified) { switch ( QMessageBox::information (this, "Closing Network...", tr("Network has not been saved. \nDo you want to save before closing it?"), "Yes", "No",0,1)) { case 0: slotFileSave(); break; case 1: break; } } statusMessage( tr("Erasing old network data....")); initNet(); statusMessage( tr("Ready.")); } /** Prints whatever is viewable on the Graphics widget */ void MainWindow::slotPrintView() { statusMessage( tr("Printing...")); QPrintDialog dialog(printer, this); if ( dialog.exec() ) { QPainter painter(printer); graphicsWidget->render(&painter); }; statusMessage( tr("Ready.")); } /** Imports a network from a formatted file */ void MainWindow::slotImportGraphML(){ fileFormat=1; this->slotChooseFile(); } /** Imports a network from a formatted file */ void MainWindow::slotImportPajek(){ fileFormat=2; this->slotChooseFile(); } /** Imports a network from a Adjacency matrix formatted file */ void MainWindow::slotImportSM(){ fileFormat=3; this->slotChooseFile(); } /** Imports a network from a two mode sociomatrix formatted file */ void MainWindow::slotImportTwoModeSM(){ fileFormat=9; this->slotChooseFile(); } /** Imports a network from a Dot formatted file */ void MainWindow::slotImportDot(){ fileFormat=4; this->slotChooseFile(); } /** Imports a network from a GML formatted file */ void MainWindow::slotImportGML(){ fileFormat=5; this->slotChooseFile(); } /** Imports a network from a UCINET formatted file */ void MainWindow::slotImportDL(){ fileFormat=6; this->slotChooseFile(); } /** Imports a network from a List formatted file */ void MainWindow::slotImportEdgeList(){ switch( QMessageBox::question( this, "Type of list format", tr("I can parse two kinds of lists: \n\n")+ tr("A. Weighted lists, with each line having exactly 3 columns (source, target, weight), i.e.\n 1 2 5 \n \n")+ tr("B. Simple edge lists, with each line having 2 or more columns (source, target1, target2, ... etc)\n\n")+ tr("Please select the appropriate type of list format for the file you want to load:"), "Weighted", "Simple",0,1 ) ) { case 0: qDebug() << "*** MW: slotImportEdgeList - Weighted list selected! " ; fileFormat = 7; break; case 1: qDebug() << "*** MW: slotImportEdgeList - Simple list selected! " ; fileFormat = 8; break; } this->slotChooseFile(); } /** * Main network file loader method * Inits everything to default values. * Then calls activeGraph::loadGraph to actually load the network... */ bool MainWindow::loadNetworkFile(QString m_fileName, int m_fileFormat ){ qDebug("MW: loadNetworkFile"); initNet(); int two_sm_mode = 0; if ( m_fileFormat == 9 ) { switch( QMessageBox::information( this, "Two-mode sociomatrix", tr("If this file is in two-mode sociomatrix format, \n")+ tr("please specify which mode to open \n\n") + tr("1st mode: rows are nodes \n") + tr("2nd mode: columns are nodes"), tr("1st Mode"), tr("2nd mode"), 0,1 ) ) { case 0: two_sm_mode = 1; break; case 1: two_sm_mode = 2; break; } } QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); bool loadGraphStatus = activeGraph.loadGraph ( m_fileName, displayNodeLabelsAct->isChecked(), graphicsWidget->width(), graphicsWidget->height(), m_fileFormat, two_sm_mode ); QApplication::restoreOverrideCursor(); return loadGraphStatus; } /** * Called from Parser/Graph when a network file is loaded. * It informs the MW about the type of the network so that it can display the appropiate message. */ void MainWindow::fileType ( int type, QString netName, int aNodes, int totalLinks, bool undirected) { qDebug()<< "MW: fileType() networkName is: " << netName << " type " << type; Q_UNUSED (undirected); if (netName != "") networkName=netName ; else networkName=(fileName.split ("/")).last(); fileFormat=type; switch( type ) { case 0: pajekFileLoaded=false; adjacencyFileLoaded=false; graphMLFileLoaded=false; fileLoaded=false; break; case 1: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=false; graphMLFileLoaded=true; fileLoaded=true; networkModified=false; statusMessage( QString(tr("GraphML formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 2: pajekFileLoaded=true; adjacencyFileLoaded=false; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("Pajek formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks )); break; case 3: pajekFileLoaded=false; adjacencyFileLoaded=true; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("Adjacency formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 4: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=true; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("Dot formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 5: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=false; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("DL-formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 6: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=false; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("GML-formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 7: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=false; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("Weighted list-formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 8: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=false; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("Simple list-formatted network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; case 9: pajekFileLoaded=false; adjacencyFileLoaded=false; dotFileLoaded=false; graphMLFileLoaded=false; fileLoaded=true; networkModified=false; statusMessage( QString(tr("Two-mode affiliation network, named %1, loaded with %2 Nodes and %3 total Links.")).arg( networkName ).arg( aNodes ).arg(totalLinks ) ); break; default: // just for sanity pajekFileLoaded=false; adjacencyFileLoaded=false; graphMLFileLoaded=false; fileLoaded=false; QMessageBox::critical(this, "Error","Unrecognized format. \nPlease specify" " which is the file-format using Import Menu.","OK",0); break; } graphChanged(); fileSave->setIcon(QIcon(":/images/saved.png")); fileSave->setEnabled(false); } /** Calls Graph::createVertex method to add a new RANDOM node into the activeGraph. Called when "Create Node" button is clicked on the Main Window. */ void MainWindow::addNode() { qDebug("MW: addNode(). Calling activeGraph::createVertex() for -1 - max width and height %i, %i", graphicsWidget->width()-10, graphicsWidget->height()-10); activeGraph.createVertex(-1, graphicsWidget->width()-10, graphicsWidget->height()-10); // minus a screen edge offset... statusMessage( tr("New node (numbered %1) added.").arg(activeGraph.lastVertexNumber()) ); } /** Calls Graph::createVertex method to add a new node into the activeGraph. Called on double clicking */ void MainWindow::addNodeWithMouse(int num, QPointF p) { qDebug("MW: addNodeWithMouse(). Calling activeGraph::createVertex() for a vertice named %i", num); activeGraph.createVertex(num, p); statusMessage( tr("New node (numbered %1) added.").arg(activeGraph.lastVertexNumber()) ); } /** Exports the network to a PNG image Mediocre Quality but smaller file */ bool MainWindow::slotExportPNG(){ qDebug("slotExportPNG"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("The canvas is empty!\nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export PNG.") ); return false; } QString fn = QFileDialog::getSaveFileName(this,tr("Save"), 0, tr("Image Files (*.png)")); if (fn.isEmpty()) { statusMessage( tr("Saving aborted") ); return false; } tempFileNameNoPath=fn.split ("/"); qDebug("slotExportPNG: grabing canvas"); QPixmap picture; picture=QPixmap::grabWidget(graphicsWidget, graphicsWidget->rect()); qDebug("slotExportPNG: adding logo"); QPainter p; p.begin(&picture); p.setFont(QFont ("Helvetica", 10, QFont::Normal, false)); p.drawText(5,10,"SocNetV: "+tempFileNameNoPath.last()); p.end(); qDebug("slotExportPNG: checking filename"); if (fn.contains("png", Qt::CaseInsensitive) ) { picture.toImage().save(fn, "PNG"); QMessageBox::information(this, "Export to PNG...",tr("Image Saved as: ")+tempFileNameNoPath.last(), "OK",0); } else { picture.toImage().save(fn+".png", "PNG"); QMessageBox::information(this, "Export to PNG...",tr("Image Saved as: ")+tempFileNameNoPath.last()+".png" , "OK",0); } statusMessage( tr("Exporting completed") ); return true; } /** Exports the network to a BMP image Better Quality but larger file */ bool MainWindow::slotExportBMP(){ qDebug( "slotExportBMP()"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to export! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export BMP.") ); return false; } QString format="bmp"; QString fn = QFileDialog::getSaveFileName(this,tr("Save Image as"), 0,tr("Image Files (*.bmp)")); if (fn.isEmpty()) { statusMessage( tr("Saving aborted") ); return false; } tempFileNameNoPath=fn.split ("/"); QPixmap picture; qDebug("slotExportBMP: grabing canvas"); picture=QPixmap::grabWidget(graphicsWidget, graphicsWidget->viewport()->rect()); QPainter p; qDebug("slotExportBMP: adding logo"); p.begin(&picture); p.setFont(QFont ("Helvetica", 10, QFont::Normal, false)); p.drawText(5,10,"SocNetV: "+tempFileNameNoPath.last()); p.end(); qDebug("slotExportBMP: checking file"); if (fn.contains(format, Qt::CaseInsensitive) ) { picture.toImage().save(fn, format.toAscii()); QMessageBox::information(this, tr("Export to BMP..."),tr("Image Saved as: ")+tempFileNameNoPath.last(), "OK",0); } else { picture.toImage().save(fn+"."+format, format.toAscii()); QMessageBox::information(this, tr("Export to BMP..."),tr("Image Saved as: ")+tempFileNameNoPath.last()+"."+format , "OK",0); } qDebug()<< "Exporting BMP to "<< fn; statusMessage( tr("Exporting completed") ); qDebug("Export finished!"); return true; } /** Exports the network to a PDF Document Best Quality */ bool MainWindow::slotExportPDF(){ qDebug( "slotExportPDF()"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("The canvas is empty!\nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export PDF.") ); return false; } QString m_fileName = QFileDialog::getSaveFileName(this, tr("Export to PDF"), 0, tr("Portable Document Format files (*.pdf)")); if (m_fileName.isEmpty()) { statusMessage( tr("Saving aborted")); return false; } else { if (QFileInfo(m_fileName).suffix().isEmpty()) m_fileName.append(".pdf"); QPrinter printer(QPrinter::HighResolution); printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFileName(m_fileName); QPainter painter(&printer); graphicsWidget->render(&painter); } qDebug()<< "Exporting PDF to "<< m_fileName; tempFileNameNoPath=m_fileName.split ("/"); QMessageBox::information(this, tr("Export to PDF..."),tr("File saved as: ")+tempFileNameNoPath.last() , "OK",0); statusMessage( tr("Exporting completed") ); return true; } /** Exports the network to a Pajek-formatted file Calls the relevant Graph method. */ void MainWindow::slotExportPajek() { qDebug ("MW: slotExportPajek"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to export! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export to Pajek.") ); return; } statusMessage( tr("Exporting active network under new filename...")); QString fn = QFileDialog::getSaveFileName(this, tr("Export Network to File Named..."), 0, tr("Pajek (*.paj *.net *.pajek);;All (*)") ); if (!fn.isEmpty()) { if ( QFileInfo(fn).suffix().isEmpty() ){ QMessageBox::information(this, "Missing Extension ",tr("File extension was missing! \nI am appending a standard .paj to the given filename."), "OK",0); fn.append(".paj"); } fileName=fn; fileNameNoPath=fileName.split ("/"); } else { statusMessage( tr("Saving aborted")); return; } int maxWidth=scene->width(); int maxHeight=scene->height(); if ( activeGraph.saveGraph(fileName, 1, networkName, maxWidth,maxHeight ) ) networkSaved(1); else networkSaved(0); } /** Exports the network to a adjacency matrix-formatted file Calls the relevant Graph method. */ void MainWindow::slotExportSM(){ qDebug("MW: slotExportSM()"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to export!\nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export to Adjacency Matrix.") ); return; } statusMessage( tr("Exporting active network under new filename...")); QString fn = QFileDialog::getSaveFileName(this, tr("Export Network to File Named..."), 0, tr("Adjacency (*.adj *.sm *.txt *.csv *.net);;All (*)") ); if (!fn.isEmpty()) { if ( QFileInfo(fn).suffix().isEmpty() ){ QMessageBox::information(this, "Missing Extension ",tr("File extension was missing! \nI am appending a standard .adj to the given filename."), "OK",0); fn.append(".adj"); } fileName=fn; fileNameNoPath=fileName.split ("/"); } else { statusMessage( tr("Saving aborted")); return; } QMessageBox::information(this, "Warning",tr("Note that exporting to an adjacency matrix does not save floating-point weight values; adjacency matrices consist of integers, only. \n If your network had any floating point weights in some edges, these are being truncated to the nearest integer or 1."), "OK",0); int maxWidth=scene->width(); int maxHeight=scene->height(); if ( activeGraph.saveGraph(fileName, 2, networkName,maxWidth,maxHeight ) ) networkSaved(1); else networkSaved(0); } /** Exports the network to a DL-formatted file TODO slotExportDL */ bool MainWindow::slotExportDL(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to export!\nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export to DL.") ); return false; } if (fileName.isEmpty()) { statusMessage( tr("Saving network under new filename...")); QString fn = QFileDialog::getSaveFileName(this, 0, 0); if (!fn.isEmpty()) { fileName=fn; } else { statusMessage( tr("Saving aborted")); return false; } } return true; } /** Exports the network to a GW-formatted file TODO slotExportGW */ bool MainWindow::slotExportGW(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to export!\nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot export to GW.") ); return false; } if (fileName.isEmpty()) { statusMessage( tr("Saving network under new filename...")); QString fn = QFileDialog::getSaveFileName(this, 0, 0); if (!fn.isEmpty()) { fileName=fn; } else { statusMessage( tr("Saving aborted")); return false; } } return true; } /** Exports the network to a list-formatted file TODO slotExportList */ bool MainWindow::slotExportList(){ if (fileName.isEmpty()) { statusMessage( tr("Saving network under new filename...")); QString fn = QFileDialog::getSaveFileName(this, 0, 0); if (!fn.isEmpty()) { fileName=fn; } else { statusMessage( tr("Saving aborted")); return false; } } return true; } /** Adds a little universal randomness :) */ void MainWindow::makeThingsLookRandom() { time_t now; /* define 'now'. time_t is probably a typedef */ now = time((time_t *)NULL); /* Get the system time and put it * into 'now' as 'calender time' the number of seconds since 1/1/1970 */ srand( (unsigned int ) now); } /** Displays the file of the loaded network. Network _must_ be unchanged since last save/load. Otherwise it will ask the user to first save the network, then view its file. */ void MainWindow::slotViewNetworkFile(){ qDebug() << "slotViewNetworkFile() : " << fileName.toAscii(); if ( fileLoaded && !networkModified ) { //file network unmodified QFile f( fileName ); if ( !f.open( QIODevice::ReadOnly ) ) { qDebug ("Error in open!"); return; } TextEditor *ed = new TextEditor(fileName);//OPEN A TEXT EDITOR WINDOW ed->setWindowTitle(tr("Viewing network file - ") + fileNameNoPath.last() ); ed->show(); statusMessage( tr("Loaded network text file " )+ fileNameNoPath.last() ); } else if (fileName.isEmpty() && networkModified) { //New network + something QMessageBox::information (this, "Viewing network file", tr("This network has not been saved yet. \nI will open a dialog for you to save it now. \nPlease choose a filename..."), "OK",0); slotFileSaveAs(); } else if (fileLoaded && networkModified ) { //file network + modified QMessageBox::information (this, "Viewing network file", //FIXME maybe better to save automagically rather than asking? tr("The network has been modified. \nI will save it to the original file for you now."), "OK",0); networkModified = false; slotFileSave(); slotViewNetworkFile(); } else { QMessageBox::critical(this, "Error", tr("Empty network! \nLoad a network file first or create and save a new one..."), "OK",0); statusMessage( tr("Nothing here. Not my fault, though!") ); } } /** Opens the embedded text editor */ void MainWindow::slotOpenTextEditor(){ qDebug() << "slotOpenTextEditor() : "; TextEditor *ed = new TextEditor(""); ed->setWindowTitle(tr("New Network File")); ed->show(); statusMessage( tr("Enter your network data here" ) ); } /** Displays the adjacency matrix of the network. It uses a different method for writing the matrix to a file. While slotExportSM uses << operator of Matrix class (via adjacencyMatrix of Graph class), this is using directly the writeAdjacencyMatrix method of Graph class */ void MainWindow::slotViewAdjacencyMatrix(){ if ( !fileLoaded && !networkModified) { QMessageBox::critical (this, "Error", tr("Empty network! \nLoad a network file or create something by double-clicking on the canvas!"), "OK",0); statusMessage( tr("Nothing to show!") ); return; } int aNodes=activeNodes(); statusBar() -> showMessage ( QString (tr ("creating adjacency adjacency matrix of %1 nodes")).arg(aNodes) ); qDebug ("MW: calling Graph::writeAdjacencyMatrix with %i nodes", aNodes); char fn[]= "adjacency-matrix.dat"; activeGraph.writeAdjacencyMatrix(fn, networkName.toLocal8Bit()) ; //Open a text editor window for the new file created by graph class QString qfn=QString::fromLocal8Bit("adjacency-matrix.dat"); TextEditor *ed = new TextEditor(fn); tempFileNameNoPath=qfn.split( "/"); ed->setWindowTitle(tr("View Adjacency Matrix - ") + tempFileNameNoPath.last()); ed->show(); } /* * Calls the m_datasetSelectionDialog to display the datasetselection dialog */ void MainWindow::slotShowDataSetSelectDialog(){ qDebug()<< "slotShowDataSetSelectDialog()"; m_datasetSelectDialog.exec(); } /* * Recreates some of the most famous and widely used data sets * in network analysis studies */ void MainWindow::slotRecreateDataSet (QString m_fileName) { int m_fileFormat=0; qDebug()<< "slotRecreateDataSet() fileName: " << m_fileName; initNet(); activeGraph.writeDataSetToFile(m_fileName); if (m_fileName.endsWith(".graphml")) { m_fileFormat=1; } else if (m_fileName.endsWith(".pajek")) { m_fileFormat=2; } else if (m_fileName.endsWith(".sm") || m_fileName.endsWith(".adj")) { m_fileFormat=3; } else if (m_fileName.endsWith(".dot")) { m_fileFormat=4; } else if (m_fileName.endsWith(".gml")) { m_fileFormat=5; } else if (m_fileName.endsWith(".dl")) { m_fileFormat=6; } else if (m_fileName.endsWith(".list")) { m_fileFormat=7; } else if (m_fileName.endsWith(".lst")) { m_fileFormat=8; } else if (m_fileName.endsWith(".2sm")) { m_fileFormat=9; } if ( loadNetworkFile(m_fileName, m_fileFormat) ) { fileNameNoPath=m_fileName.split ("/" ); fileName=m_fileName; previous_fileName=fileName; setWindowTitle("SocNetV "+ VERSION +" - "+fileNameNoPath.last()); QString message=tr("Network saved as ")+fileNameNoPath.last(); statusMessage( message ); } else { statusMessage( "Could not read new network data file. Aborting."); } } /** Calls activeGraph.createRandomNetErdos () to create a symmetric network Link existance is controlled by a user specified possibility. */ void MainWindow::slotCreateRandomNetErdos(){ bool ok; statusMessage( "You have selected to create a random symmetric network. "); int newNodes=( QInputDialog::getInteger(this, "Create random network", tr("This will create a new random symmetric network of G(n,p) model, \nwhere n is the nodes and p is the edge probability. \nPlease enter the number n of nodes you want:"),1, 1, maxNodes, 1, &ok ) ) ; if (!ok) { statusMessage( "You did not enter an integer. Aborting."); return; } double probability= QInputDialog::getDouble(this,"Create random network", "Enter an edge probability % (0-100):", 0, 0, 100, 1, &ok ); if (!ok) { statusMessage( "You did not enter an integer. Aborting."); return; } statusMessage( "Erasing any existing network. "); initNet(); makeThingsLookRandom(); statusMessage( tr("Creating random network. Please wait... ") ); qDebug("MW Erdos network: Create random network of %i nodes and %f edge probability.",newNodes, probability); if (showProgressBarAct->isChecked() && newNodes > 300){ progressDialog= new QProgressDialog("Creating random network. Please wait (or disable me from Options > View > ProgressBar, next time ;)).", "Cancel", 0, newNodes+newNodes, this); progressDialog -> setWindowModality(Qt::WindowModal); connect( &activeGraph, SIGNAL( updateProgressDialog(int) ), progressDialog, SLOT(setValue(int) ) ) ; progressDialog->setMinimumDuration(0); } QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); activeGraph.createRandomNetErdos (newNodes, probability); QApplication::restoreOverrideCursor(); if (showProgressBarAct->isChecked() && newNodes > 300) progressDialog->deleteLater(); fileLoaded=false; graphChanged(); setWindowTitle("Untitled"); double threshold = log(newNodes)/newNodes; //float avGraphDistance=activeGraph.averageGraphDistance(); //float clucof=activeGraph.clusteringCoefficient(); if ( (probability/100 ) > threshold ) QMessageBox::information(this, "New Random Network", tr("Random network created. \n")+ tr("\nNodes: ")+ QString::number(activeNodes())+ tr("\nEdges: ")+ QString::number( activeLinks()/2.0)+ //tr("\nAverage path length: ") + QString::number(avGraphDistance)+ //tr("\nClustering coefficient: ")+QString::number(clucof)+ tr("\n\nOn the average, edges should be ") + QString::number(probability * newNodes*(newNodes-1)/100) + tr("\nThis graph is almost surely connected because: \nprobability > ln(n)/n, that is: \n") + QString::number(probability/100)+ tr(" bigger than ")+ QString::number(threshold) , "OK",0); else QMessageBox::information(this, "New Random Network", tr("Random network created. \n")+ tr("\nNodes: ")+ QString::number(activeNodes())+ tr("\nEdges: ")+ QString::number( activeLinks()/2.0)+ //tr("\nAverage path length: ") + QString::number(avGraphDistance)+ //tr("\nClustering coefficient: ")+QString::number(clucof)+ tr("\n\nOn the average, edges should be ") +QString::number(probability * newNodes*(newNodes-1)/100) + tr("\nThis graph is almost surely not connected because: \nprobability < ln(n)/n, that is: \n") + QString::number(probability/100)+ " smaller than "+ QString::number(threshold) , "OK",0); statusMessage( "Random network created. "); } /** Creates a pseudo-random network where every node has the same degree */ void MainWindow::slotCreateSameDegreeRandomNetwork(){ bool ok; statusMessage( "You have selected to create a pseudo-random network where each node has the same degree. "); int newNodes=( QInputDialog::getInteger(this, "Create same degree network", tr("This will create a same degree network. \nPlease enter the number of nodes you want:"),1, 1, maxNodes, 1, &ok ) ) ; if (!ok) { statusMessage( "You did not enter an integer. Aborting."); return; } int degree = QInputDialog::getInteger(this,"Create same degree network...", "Now, select an even number d. \nThis will be the number of links of each node:", 2, 2, newNodes-1, 2, &ok); if ( (degree% 2)==1 ) { QMessageBox::critical(this, "Error",tr(" Sorry. I cannot create such a network. Links must be even number"), "OK",0); return; } statusMessage( "Erasing any existing network. "); initNet(); makeThingsLookRandom(); statusMessage( "Creating a pseudo-random network where each node has the same degree... "); if (showProgressBarAct->isChecked() && newNodes > 300){ progressDialog= new QProgressDialog("Creating random network. Please wait (or disable me from Options > View > ProgressBar, next time ;)).", "Cancel", 0, (int) (newNodes+newNodes), this); progressDialog -> setWindowModality(Qt::WindowModal); connect( &activeGraph, SIGNAL( updateProgressDialog(int) ), progressDialog, SLOT(setValue(int) ) ) ; progressDialog->setMinimumDuration(0); } QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); activeGraph.createSameDegreeRandomNetwork (newNodes, degree); QApplication::restoreOverrideCursor(); if (showProgressBarAct->isChecked() && newNodes > 300) progressDialog->deleteLater(); fileLoaded=false; graphChanged(); setWindowTitle("Untitled"); statusMessage( "Uniform random network created: "+QString::number(activeNodes())+" Nodes, "+QString::number( activeLinks())+" Links"); } void MainWindow::slotCreateGaussianRandomNetwork(){ graphChanged(); } void MainWindow::slotCreateSmallWorldRandomNetwork(){ bool ok=false; statusMessage( "You have selected to create a small world network."); int newNodes=( QInputDialog::getInteger(this, "Create small world", tr("This will create a small world network, \n")+ tr("that is an undirected graph with N nodes and N*d/2 edges,\n")+ tr("where d is the mean edge degree.\n")+ tr("Please enter the number N of nodes you want:"), 1, 1, maxNodes, 1, &ok ) ) ; if (!ok) { statusMessage( "You did not enter an integer. Aborting."); return; } int degree = QInputDialog::getInteger(this,"Create small world...", tr("Now, enter an even number d. \n")+ tr("This is the mean edge degree each new node will have:"), 2, 2, newNodes-1, 2, &ok); if ( (degree% 2)==1 ) { QMessageBox::critical(this, "Error",tr(" Sorry. I cannot create such a network. Links must be even number"), "OK",0); return; } double beta = QInputDialog::getDouble(this,"Create small world...", tr("Now, enter a parameter beta. \n")+ tr("This is the edge rewiring probability:"), 0.6, 0.00, 1.00, 2, &ok); statusMessage( tr("Erasing any existing network. ")); initNet(); makeThingsLookRandom(); statusMessage( tr("Creating small world. Please wait...")); double x0=scene->width()/2.0; double y0=scene->height()/2.0; double radius=(graphicsWidget->height()/2.0)-50; //pixels if (showProgressBarAct->isChecked() && newNodes > 300){ progressDialog= new QProgressDialog( tr("Creating random network. Please wait \n (or disable me from Options > View > ProgressBar, next time )."), "Cancel", 0, (int) (newNodes+newNodes), this); progressDialog -> setWindowModality(Qt::WindowModal); connect( &activeGraph, SIGNAL( updateProgressDialog(int) ), progressDialog, SLOT(setValue(int) ) ) ; progressDialog->setMinimumDuration(0); } QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); activeGraph.createRandomNetSmallWorld(newNodes, degree, beta, x0, y0, radius); QApplication::restoreOverrideCursor(); if (showProgressBarAct->isChecked() && newNodes > 300 ) progressDialog->deleteLater(); fileLoaded=false; graphChanged(); setWindowTitle("Untitled"); statusMessage( tr("Small world random network created: ")+QString::number(activeNodes())+" nodes, "+QString::number( activeLinks())+" links"); //float avGraphDistance=activeGraph.averageGraphDistance(); //float clucof=activeGraph.clusteringCoefficient(); QMessageBox::information(this, "New Small World", tr("Small world network created.\n")+ tr("\nNodes: ")+ QString::number(activeNodes())+ tr("\nEdges: ")+ QString::number( activeLinks()/2.0) //+ tr("\nAverage path length: ") + QString::number(avGraphDistance) //+ tr("\nClustering coefficient: ")+QString::number(clucof) , "OK",0); } /** Creates a lattice network, i.e. a connected network where every node has the same degree and is linked with its neighborhood. */ void MainWindow::slotCreateRandomNetRingLattice(){ bool ok; statusMessage( "You have selected to create a ring lattice network. "); int newNodes=( QInputDialog::getInteger(this, "Create ring lattice", tr("This will create a ring lattice network, where each node has degree d:\n d/2 edges to the right and d/2 to the left.\n Please enter the number of nodes you want:"),1, 1, maxNodes, 1, &ok ) ) ; if (!ok) { statusMessage( "You did not enter an integer. Aborting."); return; } int degree = QInputDialog::getInteger(this,"Create ring lattice...", "Now, enter an even number d. \nThis is the total number of links each new node will have:", 2, 2, newNodes-1, 2, &ok); if ( (degree% 2)==1 ) { QMessageBox::critical(this, "Error",tr(" Sorry. I cannot create such a network. Links must be even number"), "OK",0); return; } statusMessage( "Erasing any existing network. "); initNet(); makeThingsLookRandom(); statusMessage( "Creating ring lattice network. Please wait..."); double x0=scene->width()/2.0; double y0=scene->height()/2.0; double radius=(graphicsWidget->height()/2.0)-50; //pixels if (showProgressBarAct->isChecked() && newNodes > 300){ progressDialog= new QProgressDialog("Creating random network. Please wait (or disable me from Options > View > ProgressBar, next time ;)).", "Cancel", 0, (int) (newNodes+newNodes), this); progressDialog -> setWindowModality(Qt::WindowModal); connect( &activeGraph, SIGNAL( updateProgressDialog(int) ), progressDialog, SLOT(setValue(int) ) ) ; progressDialog->setMinimumDuration(0); } QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); activeGraph.createRandomNetRingLattice(newNodes, degree, x0, y0, radius ); QApplication::restoreOverrideCursor(); if (showProgressBarAct->isChecked() && newNodes > 300) progressDialog->deleteLater(); fileLoaded=false; // graphChanged(); statusMessage( "Ring lattice random network created: "+QString::number(activeNodes())+" nodes, "+QString::number( activeLinks())+" links"); setWindowTitle("Untitled"); //float avGraphDistance=activeGraph.averageGraphDistance(); //float clucof=activeGraph.clusteringCoefficient(); QMessageBox::information(this, "Ring Lattice", tr("Ring lattice network created.\n")+ tr("\nNodes: ")+ QString::number(activeNodes())+ tr("\nEdges: ")+ QString::number( activeLinks()/2.0) // + tr("\nAverage path length: ") + QString::number(avGraphDistance) //+ tr("\nClustering coefficient: ")+QString::number(clucof) , "OK",0); } /** * Shows a dialog from where the user * creates a new network by crawling a given website */ void MainWindow::slotShowWebCrawlerDialog() { qDebug () << "MW: slotShowWebCrawlerDialog() - sending canvasWidth and Height"; activeGraph.setCanvasDimensions(graphicsWidget->width(), graphicsWidget->height()); m_WebCrawlerDialog.exec() ; } /** * Called from m_WebCrawlerDialog * Clears the loaded network (saving if needed) * then passes parameters to webCrawl of ActiveGraph class. */ void MainWindow::slotWebCrawl(QString seed, int maxNodes, int maxRecursion, bool goOut ) { this->slotFileClose(); activeGraph.webCrawl( seed, maxNodes, maxRecursion, goOut ) ; } /** Calls GW: findNode() to find a node by its number or label. The node is then marked. */ void MainWindow::slotFindNode(){ qDebug ("MW: slotFindNode()"); if (!fileLoaded && !networkModified ) { QMessageBox::critical( this, tr("Find Node"), tr("No nodes present! \nLoad a network file first or create some nodes..."), tr("OK"),0 ); statusMessage( QString(tr("Nothing to find!")) ); return; } if ( markedNodeExists ) { // if a node has been already marked graphicsWidget->setMarkedNode(""); // call setMarkedNode to just unmark it. markedNodeExists=false; statusMessage( tr("Node unmarked.") ); return; // and return to MW } bool ok=false; QString nodeText = QInputDialog::getText(this, tr("Find Node"), tr("Enter node label or node number:"), QLineEdit::Normal,QString::null, &ok ); if (!ok) { statusMessage( tr("Find node operation cancelled.") ); return; } else { if ( graphicsWidget->setMarkedNode(nodeText) ) { markedNodeExists=true; statusMessage( tr("Node found and marked. Press Ctrl+F again to unmark...") ); } else { QMessageBox::information(this, tr("Find Node"), tr("Sorry. There is no such node in this network. \n Try again."), "OK",0); } } } /* * Called by Graph to update what the selected node is. */ void MainWindow::selectedNode (const int vertex){ clickedJimNumber=vertex; } /** Popups a context menu with some options when the user right-clicks on a node */ void MainWindow::openNodeContextMenu() { clickedJimNumber=clickedJim->nodeNumber(); qDebug("MW: openNodeContextMenu() for node %i at %i, %i",clickedJimNumber, QCursor::pos().x(), QCursor::pos().y()); QMenu *nodeContextMenu = new QMenu(QString::number(clickedJimNumber), this); Q_CHECK_PTR( nodeContextMenu ); //displays "out of memory" if needed nodeContextMenu -> addAction(addLinkAct); nodeContextMenu -> addAction(removeNodeAct ); QMenu *options=new QMenu(tr("Options"), this); nodeContextMenu -> addMenu( options ); options -> addAction( changeNodeLabelAct ); options -> addAction( changeNodeSizeAct ); options -> addAction( changeNodeValueAct ); options -> addAction( changeNodeColorAct ); options -> addAction( changeNodeBoxAct ); options -> addAction( changeNodeCircleAct ); options -> addAction( changeNodeDiamondAct ); options -> addAction( changeNodeEllipseAct); options -> addAction( changeNodeTriangleAct ); //QCursor::pos() is good only for menus not related with node coordinates nodeContextMenu -> exec(QCursor::pos() ); delete nodeContextMenu; clickedJimNumber=-1; //undo node selection } /** Popups a context menu with some options when the user right-clicks on a link */ void MainWindow::openLinkContextMenu() { int source=clickedLink->sourceNodeNumber(); int target=clickedLink->targetNodeNumber(); qDebug("MW: openLinkContextMenu() for edge %i-%i at %i, %i",source, target, QCursor::pos().x(), QCursor::pos().y()); QString edgeName=QString::number(source)+QString("-")+QString::number(target); //make the menu QMenu *linkContextMenu = new QMenu(edgeName, this); linkContextMenu -> addAction( removeLinkAct ); linkContextMenu -> addAction( changeLinkWeightAct ); linkContextMenu -> addAction( changeLinkColorAct ); linkContextMenu -> exec(QCursor::pos() ); delete linkContextMenu; } /** Popups a context menu with some options when the user right-clicks on the scene */ void MainWindow::openContextMenu( const QPointF &mPos) { cursorPosGW=mPos; QMenu *contextMenu = new QMenu("Link Menu",this); Q_CHECK_PTR( contextMenu ); //displays "out of memory" if needed contextMenu -> addAction( addNodeAct ); QMenu *options=new QMenu("Options", this); contextMenu -> addMenu(options ); options -> addAction(changeBackColorAct ); options -> addAction(changeAllNodesSizeAct ); options -> addAction(changeAllNodesShapeAct ); options -> addAction(changeAllNodesColorAct ); options -> addAction(changeAllLinksColorAct ); options -> addAction (displayNodeNumbersAct); options -> addAction (displayNodeLabelsAct); //QCursor::pos() is good only for menus not related with node coordinates contextMenu -> exec(QCursor::pos() ); delete contextMenu; cursorPosGW=QPoint(-1,-1); } /** * A slot activated when something has been changed in the graph. Makes the fileSave icon active and refreshes any LCD values. Also called from graphicsWidget. */ void MainWindow::graphChanged(){ qDebug("MW: graphChanged"); networkModified=true; fileSave->setIcon(QIcon(":/images/save.png")); fileSave->setEnabled(true); nodesLCD->display(activeGraph.vertices()); edgesLCD->display(activeGraph.totalEdges()); densityLCD->display( activeGraph.density() ); } /** * When the user clicks on a node, displays some information about it on the status bar. */ void MainWindow::nodeInfoStatusBar ( Node *jim) { qDebug ("MW: NodeInfoStatusBar()"); linkClicked=false; nodeClicked=true; clickedJim=jim; clickedJimNumber=clickedJim->nodeNumber(); int inLinks=activeGraph.edgesTo(clickedJimNumber); int outLinks=activeGraph.edgesFrom(clickedJimNumber); selectedNodeLCD->display (clickedJimNumber); inLinksLCD->display (inLinks); outLinksLCD->display (outLinks); clucofLCD->display(activeGraph.clusteringCoefficient(clickedJimNumber)); statusMessage( QString(tr("(%1, %2); Node %3, with label %4, " "has %5 in-Links and %6 out-Links.")).arg( ceil( clickedJim->x() ) ) .arg( ceil( clickedJim->y() )).arg( clickedJimNumber ).arg( clickedJim->labelText() ) .arg(inLinks).arg(outLinks) ); clickedJimNumber=-1; } /** * When the user clicks on a link, displays some information about it on the status bar. */ void MainWindow::linkInfoStatusBar (Edge* link) { clickedLink=link; linkClicked=true; nodeClicked=false; statusMessage( QString(tr("Link between node %1 and node %2, weight %3 and color %4.")).arg( link->sourceNodeNumber() ).arg(link->targetNodeNumber()).arg(link->weight()).arg(link->color() ) ); } /** * Deletes a node and the attached objects (links, etc). * It deletes clickedJim (signal from GraphicsView or set by another function) * or else asks for a nodeNumber to remove. The nodeNumber is doomedJim. Called from nodeContextMenu */ void MainWindow::slotRemoveNode() { qDebug("MW: slotRemoveNode()"); if (!activeGraph.vertices()) { QMessageBox::critical(this, "Error",tr("Nothing to do! \nLoad a network file or add some nodes first."), "OK",0); statusMessage( tr("Nothing to remove.") ); return; } int doomedJim=-1, min=-1, max=-1; bool ok=false; min = activeGraph.firstVertexNumber(); max = activeGraph.lastVertexNumber(); qDebug("MW: min is %i and max is %i", min, max); if (min==-1 || max==-1 ) { qDebug("ERROR in finding min max nodeNumbers. Abort"); return; } else if (clickedJimNumber >= 0 && clickedJimNumber<= max ) { doomedJim=clickedJimNumber ; } else if (clickedJimNumber == -1 ) { doomedJim = QInputDialog::getInteger(this,"Remove node",tr("Choose a node to remove between (" + QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"),min, 1, max, 1, &ok); if (!ok) { statusMessage( "Remove node operation cancelled." ); return; } } qDebug ("MW: removing vertice with number %i from Graph", doomedJim); activeGraph.removeVertex(doomedJim); clickedJimNumber=-1; graphChanged(); qDebug("MW: removeNode() completed. Node %i removed completely.",doomedJim); statusMessage( tr("Node removed completely. Ready. ") ); } /** * Adds a new link between two nodes specified by the user. Called when user clicks on the MW button "Add Link". */ void MainWindow::slotAddLink(){ qDebug ("MW: slotAddLink()"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to link to! \nCreate some nodes first."), "OK",0); statusMessage( tr("There are no nodes yet...") ); return; } int sourceNode=-1, targetNode=-1, sourceIndex=-1, targetIndex=-1; float weight=1; //weight of this new edge should be one... bool ok=false; int min=activeGraph.firstVertexNumber(); int max=activeGraph.lastVertexNumber(); if (min==max) return; //if there is only one node -> no link if (clickedJimNumber == -1) { sourceNode=QInputDialog::getInteger(this, "Create new link, Step 1",tr("This will draw a new link between two nodes. \nEnter source node ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"), min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( "Add link operation cancelled." ); return; } } else sourceNode=clickedJimNumber; if ( (sourceIndex =activeGraph.hasVertex(sourceNode)) ==-1 ) { statusMessage( tr("Aborting. ") ); QMessageBox::critical(this,"Error","No such node.", "OK",0); qDebug ("MW: slotAddLink: Cant find sourceNode %i.", sourceNode); return; } targetNode=QInputDialog::getInteger(this, "Create new link, Step 2", tr("Source node accepted. \nNow enter target node ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"),min, 1, max , 1, &ok) ; if (!ok) { statusMessage( "Add link target operation cancelled." ); return; } if ( (targetIndex=activeGraph.hasVertex(targetNode)) ==-1 ) { statusMessage( tr("Aborting. ") ); QMessageBox::critical(this,"Error","No such node.", "OK",0); qDebug ("MW: slotAddLink: Cant find targetNode %i",targetNode); return; } weight=QInputDialog::getDouble(this, "Create new link, Step 3", tr("Source and target nodes accepted. \n Please, enter the weight of new link: "),1.0, -20.0, 20.0, 1, &ok); if (!ok) { statusMessage( "Add link operation cancelled." ); return; } //Check if this link already exists... if (activeGraph.hasEdge(sourceNode, targetNode)!=0 ) { qDebug("Link exists. Aborting"); statusMessage( tr("Aborting. ") ); QMessageBox::critical(this,"Error","Link already exists.", "OK",0); return; } addLink(sourceNode, targetNode, weight); graphChanged(); statusMessage( tr("Ready. ") ); } /** helper to slotAddLink() above Also called from GW::userMiddleClicked() signal when user creates links with middle-clicks Calls Graph::createEdge method to add the new edge to the active Graph */ void MainWindow::addLink (int v1, int v2, float weight) { qDebug("MW: addLink() - setting user preferences and calling Graph::createEdge(...)"); bool drawArrows=displayLinksArrowsAct->isChecked(); int reciprocal=0; bool bezier = false; activeGraph.createEdge(v1, v2, weight, reciprocal, drawArrows, bezier); } /** * Erases the clicked link. Otherwise asks the user to specify one link. * First deletes arc reference from object nodeVector * then deletes arc item from scene **/ void MainWindow::slotRemoveLink(){ if ( (!fileLoaded && !networkModified) || activeGraph.totalEdges() ==0 ) { QMessageBox::critical(this, "Error",tr("No links present! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No links to remove - sorry.") ); return; } int min=0, max=0, sourceNode=-1, targetNode=-1; bool ok=false; min=activeGraph.firstVertexNumber(); max=activeGraph.lastVertexNumber(); if (!linkClicked) { sourceNode=QInputDialog::getInteger(this,tr("Remove link"),tr("Source node: (")+QString::number(min)+"..."+QString::number(max)+"):", min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( "Remove link operation cancelled." ); return; } targetNode=QInputDialog::getInteger(this, tr("Remove link"), tr("Target node: (")+QString::number(min)+"..."+QString::number(max)+"):",min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( "Remove link operation cancelled." ); return; } if ( activeGraph.hasEdge(sourceNode, targetNode)!=0 ) { if (activeGraph.symmetricEdge(sourceNode, targetNode) ) graphicsWidget->unmakeEdgeReciprocal(targetNode, sourceNode); graphicsWidget->eraseEdge(sourceNode, targetNode); activeGraph.removeEdge(sourceNode, targetNode); } else { QMessageBox::critical(this, "Remove link",tr("There is no such link."), "OK",0); statusMessage( tr("There are no nodes yet...") ); return; } } else { sourceNode = clickedLink->sourceNodeNumber(); targetNode = clickedLink->targetNodeNumber(); if (activeGraph.symmetricEdge(sourceNode, targetNode) ) { QString s=QString::number(sourceNode); QString t=QString::number(targetNode); switch (QMessageBox::information( this, tr("Remove link"), tr("This link is reciprocal. \n") + tr("Select what Direction to delete or Both..."), s+" -> "+ t, t+" -> "+s, tr("Both"), 0, 1 )) { case 0: graphicsWidget->removeItem(clickedLink); activeGraph.removeEdge(sourceNode, targetNode); //make new link // graphicsWidget->unmakeEdgeReciprocal(clickedLink->targetNodeNumber(), clickedLink->sourceNodeNumber()); //FIXME weight should be the same graphicsWidget->drawEdge(targetNode, sourceNode, 1, false, displayLinksArrowsAct->isChecked(), initLinkColor, false); break; case 1: clickedLink->unmakeReciprocal(); //graphicsWidget->removeItem(clickedLink); activeGraph.removeEdge(targetNode, sourceNode); // graphicsWidget->drawEdge(i, j, false, drawArrowsAct->isChecked(), initLinkColor, false); break; case 2: graphicsWidget->removeItem(clickedLink); activeGraph.removeEdge(sourceNode, targetNode); activeGraph.removeEdge(targetNode, sourceNode); } } else { graphicsWidget->removeItem(clickedLink); activeGraph.removeEdge(sourceNode, targetNode); } } graphChanged(); qDebug("MW: View items now: %i ", graphicsWidget->items().size()); qDebug("MW: Scene items now: %i ", scene->items().size()); } /** * Changes the label of the clicked node */ void MainWindow::slotChangeNodeLabel(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No nodes created.") ); return; } if (clickedJimNumber==-1) { statusMessage( tr("Please click on a node first... ") ); return; } bool ok; QString text = QInputDialog::getText(this, "Change node label", tr("Enter new node label:"), QLineEdit::Normal, QString::null, &ok ); if ( ok && !text.isEmpty() ) { qDebug()<<"MW: change label to "<< text.toAscii(); clickedJim->setLabelText(text); activeGraph.setVertexLabel( clickedJimNumber, text); if (!showLabels()) displayNodeLabelsAct->setChecked(true); statusMessage( tr("Changed label to %1. Ready. ").arg(text) ); graphChanged(); } else { statusMessage( tr("No label text. Abort. ") ); } } /** * Changes the colour of the clicked node */ void MainWindow::slotChangeNodeColor(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No nodes...") ); return; } bool ok; if (clickedJimNumber==-1) { int min=activeGraph.firstVertexNumber(); int max=activeGraph.lastVertexNumber(); long int node=QInputDialog::getInt(this, "Change node color",tr("Select node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"), min, 1, max , 1, &ok) ; statusMessage( tr("Error. ") ); if (!ok) { statusMessage( "Change clicked node color operation cancelled." ); return; } QString newColor = QInputDialog::getItem(this,"Change node color", "Select a new color:", colorList, 1, true, &ok); if (!ok) { statusMessage( "Change clicked node color operation cancelled." ); return; } if (graphicsWidget->setNodeColor(node, newColor)) { activeGraph.setVertexColor( node, newColor); graphChanged(); } else statusMessage( tr("There is no such link. ") ); } else{ QString nodeColor = QInputDialog::getItem(this,"Change node color", "Select a color:", colorList, 1, true, &ok); if ( ok ) { clickedJim->setColor(nodeColor); activeGraph.setVertexColor (clickedJimNumber, nodeColor); graphChanged(); statusMessage( tr("Ready. ") ); } else { // user pressed Cancel statusMessage( tr("Change node color aborted. ") ); } } } /** * Changes the size of the clicked node. */ void MainWindow::slotChangeNodeSize(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("Cannot change nothing.") ); return; } if (clickedJimNumber==-1) { statusMessage( tr("Error. ") ); return; } bool ok=false; int newSize = QInputDialog::getInteger(this, "Change node size", tr("Change node size to: (1-100)"),initNodeSize, 1, 100, 1, &ok ) ; if (!ok) { statusMessage( "Change size operation cancelled." ); return; } clickedJim->setSize(newSize); activeGraph.setVertexSize(clickedJimNumber,newSize); graphChanged(); statusBar()->showMessage (QString(tr("Ready")), statusBarDuration) ; return; } /** * TODO Change the value of the clicked node. */ void MainWindow::slotChangeNodeValue(){ if (clickedJimNumber==-1) { statusMessage( tr("Error. ") ); return; } // bool ok=false; //int newSize = QInputDialog::getInteger(this, "Change node value", tr("Change node size to: (1-16)"),1, 1, 16, 1, &ok ) ; // clickedJim->setSize(newSize); graphChanged(); statusBar()->showMessage (QString(tr("Ready")), statusBarDuration) ; return; } /** * Changes the shape of the clicked node to box */ void MainWindow::slotChangeNodeBox(){ activeGraph.setVertexShape( clickedJim->nodeNumber(), "box"); clickedJim->setShape("box"); graphChanged(); } /** * Changes the shape of the clicked node to triangle */ void MainWindow::slotChangeNodeTriangle(){ activeGraph.setVertexShape( clickedJim->nodeNumber(), "triangle"); clickedJim->setShape("triangle"); graphChanged(); } /** * Changes the shape of the clicked node to circle */ void MainWindow::slotChangeNodeCircle(){ activeGraph.setVertexShape( clickedJim->nodeNumber(), "circle"); clickedJim->setShape("circle"); graphChanged(); } /** * Changes the shape of the clicked node to diamond */ void MainWindow::slotChangeNodeDiamond(){ activeGraph.setVertexShape( clickedJim->nodeNumber(), "diamond"); clickedJim->setShape("diamond"); graphChanged(); } /** * Changes the shape of the clicked node to ellipse */ void MainWindow::slotChangeNodeEllipse(){ activeGraph.setVertexShape( clickedJim->nodeNumber(), "ellipse"); clickedJim->setShape("ellipse"); graphChanged(); } //TODO slotChangeLinkLabel void MainWindow::slotChangeLinkLabel(){ graphChanged(); } /** * Changes the colour of the clicked link. * If no link is clicked, then it asks the user to specify one. */ void MainWindow::slotChangeLinkColor(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("No links here! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No links present...") ); return; } int sourceNode=-1, targetNode=-1; bool ok=false; QString newColor; int min=activeGraph.firstVertexNumber(); int max=activeGraph.lastVertexNumber(); if (!linkClicked) { //no edge clicked. Ask user to define an edge. sourceNode=QInputDialog::getInteger(this, "Change link color",tr("Select link source node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"), min, 1, max , 1, &ok) ; if (!ok) { statusMessage( "Change link color operation cancelled." ); return; } targetNode=QInputDialog::getInteger(this, "Change link color...", tr("Select link target node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"),min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( "Change link color operation cancelled." ); return; } qDebug("source %i target %i",sourceNode, targetNode); newColor = QInputDialog::getItem(this , "Change link color....", "Select a color:", colorList, 1, false, &ok ); if ( ok ) { if (graphicsWidget->setEdgeColor(sourceNode, targetNode, newColor)) activeGraph.setEdgeColor( sourceNode, targetNode, newColor); else statusMessage( tr("There is no such link. ") ); } else statusMessage( tr("Change link color cancelled. ") ); } else { //edge has been clicked. Just ask the color and call the appropriate methods. newColor = QInputDialog::getItem(this, "Change link color....", "Select a new color for the clicked link:", colorList, 1, false, &ok ); if ( ok ) { clickedLink->setColor(newColor); activeGraph.setEdgeColor( clickedLink->sourceNodeNumber(), clickedLink->targetNodeNumber(), newColor); statusMessage( tr("Ready. ") ); } else { // user pressed Cancel statusMessage( tr("User abort. ") ); } } } /** * Changes the weight of the clicked link. * If no link is clicked, asks the user to specify a link. */ void MainWindow::slotChangeLinkWeight(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no links here! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No links present...") ); return; } qDebug("MW: slotChangeLinkWeight()"); int sourceNode=-1, targetNode=-1; float newWeight=1.0; int min=activeGraph.firstVertexNumber(); int max=activeGraph.lastVertexNumber(); bool ok=false; if (!linkClicked) { sourceNode=QInputDialog::getInteger(this, "Change link weight",tr("Select link source node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"), min, 1, max , 1, &ok) ; if (!ok) { statusMessage( "Change link weight operation cancelled." ); return; } targetNode=QInputDialog::getInteger(this, "Change link weight...", tr("Select link target node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"),min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( "Change link weight operation cancelled." ); return; } qDebug("source %i target %i",sourceNode, targetNode); QList list=scene->items(); for (QList::iterator it=list.begin(); it!= list.end() ; it++) if ( (*it)->type()==TypeEdge) { Edge *link=(Edge*) (*it); qDebug ("MW: searching link..."); if ( link->sourceNodeNumber()==sourceNode && link->targetNodeNumber()==targetNode ) { qDebug("MW: link found"); newWeight=(float) QInputDialog::getDouble(this, "Change link weight...",tr("New link Weight: "), 1, -100, 100 ,1, &ok ) ; if (ok) { link->setWeight(newWeight); link->update(); activeGraph.setEdgeWeight(sourceNode, targetNode, newWeight); statusMessage( QString(tr("Ready.")) ); return; } else { statusMessage( QString(tr("input error. Abort.")) ); return; } } } } else { //linkClicked qDebug() << "MW: slotChangeLinkWeight() - a link has already been clicked"; sourceNode=clickedLink->sourceNodeNumber(); targetNode=clickedLink->targetNodeNumber(); if ( activeGraph.symmetricEdge(sourceNode, targetNode) ) { QString s=QString::number(sourceNode); QString t=QString::number(targetNode); switch (QMessageBox::information( this, tr("Change link weight"), tr("This link is reciprocal. \n") + tr("Select what Direction to change or Both..."), s+" -> "+ t, t+" -> "+s, tr("Both"), 0, 1 )) { case 0: qDebug("MW: slotChangeLinkWeight() real edge %i -> %i", sourceNode, targetNode); newWeight=QInputDialog::getDouble(this, "Change link weight...",tr("New link weight: "), 1.0, -20.0, 20.00 ,1, &ok) ; if (ok) { clickedLink->setWeight(newWeight); clickedLink->update(); qDebug()<<"MW: newWeight will be "<< newWeight; activeGraph.setEdgeWeight(sourceNode, targetNode, newWeight); statusMessage( QString(tr("Ready.")) ); return; } else { statusMessage( QString(tr("Change link weight cancelled.")) ); return; } break; case 1: qDebug("MW: slotChangeLinkWeight() virtual edge %i -> %i",targetNode , sourceNode); newWeight=(float) QInputDialog::getDouble(this, "Change link weight...",tr("New link Weight: "), 1, -100, 100 ,1, &ok ) ; if (ok) { qDebug()<<"MW: newWeight will be "<< newWeight; activeGraph.setEdgeWeight( targetNode, sourceNode, newWeight); statusMessage( QString(tr("Ready.")) ); return; } else { statusMessage( QString(tr("Change link weight cancelled.")) ); return; } break; case 2: qDebug("MW: slotChangeLinkWeight() both directions %i <-> %i",targetNode , sourceNode); newWeight=(float) QInputDialog::getDouble(this, "Change link weight...",tr("New link Weight: "), 1, -100, 100 ,1, &ok ) ; if (ok) { qDebug()<<"MW: Changing first direction. NewWeight will be "<< newWeight; activeGraph.setEdgeWeight(sourceNode, targetNode, newWeight); qDebug()<<"MW: Changing opposite direction. NewWeight will be "<< newWeight; activeGraph.setEdgeWeight( targetNode, sourceNode, newWeight); statusMessage( QString(tr("Ready.")) ); return; } else { statusMessage( QString(tr("Change link weight cancelled.")) ); return; } break; } } else { qDebug("MW: slotChangeLinkWeight() real edge %i -> %i", sourceNode, targetNode); newWeight=QInputDialog::getDouble(this, "Change link weight...",tr("New link weight: "), 1.0, -20.0, 20.00 ,1, &ok) ; if (ok) { clickedLink->setWeight(newWeight); clickedLink->update(); qDebug()<<"MW: newWeight will be "<< newWeight; activeGraph.setEdgeWeight(sourceNode, targetNode, newWeight); statusMessage( QString(tr("Ready.")) ); return; } else { statusMessage( QString(tr("Change link weight cancelled.")) ); return; } } linkClicked=false; } } /** * Filters Nodes by their value TODO slotFilterNodes * */ void MainWindow::slotFilterNodes(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to filter! \nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Nothing to filter!")) ); return; } } /** * Calls Graph::filterOrphanVertices to filter vertices with no links */ void MainWindow::slotFilterOrphanNodes(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to filter! \nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Nothing to filter!")) ); return; } qDebug()<< "MW: slotFilterOrphanNodes"; activeGraph.filterOrphanVertices( ! filterOrphanNodesAct->isChecked() ); } /** * Shows a dialog from where the user may * filter edges according to their weight * All edges weighted more (or less) than the specified weight will be disabled. */ void MainWindow::slotShowFilterEdgesDialog() { if (!fileLoaded && !networkModified ) { statusMessage( QString(tr("Load a network file first. \nThen you may ask me to compute something!")) ); return; } m_filterEdgesByWeightDialog.exec() ; } /** * Transforms all nodes to links TODO slotTransformNodes2Links */ void MainWindow::slotTransformNodes2Links(){ graphChanged(); } /** * Converts all edges to double edges, so that the network becomes undirected (symmetric adjacency matrix). */ void MainWindow::slotSymmetrize(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("No links here! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No links present...") ); return; } qDebug("MW: slotSymmetrize() calling symmetrize"); activeGraph.symmetrize(); QMessageBox::information(this, "Symmetrize",tr("All links are reciprocal. \nYour network is symmetric..."), "OK",0); statusBar()->showMessage (QString(tr("Ready")), statusBarDuration) ; } /** TODO slotColorationStrongStructural */ void MainWindow::slotColorationStrongStructural() { } /** TODO slotColorationRegular */ void MainWindow::slotColorationRegular() { } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their In-Degree Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRandom(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Sorry, I can't follow! \nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double maxWidth=graphicsWidget->width(); double maxHeight=graphicsWidget->height(); statusMessage( QString(tr("Randomizing nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRandom(maxWidth, maxHeight); destroyProgressBar(); statusMessage( tr("Node positions are now randomized.") ); } /** TODO slotLayoutRandomCircle */ void MainWindow::slotLayoutRandomCircle(){ } /** slotLayoutSpringEmbedder called from menu */ void MainWindow::slotLayoutSpringEmbedder(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are node nodes yet!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( tr("I am really sorry. You must really load a file first... ") ); return; } if (moveSpringEmbedderBx->checkState() == Qt::Unchecked){ statusMessage( tr("Embedding a spring-gravitational model on the network.... ") ); moveSpringEmbedderBx->setCheckState(Qt::Checked); statusMessage( tr("Click on the checkbox \"Spring-Embedder\" to stop movement!") ); } else { moveSpringEmbedderBx->setCheckState(Qt::Unchecked); statusMessage( tr("Movement stopped!") ); } } /** Called from moveSpringEmbedderBx button. Calls Graph::startNodeMovement to embed a spring Embedder layout... */ void MainWindow::layoutSpringEmbedder (int state){ qDebug("MW: layoutSpringEmbedder ()"); scene->setItemIndexMethod (QGraphicsScene::NoIndex); //best when moving items moveFruchtermanBx->setChecked(false); activeGraph.nodeMovement(state, 1, graphicsWidget->width(), graphicsWidget->height()); scene->setItemIndexMethod (QGraphicsScene::BspTreeIndex); //best when not moving items } /** slotLayoutFruchterman called from menu */ void MainWindow::slotLayoutFruchterman(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes yet!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( tr("I am really sorry. You must really load a file first... ") ); return; } if (moveFruchtermanBx->checkState() == Qt::Unchecked){ statusMessage( tr("Embedding a repelling-attracting forces model on the network.... ") ); moveFruchtermanBx->setCheckState(Qt::Checked); statusMessage( tr("Click on the checkbox \"Fruchterman-Reingold\" to stop movement!") ); } else { moveFruchtermanBx->setCheckState(Qt::Unchecked); statusMessage( tr("Movement stopped!") ); } } /** Called from moveSpringEmbedderBx button. Calls Graph::startNodeMovement to embed a repelling-attracting forces layout... */ void MainWindow::layoutFruchterman (int state){ qDebug("MW: layoutFruchterman ()"); moveSpringEmbedderBx->setChecked(false); scene->setItemIndexMethod (QGraphicsScene::NoIndex); //best when moving items activeGraph.nodeMovement(state, 2, graphicsWidget->width(), graphicsWidget->height()); scene->setItemIndexMethod (QGraphicsScene::BspTreeIndex); //best when not moving items } /** Resizes all nodes according to the amount of their out-Links from other nodes. */ void MainWindow::slotLayoutNodeSizeProportionalOutEdges(bool checked){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Wake up! \nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( tr("I am really sorry. You must really load a file first... ") ); return; } qDebug("MW: slotLayoutNodeSizeProportionalOutEdges()"); QList list=scene->items(); int edges = 0, size = initNodeSize ; if (checked != true) { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); for (QList::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); (*jim).setSize(size); } } nodeSizeProportionalOutDegreeAct->setChecked(false); nodeSizeProportional2OutDegreeBx->setChecked(false); QApplication::restoreOverrideCursor(); return; } nodeSizeProportionalOutDegreeAct->setChecked(true); nodeSizeProportional2OutDegreeBx->setChecked(true); statusMessage( tr("Embedding node size model on the network.... ") ); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); for (QList::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); edges = activeGraph.edgesFrom( (*jim).nodeNumber() ) ; qDebug() << "Node " << (*jim).nodeNumber() << " outDegree: "<< edges; if (edges == 0 ) { size = initNodeSize; } else if (edges == 1 ) { size = initNodeSize + 1; } else if (edges > 1 && edges <= 2 ) { size = initNodeSize + 2; } else if (edges > 2 && edges <= 3 ) { size = initNodeSize + 3; } else if (edges > 3 && edges <= 4 ) { size = initNodeSize + 4; } else if (edges > 4 && edges <= 6 ) { size = initNodeSize + 4; } else if (edges > 5 && edges <= 7 ) { size = initNodeSize+5 ; } else if (edges > 7 && edges <= 10 ) { size = initNodeSize+6 ; } else if (edges > 10 && edges <= 15 ) { size = initNodeSize+7 ; } else if (edges > 15 && edges <= 25 ) { size = initNodeSize+8 ; } else if (edges > 25 ) { size = initNodeSize+9; } qDebug() << "Changing size of " << (*jim).nodeNumber() << " to " << size; (*jim).setSize(size); } } QApplication::restoreOverrideCursor( ); } /** Resizes all nodes according to the amount of their in-Links from other nodes. */ void MainWindow::slotLayoutNodeSizeProportionalInEdges(bool checked){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("You must be dreaming! \nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( tr("I am really sorry. You must really load a file first... ") ); return; } qDebug("MW: slotLayoutNodeSizeProportionalInEdges()"); QList list=scene->items(); int edges = 0, size = initNodeSize ; if (checked != true) { for (QList::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); (*jim).setSize(size); } } nodeSizeProportionalInDegreeAct->setChecked(false); nodeSizeProportional2InDegreeBx->setChecked(false); return; } nodeSizeProportionalInDegreeAct->setChecked(true); nodeSizeProportional2InDegreeBx->setChecked(true); statusMessage( tr("Embedding node size model on the network.... ") ); for (QList::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); edges = activeGraph.edgesTo( (*jim).nodeNumber() ) ; qDebug() << "Node " << (*jim).nodeNumber() << " inDegree: " << edges; if (edges == 0 ) { size = initNodeSize; } else if (edges == 1 ) { size = initNodeSize + 1; } else if (edges > 1 && edges <= 2 ) { size = initNodeSize + 2; } else if (edges > 2 && edges <= 3 ) { size = initNodeSize + 3; } else if (edges > 3 && edges <= 4 ) { size = initNodeSize + 4; } else if (edges > 4 && edges <= 6 ) { size = initNodeSize + 4; } else if (edges > 5 && edges <= 7 ) { size = initNodeSize+5 ; } else if (edges > 7 && edges <= 10 ) { size = initNodeSize+6 ; } else if (edges > 10 && edges <= 15 ) { size = initNodeSize+7 ; } else if (edges > 15 && edges <= 25 ) { size = initNodeSize+8 ; } else if (edges > 25 ) { size = initNodeSize+9; } qDebug() << "Changing size of " << (*jim).nodeNumber() << " to " << size; (*jim).setSize(size); } } } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their In-Degree Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityInDegree(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Sorry, I can't follow! \nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,1); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater In-Degree Centrality.") ); } /** * Calls Graph::layoutRadialCentrality() * to reposition all nodes on a radial layout according to their out-degree Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityOutDegree(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Load a network file or create a new network first!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,2); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Out-Degree Centrality. ") ); } /** * Calls Graph::layoutRadialCentrality() * to reposition all nodes on a circular layout based on their Closeness Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityCloseness(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Sorry, there are no nodes yet!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels createProgressBar(); statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,3); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Closeness Centrality. ") ); } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their Betweeness Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityBetweeness(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("No nodes yet!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,4); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Betweeness Centrality. ") ); } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their Stress Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityStress(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,5); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Stress Centrality. ") ); } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their Graph Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityGraph(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do here!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,6); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Graph Centrality. ") ); } /** * Calls Graph::layoutRadialCentrality() * to reposition all nodes on a circular layout based on their Eccentricities * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityEccentr(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,7); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Eccentricity Centrality. ") ); } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their Power Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityPower(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,8); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Power Centrality. ") ); } /** * Calls Graph::LayoutRadialCentrality() * to reposition all nodes on a circular layout based on their Informational Centralities. * More central nodes are closer to the centre */ void MainWindow::slotLayoutRadialCentralityInformation(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double x0=scene->width()/2.0; double y0=scene->height()/2.0; double maxRadius=(graphicsWidget->height()/2.0)-50; //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutRadialCentrality(x0, y0, maxRadius,9); destroyProgressBar(); statusMessage( tr("Nodes in inner circles have greater Information Centrality. ") ); } /** * Calls Graph::layoutLayeredCentrality * to reposition all nodes on different top-down levels according to their * In-Degree Centrality * More central nodes are closer to the top of the canvas */ void MainWindow::slotLayoutLayeredCentralityInDegree(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double maxWidth=scene->width(); double maxHeight=scene->height(); //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutLayeredCentrality(maxWidth, maxHeight, 1); destroyProgressBar(); statusMessage( tr("Nodes in upper levels have greater In-Degree Centrality. ") ); } /** * Calls Graph::layoutLayeredCentrality * to reposition all nodes on different top-down levels according to their * Out-Degree Centrality * More central nodes are closer to the top of the canvas */ void MainWindow::slotLayoutLayeredCentralityOutDegree(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Load a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double maxWidth=scene->width(); double maxHeight=scene->height(); //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutLayeredCentrality(maxWidth, maxHeight, 2); destroyProgressBar(); statusMessage( tr("Nodes in upper levels have greater Out-Degree Centrality. ") ); } /** * Calls Graph::LayoutLayeredCentrality * to reposition all nodes on different top-down levels according to their * Closeness Centrality * More central nodes are closer to the top of the canvas */ void MainWindow::slotLayoutLayeredCentralityCloseness(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Load a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double maxWidth=scene->width(); double maxHeight=scene->height(); //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutLayeredCentrality(maxWidth, maxHeight, 3); destroyProgressBar(); statusMessage( tr("Nodes in upper levels have greater Closeness Centrality.") ); } /** * Calls Graph::LayoutLayeredCentrality * to reposition all nodes on different top-down levels according to their * Betweeness Centrality * More central nodes are closer to the top of the canvas */ void MainWindow::slotLayoutLayeredCentralityBetweeness(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network first. \nThen we can talk about layouts!"), "OK",0); statusMessage( QString(tr("Nothing to layout! Are you dreaming?")) ); return; } double maxWidth=scene->width(); double maxHeight=scene->height(); //pixels statusMessage( QString(tr("Calculating new nodes positions. Please wait...")) ); graphicsWidget->clearBackgrCircles(); createProgressBar(); activeGraph.layoutLayeredCentrality(maxWidth, maxHeight, 4); destroyProgressBar(); statusMessage( tr("Nodes in upper levels have greater Betweeness Centrality. ") ); } /** TODO slotLayoutLayeredCentralityInformational */ void MainWindow::slotLayoutLayeredCentralityInformation(){ } /** * Returns the amount of active links on the scene. */ int MainWindow::activeLinks(){ qDebug ("activeLinks()"); totalLinks=activeGraph.totalEdges(); return totalLinks; } /** * Returns the amount of active nodes on the scene. */ int MainWindow::activeNodes(){ return activeGraph.vertices(); } /** * Displays a box informing the user about the symmetry or not of the adjacency matrix */ void MainWindow::slotCheckSymmetry(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("There is no network!")) ); return; } if (activeGraph.isSymmetric()) QMessageBox::information(this, "Network Symmetry", tr("Adjacency matrix symmetry = YES "),"OK",0); else QMessageBox::information(this, "Network Symmetry", tr("Adjacency matrix symmetry = NO "),"OK",0); statusMessage (QString(tr("Ready")) ); } void MainWindow::slotInvertAdjMatrix(){ if ( !fileLoaded && !networkModified) { QMessageBox::critical (this, "Error", tr("Empty network! \nLoad a network file or create something by double-clicking on the canvas!"), "OK",0); statusMessage( tr("Nothing to show!") ); return; } int aNodes=activeNodes(); statusBar() -> showMessage ( QString (tr ("inverting adjacency adjacency matrix of %1 nodes")).arg(aNodes) ); qDebug ("MW: calling Graph::writeInvertAdjacencyMatrix with %i nodes", aNodes); char fn[]= "invert-adjacency-matrix.dat"; activeGraph.writeInvertAdjacencyMatrix(fn, networkName.toLocal8Bit()) ; //Open a text editor window for the new file created by graph class QString qfn=QString::fromLocal8Bit("invert-adjacency-matrix.dat"); TextEditor *ed = new TextEditor(fn); tempFileNameNoPath=qfn.split( "/"); ed->setWindowTitle(tr("View Adjacency Matrix - ") + tempFileNameNoPath.last()); ed->show(); } /** * Displays the graph distance (geodesic distance) between two user-specified nodes This is the length of the shortest path between them. */ void MainWindow::slotGraphDistance(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("There are no nodes. Nothing to do...")) ); return; } bool ok=false; long int min=1, max=1, i=-1, j=-1; QList list=scene->items(); for (QList ::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); if ( min>jim->nodeNumber() ) min=jim->nodeNumber(); if ( maxnodeNumber() ) max=jim->nodeNumber(); } } i=QInputDialog::getInteger(this, tr("Distance between two nodes"),tr("Select source node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"), min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( "Distance calculation operation cancelled." ); return; } j=QInputDialog::getInteger(this, tr("Distance between two nodes"), tr("Select target node: ("+QString::number(min).toAscii()+"..."+QString::number(max).toAscii()+"):"),min, 1, max , 1, &ok ) ; if (!ok) { statusMessage( tr("Distance calculation operation cancelled.") ); return; } qDebug() << "source " << i << " target" << j; if (activeGraph.isSymmetric() && i>j) { qSwap(i,j); } if ( activeGraph.distance(i,j) != 0 ) QMessageBox::information(this, tr("Distance"), tr("Network distance (")+QString::number(i)+", "+QString::number(j)+") = "+QString::number(activeGraph.distance(i,j))+tr("\nThe nodes are connected."),"OK",0); else QMessageBox::information(this, tr("Distance"), tr("Network distance (")+QString::number(i)+", "+QString::number(j)+") = "+QString::number(activeGraph.distance(i,j))+tr("\nThe nodes are not connected."),"OK",0); } /** * Invokes creation of the matrix of nodes' distances, then displays it. */ void MainWindow::slotViewDistanceMatrix(){ qDebug("MW: slotViewDistanceMatrix()"); if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes nor links!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Nothing to do!")) ); return; } statusMessage( tr("Creating distance matrix. Please wait...") ); char fn[]= "distance-matrix.dat"; char fn1[]="sigmas-matrix.dat"; createProgressBar(); activeGraph.writeDistanceMatrix(fn, fn1, networkName.toLocal8Bit()); destroyProgressBar(); //Open a text editor window for the new file created by graph class QString qfn1=QString::fromLocal8Bit(fn1); TextEditor *ed = new TextEditor(fn); TextEditor *ed1 = new TextEditor(fn1); ed1->setWindowTitle(tr("Matrix of sigmas ")); ed->setWindowTitle(tr("Matrix of distances ")); ed1->show(); ed->show(); } /** Displays the network diameter (largest geodesic) */ void MainWindow::slotDiameter() { if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes nor links!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Cannot find the diameter of nothing...")) ); return; } createProgressBar(); int netDiameter=activeGraph.diameter(); destroyProgressBar(); if (netDiameter > (activeGraph.vertices()-1) ) QMessageBox::information(this, "Diameter", "Network diameter = "+ QString::number(netDiameter)+" > (vertices()-1).", "OK",0); else QMessageBox::information(this, "Diameter", "Network diameter = " + QString::number(netDiameter), "OK",0); statusMessage( tr("Diameter calculated. Ready.") ); } /** Displays the average shortest path length (average graph distance) */ void MainWindow::slotAverageGraphDistance() { if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes nor links!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Cannot find the diameter of nothing...")) ); return; } createProgressBar(); float averGraphDistance=activeGraph.averageGraphDistance(); destroyProgressBar(); QMessageBox::information(this, "Average Graph Distance", "The average shortest path length is = " + QString::number(averGraphDistance), "OK",0); statusMessage( tr("Average distance calculated. Ready.") ); } /** * Displays a message on the status bar when you resize the window. */ void MainWindow::windowInfoStatusBar(int w, int h){ statusMessage( QString(tr("Window resized to (%1, %2) pixels.")).arg(w).arg(h) ); } /** * Calls Graph:: writeNumberOfCliques() to write the number of cliques (triangles) * of each vertex into a file, then displays it. */ void MainWindow::slotNumberOfCliques(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do! \nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" No network here. Sorry. Nothing to do.")) ); return; } QString fn = "number-of-cliques.dat"; bool considerWeights=true; createProgressBar(); activeGraph.writeNumberOfCliques(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Number of cliques saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Clustering Coefficients into a file, then displays it. */ void MainWindow::slotClusteringCoefficient (){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do! \nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" No network here. Sorry. Nothing to do.")) ); return; } QString fn = "clustering-coefficients.dat"; bool considerWeights=true; createProgressBar(); activeGraph.writeClusteringCoefficient(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Clustering Coefficients saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Calls Graph to conduct and write a triad census into a file, then displays it. */ void MainWindow::slotTriadCensus() { if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do! \nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" No network here. Sorry. Nothing to do.")) ); return; } QString fn = "triad-census.dat"; bool considerWeights=true; createProgressBar(); activeGraph.writeTriadCensus(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Triad Census saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Out-Degree Centralities into a file, then displays it. */ void MainWindow::slotCentralityOutDegree(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do! \nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" No network here. Sorry. Nothing to do.")) ); return; } bool considerWeights=false; switch( QMessageBox::information( this, "Centrality Out-Degree", tr("Take weights into account (Default: No)?"), tr("Yes"), tr("No"), 0, 1 ) ) { case 0: considerWeights=true; break; case 1: considerWeights=false; break; default: // just for sanity considerWeights=true; return; break; } QString fn = "centrality-out-degree.dat"; createProgressBar(); activeGraph.writeCentralityOutDegree(fn, considerWeights); destroyProgressBar(); statusMessage( QString(tr(" displaying file..."))); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Out-Degree Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes In-Degree Centralities into a file, then displays it. */ void MainWindow::slotCentralityInDegree(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("Nothing to do!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Nothing to do...")) ); return; } bool considerWeights=false; switch( QMessageBox::information( this, "Centrality In-Degree", tr("Take weights into account (Default: No)?"), tr("Yes"), tr("No"), 0, 1 ) ) { case 0: considerWeights=true; break; case 1: considerWeights=false; break; default: // just for sanity considerWeights=true; return; break; } QString fn = "centrality-in-degree.dat"; createProgressBar(); activeGraph.writeCentralityInDegree(fn, considerWeights); destroyProgressBar(); statusMessage( QString(tr(" displaying file..."))); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("In-Degree Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Closeness Centralities into a file, then displays it. */ void MainWindow::slotCentralityCloseness(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr("Nothing to do...")) ); return; } QString fn = "centrality_closeness.dat"; bool considerWeights=true; createProgressBar(); activeGraph.writeCentralityCloseness(fn, considerWeights); destroyProgressBar(); statusMessage( QString(tr(" displaying file..."))); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Closeness Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Betweeness Centralities into a file, then displays it. */ void MainWindow::slotCentralityBetweeness(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" Nothing to do...")) ); return; } QString fn = "centrality_betweeness.dat"; bool considerWeights=true; statusMessage( QString(tr(" Please wait..."))); createProgressBar(); activeGraph.writeCentralityBetweeness(fn, considerWeights); destroyProgressBar(); statusMessage( QString(tr(" displaying file..."))); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Betweeness Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); QApplication::restoreOverrideCursor(); } /** * Writes Informational Centralities into a file, then displays it. TODO slotCentralityInformation */ void MainWindow::slotCentralityInformation(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" Nothing to do...")) ); return; } QString fn = "centrality_information.dat"; statusMessage( QString(tr(" Please wait..."))); createProgressBar(); activeGraph.writeCentralityInformation(fn); destroyProgressBar(); statusMessage( QString(tr(" displaying file..."))); TextEditor *ed = new TextEditor(fn); tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Information Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); QApplication::restoreOverrideCursor(); } /** * Writes Stress Centralities into a file, then displays it. */ void MainWindow::slotCentralityStress(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" Nothing to do! Why don't you try creating something first?")) ); return; } QString fn = "centrality_stress.dat"; bool considerWeights=true; statusMessage( QString(tr(" Please wait..."))); createProgressBar(); activeGraph.writeCentralityStress(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Stress Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Graph Centralities into a file, then displays it. */ void MainWindow::slotCentralityGraph(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" Try creating a network first. \nThen I compute whatever you want...")) ); return; } QString fn = "centrality_graph.dat"; bool considerWeights=true; statusMessage( QString(tr(" Please wait..."))); createProgressBar(); activeGraph.writeCentralityGraph(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/" ); ed->setWindowTitle("Graph Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Power Centralities into a file, then displays it. */ void MainWindow::slotCentralityPower(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" Nothing to do! Why don't you try creating something first?")) ); return; } QString fn = "centrality_power.dat"; bool considerWeights=true; statusMessage( QString(tr(" Please wait..."))); createProgressBar(); activeGraph.writeCentralityPower(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle("Stress Centralities saved as: " + tempFileNameNoPath.last()); ed->show(); } /** * Writes Eccentricity Centralities into a file, then displays it. */ void MainWindow::slotCentralityEccentricity(){ if (!fileLoaded && !networkModified ) { QMessageBox::critical(this, "Error",tr("There are no nodes!\nLoad a network file or create a new network. \nThen ask me to compute something!"), "OK",0); statusMessage( QString(tr(" Nothing to do...")) ); return; } QString fn = "centrality_eccentricity.dat"; bool considerWeights=true; statusMessage( QString(tr(" Please wait..."))); createProgressBar(); activeGraph.writeCentralityEccentricity(fn, considerWeights); destroyProgressBar(); TextEditor *ed = new TextEditor(fn); //OPEN A TEXT EDITOR WINDOW tempFileNameNoPath=fn.split( "/"); ed->setWindowTitle(tr("Eccentricity Centralities saved as: ") + tempFileNameNoPath.last()); ed->show(); QApplication::restoreOverrideCursor(); } void MainWindow::createProgressBar(){ if (showProgressBarAct->isChecked() || activeGraph.totalEdges() > 2000){ progressDialog= new QProgressDialog("Please wait, for distance matrix creation....", "Cancel", 0, activeGraph.vertices(), this); progressDialog -> setWindowModality(Qt::WindowModal); connect( &activeGraph, SIGNAL( updateProgressDialog(int) ), progressDialog, SLOT(setValue(int) ) ) ; progressDialog->setMinimumDuration(0); } QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); } void MainWindow::destroyProgressBar(){ QApplication::restoreOverrideCursor(); if (showProgressBarAct->isChecked() || activeGraph.totalEdges() > 1000) progressDialog->deleteLater(); } /** * Called from Graph:: */ bool MainWindow::showNumbers(){ return displayNodeNumbersAct->isChecked(); } /** * Turns on/off displaying the numbers of nodes (outside ones) */ void MainWindow::slotDisplayNodeNumbers(bool toggle) { if (!fileLoaded && ! networkModified) { QMessageBox::critical(this, "Error",tr("There are no nodes! \nLoad a network file or create a new network."), "OK",0); statusMessage( tr("Errr...no nodes here. Sorry!") ); return; } statusMessage( tr("Toggle Nodes Numbers. Please wait...") ); if (!toggle) { graphicsWidget->setAllItemsVisibility(TypeNumber, false); statusMessage( tr("Node Numbers are invisible now. Click the same option again to display them.") ); return; } else{ graphicsWidget->setAllItemsVisibility(TypeNumber, true); statusMessage( tr("Node Numbers are visible again...") ); } } /** * Called by Graph:: and this->initNet() */ bool MainWindow::showLabels(){ return displayNodeLabelsAct->isChecked(); } /** * Called by Graph:: and this->initNet() */ bool MainWindow::showNumbersInsideNodes(){ return displayNumbersInsideNodesAct->isChecked(); } /** * Turns on/off displaying the nodenumbers inside the nodes. */ void MainWindow::slotDisplayNumbersInsideNodes(bool toggle){ statusMessage( tr("Toggle Numbers inside nodes. Please wait...") ); if ( showNumbers() ) { // ? } else{ displayNodeNumbersAct->setChecked(true); } activeGraph.setShowNumbersInsideNodes(toggle); graphicsWidget -> setNumbersInsideNodes(toggle); if (toggle){ statusMessage( tr("Numbers inside nodes...") ); } else { statusMessage( tr("Numbers outside nodes...") ); } } /** * Turns on/off displaying labels */ void MainWindow::slotDisplayNodeLabels(bool toggle){ if (!fileLoaded && ! networkModified) { QMessageBox::critical(this, "Error",tr("There are no nodes! \nLoad a network file or create a new network first. "), "OK",0); statusMessage( tr("No nodes found. Sorry...") ); return; } statusMessage( tr("Toggle Nodes Labels. Please wait...") ); if (!toggle) { graphicsWidget->setAllItemsVisibility(TypeLabel, false); statusMessage( tr("Node Labels are invisible now. Click the same option again to display them.") ); return; } else{ graphicsWidget->setAllItemsVisibility(TypeLabel, true); statusMessage( tr("Node Labels are visible again...") ); } activeGraph.setShowLabels(toggle); } /** * Changes the size of all nodes */ void MainWindow::slotChangeAllNodesSize() { bool ok=false; int newSize = QInputDialog::getInteger(this, "Change node size", tr("Select new size for all nodes: (1-16)"),initNodeSize, 1, 16, 1, &ok ); if (!ok) { statusMessage( "Change node size operation cancelled." ); return; } qDebug ("MW: slotChangeAllNodesSize:"); changeAllNodesSize(newSize); graphChanged(); statusBar()->showMessage (QString(tr("Ready")), statusBarDuration) ; return; } /** * Changes the size of nodes. */ void MainWindow::changeAllNodesSize(int size) { qDebug ("MW: changeAllNodesSize:"); if (size == 0 ) { if (activeNodes() < 200) { return; } else if (activeNodes() >= 200 && activeNodes() < 500){ size = 4; } else if (activeNodes() >= 500 && activeNodes() < 1000) { size = 3; } else if (activeNodes() >= 1000) { size = 2; } } initNodeSize = size; activeGraph.setInitVertexSize(initNodeSize); qDebug () << "MW: changeAllNodesSize: changing to " << size; QList list=scene->items(); for (QList::iterator it=list.begin(); it!=list.end(); it++) if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); (*jim).setSize(size); } } /** * Changes the shape of all nodes. */ void MainWindow::slotChangeAllNodesShape() { bool ok=false; QStringList lst; lst << "box"<< "circle"<< "diamond"<< "ellipse"<< "triangle"; QString newShape = QInputDialog::getItem(this, "Node shapes", "Select a shape for all nodes: ", lst, 1, true, &ok); if ( ok ) { //user selected an item and pressed OK QList list=scene->items(); for (QList::iterator it=list.begin(); it!=list.end(); it++) if ( (*it) -> type() == TypeNode ){ Node *jim = (Node*) (*it); (*jim).setShape(newShape); activeGraph.setVertexShape ((*jim).nodeNumber(), newShape); } graphChanged(); activeGraph.setInitVertexShape(newShape); statusBar()->showMessage (QString(tr("All shapes have been changed. Ready")), statusBarDuration) ; } else { //user pressed Cancel statusBar()->showMessage (QString(tr("Change node shapes aborted...")), statusBarDuration) ; } } /** * Change size of all nodes' numbers (outside ones) */ void MainWindow::slotChangeNumbersSize() { bool ok=false; int newSize; newSize = QInputDialog::getInteger(this, "Change text size", tr("Change all nodenumbers size to: (1-16)"),initNumberSize, 1, 16, 1, &ok ); if (!ok) { statusMessage( tr("Change font size: Aborted.") ); return; } QList list=scene->items(); for (QList::iterator it2=list.begin();it2!=list.end(); it2++) if ( (*it2)->type()==TypeNumber) { NodeNumber * number= (NodeNumber*) (*it2); qDebug ("MW: slotChangeNumbersSize Found"); number->setFont( QFont (number->font().family(), newSize, QFont::Light, false) ); } activeGraph.setInitVertexNumberSize(newSize); statusMessage( tr("Changed numbers size. Ready.") ); } /** * Changes size of all nodes' labels */ void MainWindow::slotChangeLabelsSize() { bool ok=false; int newSize; newSize = QInputDialog::getInteger(this, "Change text size", tr("Change all node labels size to: (1-16)"),initNumberSize, 1, 16, 1, &ok ); if (!ok) { statusMessage( tr("Change font size: Aborted.") ); return; } QList list=scene->items(); for (QList::iterator it2=list.begin();it2!=list.end(); it2++) if ( (*it2)->type()==TypeLabel) { NodeLabel *label= (NodeLabel*) (*it2); qDebug ("MW: slotChangeLabelsSize Found"); label->setFont( QFont (label->font().family(), newSize, QFont::Light, false) ); activeGraph.setVertexLabelSize ( (label->node())->nodeNumber(), newSize); } activeGraph.setInitVertexLabelSize(newSize); statusMessage( tr("Changed labels size. Ready.") ); } /** Turns on/off drawing links as thick as their weights. TODO */ void MainWindow::slotDrawLinksThickAsWeights() { } /** * Turns on/off displaying link weight numbers */ void MainWindow::slotDisplayLinksWeightNumbers(bool toggle) { if (!fileLoaded && ! networkModified) { QMessageBox::critical(this, "Error",tr("There are no links! \nLoad a network file or create a new network first."), "OK",0); statusMessage( tr("No nodes or edges found. Sorry...") ); return; } statusMessage( tr("Toggle Edges Weights. Please wait...") ); if (!toggle) { graphicsWidget->setAllItemsVisibility(TypeEdgeWeight, false); statusMessage( tr("Edge weights are invisible now. Click the same option again to display them.") ); return; } else{ graphicsWidget->setAllItemsVisibility(TypeEdgeWeight, true); statusMessage( tr("Edge weights are visible again...") ); } activeGraph.setShowLabels(toggle); // pair pair1; // QList list=scene->items(); // if ( toggle ) { //draw Edge Weight Numbers // qDebug ("toogle is true. Will show weight numbers"); // for (QList::iterator it=list.begin(); it!=list.end(); it++) // if ( (*it)->type() == Link_Rtti ){ // Edge* link= (Edge*) (*it); // qDebug ("found link"); // EdgeWeight *linkWeight =new EdgeWeight (link, QString::number(link->weight()), scene ); // qDebug ("will draw weight number %i",link->weight() ); // // linkWeight ->setZ (255); // pair1=link->center(); // linkWeight ->move(pair1.first,pair1.second); // linkWeight-> setColor (link->color()); // linkWeight ->show(); // qDebug ("show"); // } // } // else { //delete them // qDebug ("toogle is false. Deleting all numbers"); // for (QList::iterator item=list.begin();item!=list.end(); item++){ // if ( (*item)->type() == Weight_Rtti ) { // delete *item; // } // else if ( (*item)->type() == Link_Rtti ) { // Edge* link= (Edge*) (*item); // link->clearWeightList(); // qDebug ("weight List cleared"); // } // // } // return; // } } /** * Turns on/off displaying links */ void MainWindow::slotDisplayLinks(bool toggle){ if (!fileLoaded && ! networkModified) { QMessageBox::critical(this, "Error",tr("There are no nodes nor links! \nLoad a network file or create a new network first!"), "OK",0); statusMessage( tr("No links found...") ); return; } statusMessage( tr("Toggle Edges Arrows. Please wait...") ); if (!toggle) { graphicsWidget->setAllItemsVisibility(TypeEdge, false); statusMessage( tr("Links are invisible now. Click again the same menu to display them.") ); return; } else{ graphicsWidget->setAllItemsVisibility(TypeEdge, true); statusMessage( tr("Links visible again...") ); } } /** * Turns on/off the arrows of links */ void MainWindow::slotDisplayLinksArrows(bool toggle){ if (!fileLoaded && ! networkModified) { QMessageBox::critical(this, "Error",tr("There are no links! \nLoad a network file or create a new network first!"), "OK",0); statusMessage( tr("No links found...") ); return; } statusMessage( tr("Toggle Edges Arrows. Please wait...") ); if (!toggle) { QList list = scene->items(); for (QList::iterator item=list.begin();item!=list.end(); item++) { if ( (*item)->type() ==TypeEdge){ Edge *edge = (Edge*) (*item); edge->showArrows(false); } } return; } else{ QList list = scene->items(); for (QList::iterator item=list.begin();item!=list.end(); item++) if ( (*item)->type() ==TypeEdge){ Edge *edge = (Edge*) (*item); edge->showArrows(true); } } statusMessage( tr("Ready.")); } /** * FIXME links Bezier */ void MainWindow::slotDrawLinksBezier(bool toggle){ if (!fileLoaded && ! networkModified) { QMessageBox::critical(this, "Error",tr("There are no links! \nLoad a network file or create a new network!"), "OK",0); statusMessage( tr("There are NO links here!") ); return; } statusMessage( tr("Toggle links bezier. Please wait...") ); // // graphicsWidget->setBezier(toggle); if (!toggle) { // QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); // QList list = scene->items(); // for (QList::iterator item=list.begin();item!=list.end(); item++) { // if ( (*item)->type() ==TypeEdge ){ // Edge *edge = (Edge*) (*item); // // edge->toggleBezier(false); // (*item)->hide();(*item)->show(); // } // // } // QApplication::restoreOverrideCursor(); // return; } else{ // QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); // QList list = scene->items(); // for (QList::iterator item=list.begin();item!=list.end(); item++){ // if ( (*item)->type() ==TypeEdge ){ // Edge *edge = (Edge*) (*item); // // edge->toggleBezier(true); // (*item)->hide();(*item)->show(); // } // } // QApplication::restoreOverrideCursor(); } } /** * Changes the background color of the scene */ void MainWindow::slotBackgroundColor () { qDebug("MW: slotBackgroundColor "); QColor backgrColor = QColorDialog::getColor( initBackgroundColor, this ); graphicsWidget ->setBackgroundBrush(QBrush(backgrColor)); statusMessage( tr("Ready. ") ); } /** * Changes the color of all nodes */ void MainWindow::slotAllNodesColor(){ bool ok=false; initNodeColor = QInputDialog::getItem(this, "Nodes' colors", "Select a new color:", colorList, 1, true, &ok); if ( ok ) { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); qDebug ("MW: Will change color"); QList list= scene->items(); for (QList::iterator it=list.begin(); it!=list.end(); it++) if ( (*it)->type() == TypeNode ) { Node *jim = (Node *) (*it); jim->setColor(initNodeColor); qDebug ("MW: Changed color"); activeGraph.setVertexColor (jim->nodeNumber(), initNodeColor); graphChanged(); } activeGraph.setInitVertexColor(initNodeColor); QApplication::restoreOverrideCursor(); statusMessage( tr("Ready. ") ); } else { // user pressed Cancel statusMessage( tr("Change node color aborted. ") ); } } /** * Changes the color of all links */ void MainWindow::slotAllLinksColor(){ bool ok=false; initLinkColor = QInputDialog::getItem(this, "Links' colors", "Select a new color:", colorList, 1, true, &ok); if ( ok ) { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); qDebug ("MW: Will change color"); QList list= scene->items(); for (QList::iterator it=list.begin(); it!=list.end(); it++) if ( (*it)->type() == TypeEdge ) { Edge *link = (Edge *) (*it); link->setColor(initLinkColor ); qDebug ("MW: Changed color"); activeGraph.setEdgeColor (link->sourceNodeNumber(), link->targetNodeNumber(), initLinkColor); graphChanged(); } activeGraph.setInitEdgeColor(initLinkColor); QApplication::restoreOverrideCursor(); statusMessage( tr("Ready. ") ); } else { // user pressed Cancel statusMessage( tr("Change link color aborted. ") ); } } /** * Changes the color of nodes' numbers */ void MainWindow::slotAllNumbersColor(){ // = QInputDialog::getItem(this, "Links' colors", "Select a new color:", colorList, 1, true, &ok); QColor textColor = QColorDialog::getColor( Qt::black, this ); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); qDebug ("MW: Will change color"); QList list= scene->items(); for (QList::iterator it=list.begin(); it!=list.end(); it++) { if ( (*it)->type() == TypeNumber) { NodeNumber *jimNumber = (NodeNumber *) (*it); jimNumber->update(); jimNumber->setDefaultTextColor(textColor); } } activeGraph.setInitVertexNumberColor( textColor.name() ); QApplication::restoreOverrideCursor(); statusMessage( tr("Numbers' colors changed. Ready. ") ); } /** * Changes the color of nodes labels */ void MainWindow::slotAllLabelsColor(){ QColor textColor = QColorDialog::getColor( Qt::black, this ); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); qDebug ("MW: Will change label color"); QList list= scene->items(); for (QList::iterator it=list.begin(); it!=list.end(); it++) if ( (*it)->type() == TypeNode ) { Node *jim = (Node *) (*it); jim->label()->update(); jim->label()->setDefaultTextColor(textColor); qDebug ("MW: Changed color"); activeGraph.setVertexLabelColor (jim->nodeNumber(), textColor.name()); } activeGraph.setInitVertexLabelColor(textColor.name()); QApplication::restoreOverrideCursor(); statusMessage( tr("Label colors changed. Ready. ") ); } /** * turns antialiasing on or off */ void MainWindow::slotAntialiasing(bool toggle) { statusMessage( tr("Toggle anti-aliasing. This will take some time if the network is large (>500)...") ); //Inform graphicsWidget about the change QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); graphicsWidget->setRenderHint(QPainter::Antialiasing, toggle); graphicsWidget->setRenderHint(QPainter::TextAntialiasing, toggle); graphicsWidget->setRenderHint(QPainter::SmoothPixmapTransform, toggle); QApplication::restoreOverrideCursor(); if (!toggle) statusMessage( tr("Anti-aliasing off.") ); else statusMessage( tr("Anti-aliasing on.") ); } /** * turn progressbar on or off */ void MainWindow::slotShowProgressBar(bool toggle) { statusMessage( tr("Toggle progressbar...")); if (!toggle) { statusMessage( tr("Progress bars off.") ); } else { statusMessage( tr("Progress bars on.") ); } } /** * Turns debugging messages on or off */ void MainWindow::slotPrintDebug(bool toggle){ if (!toggle) { printDebug=false; statusMessage( tr("Debug messages off.") ); } else { printDebug=true; statusMessage( tr("Debug messages on.") ); } } /** * Turns Toolbar on or off */ void MainWindow::slotViewToolBar(bool toggle) { statusMessage( tr("Toggle toolbar...")); if (toggle== false) { toolBar->hide(); statusMessage( tr("Toolbar off.") ); } else { toolBar->show(); statusMessage( tr("Toolbar on.") ); } } /** * Turns Statusbar on or off */ void MainWindow::slotViewStatusBar(bool toggle) { statusMessage( tr("Toggle statusbar...")); if (toggle == false) { statusBar()->hide(); statusMessage( tr("Status bar off.") ); } else { statusBar()->show(); statusMessage( tr("Status bar on.") ); } } /* * Enables/disables displaying a user-defined custom image in the background */ void MainWindow::slotBackgroundImage(bool toggle) { statusMessage( tr("Toggle BackgroundImage...")); QString m_fileName ; if (toggle == false) { statusMessage( tr("BackgroundImage off.") ); graphicsWidget->setBackgroundBrush(QBrush(initBackgroundColor)); } else { m_fileName = QFileDialog::getOpenFileName( this, tr("Select one image"), "", tr("All (*);;PNG (*.png);;JPG (*.jpg)") ); graphicsWidget->setBackgroundBrush(QImage(m_fileName)); graphicsWidget->setCacheMode(QGraphicsView::CacheBackground); statusMessage( tr("BackgroundImage on.") ); } } /** * Displays a random tip */ void MainWindow::slotTips() { int randomTip=rand()%tipsCounter; //Pick a tip. QMessageBox::about( this, tr("Tip Of The Day"), tips[randomTip]); } /** Creates our tips. */ void MainWindow::createTips(){ tips+=tr("You can add a new node by double-clicking on the scene."); tips+=tr("You can add a new node by clicking on Add button."); tips+=tr("You can remove a node by clicking on Remove button."); tips+=tr("You can rotate the network by selecting a new angle on the dock."); tips+=tr("You can add a new link between two nodes, by middle-clicking (or pressing both mouse buttons simultanesously) on the first and then on the second node."); tips+=tr("You can remove a node by right-clicking on it and selecting Remove."); tips+=tr("You can change background color (from the menu Edit > Colors)."); tips+=tr("Nodes can have the colors of your choice. Just right-click on a node and then select > Options > Change Color. You can select every color supported by the X.org pallette."); tips+=tr("The tabs on the left dock show information about the network (nodes, edges, density, etc) as well as information about any node you clicked on (inDegrees, outDegrees, clustering)."); tips+=tr("You can move a node easily by dragging it with your mouse."); tips+=tr("SocNetV can save the positions of the nodes in a network, if you save it in Pajek/GraphML format."); tips+=tr("You can apply layout algorithms on the network from the menu Layout or by clicking on the Dock > Layout tab checkboxes"); tips+=tr("You can change the label of node by right-clicking on it, and selecting Options > Change Label."); tips+=tr("All basic operations of SocNetV are available from the dock on the left, or by right-clicking on a node or a link."); tips+=tr("Node information is displayed on the Status bar, when you left-click on it."); tips+=tr("Link information is displayed on the Status bar, when you left-click on it."); tipsCounter = 16; } /** Loads the HTML Help file and displays it via HTMLViewer. */ void MainWindow::slotHelp(){ QString helpPath; bool manualFound = false; QDir d( QCoreApplication::applicationDirPath() ); qDebug()<< QCoreApplication::applicationDirPath().toAscii(); if ( d.exists("manual.html") ) { helpPath=d.filePath("manual.html"); } else { if (d.dirName()=="bin") { d.cdUp(); } if (d.cd("./manual") ) { if ( d.exists("manual.html") ) { helpPath=d.filePath("manual.html"); manualFound = true; } else { qDebug()<< "help file does not exist here."; manualFound = false; } } if ( !manualFound && d.cd("/usr/local/share/doc/socnetv/") ) { //for compile installation if (d.exists("manual/")) d.cd("manual/"); if ( d.exists("manual.html") ) { helpPath=d.filePath("manual.html"); qDebug()<< "path" << helpPath.toAscii(); manualFound = true; } else { qDebug()<< "help file does not exist."; manualFound = false; } } if (!manualFound && d.cd("/usr/share/doc/socnetv/") ) { //for Debian Ubuntu if (d.exists("manual/")) d.cd("manual/"); if ( d.exists("manual.html") ) { helpPath=d.filePath("manual.html"); manualFound = true; } else { qDebug("help file does not exist in /usr/share/doc/socnetv/."); manualFound = false; } } if ( !manualFound && d.cd("/usr/share/doc/packages/socnetv/") ) { //for opensuse file hierarchy if (d.exists("manual/")) d.cd("manual/"); if ( d.exists("manual.html") ) { helpPath=d.filePath("manual.html"); manualFound = true; } else { qDebug("help file does not exist."); } } QString fedoraPath = "/usr/share/doc/socnetv-" + VERSION; if ( !manualFound && d.cd(fedoraPath) ) { //for Fedora file hierarchy if (d.exists("manual/")) d.cd("manual/"); if ( d.exists("manual.html") ) { helpPath=d.filePath("manual.html"); manualFound = true; } else { qDebug("help file does not exist."); } } } qDebug () << "help path is: " << helpPath.toAscii(); HTMLViewer *helpViewer = new HTMLViewer (helpPath, this); helpViewer -> setWindowTitle ( "SocNetV "+ VERSION + tr(" Manual")); helpViewer->show(); } /** Displays the following message!! */ void MainWindow::slotHelpAbout(){ int randomCookie=rand()%fortuneCookiesCounter;//createFortuneCookies(); QString BUILD="Tue Oct 12 00:58:06 EEST 2010"; QMessageBox::about( this, "About SocNetV", "Social Network Visualizer (SocNetV)" "

Version: " + VERSION + "

" "

Build: " + BUILD + "

" "

(C) 2005-2010 by Dimitris V. Kalamaras" "
dimitris.kalamaras@gmail.com" "

Fortune cookie:
\"" + fortuneCookie[randomCookie] +"\"" "

License:
" "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

" "

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

" "

You should have received a copy of the GNU General Public License along with this program; If not, see http://www.gnu.org/licenses/

"); } /** Creates the fortune cookies displayed on the above message. */ void MainWindow::createFortuneCookies(){ fortuneCookie+="sic itur ad astra / sic transit gloria mundi ?
--Unknown"; fortuneCookie+="losers of yesterday, the winners of tomorrow...
--B.Brecht"; fortuneCookie+="Patriotism is the virtue of the wicked...
--O. Wilde"; fortuneCookie+="No tengo nunca mas, no tengo siempre. En la arena
" "la victoria dejo sus piers perdidos.
" "Soy un pobre hombre dispuesto a amar a sus semejantes.
" "No se quien eres. Te amo. No doy, no vendo espinas.
--Pablo Neruda" ; fortuneCookie+="I will never apologize for the United States of America. I don't care what it has done. I don't care what the facts are.
--Vice President George H.W. Bush, after the Iranian airliner flight IR655 (an Airbus A300) was shot down by a U.S. missile cruiser (USS Vincennes), killing all 290 civilian passengers..."; fortuneCookie+="Man must not check reason by tradition, but contrawise, must check tradition by reason.
--Leo Tolstoy"; fortuneCookie+="Only after the last tree has been cut down,
only after the last river has been poisoned,
only after the last fish has been caught,
only then will you realize that money cannot be eaten.
--The Cree People"; fortuneCookie+="Stat rosa pristina nomine, nomina nuda tenemus
--Unknown"; fortuneCookie+="Jupiter and Saturn, Oberon, Miranda
" "And Titania, Neptune, Titan.
" "Stars can frighten.
Syd Barrett"; fortuneCookiesCounter=9; // return fortuneCookie.count(); } /** Displays a short message about the Qt Toolbox. */ void MainWindow::slotAboutQt(){ QMessageBox::aboutQt(this, "About Qt - SocNetV"); } socnetv-0.90/src/images/0000755000175000017500000000000011455100156015407 5ustar dimitrisdimitrissocnetv-0.90/src/images/resize.png0000755000175000017500000000231111261401573017420 0ustar dimitrisdimitrisPNG  IHDR M )sBIT|d pHYs--; tEXtSoftwarewww.inkscape.org<FIDATH[Legfwg˲\ʂ-P eD6yM->Xk &M4ƶIզ/Q,XTD(r۬n..A\Y?9ΜbfQI#z--cICN79VDhNY OP^2":-d/.t^o9f~ HEVllzkzuŽWzž翑.y/3dvo>)3tJGP/r6@Dzf)]A~jDp8FFo=̭b:dC*JV .>Qs "+uI٨Ȯ@yiILqe+<؀Z-ܑ[(7=R 6 zbkZ\X R#O(Gq@pv`t̽V>'QӸ҄Eִ$(30|Eņ×Q\̡$̼ 6x +!zok>JIHd\EVSUFi"%YXe+@Dj&f^4hnyٷbuT|03S+)w'odb` &̼AĚRY ܹh0횸qHoVxj353__-xɔPP74p_G>~vdu!X 3{@(.JʘpfP ƒ⍇b3d3`p,F()gD$ DT@fkRԂZ@ J}1k`UƠ'@ xT05E$TuκXDGvuE;"PwT{-P`ै:U[PhBD<3(sb-bH} <75p.C^[Zp75јqNaeEDdGu;8`2%[K&)BNSN/wR8xd+h)GG 8L*b ;dWűChyn093CJNsHQU-k U%d"^801tU_vokIc>ϟTOިb1_zVuIENDB`socnetv-0.90/src/images/nodecolor.png0000755000175000017500000000403011261401573020103 0ustar dimitrisdimitrisPNG  IHDR szzsBIT|d pHYsiZBtEXtSoftwarewww.inkscape.org<IDATXWkP~wY]...( *A(oxS;qV֙j3mmEM$ډI'&֚Ԫ4QT  r~e/}?F g9y=̘̈H`"fG웙$B/usIP DDFB2NC[S >nDd\sk3Rh2>?TT6}) s"#u1}Wb{պP'_[[L8v3,j]ϕ +?} &.QUX|ԾZ!O HH#҈ȇ"k3Lپ|HӲ?z{H1#`x p؀2zD_Eq>A#(/?64ǂL"|):彄ڪRuɳ ;v͹˭A*-w H`J*q {*1Ձ8}9-΁w ^a᳈r PV/lgf'0V%Ӓgsz=VvhMC{Gg%X(;jXY+jhltbOn8p}GG*= "cI-ӦaJ0Mp0s`4۸1%7/o8r>=/`Viup"?c5(q@Q!+ ( i^BwBkeRScV)F#bf~dV݂>Ž;H$ɲ(( ( M]pA0PlH &AK&f~5>~?PUnԩtUP\ݺo_/uTшdYV+럐&}wX:) C"ЇhK7[%} 7bRV1r35*{br9-cʨ Gb7K’4&kx E x c:@.,4ҧeF0alЈbNuBeeݻ Jև oė]D^U,!&7;RiK0RzKp+8p'1$=uϽUaVEG$C|笼`" ia=f\/&e3<Dx̶ᔵw_:_Z+2Ѫ3kpAqC#w,(#'$d^ˠ7AU05)rk.h_tok_?r nܩukf,$BV$aj\iwblGXRXU((S6ё%r]u{Qs]fB"J0 7wY8?5l=ŅU ["5VbUvƙxpsZ҂ 돼Цgzf~ޟcJw TIT=ζQg\~-&^,&Rレ(FW`1C1cCos:^gf0sE>.<ҷ9{' |`X՝c%u 3OGvTɖzAnt˛)Y(Vlm= U M=;cCIENDB`socnetv-0.90/src/images/circle.png0000755000175000017500000000160511261401573017365 0ustar dimitrisdimitrisPNG  IHDR szzgAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxW;hAg.ԨS B,Dll Ie`I:DD*jHXب!u{ٝ}16E>vwv, vrHcW Hod@c3SIx.Ia&"aD^WA:Y'ܐ1y;\>)2t)U=XZZy;7?pCBǕnGOSNey>q%?\<:|Lgtnf%ׅp+OH N>WzwI`q0L ,=&;DY[f7\/8R$ Fk:SSC(@u%߳Ӌ /K$aM^2 >Zo(%Y PU F ' ])pؠ&TT "䫠)58h p0:^ׁjje)&khXMUAke6-`HQPE69oR[I-xqY\E^<#Ōidh%珯~vgsPe016Mv5aD3 D.Ğ#Cgc([fr圳瘈OJFD hA=FH"Q}gs|yXtysc/& kahUZ) Qyu ĥJKXl&?ޔ B H?n#a3qh_݊[9:'d7t2jHBGO]^:UIENDB`socnetv-0.90/src/images/back.png0000755000175000017500000000313111261401573017020 0ustar dimitrisdimitrisPNG  IHDR szzbKGD pHYs ,tIME *IMIDATxŗ][Gwڬ#.Iv6P%6{D " )/-m +CߪTBJ""%* UԈ .]lM^3<ڎl 33yhx.PGA(ٴAw|tZ},L$X@:8K&+9K?0vfx%!A"8;%>@فFj,e8O[Io%|?'EDۚR}[L'5鴿ur= yx`MFh;<[gLn.,_XWH]ɍ;vle}nvl}QZ0rh>5P!gYdT3o0ϜTU̕9u$;\Z>5s$ >v]sCӗ ~u$?]oMr(C,)<}4 ل6sZƵNG{/P(`gJfҶ[f,rP 4-^8TX:GK6a{ˀm}]abe?Z lٕWWJ咋BfF'k'Z  2H*Yb{Ӎ?/u%^XqpEjn1bfA`jM(>VOrkWWs#-h@D=@ܥ|O=ݢ<^&] "؍$ȧ"F2Ru܍9Q=FsJxnk( v CzJCz18kQuz.ς@yY@aAө>ޚCg]7hM/]ˢw%em8^.]t a 7yčv|'={-X<AVOH_(pOG_9T_(mlRT[d2f_+oO $Čvq׬D旦ow_]o\{S&Pl>] @v>G荺mF]bGv>W7t/z ɨϫ Ǘ5vE:Ϳ9*5>)Pu>>.Ĥ#DϢcQSɭ IueMx Uj_Cw 6]PD T>{M]G WK>۴X-߇m (tښk{1""{I /KP2a wjV9 az2`p6jN JWIENDB`socnetv-0.90/src/images/diamond.png0000755000175000017500000000134411261401573017537 0ustar dimitrisdimitrisPNG  IHDR szzgAMA7tEXtSoftwareAdobe ImageReadyqe<vIDATxW=@~ɡ"{VX*V `!Ux`ai!bca#Vb%Vr"Zpxwl6&$&7wBk|_ÿ́xr CyM,/Oh\O>0OLǜ1% C< #?{b` 1Ol836i}k5?z)⸁8AˊૐC1S( aΓ6/ %DN>{~q<|Ŝ(%/CBI ,@,.^YiT!X̽zUa6qA`[PakGE *mj.}kz A5حCqiT}񳷄繤Q-E@ I\]Cwg,>*M4\/H0 6 py}Dwu獥[۾{` -_"2v45q8,._"MUy&{i\1p Xt7]UL%W9r6+U8xFv(q 8ZD><b3R|" 5v{ ~ёU>)ґU.$q(ƍ2d&rIENDB`socnetv-0.90/src/images/connect.png0000755000175000017500000000151311261401573017553 0ustar dimitrisdimitrisPNG  IHDR ꂣAsBIT|d pHYs-5tEXtSoftwarewww.inkscape.org<IDATH]HQ1#[8 ISë "C* $/ nnh H- )dӧ ?Pn8y㜣DTRʨΥN/_ v:v ^(n"xM o^==(*B*T?,Bh}Pk+ ݵ..JK 9lشfYYL&L33|'oiypk_66vb]Jj|{;pf`AQJ]3\[K_u5FrX#0=M pT8)"2R෈hmxeH\v%`@x ֤ӉP ^9YH88IY>R|` cteH&sGs} `1,])ڀ@RJ8ds%m,F] *v0QlةRJUTUVͺ:r 49w|;0bH=uGgg 6?pC_fg% LLL(`BBB  @ ۶m޽ssf  @` &*|ԩ_7o\MM@syA @pA*Ι3?p 3իW/\𿭭IINX0222``pm;zΝ/_xӧO?~Ia h`, r-#%K cǟ??{ݻwϚ5yO>^^11j@ʪĵk?#Lap&%?ܞ=_#oҥg̘gϞ578;!+_q˗_z5إ  d@@YO : Yc\ΉūV_L ˁ̟?S !//o(`q{s6fd  ]pu[_i@WX 2e &#򿊊JP`YscΝ7zn[@.] ZP tDmm`qpd.@ ff0'ڵk3(#,[ l… 2t"0x@·l/Pq@`vc ʐr쮀2(,Zܹs SKAWUUE$@ 600l ɉ ""M6yd+a" Rmllqߗ]v uH W*e`[ '3">vH~Y2ϭB9DQ臆={XSR,::NI1>I,`]YSMM4 1y`Ż?ū)LOϮ׼tCO3@{=.4W S2^5C`\&K|H$8As''H׻ "U77N,V>V:q,k,'6?F}oY1~ Z{?0L(CF&e-,!4{Z;~m$~CF=5iu?PZlY]/sq 1% cbjC'ݼ-Ӱ;3&SXO!,CPF BBsZ*tȼE lϛ'Ào%Q(/bM$"R-BySt < ] /yƪԳs LŔbK˫#7G<<b~/=/-:C(QNܿ}3i 3Th58 X\3>GelAC'b ER$nPD΋J~ m['Ѡe")(Ȑx5 >c f]KcNzI1N[;|%jJ0("3 t.| J*qQF@7 jH7'@L{RE qAAͷ]lC(N#KQWHoXQG `4QɫgA@?noiқ*/ru)S)+vQŕky8n3cjs@"mDžPt +4X$ |J8aVU;:!z/]&o8=cn*F׃H:381 ^QO`+] 9g=JUmCeS@%`+njǩD9|6ZZ8/95j'zLIdnFڍv9,9=NrG ;Fc9=pOJnX,P(@!F.[! o<<5iEX?7Ǎ: !p5U!4[7*4nI:rsm$Jesp)>|c.2*\"]~M 6tvw䈶"I m2JxLKIõ.|me6Y\Q{ %&6ǝՂ^NEXx]\UPuTA/ rjQCO-H/5z-Wxܯ\u˯Ev2g`§ҩ;P 9 /"mak^2/f_=IENDB`socnetv-0.90/src/images/diameter.png0000755000175000017500000000263611261401573017723 0ustar dimitrisdimitrisPNG  IHDR ꂣAsBIT|d pHYstEXtSoftwarewww.inkscape.org<IDATHYLTgg2E@$X* * ʨ,a1Z|2ĵIM>uIM1RӨ՘V0TR (Xd8p"38\hzpDUHRz:''v3˗֦ATuOr2qq00|OOBL|&Fo/O\.\.  #?fq,qyTnՊ7 03D."ɪ"4;["2ID DdMՊbhLHƍT45yʓ}F:ҥlkj勷WҞCѸb~=3(%%rF۸|9_aw,xs<I].z{yRWGo|Zn+"DjXW?dE= }s.q~{c`!_ss$/e|t,"'q~KUDZ6.Y"n\訪`ݻ4{CEct"? cʁ ji0,>9 \S.d#kYxTCUMDwʼn@ix4r`m-=--tV>0;~AEPs'TVE$$3SPfȤ54pzDUIMžaf>* 8 $Rd3^yE޽8v-,7a`tvbl0"(6X6 S _a,Xڒٱ| 5&ffcyu5]WW,UUjiTS4㾱p[<|ܥK<{\UϜI/;g9NjYmY[X>bEd$S::h̕+x0,}rKIENDB`socnetv-0.90/src/images/nodein.png0000644000175000017500000000273211261401573017377 0ustar dimitrisdimitrisPNG  IHDR VόsBIT|d pHYsP)tEXtSoftwarewww.inkscape.org<WIDATHW{LW TD#k-P`T.꘢Y3bfn3fN:c\ M|cP/R @J[(gbZysw1=s,*pO'VL-)~F f'e{ןiЪ;2L +0Ѵa4`8#$x{&%u@80"Xw9Rq?^.! |0Fi+orlx)F\eC3Y@D.\R空LSS{ fk<,`ϫc4OuW.7`*Ŧ6֞՘*CҀd<7MLmým2$"YxLϩϕEF`4?$7<>.Xj͚91&J"Ѽ%¥sFxz:'1h^o| uukn13j\@@5c9mRvUnq@MӏT0?i{ZS~SD @Hf>=< D f^AW&O4/WH^wJ[1mA!̌Y};.6#ÇQ/$Ml65ab)hCz5ek3 ]#:&t Jn(AHnt|}}~@DkCE"MDLDGQXdhw%@B>lmVeh.hJ@`13cfdTИ\FEadH#w'n Meboe[N" P @*3 3[j|*#T*(ˑ^Yr"}8 6@xWh0xO6Uw0Tcgf&"ɭ[HbQV"JDDN 毒%?%<V@hi,oSu7XSMDo̅DD2ؾI"7fFAa͎u"Rrr䙦XҲPtu?p5q&'YoHEnyN f5-VF\f甞ೊxh?ƽf#(*g2A7"sﺆqGJi-_H,1nEb㝍>uKWW'gH/OQݒ~k3ゃ yUGG+R䳡Bkn7l.\`K~X0&wQؘ FΠ%>ϚϦ^ /z]{Hi-aӽJpՊS\+yV|ܬK{KjIENDB`socnetv-0.90/src/images/socnetv.ico0000644000175000017500000004005611261401573017573 0ustar dimitrisdimitris@> @(@| B*%s,`? ~-_4?24L>9$!{^x 5<-&o~Ny99vzlD@ %q|+bNDmWC 8XcN/]G"z$tw4Q,M3 $twOd   } ZX"y &qj#t}@3\[ 8] P9 Qc'k[5F/utttuv}zz{zrrutqwtlkkjhhgf*da +00 wS&ut3Ps.VM5D"nzw- @ { { < $t33.P- h _ya9 |  u5\yg$SV/Q& w&p  yy7o&   /a9} bE|u~ -Mwh  xhvZ({wt=Y  O Q  KGvs &  ?xv n}G  % us i ;Yhi_4 l ur@  {  6|9:~y. |}9usKwp& rh\Xz_s )vtDv iz z*    &w  rq]  zr    }f| !Nf]z )s\yoi,    =bmsNd* z_TqJ}/8  { Eu&|U]xD{lb K] O<    JN ZE`rYsKe6G%r|$u~'73 F~+  }   w|  2t1 El2G$u}%r|6G/Y(3T#w{R  Z35T   Z59\ |]wa,a/Y(sk| z    v   u )pu }  sr    |k s   u yy   o  v (knGs= y    z  r4yE(kn&ooKQ Ivtf*.e    e37_ pzTIH&pn! cWsR y {y N!Pp * Y_ z3qn"R9 JF  P@ HB)xE| Xd  Uf d` w |  hj"s `Y  Fwz >Z,sv7e&  8V5~y9m7 qlP B |V  Y$xG   'i  }s@ Dzv  p / q   #}Lti %q~B ,mAp  }$v iuO\yj }  ~*mys 4b  8zx4 i  ll~   cy`aZ~   * ly T= H) /8 %NGly } ,mxO S{g. yk.LMB3tQ  g! n'   ?` !s j3n*4"==++-yw:A  |   MuHwi$_V(h`evTqG s $nSoa  1X4KJIGLFGd;B<P421184>3-4l52///0V"zFEDBDFLOyGJPJOHIM[SWPrVTQQSUXI!|#y!n af?b v*|M "3- -Y99 }!x# Op ? %dY(me=30SP>3 Bt Q7Y: 0 7%/XW.\_<< 8~w&  27{vF hx ,G: (fg(hw/WT$t{B*5K7E 0W'??7=?w?socnetv-0.90/src/images/sw.png0000644000175000017500000001025311261401573016551 0ustar dimitrisdimitrisPNG  IHDR szzsRGBbKGDMM pHYs  tIME u+IDATX  NbNFiOmAQA KiOX8s OKK Ojyjjyj  jyjjyjF f2";A:6) %}<Q'z2mκ~J]J ? *˪N%r m-(  %'Vx9 a TP^/'E~  D ^3Y|wJDž2~qDA  ! 8@8 t?/"oK tto})&&/AQA?  H"*ǹdz[^^ <p?#_ ?PP$4**7|@@d )%9 0<9й ShSjyj58    %"  Ʒo Y0--]u jyg :J~dl&%&l@@NX$eqDUDL hE 6 UIt ȸk  " *^R;ܱ\  P#K$m /ϴ  & 8Q I1Vjyjߨ. 1 ȡ#?  J]J ?κf  @  JɜPIENDB`socnetv-0.90/src/images/erdos.png0000644000175000017500000000344011261401573017234 0ustar dimitrisdimitrisPNG  IHDR szzsBIT|d pHYs<tEXtSoftwarewww.inkscape.org<IDATXWyPw@%b-axKǮu+2ng[tjoi;㺳C ԊNJ:c]Zd.r! "D#㾙L~~C O@D<$KMTOTȾv uu8R[{4 ,z6+qѓwН~B>{ ``BpgSH=~u\ 9v;|?~a:ɐfgc3&@$#""'zr9u1˃~֎O8qMM-Οǧn\_c{ @ ̌B0.ZSǿOx'sx`*lMI1ݨ(71g4GOCp^m/5 3_{$wQrʤ8Y O|l|2=0k)L284 t`2hIaR fL'.QV ~>CWUaC7鋘%IA䭘P\FDDtwmvF0bOnIHOG kAvJz𹧒]s_[lO 0\f~ojIѴ`i-^󸈲Q0wTK$ZJLxvZ;GWFDm-LDADy\0,3]3>WC"[?{H1lӹ24iY@S?3CBHnP:q{pI8uuo0kt "-hԸM Mǎ '}R1T*)`RR5^_ QZV]^Ve\L^b'@ Nf%&Ҝ |"06oF=x%3ЃDgjui_ ߶46Z>01sPJ>vDېG\A"_68 xVW`6bdt^Fq&t:ߋ ;r\1^]W1k[R3]e.'bU%3 ekyS3V(z"%'CӃN3bw^L>wʜ\'UAB|XLk>rgO4" 3ҋSm#@u>'?d2w ܴX :eE3¦'t/z.0;}xA>dg=5Uߡˮ46`a4vU`ܯG^ ??Y[d,SDibTU7aLWF48 ͽn)7uM]nZSzd/Lu#Gm6$RI*^9 jZ? u *y3)-Excn4< .{|鬍kynjaiGn /CCY"o_ŞQH` Z(&]~S==ڈ;!!;zoZXҠֆW &]  އe3:5IH+  (% ׾QTf oaEC,FF) "'$ DO7B g2ehtJgdA ,. +'#"   Vܟ#w&76'??%//  +,&%N%%I+.SDE):9#y ("  q wbDB,dIF* <9#(%   E .;i12!(*,)30"   ҍ  % 10        ,7&!+ E_ v  " \     e',c ('   ?1:-  ?3=?7!  %  +$    >1    &. H;!<- `  ) ))'$ ;#.>%N/0    9%R19 V1 , r 5 J C(  ' " 6 K_G(  .{Z     6  h܋^  <m~ z( Frʼ!޼(Z$2((" . ! <mnی') ȧ^#]Un% L+% ؈"rގ_ , & 3 o6-lIENDB`socnetv-0.90/src/images/net3.png0000755000175000017500000000321311261401573016772 0ustar dimitrisdimitrisPNG  IHDR S4sBIT|d pHYsrntEXtSoftwarewww.inkscape.org<IDATHL?{^~^@A)bEi éE֦Zu&iԸe]ܖئYЭY6t?RgIZc"prgbjw}===UV{;/.2*))Q1u/7-vbi!U7W.\@k\ߴaɎuZ-Be5ΚҢTU()p_A,U2~/aj]85#)F"&Z^14◨H hkgpWܲ;āgQ1?ªJW$C*1y ˬ6aSD= Opq~+=+6{ǯduw^x&瞕wEWML]ml~V5>9GXI3f~*Vɐ~_D"/"ZpMqǰ0[f=!-=w}:5P/l^bTt\1@mjێ)Fާ큆g/^xDD8cc'`U:_l)b@q.ec>LŖǞ:l`m 1??+" D$'۟۶ |zzseK?Wp,8XV  IKA\4TS N[$C*36+UDqIdK$K&aIR% v%Ʒ-y)+rWd;F۞$N6=35rH/yڪ ! INigڠ-:1iC09F44Kvt1|/Մfywq 1 r\wN5^T &R{sS3݁oD>8Y705?IENDB`socnetv-0.90/src/images/colorize.png0000755000175000017500000000350311261401573017751 0ustar dimitrisdimitrisPNG  IHDRw=gAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxb?-@1b< +``db`,dɫ*&-[/^oo^n?{2E P-fS1̐4S+KԔ[ Y߮exq0G'سgs S`8B/W.1>Y2 \2 1000p00\~R7y l`Vn$*>Ͽs/34 GIXzMR *d+ }c` {6>cS ~o;@wejo V! quS&g,>>}G ^˶>9(okX>/~`O)I{o~f,qH2%o9!ba`KQ򊗾kO d8Ozܴ:Z?0b` ,!1 k320 h,!Nq]3]KWV)_ӀAu:߳?bc`fV` X9~b`a` u 6`X~z .` @,rʼ 2(81 }DU們0B0Ȓ| 6_N 0}\g`S ^2z<07`p<B_o@0rPA-+@`xaE9Č ׵ $>q)s񲂃? $3fX3xAN ^q _3D<óE3oo~{=TN'㟿 oz1<{3Ó =d0Zq a3|S 3eX @j#`x(+05'vOq-//2H2 ^``Z.Çfc8CϿ @ b_- r32q^fA{ j`ed T{X./BT#)2'39td`gca`?SGRPm~ 5",CIENDB`socnetv-0.90/src/images/circular.png0000644000175000017500000000410011261401573017716 0ustar dimitrisdimitrisPNG  IHDR szzsBIT|d pHYspUtEXtSoftwarewww.inkscape.org<IDATXyp?~YHBB=@ e+RY:X@TbN 8PdK2B(İC;# Z3w~=|={*?MxڙMC\,忶}s/L₱iC=brMMCD@TmFCtml '?SU'۞ϴ,5,K 4**4(yY"-]wԻ 24 ==zHqqeOY ˲Fq"ZQQQU0S^{F OݲEprd M@DBk 4hްkaѥ_~kGE5z2M_~m-msDo i>q@?,wjί^ѳ#"BFx0h 4ӟ> %b J3q3㉪RrNs~MO.jtya `\wXVTd=. 9uJo߳l=#&UD\٧OlZrd8 @ pEd SU|\]SO`f5,%%2LUED4:c8VD; p\ئGU@!qMS\.eĶ 2vTEEU*csCEiVykn>QGDU=E1}Us z`ФqZl^RRYZrzwg !"l >UśLD"`:|g[4H+ > ,]n+0{69kײqfJD`Z A+ar8(@DO~U7&Mc؛^Tt50 T 3Ğ\Th("Ȭua^-"|/_)"mRR";^δvψ `:te]RE4:Uz]XtcvIQ0m$ h&>7Eu7m@+R֍#DDnaI81QU:wj8sF.@|jDR~`40ƻXl_Θo?y{q9L<v+T[Ps 'xB#w=շOFF}FRÛgtԓ!b._ `p=cϟ1dNgte'tͥĄ63))rpee-)5(  "   .    8! bQc 2SO@    <'wSA&-++ cq+ !$M)  E1 -*!T# XF2%< ;Ⱦ&086F! ׻: #"!^Ƣո?cšžR x0IENDB`socnetv-0.90/src/images/dm.png0000644000175000017500000001032011261401573016513 0ustar dimitrisdimitrisPNG  IHDR szzsRGBbKGD pHYs  tIME  }:o"tEXtCommentCreated with GIMPW+IDATX  kZ?@QJ+PUm-KET}iit 44C644$TR|4444?>|%k?+CuJ+m- ʗ@|:IENDB`socnetv-0.90/src/images/distance.png0000755000175000017500000000252011261401573017713 0ustar dimitrisdimitrisPNG  IHDR  hsBIT|d pHYs{tEXtSoftwarewww.inkscape.org<IDATHylU? ԃ4XJ*)Aj ( &b"$I4hPbJ(B)]B(A=~ղIfތ*hLSXȺT2|>.]z/恡HUոU9SVF=0&֙8 ~ #Ct^|v;LLH"x /vafCgv|YS)jG;qĪU*s07 4y͑+oY6aSuq^{U=(!lRU?| دw"d[3Jg#Γg~!G;Ǐ?p\;zח.=Xz V|*Yxۖ- Ql`0`X6n|g  $"Hܤ ǎ5Q`0hZ'ͩN찞&"E<v/"CY,! X,A@ 0 HYE G/e$pQ@n 3MVwt\>#odq!-99ҋ ׮].OǕ+KK`CV9:PHDnX,\$._Vа]u~SX8m8i/?"hUժx:a2K/ĸ([ |BsxzPHl %icX| lI"g۹ADT`%s|NBՊ֚66j>~Vz <8BDd-/9rصӧ?I~^%[L3zQSVN ͳ˪z0~V9"JI!;ղd݇s \Wz5|>|^/>^/ӤW϶mE5y>j O%%i@x}SSW;@hq:I$3k n/޻\Q{>/o^DU9DDFe  Uceǚ5,+*"rUV! a'>v8"EL})?ee͆rQܬG+*b47oya0uuuFGŋz85@ݝ;鬩x(xs ʙ_1ADr̙m-#鱝2IENDB`socnetv-0.90/src/images/net.png0000755000175000017500000000243611261401573016715 0ustar dimitrisdimitrisPNG  IHDR ꂣAsBIT|d pHYsֲ4tEXtSoftwarewww.inkscape.org<IDATHŖ]Pe|  )@yQ~:]_!!MdT3 cZMy3I4cMYڠ3Nڎ ˢ.Xe̹߭x?9W`nd,DKKMADDnM̦;{i]qֲg}GT͎*^T+@2`0\6`#Vk\4A,$D?ol[mytӾQJ5+n[vu>t?t_~/77e XyD,^xlvEI ^ ԀY?}-"~CRj` e2,_t5C)ޏ[V_L%%hh7C8A~GV32-fMNNj x?SjbH+@उg +0"R=oo"*DdXlPW_M.VU} d_FA)2yBDzN6wUv‚ EnۺhiF$zmajj&[m6>yi<] [6n.=|gK!hIw6`SlloH{ =IF/z>H)""CD6<5',$..k)#+8QJ@XRP4/wewjoUQQe: -TRy_rd>LNV&O>mmǎ9@]6ק.5ǏsGh=tKR&OLlƓ^fstهkoW=GZsTTǬCxHssҢw*hl#_seVBELNe tz?z+?E渳3p11z FD*1^O.Wg'fo6p< ee4-~0//}dY`:pxFwK2o5sׯćiqƊ v(PJ5{~>-a;J2ro,܇䦋]zZDx~N8_IENDB`socnetv-0.90/src/images/avdistance.png0000644000175000017500000001032011261401573020234 0ustar dimitrisdimitrisPNG  IHDR szzsRGBbKGDH pHYs  tIME  1~0tEXtCommentCreated with GIMPW+IDATX  ,+.4Z]&|%K ;&1:#. , \\ '7%VWNM'?+'\\ \\'T K ;;&Z<we%:P# NM'\\ &**4yM 6 !P/o^ %%HZH fS{L_e%:HZH  ˸N; f5=5$($;VS$($$($#K <\t(3F3˾H5su  ybn |%K 0[#}:#@ , \\ q-Hj32,32,}8@[ 'TWEF 7;&R<I$NM'\\  A*@0 #G Iͼ(*OIENDB`socnetv-0.90/src/images/remove.png0000755000175000017500000000406111261401573017420 0ustar dimitrisdimitrisPNG  IHDRĴl;sRGBbKGD pHYs ,tIME0qͫIDAT8Y7*;a/ -"Є(L;?IMJ:(B5P R   R9, qL;4 P3!+$   @*- >)5(  "   .     | 5S###)d   ԫo1>khB!uN/ @/b(C8O#'#0&+>- " 8  ή2! #$(*+dUU@@K&"/s??|@'"]))O/!+ 8< $|%T j/`( 'H}IENDB`socnetv-0.90/src/images/disconnect.png0000755000175000017500000000161211261401573020253 0ustar dimitrisdimitrisPNG  IHDR ꂣAsBIT|d pHYs-5tEXtSoftwarewww.inkscape.org<IDATHQHQ3[bZ.+H0Ӣz饬I) E^zR$,H- ZBG&4K[wǽ8sU"C)eTUqdo~>릦 9ˤV.E`p"8n[q1;mKEzfuI $_p {^^j]v6٦?}eO:nlaǶ6>,- Ēj؈/<&y("(+fcd.voD 冈pz>0#" ss2 -!2EzZ`p._Z;ZI:1<Z 5\NKDƿ`VJ[>ȏ4eN4\p4!yiqd}!D`SF>Sij~%·R ,+@lk} 5tk8k pXH!Q 3E@*a|:WElJDPJJ9{77Xo/NG%"-i jz?fc<&~Pgk m ʜ!Q^laawJ"5鿡!*uwS,f6(WiS)*P)T8hp`ZBK ]oUʴ4Rx Iз>R}mV:ֲڥ֠H;5.)mB4MNቬiY֨SykuO>ڠhM=+IENDB`socnetv-0.90/src/images/save.png0000755000175000017500000000224311261401573017061 0ustar dimitrisdimitrisPNG  IHDR szzgAMAOX2tEXtSoftwareAdobe ImageReadyqe<5IDATX͏TE{n@FM4DHČL\.M\kXÎč΂htA\ =`PQ` ^` QVR{:ԩz~6>>]vN5ػ」;v<:̗7XSڠkg|p?0x.ory #ӟd}k@E@xp,#˲m00aP|#%"+Օs΃* ,I Iw:琷Ղv+m(r8 㯼IkFؽ{k놮ZVmQg5 ,# /#&|#!Я'aa%% 4M:ólc V_)Fara-р: TIO4/!g iXvj#wPE x:Tx3x$wh6h߱R^DM_ 8ňKvRPZ0}@Ű&WU.2p}Ʉ-Jsf+7QW?תd~')Ü wl 55Y1{X0+WVU!ѐS,-޸Wj'WڣU<_o|w__sl}5ځ?MKFIENDB`socnetv-0.90/src/images/exit.png0000755000175000017500000000273011261401573017075 0ustar dimitrisdimitrisPNG  IHDR szzgAMA a pHYs )ItIME CJbKGDUIDATXWkOTW7K|J[HtZKB_֠@AX!0<ûDAPã ܙ( c41-U}䞹{bRSo3=gݷe}^a?.n/:qk~L G~"8{`I{v<ز֌3`5FR,`I+0CCaRD|d"u^Ѓ&`0ANc˚&W6~W-/ EgQ6mg]!zz_?OFC9}qG9'|?@?O?]8;r0{IL/|85,p`5@kLJiZؚ+nES% +d dG@W? hn,"u=q"Y j'i/4^Ϊ+jH{LMZԾ7?2`D~殚LxW Zj_4]kcO=$Gڐ:& Y~I:|7].ط(6h`j}a7XlPCVJpOJH _@ # ,{ZNJ92UK;_Rb[_c# p0&@v8p]t}>ZN4T"۫@@^׬ 8 <&w_჆۾&@#N+_V^ek6b돜 |2 :A9SYlۮ}~C60kx " }X8޾kS7652T$ 'i$CaB)8a̍ 4\r8xE->7o P6[ 'jvgfbӃ0|&^σMJ| HF@#L;{?SO Gݠ0Rd暊|B AS '7(:Szd|^NeU7ԛi,\}Z|TL۟ PV]v8wHBWUr@EC|uu,WPnLULEeTBNJG=Ί^dHpt ߎ(StJ2(J2&hHFLZN3v/q sM]IENDB`socnetv-0.90/src/images/view.png0000755000175000017500000001032011261401573017070 0ustar dimitrisdimitrisPNG  IHDR szzsRGBbKGD pHYs  tIME+ *(tEXtCommentCreated with GIMPW+IDATX  wp5-_IENDB`socnetv-0.90/src/images/help.png0000644000175000017500000000471611261401573017057 0ustar dimitrisdimitrisPNG  IHDR szzgAMAOX2tEXtSoftwareAdobe ImageReadyqe< `IDATXõiU]>N;)-LK@U!mQjbEEK>Ƹ%+$@R(`لvZzgs{z%-6Orr·=yyaAl[usfGuBL cLð[;boXyoup`JzvoD1c@ (cb\p=˻;EtT=ci}a6{ [fաʼn0=.!$0m11/;P*gw4hקx`D~Ջ0:BbRycLU d:f;:  H!l/o" wՆ{q^|6[>ƩQ5;e^PsB1SH@k0Kt#0DU]-ibI:m wy/C%o/^8Sr?9`Dhc0B`0QĈTAAܒ,JailJiIbem{~4 Xu;v$k}H a$JPTb1*Q^@drqݮ.:]"26D2L@"P!(qۢ7.OwO?-Ơ'{[ZlXRX2?g(~kbu׸wM:jP<ҺMW_j뺯+O !n  $3 "?T o;CR^J=d%6pKx-GY=曫b2&td> jOBKڸZǙWW(WB\c:"VIuˇ+3ĝ|O[ 0$;[~e{査I+@)$^T Ba"J_ |IlE+s{'馊8ubJ2>tUk.ŠBM- 6p٦;6d,"}2̣Ef|>p4GF#p {df6 >f8ٝWm,;RGd4FGH!{FPw\!(s~ɚ6qq>IRˎR+$tWk6o}rbxbw f|"!BVb5)d2{5 b;^c˵6_?7Tuޒ(.xnF'N\_(] \ ԖB쎈MA4U]1IT u(XR!wms\#ddY&fLd>v3KΦ&iK M>ϯ#۳u8՜!M9~JjsSu7l-*MR }2 "᾽EOx CWxgyKNg$N6083-+zb$s㌜xn \W3dt.cJexK#@yoDiM-K&v+)[ynqB%PNSb^fV+}E,n0\O Fˆb'սe^A:LT[F^"`xJV4?ZyZ D{q+9w}̫F8ۣM2tIǭռcL%G{:f+hZCȏisxϟrj(6[wyY%,f jM"BLc؁\ v^l|9O(0ԑG#A (\s͆ l^۷Jź2[$P -iI,x= !Fyh0wd-Lh7[1` V8@ЬWiM!Sckym Dz`­3㇂G֘ @H5sb &`D}fDvAosBIT|d pHYsS`tEXtSoftwarewww.inkscape.org<cIDAThśyt?ͽNA@D ʈ;qܪ訴u\jVO:q:ւ=-"".e č"*Aٓ{1dђs[>y_>N;ڕ%1Hla;ZܥsrwP1o?[oKyb}m̘ywfZky+iadvE<Ї88K4u<XSbAy :=[kI1?) 9{l{; FOh`ā?%A~[5*6~o k?@.P n6Pr;=P>~< |Hwށ)8"/]k{Xw Dm3EԽ?SĎc%#)ȂȊ@)pȳJ"3SBA| =:WdWO{c'KrO"tNseZfZb> YLcF֎}l40Rd Q~ .?8l?;Kp჉72y(?ڰn=`-/X|!df y)+*wNT l}(\(^ǁBC1#mJ jwو$~{](nE>Yߛm À[!O8= 3xUf(ab{M2Svf" )fعrDj)r|Á8dNdR&p3SJ ǔ}xC qDZ]<8_ đ8h9g;S6ežC\E@eK9q{n{߂g Bzn=.b]e¦s.idM Zhe yǞUh CB2v$MU|ρ3'<0U;Fjϛ<^V_S,M!5HA62[E|tD}G ЊB}\r1 O!BFHvF+Qb(,>A4s'")'®r M0Ij({0n-dhqXgL5J.ӈ]#BeB=` F#f XȲ `eLB!Kz!/<u;LE(4t|D@GV=;Y$\2[[3Q)aRo 5Mvȃ!`{P$mk(UFgѣ} sPR-pOy[|fr@kh9ȂE.A`P6fHKꑇ6]/D}1zz;FY~B2s8[BdQ8BTZd6HBTl=dbjA FS7b#@|d6^Xi#"|Sf%C6\ c& K^Y[BmRḆ󐇔6e4kAӢ4Vڙh۫%2d6=dZQA׶BCYnF;9vIh\5mG^ `C_a;"}/@3Di<[(s'Tsh[t{AB5ܞ&u2j wqsv"̶(ދBΡfC>c+I.sNQe&Vmtqt&o庨Ħ0r"mwQbFVlA^pUw,Qgd عvSގr6u_Pξ/k&k L}24y`;ɰ*,.z2owX;v]wlΥc/ A\O%{4/4#kJfxR\=b97_ .NZm'+Tm6W4*lWqϪž/6EVhrGnF1> xl{.cSUqNj+gts-Oto} Úa _w{#moz˯э]mJ~0IuV?eS˯G"08ot)Oϥ8Mp Xn5௽7eùjޤ^̻eҕ:~$'6puP*?R1mLUA}-O9|1X߶9BV`_u&BjHP;j%ҔeSxbmKHfG{IENDB`socnetv-0.90/src/images/symmetry.png0000755000175000017500000001032011261401573020007 0ustar dimitrisdimitrisPNG  IHDR szzsRGBbKGD pHYs  tIME +]F tEXtCommentCreated with GIMPW+IDATX  \ZI F&'  J G][\ZI F&'  J G][ @eIENDB`socnetv-0.90/src/images/saved.png0000755000175000017500000000111511261401573017222 0ustar dimitrisdimitrisPNG  IHDR sbKGD̿ pHYs  tIME +3HIDATH?nP{M"$H!ppPE!EHH_K:YSl;8̓%?[ofތ]GBo%e/n]/O8|u×_ImZX؂WJ( M%ՊjMd+ "TN Q1~]A;,B( j5**9̾X^EĺÛBxB4_I5#]hVDK?gN*MrccA[!<-Ր`^[TlN[_رө[x;HKu,se0i>T*JDLmJd ²9H͗åosLJs%-+_B5z*@Z4F@rJt*`ҜDpĶz :¦-I wP}lz7|:Z&zztp"4cc^/Ӑ5yV>mldwS|UGnYCspС:!yGGLU~U;pkz:iPTDL}=*"i]lٚ-[ٓ'ݵ{l*+H {NM}׍nGrr8bɋ8 b^~+3je%"024ҙdAr2LNLl,thТ9Dz39IO1e2miR l]~.~"2:A)u5+RS+u3~gl6ټ xųe #@|E9?-"2Iⓚog:M;"2MR*PϢ!vF;;y]jBiӮ˗& |m3g()#u}>RF=Nn}e'=i_/ZgZI3oV׉ub4۹HE*Rn^kUŋ;yn @08LRJEI͟qlqZZr1iL3a2-˅SBs<Ϙpx,AcON҂W{z #vB3"BI GvƌWիiNہ( C%ŕy9O~o~gƍoRyy63u [TEJmu {),ٙe @fX8SzPa^DwS[J8yWgKlF]uS| ^"wj=0W-/7LN2மnS 7~_ "GZɶXol)),6m%ŋJKk} ; c40J=㏇CG_W?ѿc6!N'O< E<' sW4ʾ}쬩Dyp?">,Ą39ϷXF?.QJܷGx^D @@Ѯ:z{ʹ>MP KAKkk~mX8ҹJ}o`zzTyyZV4IENDB`socnetv-0.90/src/images/symmetrize.png0000644000175000017500000000150411261401573020327 0ustar dimitrisdimitrisPNG  IHDR @sBIT|d pHYsO¢tEXtSoftwarewww.inkscape.org<IDATHKSa?(6؍nR$_A%TWB#FP'$ZXD b1P#F&4ŧ 7йәg}<($U=v:۩egi_E@DLuc4fS?=$v/";:xV.4냃$=ZKo/ߴYfbrj:;)UWc7  19IJOº`ًDxH!=?ϋNVhtnQB$]."2cQJAY̶zfguDBŁR-P"" <kj)p - l|bgD ܟΉ}d@) J_nan e7@3p> NJ*"y͙,cUr2`ȉ_΋ȗB><2ghf@+gyڛs@& CUW諬aQF*g|fF99}̤,+srHJ6z/L@C]GYjoU|p aB GXfRU]/\jq\XYMMe8?4DZKFD4OLDpVv8̦(g* R[J%p) ƀ4P]RKKR{HN׬h *wBPr~ĨըM`WD HIA$|{E!Fm\+@prY~9))rzXF*=eyTթqv{2"`4T{n` L]P LD.{Zte%:\p|y9D,ѲXDB+4qT2+ Q/^&ULc+KR?#"[@# @bg_afG=k|xZXXHlY7lomnY= 7x= KMEudRlNLc.8Oܜշ?lW#"b XU|cmg~8PSikS*IENDB`socnetv-0.90/src/images/box.png0000755000175000017500000000106211261401573016711 0ustar dimitrisdimitrisPNG  IHDR szzgAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxWN0^|  B:͓Yj Kf%';;]kr8 m Вn 4hdGZ1;cˆcc'yI X]*}Q%6~qCض ֬%iP$;T=wʆ Z4 em#N7ޅp𜅜;!$G{`CNK[%_! D-瞱Oډ"j@D)3=UH^j!@)xbi$~)CB Xϝw!P[N@r/s"T$mw!tk=sUr#j%a]ш=}>xSL\q~(1 T\Uqjh4;`ϕ%(%W84FnH7_J{=`LB&"IENDB`socnetv-0.90/src/images/nodeout.png0000644000175000017500000000276511261401573017606 0ustar dimitrisdimitrisPNG  IHDR VόsBIT|d pHYsP)tEXtSoftwarewww.inkscape.org<rIDATHV{PU `*,pyRTtA+gʘ|1DdjShcS I>P÷ .ʂ ʐ,ttoskoW3gyi&87L36/ӄκ6n'qB!Ϝ4]_Lo/ꮞA.^*.[W8"4>p='H$X$:D>& qZ^f,|H`PFe[y.Jh'[+࢙Dҏ+cO5x{M|TU_P~RRX~nPeooos4tfia!ZbrR٪s̮rW4PoC>Ѐ"SL"@DR)N>} _Ϡ /3c|;}}Ͼ͛!Hc3 Zngg|43Gfnx;W|%I'')((~f$ lY6MwGZUsC*薪pzv&x]E ,geQBk+ ]{WC>9}mԎTT=[764WXW2( %gmڐL#0h B|78}V(Uk BaclXf,(-_ ":-kK3yfn{5Rf=_/+Ҍ H|ټ_k_ZVuYV,VRp~yvS^ G[kwd닁 cJeO:䫸h@|o@"Wbbb67gg7] }- %XYYE#n+7!bԿum==]jc'F(QAڶj(c/g[X+._νVBQE 9 ^IENDB`socnetv-0.90/src/images/net1.png0000755000175000017500000000261311261401573016773 0ustar dimitrisdimitrisPNG  IHDR M )sBIT|d pHYspUtEXtSoftwarewww.inkscape.org<IDATHHw_;kQjuZe-4q6b60j`e4nLز ƪ,E,j-+eR҄RcSv:>y<{NH)ZTFGLtg'͵ZRzl"J⴦&zVbgM&RN匛dxgBFg6=B?}@7zUm&!hƴ49"~OJ Q2PΞ%#` QSCv;Jb"ǁE@ٻoHAT[q88vjvӧylܸAGv6xGJIXUUt; h8uFq8psT~)Q8_Cl,Y ݷXAUUt8n | UE11wOǛ_} 4CEXxT[̯ә(ׯӹlAtJJ [ >{Foc#ݹ]p"!Ĵ@>MIa^` ﷴP[ױ:f%]nkE'o2֧r2>kE33-^: tupd"5 3#"0?x?ήpVz:E^BǶH6=ʲ6*EI}?ݭp P ! V6U^MC08a#sQjGJ^ dl#q\c b )B~]K#Uu4 Lx<@#1ח99\￧9=/8ٳYsٰfw*]R S9bfRX0^rCZ~\Nͷok'NKKis1q4/[9mO3$&rݢEǎLp8,_&!D>Av#HQv20&RJvX+R$$d"(6,\d<9/v}D~ xb!02 ŋY |B懒"#"q<{22ŒPVo6̛{55ݼwRad"J1RWp0d'Zn)@dLpB44pytGNףlߏu:FN$~I_ =]fMHUWS(M_AhIENDB`socnetv-0.90/src/images/nodes.png0000755000175000017500000000205211261401573017231 0ustar dimitrisdimitrisPNG  IHDR @sBIT|d pHYs"":tEXtSoftwarewww.inkscape.org<IDATHALw??(mjY'6NH MD<]Ne  Kh] ;xY!4m,&hh-bk)è@m/~>~/+AϔRN'X,XS)#|뙈hfͺ:XH$Hkhc~~ebh3"2UJ)#wB<~+3fL& Q³{$TyoΟ" M륷 x;rmkkLx 9--kA3'rqa+L~wq0}"x3jr݋{7ޗ`C}xNhvVÜ6GkjXؕi]cn*$y8LTfi/MMzY䉉M|vӁpp BNlwu5vww+3F@"\b, jU^-G,=5wnK^^+UZSS $q.{>0 J2>|"vnv=!͇%.^ϞP!'_XxaGAbAͦݰ!br1>J!.Z]o5o2ӳ9:ݡ )11r^yZ&| ҥR.2"B*P)|JV03##ooDž`b[w[mq>[]011Sz^<}76~&I_SJG}_V\x띚ju7g,R%!dAˎK|8C#thbfݳgF5 ziO;cc2JM…bKOV[閎J15Y,.[2Ǜk`RiZMJ)|;@dL844tV\x<2lko?OR6&Z#  ir W'+?PB2?ςp0gb"0 mmG[&09y]Cq%Ωu;{uv){H`-MIALH}UUh!ت8Η66m* BeJp@7JŔu:PY*3ڏTw݄QB䓤e6S(CLHwRP4W>dvek42`<`FE!Ӕ,i egF D$_D"Zn |J^@=N=X1jtDkPfZZ'MJńmjmEYs ?aXlq%ecrbP(5!?|hb/ӺdIR%ۥRf665RJa 4:=:Pzxo|w47U%0!$z5_nˋabG^ߴ$xaXA LK˜q1"ƙ3{vԌm\>`-xtNBeUꎅӆANwPjUܹsvQqܶXj7(kIENDB`socnetv-0.90/src/images/plines.png0000755000175000017500000000214511261401573017416 0ustar dimitrisdimitrisPNG  IHDR szzgAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxW]hE6_m+,$mR/FЗBQ B̋PQ >V}!b&Jcvv2wgs؅?3;w79,Dw OpfM=p@X3cP'A:-X:u׃z/dKq;bC#[ZJ?=y~ l0OӟxhDt_n}`9_r+S';!ޙXW\.m^=z2|Օ20lތn2F#cO!#qeyyb\<-+ v D&GH[6hq3uA ̑<,hvp}̎?paZQ@->Odö~k=̖3nTtѷ$DV *  h^#/ߜ;r߫ e]58Fcp \5?u쁵 2ݐVJQlܮN0};DUm_wD ܏jX/IpAS7!R <EOd?΁pͨVp,eaTZ>hWf]P0hkƴf\HQkM:62) FIj!.? 0%ʟIENDB`socnetv-0.90/src/images/forward.png0000755000175000017500000000315711261401573017574 0ustar dimitrisdimitrisPNG  IHDR szzbKGD pHYs ,tIME 3rIDATxŗ]lWckfi;V! T""J}iX`ɭPU$ @H< JWN BC !%J)Im)_κ;;3nkĕZ͞sϹg9K8ã;@1 !E;RL!'3H|8F@ ۸f_n+":^LdM?*پ)U8\$<:^sjttMavkK+ ֬^═=ȧ! pw+%ǒ˛ǒyCqnNԔ#=ǁ7E`x~1{o_[S&|ӯҕ\-Y3߫L],)M.;)bMZcIR?i(hP |i`?r%Xzc-g^m-|-# mhrd'Wj$_*Ͼ<=Zx藋-ޢ3}+ˆ, uCXmYT `b$*ޏ|YcI0L-i*/X4t编q8n5lѕ ^͚΢iP]@U\gu_.9Wg8smk?H+59e 8x  /d_g[1[ʿ%{33ŗ(`6Gj}ůqz̀wZ <|[}"^R^ρ|2gžO`hI~UE!syf$Jr~ڶ-Zz6+? z|@oah*{]wٖ:TA5e t:h,˒LNfB5P_ҟR0蚲 /8Rk S̅%'4=<0 U۶gB۶,+v3.PٶQUtuHyҤI{9g~8HL &koq>d< js}=u飹Ǐ8ܝ~q7vՑW5ogN;Nց>~H\'x$#M*Xk1b׎׸)Q] vʋ? /wi5}wĕcys<0k/ d_^'1@ӳxu҃77MPRN&4kd[?JudZ v/1;tF,Fa02yh7 # ;좹Ph ]HDrs:>̆ޕfq .nzc4 u F,{/>AmpWT{`v^rm/KC忁-"VVr::uXxv4A Ը8-|-yRkUiq:<6vo\BpRk`6\ba}UŦ˝jmG6m `zMKhmpR &Z0"tGpS5l64 mFpȖ93q|1B!b*'XV?"K\#E@7!n5"Tih2@k-8BS/07FR @!lS=13Ac ;>1b)CDIP݅2۱"OƄ#_;^'Z Zɲf@ұ4O64@TD\>S̃,%La#Mch@=LD)M+| bq# w$Pݛb#Y|R ei{7r Ww3!ՑBG[k婢$[ja1f2b]K`f򩣆8XEh6J|Gl+6K JXuVY`8,|6)lAww ׊],θؙ5q.lxW -- QqhVS]v{)p 19EX-|X#u^^pPYXa>g~L~C*d^Ҫⲏc-UqZzSX:0+mwb FqO(u[?W(,ȸEX3,|c cNݰwĠZƓxYTU'IENDB`socnetv-0.90/src/images/sm.png0000755000175000017500000001032011261401573016535 0ustar dimitrisdimitrisPNG  IHDR szzsRGBbKGD pHYs  tIME &G?tEXtCommentCreated with GIMPW+IDATX  AAPPIAAAAPPIAAAAAAPPPPIIAAAA ^ ',yIENDB`socnetv-0.90/src/images/letters.png0000755000175000017500000000167011261401573017610 0ustar dimitrisdimitrisPNG  IHDRĴl;sBIT|dtEXtSoftwarewww.inkscape.org<JIDAT8Mhe~tdMWSiC^4R(XzH"$o zSO([!f76ݙdg `xwhh4H$b8uIXŚ]bPJ;???82}/"Q뺔eYzbYV7xRsv8rC=C} uR*P|+\A/hAc&Hd[yC- F(4 IPBmK[ m^9Ci |ɼo?,u2;ctjsHY$B:B7t$#hYYt]G)%J)#J[kׯv[\EJ0lMp=T6iqשtuHdGgv,q=\o4,@uN40<H~?3,4)ƛO{[;[(-}zp\pcDů̑) nUこwXt&;L,/LNE]j Q׽|r{kUb?8WVV_-ϫߎSq H|V&uZ9X';n3y/f}gzNؽ~R3gP҈d*3y͌g[z,ױzTZ[/d1/G̏RT̝}ZQ>)˨2{GVIENDB`socnetv-0.90/src/images/print.png0000755000175000017500000000330411261401573017256 0ustar dimitrisdimitrisPNG  IHDR szzgAMAܲ{IDATXíWiLTWv!b%R EIVMlihŲF,aQH$d"BYD@@}S6 $ b _Ϲ1/޼{s=yT.;/##.Hӫ%.VGFެMLj/6A+WJۍ|IiZhoGsL ӈ=뗉P 2ǑmXyc8dq[+F:`~!,шKKB%3 -IJ9"g(jGͨ(-1' N t;Tcu`gĎ:6 Hiꀄj lJhjꀯ+25D. pR1qPzahhx! PPPxxxLnڴivmcc+,,Lr\|իWFGG?IݍJ68p`u9r$O&Щ`C&}666s 0ykk(TY{Um VOU;aB*y`---ɓ'x1=z$Z gSىDsqJRwL ;`&H0n޼) [n߿ P8K?jΕK WLvv(d???899رci!&&HIIUEp01ϒCbpubqyxz 233 Bt]QdHOOXzLM yu21 4%+Wؼy+a7oj);c!"bsDy㜫 {KxMOO 5ǏG̹*9]pT[\3gЎi8;wJXwMEɹ~P߷hM }D4C idP?xaKs$N:jd}...s myS1DFНq}\WWc˖-rvE `mm=+97-᫩ 'O%|h6_|͚5fff#‰Rw=eس dQ|ޓ˗&55K֒TY~Ajžu֕ڵkw@vx- ŋմJ[vrI4Eoŕ*"u%<@[[qmVVV-۶m=ZYGG|aBOOOU@N(Ή+Y+h ,(D;ʕ+V^@Yp7" 5򵤘 ",Sre~TJGcIENDB`socnetv-0.90/src/images/gridlines.png0000644000175000017500000000203411261401573020076 0ustar dimitrisdimitrisPNG  IHDR M )sBIT|d pHYsktEXtSoftwarewww.inkscape.org<IDATHYUE_aaApdD B 0lИOQ#&/"HHB e5\ӷ9w^+UuUWUWIJ)-V gpqpgύlr)UՈA~#}|)1o^W؇gD"vb U]0 l?<[N5oQTz psyn,=#${Vct^E؀w ۺ ZF-|8 ޛr8֯hqPW 4Wg("f983«V&z7YD<(rcmM⯈Q[bvP[ˊۃ)Ý:][~ ^(Zh+֯5) -2Şr? #_a<"' l''5up&-Oa}&s*,̕"{\D<ׁΫCq5.Ÿ{ {*e*ur+A7b=7#_oԁ8.?aF}֗nP=NeOLUJJiYY ;t>^RQ<=JUejfSRMp:Wq]ӑ:W1RZapJi '<>k;.Dl<"ntFl#3at 6a\#">/bUD|aqzLcyڂzt1ͦZ68cY0=xK ށRmٰROwbãuZ[)3Q0&}KG>_vqIm^5R6L&#؏(S?'">)ˁlحi\)SSȯfu|élx^]Qԏu q/GIENDB`socnetv-0.90/src/images/home.png0000755000175000017500000000331011261401573017047 0ustar dimitrisdimitrisPNG  IHDR szzbKGD pHYs ,tIME  3VUIDATxŗo?sf粻wqbƉb'M=-Rڢ h6}X>BJxmQʦ6I|]ۻ33sNvCHR#}3].;!<3{i8JPr_p8d:V&>< < Lv@zz[>@o8w?N˻`x %LًiEYཅ^*ୂz/8{I6Z :ٵ=ı]oHNKɆ .aLrY4Ȼ6Q <#fUyT|s|thRb"N*M6s5ށɩ߶_Msb'}DRK2RBsh:%7#ޮh8WJvҿ@u!D4qo&& z 2҃;f lch> y'EݲDo zaԛLoivgJ6A NZ>tאOª67v@+Mª~ |ⵚתOE]\zI7|^}o|<_m +Mڏ{Ph2z҉rkPW  '40t4[s){>T/9_r@!N;p8 {v\<~2];g\1'08N8lN-R%_ w "-40}̥O lenV״cY>55%tG0/铖!7蠤7~a賶Vk/d0{ٱޚk~(lLB@jZ=<>5/Qbd0ON JїfSSSZ=āt1 yaz:񳄕,|dJVկԜ֭a-îωF0ݮ9/B6z:IENDB`socnetv-0.90/src/images/zoomin.png0000755000175000017500000000312611261401573017437 0ustar dimitrisdimitrisPNG  IHDR szz pHYs  tIME51EHbKGDIDATXŖmLSg7%˲}s2`-.FQcL]DV H( ٬ PP@,yK UA9zsS[$MNs9N󌫢Vb0X5&Y_o fklh10vg l(Q^;tUijwTVee&Ū9/,+JJQxMϝZPҎN4uލ4w=S]tF/ LQPT23zw;g7ϔM(**\[JU.@ĝSc1\'t"eͽ"L=j9Z)ᛰadpctôtw#rr󑑡ӹ.6ku OL`|z33:`:|Mo݆*W))yT[].ܛF#&qn#zzJeZP*SZS-W< jf"<܂9ósqhRNH gΜ'7uRt{?3BQOIJ^y0X`m'ES)z58NSwbjv;sAd=mqqcN&8i@k 2B\L TZ>2BFk+ <(5X{: H`rJr 9ozhM z@AD=O'S99%q>XXÇ|혚Fx!xID<1Р!SIݔ ;zGȺ:@j j~Jɲ? 0EM?~%̺ Ec^iQ[B2kmROwO2,A8߃;#dr4֣GH$6Q r.+CDDj?]ah9MEI'v(!6NJeǣŠ4 بe>Mﳱ}l˞=RP~biP( T]`jrsLdVkEh;ĵ0Ů_YF.$w%PDb.YGgޡ{RR,ecVw֡mûȞw.WIY3滏c _5v-H_“ⷁ@'`^J_{?db5u>[}Ӿ zr# qA$(Y ȱ5J?) 3|02 D;Tύ\[m?m TAD&8D2 ^Ǖ?i[i&|/4Ad`E) bћXx2 ^Q}mli2tQ^aڅΓo jXu F_fBͩ4a7@=;UYy?l8x%E8p _]"DĦ3Kp&IIENDB`socnetv-0.90/src/images/zoomout.png0000755000175000017500000000310111261401573017631 0ustar dimitrisdimitrisPNG  IHDR szz pHYs  tIME5 *bKGDIDATXŖ[PSWڷヽ3Nf-iǎcLGXQ%Ђ hQHTBJ0w~3%!QA6Tk'Di̚>'g}_'" .`U5kך XZ~V[/C jMVMFhFk-liUS5s*+KT2-W>goFUJJK /FaaD eUMOt'k3ҵ;!\h& A Q1ZJ9x=tg:}qߧgK` /Z崲ctƃT16aZ{7ȟ#J(V<+00Wq:y(F&'113YOVK0]CV>nFMC# U+S\*Si877ǃQIBMπ!!ɞwAppt`l|= m4|MJ\w?|KSAAՊw={¬.z]gЪ)ǏY0v`׮apΞ(RL11Gw߃QXT7֣:`d6H J~Ea ן䐐Ќ(ؗZӮHӹma9:V2 FcwVFppfbM8>:PHN2G"2R"xyVU~@{/ڎ)~[5YY ::ɩJ,T vq-=M-_UWpZ4d-1UֲY 3{00Q_“ _,, "AlcoW"7_,_= l 1S B{W"[?qN?g B *1 Pv!^#]BnOhyX bx g (\x@K?qB˙OD. vr {|px_Em96n,OiQ>aډo#j{X8WBq1-"%!}CZۍHKT:7ÿП֭с"k G/G IENDB`socnetv-0.90/src/images/new.png0000755000175000017500000000152411261401573016715 0ustar dimitrisdimitrisPNG  IHDR szzgAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDATX՗Na5{q\\0&bXX ѝRHECey{QJ!Iޜ3MN"SsՐn==d 12<S(CfIkR׾TUNK޷’=Oޣqnl4kZS YoK|mu5e<7ɺx&oFh?B~Ql% wIENDB`socnetv-0.90/src/edgeweight.cpp0000755000175000017500000000370711423751762017006 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop edgeweight.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "edgeweight.h" #include EdgeWeight::EdgeWeight( Edge *link , int size, QString labelText, QGraphicsScene *scene ) : QGraphicsTextItem( 0, scene) { link -> addWeight(this); setPlainText( labelText ); this->setFont( QFont ("Courier", size, QFont::Light, TRUE) ); } void EdgeWeight::move(double x, double y) { this -> move(x,y); } EdgeWeight::~EdgeWeight() { } socnetv-0.90/src/texteditor.h0000755000175000017500000000514411423751762016527 0ustar dimitrisdimitris/**************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop texteditor.h ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com *****************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef TEXTEDITOR_H #define TEXTEDITOR_H #include class QAction; class QMenu; class QTextEdit; class TextEditor : public QMainWindow { Q_OBJECT public: TextEditor(const QString &fileName); protected: void closeEvent(QCloseEvent *event); private slots: void newFile(); void open(); bool save(); bool saveAs(); void about(); void documentWasModified(); private: void createActions(); void createMenus(); void createToolBars(); void createStatusBar(); void readSettings(); void writeSettings(); bool maybeSave(); void loadFile(const QString &fileName); bool saveFile(const QString &fileName); void setCurrentFile(const QString &fileName); QString strippedName(const QString &fullFileName); QTextEdit *textEdit; QString curFile; QMenu *fileMenu; QMenu *editMenu; QMenu *helpMenu; QToolBar *fileToolBar; QToolBar *editToolBar; QAction *newAct; QAction *openAct; QAction *saveAct; QAction *saveAsAct; QAction *exitAct; QAction *cutAct; QAction *copyAct; QAction *pasteAct; QAction *aboutAct; QAction *aboutQtAct; }; #endif socnetv-0.90/src/matrix.cpp0000755000175000017500000002711111444336706016171 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 matrix - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "matrix.h" #include //used for cout #include //need for fabs function //constructor - every Row object holds max_int=32762 Matrix::Matrix(const Matrix &b) { row = new Row[m_Actors=b.m_Actors]; for (register int i=0;i=erased) { setItem( i, j, item(i,j+1) ) ; qDebug() << "case 2"; } if (i>=erased && j=erased && j>=erased) { setItem( i, j, item(i+1,j+1) ) ; qDebug() <<"case 4"; } if (i>=m_Actors || j>=m_Actors) { setItem( i, j, 0) ; qDebug() <<"case 5 (border)"; } qDebug() << "Matrix: new value (" << i << ", " << j << ")="<< item(i, j) ; } } for (register int i=0;i j && symmetry) { if (a.item(i,k)!=0 && b.item(j,k)!=0) setItem(i,j, item(i,j)+a.item(i,k)*b.item(j,k)); } else{ setItem(i,j, item(i,j)+a.item(i,k)*b.item(k,j)); } } return *this; } //takes two (AXA) matrices (symmetric) and outputs an upper triangular matrix Matrix& Matrix::productSym( Matrix &a, Matrix & b) { for (register int i=0;i=j) continue; for (register int k=0;k j ) { if (a.item(i,k)!=0 && b.item(j,k)!=0) setItem(i,j, item(i,j)+a.item(i,k)*b.item(j,k)); } else //k <= j && ik ) { if (a.item(k,i)!=0 && b.item(k,j)!=0) setItem(i,j, item(i,j)+a.item(k,i)*b.item(k,j)); } else { if (a.item(i,k)!=0 && b.item(k,j)!=0) setItem(i,j, item(i,j)+a.item(i,k)*b.item(k,j)); } } return *this; } Matrix& Matrix::pow (int power, bool symmetry) { Matrix t=*this; for (register int k=1; k fabs ( m_pivot ) ) { qDebug() << " A("<< i+1 << ","<< j+1 << ") = " << temp_pivot << " absolutely larger than current pivot "<< m_pivot << ". Marking new pivot line: " << i+1; m_pivotLine=i; m_pivot = temp_pivot ; } } if ( m_pivotLine != -1 ) { A.swapRows(m_pivotLine,j); swapRows(m_pivotLine,j); } qDebug()<<" multiplyRow() "<< j+1 << " by value " << 1/m_pivot ; for ( register int k=0; k< rows(); k++) { A.setItem ( j, k, (1/m_pivot) * A.item (j, k) ); setItem ( j, k, (1/m_pivot) * item (j, k) ); qDebug()<<" A.item("<< j+1 << ","<< k+1 << ") = " << A.item(j,k); qDebug()<<" item("<< j+1 << ","<< k+1 << ") = " << item(j,k); } qDebug() << "eliminate variables FromRowsBelow()" << j+1 ; for ( register int i=0; i< rows(); i++) { qDebug()<<" Eliminating item("<< i+1 << ","<< j+1 << ") = " << A.item(i,j) << " while at column j="< #include DataSetSelectDialog::DataSetSelectDialog (QWidget *parent) : QDialog (parent) { ui.setupUi(this); connect ( ui.buttonBox,SIGNAL(accepted()), this, SLOT(gatherData()) ); (ui.buttonBox) -> button (QDialogButtonBox::Ok) -> setDefault(true); QStringList datasets_list; datasets_list << "Krackhardt_High-tech_managers_Advice_relation.sm" << "Krackhardt_High-tech_managers_Friendship_relation.sm" << "Krackhardt_High-tech_managers_ReportsTo_relation.sm" << "Padgett_Florentine_Families_Marital_relation.sm" << "Padgett_Florentine_Families_Business_relation.sm" << "Zachary_Karate_Club_Simple_Ties.sm" << "Zachary_Karate_Club_Weighted_Ties.sm" << "Bernard_Killworth_Fraternity_Symmetric_Observer_Data.sm" << "Bernard_Killworth_Fraternity_Non_Symmetric_Cognitive_Data.sm" << "Galaskiewicz_CEOs_and_clubs_affiliation_network_data.2sm" << "Freeman_EIES_network_Acquaintanceship_at_time-1" << "Freeman_EIES_network_Acquaintanceship_at_time-2" << "Freeman_EIES_network_Messages" << "Mexican_Power_Network_1940s.lst"; (ui.comboBox) -> insertItems( 1, datasets_list ); } void DataSetSelectDialog::gatherData(){ qDebug()<< "Dialog: gathering Data!..."; QString dataset_name = (ui.comboBox) -> currentText(); qDebug()<< "Dialog: emitting userChoises signal "; emit userChoices( dataset_name ); } socnetv-0.90/src/graphicswidget.h0000755000175000017500000001132611444336706017337 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 graphicswidget.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef GRAPHICSWIDGET_H #define GRAPHICSWIDGET_H #include #include "graph.h" #include #include class MainWindow; //class QGraphicsSceneMouseEvent; class Node; class Edge; class NodeNumber; class NodeLabel; class BackgrCircle; class EdgeWeight; typedef QMap StringToEdgeMap; typedef QHash hash_in; class GraphicsWidget : public QGraphicsView { Q_OBJECT public: GraphicsWidget(QGraphicsScene*, MainWindow* parent); ~GraphicsWidget(); void clear(); Node* hasNode(QString text); // Node* hasNode(int number); bool setMarkedNode(QString text); void removeItem(Edge*); void removeItem(Node*); void removeItem(NodeNumber*); void removeItem(NodeLabel*); void nodeMoved(int, int, int); void setInitNodeColor(QString); void setInitLinkColor(QString); void setInitNodeSize(int); void setInitNumberDistance(int); void setInitLabelDistance(int); void setNumbersInsideNodes(bool); bool setNodeColor(long int, QString); bool setEdgeColor(int, int, QString); bool setEdgeWeight(int, int, float); void setAllItemsVisibility(int, bool); void removeAllItems(int); protected: void wheelEvent(QWheelEvent *event); void mouseDoubleClickEvent ( QMouseEvent * e ); void mousePressEvent ( QMouseEvent * e ); //void mouseReleaseEvent(QMouseEvent * e ); void resizeEvent( QResizeEvent *e ); void paintEvent ( QPaintEvent * event ); public slots: void drawNode( int i, int size, QString aColor, QString nColor, int nSize, QString label, QString lColor, int lSize, QPointF p, QString nodeShape, bool showLabels, bool labelIn, bool showNumbers ); void eraseNode(long int doomedJim); void drawEdge(int, int, float, bool, bool, QString, bool); void eraseEdge(int, int); void setEdgeVisibility ( int, int, bool); void setNodeVisibility(long int, bool ); //Called from Graph via MW void nodeClicked(Node *); void edgeClicked(Edge *); void openNodeContextMenu(); void openEdgeContextMenu(); void moveNode(int, int, int); //Called from Graph when creating random nets. void changeZoom(const int value); void startEdge(Node *node); void drawEdgeReciprocal(int, int); void unmakeEdgeReciprocal(int, int); void clearBackgrCircles(); void addBackgrCircle( int x0, int y0, int radius); void addBackgrHLine(int y0); void zoomIn(); void zoomOut(); void rot(int angle); signals: void windowResized(int,int); void userDoubleClicked(int, QPointF); void userMiddleClicked(int, int, float); void openNodeMenu(); void openEdgeMenu(); void updateNodeCoords(int, int, int); void selectedNode(Node *); void selectedEdge(Edge *); void zoomChanged(int); private: hash_in nodeHash; //This is used in drawEdge() method StringToEdgeMap edgesMap; int timerId, layoutType, m_nodeSize, m_numberDistance, m_labelDistance; double m_currentScaleFactor; int m_currentRotationAngle; int zoomIndex, originalNodeSize; QString m_nodeLabel, m_numberColor, m_nodeColor, m_labelColor, m_linkColor; bool secondDoubleClick, dynamicMovement, markedNodeExists; QGraphicsItem *moving; QPointF startPoint, endPoint; Node *firstNode, *secondNode, *markedNode, *tempNode ; }; #endif socnetv-0.90/src/parser.h0000755000175000017500000001060011434417714015617 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 parser.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef PARSER_H #define PARSER_H using namespace std; #include #include #include #include #include #include /** Main class for network file parsing and loading Currently, it supports Pajek, Adjacency, Graphviz, GraphML */ class Parser : public QThread { Q_OBJECT public: bool load(QString fn, int iNS, QString iNC, QString iNSh, QString iNNC, int iNNS, QString iNLC, int iNLS , QString iEC, int w, int h, int format, int sm_mode); bool loadPajek(); bool loadAdjacency(); bool loadDot(); bool loadGraphML(); bool loadGML(); bool loadGW(); bool loadDL(); bool loadSimpleList(); bool loadWeighedList(); bool loadTwoModeSociomatrix(); void dotProperties(QString str, float &, QString &label, QString &shape, QString &color, QString &fontName, QString &fontColor ); void readGraphML (QXmlStreamReader &); void readGraphMLElementGraph(QXmlStreamReader &); void readGraphMLElementNode (QXmlStreamReader &); void endGraphMLElementNode (QXmlStreamReader &); void readGraphMLElementEdge (QXmlStreamAttributes &); void endGraphMLElementEdge (QXmlStreamReader &); void readGraphMLElementData (QXmlStreamReader &); void readGraphMLElementUnknown (QXmlStreamReader &); void readGraphMLElementKey (QXmlStreamAttributes &); bool xmlStreamHasAttribute( QXmlStreamAttributes &, QString ) const ; void readGraphMLElementDefaultValue(QXmlStreamReader &); void readGraphMLElementNodeGraphics (QXmlStreamReader &); void readGraphMLElementEdgeGraphics (QXmlStreamReader &); bool isComment(QString str); signals: void createNode( int num, int size, QString color, QString numColor, int numSize, QString label, QString lColor, int lSize, QPointF p, QString shape, bool signalMW); void createEdge (int, int, float, QString, int, bool, bool); void fileType(int, QString, int, int, bool); void removeDummyNode (int); protected: void run(); private: QMutex mutex; QHash nodeNumber; QHash keyFor, keyName, keyType, keyDefaultValue ; QMultiMap firstModeMultiMap, secondModeMultiMap; QXmlStreamReader *xml; QString fileName, networkName, initNodeColor, initEdgeColor, initNodeShape, initNodeNumberColor, initNodeLabelColor; QString nodeColor, edgeColor, edgeType, nodeShape, nodeLabel, edgeLabel, nodeNumberColor, nodeLabelColor; int gwWidth, gwHeight; int totalLinks, aNodes, fileFormat, two_sm_mode, undirected; int initNodeSize, initNodeNumberSize, nodeNumberSize, initNodeLabelSize, nodeLabelSize, source, target, nodeSize; float initEdgeWeight, edgeWeight, arrowSize; float bez_p1_x,bez_p1_y, bez_p2_x, bez_p2_y; bool arrows, bezier, conv_OK; bool bool_key, bool_node, bool_edge; QString key_id, key_value, key_name, key_what, key_type; QString node_id, edge_id, edge_source, edge_target; double randX, randY; }; #endif socnetv-0.90/src/webcrawler.cpp0000644000175000017500000004044711423751762017026 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 webcrawler.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "webcrawler.h" #include #include #include #include #include #include QHttp *http; QQueue frontier; QMap sourceMap; QMap checkedMap; QMap discoveredMap; QByteArray ba; QWaitCondition newDataRead; QMutex mutex; QString baseUrl="", seed="", domain="", seed_domain = "", previous_domain="", path="", urlPrefix=""; int maxNodes, discoveredNodes=0, currentNode, maxRecursion; bool goOut=false, hasUrlPrefix=false; void WebCrawler::load (QString url, int maxN, int maxRec, bool gOut){ if (seed.contains(" ")) //urls can't have spaces... return; seed=url; maxNodes=maxN; //maxnodes we'll check maxRecursion = maxRec; goOut = gOut; //clear global variables frontier.clear(); sourceMap.clear(); checkedMap.clear(); discoveredMap.clear(); baseUrl="", domain="", previous_domain="", path="", urlPrefix=""; frontier.enqueue(seed); //queue the seed to frontier currentNode=1; //start at node 1 discoveredNodes = 1; http = new QHttp(this); //connect done() signal of http to load() of 2ond Reader class connect (http,SIGNAL( done(bool) ), &reader, SLOT( load() ) ); qDebug() << "WebCrawler:: I will start a new QThread!"; connect ( &reader, SIGNAL( signalCreateNode (QString, int) ), this, SLOT(slotCreateNode(QString, int ) ) ) ; connect ( &reader, SIGNAL(signalCreateEdge (int, int)), this, SLOT(slotCreateEdge (int, int) ) ); if (!isRunning()) start(QThread::TimeCriticalPriority); } //called from reader createNode signal void WebCrawler::slotCreateNode(QString url, int number) { emit createNode(url, number); } //called from reader createEdge signal void WebCrawler::slotCreateEdge (int source, int target){ emit createEdge (source, target); } /* This thread sets host and url to http object. * When http signals done() then reader thread is loaded * to parse the data */ void WebCrawler::run(){ int pos, second_pos; do { //repeat forever.... if (currentNode>1 ) { maxRecursion --; } if (frontier.size() ==0 ) { // .... or until we crawl all urls in frontier. qDebug () <<" WebCrawler #### Frontier is empty: " <0) { // .... or until we have reached maxNodes if (currentNode == maxNodes ) { qDebug () <<" WebCrawler: #### Seems we have reached maxnodes!" << " - we will stop now" ; break; } } baseUrl = frontier.head(); //take the first url from the frontier - name it baseUrl if ( ! checkedMap[baseUrl] ){ checkedMap[baseUrl]=true; if (baseUrl.contains ("http://" ) || baseUrl.contains ("https://" )) { // If baseUrl (except seed) contains http, it is external if ( currentNode != 1 && !goOut ) { // if the user don't want to crawl external links, just continue. if ( !baseUrl.contains( seed_domain, Qt::CaseInsensitive) ) { qDebug() << " WebCrawler: external baseUrl detected: "<setHost( domain ); seed_domain = domain; http->get( path ); if ( (second_pos=path.lastIndexOf ("/")) !=-1 ){ urlPrefix = path.left(second_pos); hasUrlPrefix=true; qDebug() << " WebCrawler: urlPrefix: "<< urlPrefix.toAscii() ; } } else { qDebug() << " WebCrawler: Host domain is the url: " << baseUrl.toAscii() << " I' ll just get /..."; domain = baseUrl; seed_domain = domain; http->setHost(domain); http->get("/"); } } else { //no http: if (currentNode==1) { //only if this is the seed node if ( (pos=baseUrl.indexOf ("/")) !=-1 ) { domain = baseUrl.left(pos); qDebug() << " WebCrawler: Initial Host domain: "<< domain.toAscii(); path = baseUrl.remove(0, pos); qDebug() << " WebCrawler: Initial Webpage to get: "<< path.toAscii() ; seed_domain = domain; http->setHost( domain ); http->get( path ); } else { qDebug() << " WebCrawler: Initial url: " << baseUrl.toAscii() << " I' ll just get /..."; domain = baseUrl; http->setHost(domain); http->get("/"); } emit createNode(baseUrl, 1); } else { qDebug() << " WebCrawler: internal url detected " << baseUrl.toAscii() << " I will use previous domain "<< domain.toAscii(); if (baseUrl.startsWith('.', Qt::CaseInsensitive) ) baseUrl=baseUrl.remove(0, 1); else if (!baseUrl.startsWith('/', Qt::CaseInsensitive) ) { baseUrl = "/"+baseUrl; qDebug() << " adding / to baseUrl " << baseUrl; } http->setHost(previous_domain); http->get(baseUrl); } } } else { //else don't do nothing! qDebug() << " WebCrawler: baseUrl " << baseUrl.toAscii() << " already scanned. Skipping."; frontier.dequeue(); //Dequeue head continue; } if ( domain != previous_domain && (currentNode!=1) ) { qDebug () << " WebCrawler: **** NEW DOMAIN " ; } else { qDebug () << " WebCrawler: **** SAME DOMAIN "; } //lock mutex mutex.lock(); qDebug() << " WebCrawler: ZZzz We should wait a bit..." <<"frontier size " << frontier.size() << " currentNode " << currentNode ; //Thread goes to sleep to protect all variables (locked by mutex). newDataRead.wait(&mutex); //Unlock it mutex.unlock(); qDebug () <<" WebCrawler: OK. Waking up to continue: frontier size = " << frontier.size(); qDebug () <<" WebCrawler: Increasing currentNode, dequeuing frontier and setting previous domain to domain"; currentNode++; frontier.dequeue(); //Dequeue head previous_domain = domain; //set previous domain } while ( 1 ); if (reader.isRunning() ) //tell the other thread that we must quit! reader.quit(); qDebug() << " Finished!"; } //called from Graph, when closing network, to terminate all processes void WebCrawler::terminateReaderQuit (){ if (reader.isRunning() ) //tell the other thread that we must quit! reader.quit(); } /* * This method starts the Reader thread * It is called when the http object has emitted the done() signal * (that is, when last pending request has finished). */ void Reader::load(){ if (!isRunning()) start(QThread::NormalPriority); } /* * This method is all that the Reader thread does. * Essentially, it's called when http has finished all pending requests. * First, we start by reading all from http to the QString page. * Then we parse the page string, searching for url substrings. */ void Reader::run(){ qDebug() << " READER: read something!"; QString newUrl; bool createNodeFlag = false, createEdgeFlag=false ; int start=-1, end=-1, equal=-1 ;// index=-1; ba=http->readAll(); QString page(ba); if (!page.contains ("a href")) { //if a href doesnt exist, return //FIXME: Frameset pages are not parsed! See docs/manual.html for example. qDebug() << " READER: ### Empty or not usefull data from " << baseUrl.toAscii() << " RETURN"; newDataRead.wakeAll(); return; } mutex.lock(); while (page.contains("href")) { //as long there is a href in the page... createNodeFlag = false; createEdgeFlag = false; page=page.simplified(); // remove whitespace from the start and the end - all whitespace sequence becomes single space start=page.indexOf ("href"); //Find its pos page = page.remove(0, start); //erase everything up to href equal=page.indexOf ("="); // Find next equal sign (=) page = page.remove(0, equal+1); //Erase everything up to = if (page.startsWith("\"") ) { page.remove(0,1); end=page.indexOf ("\""); } else if (page.startsWith("\'") ){ page.remove(0,1); end=page.indexOf ("\'"); } else { //end=page.indexOf ("\'"); } newUrl=page.left(end); //Save new url to newUrl :) newUrl=newUrl.simplified(); qDebug()<< " READER: page still contains links - Parsing " << newUrl.toAscii(); // if this is not the 1st node, and it has been already checked ... QMap::const_iterator index = discoveredMap.find(newUrl); if ( index!= discoveredMap.end() ) { qDebug()<< " READER: #---> newUrl " << newUrl.toAscii() << " already CHECKED - Just creating an edge from " << currentNode << " to " << index.value(); //this->createEdge (sourceMap [ index.value() ], index.value()); // ... then create an edge from the previous node ... this->createEdge (currentNode, index.value() ); continue; // .... and continue skipping it! } // if this is the first node or it is visited for the first time ... if ( newUrl.contains("http://", Qt::CaseInsensitive) || newUrl.contains("https://", Qt::CaseInsensitive) ) { //if this is an absolute url if (true) //flag to display css/rss icons if ( newUrl.endsWith(".css", Qt::CaseInsensitive) || newUrl.endsWith("feed/", Qt::CaseInsensitive) || newUrl.endsWith("rss/", Qt::CaseInsensitive) || newUrl.endsWith("atom/", Qt::CaseInsensitive) || newUrl.endsWith("xmlrpc.php", Qt::CaseInsensitive) || newUrl.endsWith("?rsd", Qt::CaseInsensitive) || newUrl.endsWith(".xml", Qt::CaseInsensitive) || newUrl.endsWith("favicon.ico", Qt::CaseInsensitive) || newUrl.endsWith("favicon.gif", Qt::CaseInsensitive) || newUrl.endsWith("favicon.jpg", Qt::CaseInsensitive) || newUrl.endsWith("css?H", Qt::CaseInsensitive) ) { qDebug()<< " READER: # absolute newUrl " << newUrl << " must be a web 2.0 element (rss, favicon, etc) or file. Skipping..."; // emit createNode(baseUrl, currentNode); // perhaps we paint that node with a different colour or check a variable? //continue; } if ( !goOut ) { // ... and we need to limit ourselves within the seed domain... if ( !newUrl.startsWith(seed_domain, Qt::CaseInsensitive ) || !newUrl.startsWith( "http://"+seed_domain, Qt::CaseInsensitive) ) { //...then check if the newUrl is out of the seed domain qDebug()<< " READER: # absolute newUrl " << newUrl.toAscii() << " is OUT OF the seed (original) domain. I will create a node but NOT add it to frontier..."; this->createNode(newUrl, false); this->createEdge(currentNode, discoveredNodes); } else { qDebug()<< " READER: absolute newUrl" << newUrl.toAscii() << " appears INSIDE the seed domain " << seed_domain << " - I will create a node here..." ; this->createNode(newUrl, true); this->createEdge(currentNode, discoveredNodes); } } else { // ... else if we can go out the seed domain, then just add it. qDebug()<< " READER: absolute newUrl" << newUrl.toAscii() << " is outside the seed domain " << seed_domain << " - and we are allowed to go there, so I will create a node here..." ; this->createNode(newUrl, true); this->createEdge(currentNode, discoveredNodes); } } else { // if this is an internal or relative url .... // ...and an index, then skip it. if (newUrl == "index.html" || newUrl == "index.htm" || newUrl == "index.php"){ qDebug()<< " READER: # non-absolute newUrl " << newUrl.toAscii() << " must be an index file. Creating edge from 1 to " << discoveredNodes; this->createEdge ( 1 , discoveredNodes); continue; } // ...different treatment for css, favicon, rss, ping, else if (true) {//flag to display css/rss icons if ( newUrl.endsWith(".css", Qt::CaseInsensitive) || newUrl.endsWith("feed/", Qt::CaseInsensitive) || newUrl.endsWith("rss/", Qt::CaseInsensitive) || newUrl.endsWith("atom/", Qt::CaseInsensitive) || newUrl.endsWith("xmlrpc.php", Qt::CaseInsensitive) || newUrl.endsWith("?rsd", Qt::CaseInsensitive) || newUrl.endsWith(".xml", Qt::CaseInsensitive) || newUrl.endsWith("favicon.ico", Qt::CaseInsensitive) || newUrl.endsWith("favicon.gif", Qt::CaseInsensitive) || newUrl.endsWith("favicon.jpg", Qt::CaseInsensitive) || newUrl.endsWith("css?H", Qt::CaseInsensitive) ) { qDebug()<< " READER: # non-absolute newUrl " << newUrl << " must be a web 2.0 element (rss, favicon, etc) or file. Skipping..."; // emit createNode(baseUrl, currentNode); // perhaps we paint that node with a different colour or check a variable? continue; } } // .. else create node and add it to frontier. qDebug()<< " READER: non-absolute newUrl " << newUrl.toAscii() << " first time visited. I will create a node for it and add it to frontier"; this->createNode(newUrl, true); this->createEdge(currentNode, discoveredNodes); } } newDataRead.wakeAll(); mutex.unlock(); } //signals node creation Called from Reader::load() void Reader::createNode(QString newUrl, bool enqueue_to_frontier) { discoveredNodes++; sourceMap[ discoveredNodes ] = currentNode; discoveredMap[newUrl]=discoveredNodes; if (enqueue_to_frontier) { frontier.enqueue(newUrl); qDebug()<< "\n\n READER: * Creating node " << discoveredNodes << " newUrl "<< newUrl << " Frontier size: "<< frontier.size() << " = discoveredNodes: " < Creating edge from " << source << " to "<< target << "\n\n"; emit signalCreateEdge (source, target); } socnetv-0.90/src/nodenumber.h0000755000175000017500000000373611423751762016477 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 nodenumber.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef NODENUMBER_H #define NODENUMBER_H #include class Node; static const int TypeNumber=QGraphicsItem::UserType+3; class NodeNumber : public QGraphicsTextItem { public: NodeNumber(Node * , int, QString, QGraphicsScene *); void removeRefs(); enum { Type = UserType + 3 }; int type() const { return Type; } Node* node() { return source; } ~NodeNumber(); private: Node *source; }; #endif socnetv-0.90/src/parser.cpp0000755000175000017500000021220711444336706016163 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 parser.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "parser.h" #include #include #include #include #include #include //used for qDebug messages #include #include #include #include "graph.h" //needed for setParent bool Parser::load(QString fn, int iNS, QString iNC, QString iNSh, QString iNNC, int iNNS, QString iNLC, int iNLS , QString iEC, int width, int height, int fFormat, int sm_mode ) { qDebug("Parser: load()"); initNodeSize=iNS; initNodeColor=iNC; initNodeShape=iNSh; initNodeNumberColor=iNNC; initNodeNumberSize=iNNS; initNodeLabelColor=iNLC; initNodeLabelSize=iNLS; initEdgeColor=iEC; undirected=0; arrows=FALSE; bezier=FALSE; fileName=fn; networkName=(fileName.split ("/")).last(); gwWidth=width; gwHeight=height; randX=0; randY=0; fileFormat= fFormat; two_sm_mode = sm_mode; //qDebug()<< "Parser: start() a new parsing thread for file format: " << fileFormat ; if (!isRunning()) start(QThread::NormalPriority); if (isFinished()) { //qDebug()<< "**** Parser:: thread has finished! " //<< " fileFormat now "<< fileFormat ; if ( fileFormat != -1 ) { return true; } else return false; } else { qDebug()<< "**** Parser:: thread has not finished yet but we return back to Graph and MW! " << " fileFormat now "<< fileFormat ; } return true; } /** Tries to load a file as DL-formatted network. If not it returns -1 */ bool Parser::loadDL(){ qDebug ("\n\nParser: loadDL"); QFile file ( fileName ); if ( ! file.open(QIODevice::ReadOnly )) return false; QTextStream ts( &file ); QString str, label; int i=0, j=0, lineCounter=0, mark=0, nodeNum=0; edgeWeight=0; bool labels_flag=false, data_flag=false, intOK=false, floatOK=false; QStringList lineElement; totalLinks=0; while ( !ts.atEnd() ) { str= ts.readLine(); lineCounter++; if ( isComment(str) ) continue; if ( (lineCounter == 1) && (!str.startsWith("DL",Qt::CaseInsensitive) ) ) { qDebug("*** Parser-loadDL(): not a DL file. Aborting!"); file.close(); return false; } if (str.startsWith( "N=", Qt::CaseInsensitive) || str.startsWith( "N =", Qt::CaseInsensitive) ) { mark=str.indexOf("="); str=str.right(str.size()-mark-1); qDebug()<< "N = : " << str.toAscii() ; aNodes=str.toInt(&intOK,10); if (!intOK) { qDebug()<< "Parser: loadDL(): conversion error..." ; return false;} } if (str.startsWith( "FORMAT =", Qt::CaseInsensitive) || str.startsWith( "FORMAT=", Qt::CaseInsensitive)) { mark=str.indexOf("="); str=str.right(str.size()-mark-1); qDebug()<< "FORMAT = : " << str.toAscii() ; } if (str.startsWith( "labels", Qt::CaseInsensitive) ) { labels_flag=true; data_flag=false; continue; } else if ( str.startsWith( "data:", Qt::CaseInsensitive) || str.startsWith( "data :", Qt::CaseInsensitive) ) { data_flag=true; labels_flag=false; continue; } if (labels_flag) { //read a label and create a node in a random position label=str; randX=rand()%gwWidth; randY=rand()%gwHeight; nodeNum++; qDebug()<<"Creating node at "<< randX<<","<< randY; emit createNode( nodeNum, initNodeSize,initNodeColor, initNodeNumberColor, initNodeNumberSize, label, initNodeLabelColor, initNodeLabelSize, QPointF(randX, randY), initNodeShape, false ); } if ( data_flag){ //read edges //SPLIT EACH LINE (ON EMPTY SPACE CHARACTERS) lineElement=str.split(QRegExp("\\s+"), QString::SkipEmptyParts); j=0; for (QStringList::Iterator it1 = lineElement.begin(); it1!=lineElement.end(); ++it1) { qDebug()<< (*it1).toAscii() ; if ( (*it1)!="0"){ //here is an non-zero edge weight... qDebug()<< "Parser-loadDL(): there is an edge here"; edgeWeight=(*it1).toFloat(&floatOK); undirected=0; arrows=true; bezier=false; emit createEdge(i+1, j+1, edgeWeight, initEdgeColor, undirected, arrows, bezier); totalLinks++; qDebug()<< "Link from Node i= " << i+1 << " to j= "<< j+1; qDebug() << "TotalLinks= " << totalLinks; } j++; } i++; } } //sanity check if (nodeNum != aNodes) { qDebug()<< "Error: aborting"; return false; } //The network has been loaded. Tell MW the statistics and network type // 0: no format, 1: GraphML, 2:Pajek, 3:Adjacency, 4: Dot, 5:DL, 6:GML, 7: List emit fileType(5, networkName, aNodes, totalLinks, undirected); qDebug() << "Parser-loadDL()"; return true; } /** Tries to load the file as Pajek-formatted network. If not it returns -1 */ bool Parser::loadPajek(){ qDebug ("\n\nParser: loadPajek"); QFile file ( fileName ); if ( ! file.open(QIODevice::ReadOnly )) return false; QTextStream ts( &file ); QString str, label, temp; nodeColor=""; edgeColor=""; nodeShape=""; QStringList lineElement; bool ok=FALSE, intOk=FALSE, check1=FALSE, check2=FALSE; bool nodes_flag=FALSE, edges_flag=FALSE, arcs_flag=FALSE, arcslist_flag=FALSE, matrix_flag=FALSE; bool fileContainsNodeColors=FALSE, fileContainsNodesCoords=FALSE; bool fileContainsLinksColors=FALSE; bool zero_flag=FALSE; int i=0, j=0, miss=0, source= -1, target=-1, nodeNum, colorIndex=-1, coordIndex=-1; unsigned long int lineCounter=0; float weight=1; list listDummiesPajek; totalLinks=0; aNodes=0; j=0; //counts how many real nodes exist in the file miss=0; //counts missing nodeNumbers. //if j + miss < nodeNum, it creates (nodeNum-miss) dummy nodes which are deleted in the end. QList toBeDeleted; while ( !ts.atEnd() ) { str= ts.readLine(); if ( isComment(str) ) continue; lineCounter++; if (lineCounter==1) { if ( str.contains("graph",Qt::CaseInsensitive) || str.contains("digraph",Qt::CaseInsensitive) || str.contains("DL",Qt::CaseInsensitive) || str.contains("list",Qt::CaseInsensitive) || str.contains("graphml",Qt::CaseInsensitive) || str.contains("xml",Qt::CaseInsensitive) ) { qDebug()<< "*** Parser:loadPajeck(): Not an Pajek-formatted file. Aborting!!"; file.close(); return false; } } if (!edges_flag && !arcs_flag && !nodes_flag && !arcslist_flag && !matrix_flag) { //qDebug("Parser-loadPajek(): reading headlines"); if ( (lineCounter == 1) && (!str.contains("network",Qt::CaseInsensitive) && !str.contains("vertices",Qt::CaseInsensitive) ) ) { //this is not a pajek file. Abort qDebug("*** Parser-loadPajek(): Not a Pajek file. Aborting!"); file.close(); return false; } else if (str.contains( "network",Qt::CaseInsensitive) ) { //NETWORK NAME if (str.contains(" ")) { lineElement=str.split(QRegExp("\\s+")); //split at one or more spaces //qDebug()<<"Parser-loadPajek(): possible net name: "< nodeNum ) { qDebug ("Error: This Pajek net declares this node with nodeNumber smaller than previous nodes. Aborting"); return false; } emit createNode( nodeNum,initNodeSize, nodeColor, initNodeNumberColor, initNodeNumberSize, label, initNodeLabelColor, initNodeLabelSize, QPointF(randX, randY), nodeShape, false ); initNodeColor=nodeColor; } /**NODES CREATED. CREATE EDGES/ARCS NOW. */ else { if (j && j!=aNodes) { //if there were more or less nodes than the file declared qDebug()<<"*** WARNING ***: The Pajek file declares " << aNodes <<" nodes, but I found " << j << " nodes...." ; aNodes=j; } else if (j==0) { //if there were no nodes at all, we need to create them now. qDebug()<< "The Pajek file declares "<< aNodes<< " but I didnt found any nodes. I will create them...."; for (int num=j+1; num<= aNodes; num++) { qDebug() << "Parser-loadPajek(): Creating node number i = "<< num; randX=rand()%gwWidth; randY=rand()%gwHeight; emit createNode( num,initNodeSize, initNodeColor, initNodeNumberColor, initNodeNumberSize, QString::number(i), initNodeLabelColor,initNodeLabelSize, QPointF(randX, randY), initNodeShape, false ); } j=aNodes; } if (edges_flag && !arcs_flag) { /**EDGES */ //qDebug("Parser-loadPajek(): ==== Reading edges ===="); qDebug()< (i-1) internally else if (source < 0 && target >0 ) { //weights come first... edgeWeight = lineElement[0].toFloat(&ok); source= lineElement[1].toInt(&ok, 10); if (lineElement.count()>2) { target = lineElement[2].toInt(&ok,10); } else { target = lineElement[1].toInt(&ok,10); //self link } } else if (lineElement.count()>2) edgeWeight =lineElement[2].toFloat(&ok); else edgeWeight =1.0; //qDebug()<<"Parser-loadPajek(): weight "<< weight; if (lineElement.contains("c", Qt::CaseSensitive ) ) { //qDebug("Parser-loadPajek(): file with link colours"); fileContainsLinksColors=TRUE; colorIndex=lineElement.indexOf( QRegExp("[c]"), 0 ) +1; if (colorIndex >= lineElement.count()) edgeColor=initEdgeColor; else edgeColor=lineElement [ colorIndex ]; if (edgeColor.contains (".") ) edgeColor=initEdgeColor; //qDebug()<< " current color "<< edgeColor; } else { //qDebug("Parser-loadPajek(): file with no link colours"); edgeColor=initEdgeColor; } undirected=2; arrows=true; bezier=false; qDebug()<< "Parser-loadPajek(): EDGES: Create edge between " << source << " - "<< target; emit createEdge(source, target, edgeWeight, edgeColor, undirected, arrows, bezier); totalLinks=totalLinks+2; } //end if EDGES else if (!edges_flag && arcs_flag) { /** ARCS */ //qDebug("Parser-loadPajek(): === Reading arcs ==="); source= lineElement[0].toInt(&ok, 10); target = lineElement[1].toInt(&ok,10); if (source == 0 || target == 0 ) return false; // i --> (i-1) internally else if (source < 0 && target >0 ) { //weights come first... edgeWeight = lineElement[0].toFloat(&ok); source= lineElement[1].toInt(&ok, 10); if (lineElement.count()>2) { target = lineElement[2].toInt(&ok,10); } else { target = lineElement[1].toInt(&ok,10); //self link } } else if (lineElement.count()>2) edgeWeight =lineElement[2].toFloat(&ok); else edgeWeight =1.0; if (lineElement.contains("c", Qt::CaseSensitive ) ) { //qDebug("Parser-loadPajek(): file with link colours"); edgeColor=lineElement.at ( lineElement.indexOf( QRegExp("[c]"), 0 ) + 1 ); fileContainsLinksColors=TRUE; } else { //qDebug("Parser-loadPajek(): file with no link colours"); edgeColor=initEdgeColor; } undirected=0; arrows=true; bezier=false; qDebug()<<"Parser-loadPajek(): ARCS: Creating arc from node "<< source << " to node "<< target << " with weight "<< weight; emit createEdge(source, target, edgeWeight , edgeColor, undirected, arrows, bezier); totalLinks++; } //else if ARCS else if (arcslist_flag) { /** ARCSlist */ //qDebug("Parser-loadPajek(): === Reading arcs list==="); if (lineElement[0].startsWith("-") ) lineElement[0].remove(0,1); source= lineElement[0].toInt(&ok, 10); fileContainsLinksColors=FALSE; edgeColor=initEdgeColor; undirected=0; arrows=true; bezier=false; for (register int index = 1; index < lineElement.size(); index++) { target = lineElement.at(index).toInt(&ok,10); qDebug()<<"Parser-loadPajek(): ARCS LIST: Creating ARC source "<< source << " target "<< target << " with weight "<< weight; emit createEdge(source, target, edgeWeight, edgeColor, undirected, arrows, bezier); totalLinks++; } } //else if ARCSLIST else if (matrix_flag) { /** matrix */ //qDebug("Parser-loadPajek(): === Reading matrix of edges==="); i++; source= i; fileContainsLinksColors=FALSE; edgeColor=initEdgeColor; undirected=0; arrows=true; bezier=false; for (target = 0; target < lineElement.size(); target ++) { if ( lineElement.at(target) != "0" ) { edgeWeight = lineElement.at(target).toFloat(&ok); qDebug()<<"Parser-loadPajek(): MATRIX: Creating arc source "<< source << " target "<< target +1<< " with weight "<< weight; emit createEdge(source, target+1, edgeWeight, edgeColor, undirected, arrows, bezier); totalLinks++; } } } //else if matrix } //end if BOTH ARCS AND EDGES } //end WHILE file.close(); if (j==0) return false; //The network has been loaded. Tell MW the statistics and network type // 0: no format, 1: GraphML, 2:Pajek, 3:Adjacency, 4: Dot, 5:DL, 6:GML, 7: List emit fileType(2, networkName, aNodes, totalLinks, undirected); qDebug("Parser-loadPajek(): Removing all dummy aNodes, if any"); if (listDummiesPajek.size() > 0 ) { qDebug("Trying to delete the dummies now"); for ( list::iterator it=listDummiesPajek.begin(); it!=listDummiesPajek.end(); it++ ) { emit removeDummyNode(*it); } } qDebug("Parser-loadPajek(): Clearing DumiesList from Pajek"); listDummiesPajek.clear(); exit(0); return true; } /** Tries to load the file as adjacency sociomatrix-formatted. If not it returns -1 */ bool Parser::loadAdjacency(){ qDebug("\n\nParser: loadAdjacency()"); QFile file ( fileName ); if ( ! file.open(QIODevice::ReadOnly )) return false; QTextStream ts( &file ); QString str; QStringList lineElement; int i=0, j=0, aNodes=0, newCount=0, lastCount=0; edgeWeight=1.0; bool intOK=FALSE; totalLinks=0; i=1; while ( i < 11 && !ts.atEnd() ) { str= ts.readLine() ; str=str.simplified(); if ( isComment(str) ) continue; if ( str.contains("vertices",Qt::CaseInsensitive) || str.contains("network",Qt::CaseInsensitive) || str.contains("graph",Qt::CaseInsensitive) || str.contains("digraph",Qt::CaseInsensitive) || str.contains("DL",Qt::CaseInsensitive) || str.contains("list",Qt::CaseInsensitive) || str.contains("graphml",Qt::CaseInsensitive) || str.contains("xml",Qt::CaseInsensitive) ) { qDebug()<< "*** Parser:loadAdjacency(): Not an Adjacency-formatted file. Aborting!!"; file.close(); return false; } if ( str.contains (",")) newCount = (str.split(",")).count(); else newCount = (str.split(" ")).count(); qDebug() << str; qDebug() << "newCount "<1 ) || (newCount < i) ) { // line element count differ, therefore this can't be an adjacency matrix qDebug()<< "*** Parser:loadAdjacency(): Not an Adjacency-formatted file. Aborting!!"; file.close(); return false; } lastCount=newCount; i++; } ts.reset(); ts.seek(0); i=0; while ( !ts.atEnd() ) { str= ts.readLine() ; str=str.simplified(); // transforms "/t", " ", etc to plain " ". if ( isComment(str) ) continue; if ( str.contains (",")) lineElement=str.split(","); else lineElement=str.split(" "); if (i == 0 ) { aNodes=lineElement.count(); qDebug("Parser-loadAdjacency(): There are %i nodes in this file", aNodes); for (j=0; j values; for (int k = 1; k < i ; ++k) { qDebug() << "Checking earlier discovered actor k = " << k; if ( firstModeMultiMap.contains(k, j) ) { undirected=2; arrows=true; bezier=false; edgeWeight = 1; qDebug() << " Actor " << i << " on the same event as actor " << k << ". Creating edge "; emit createEdge(i, k, edgeWeight, initEdgeColor, undirected, arrows, bezier); totalLinks++; } } } j++; } } file.close(); // 0: no format, 1: GraphML, 2:Pajek, 3:Adjacency, 4: Dot, 5:DL, 6:GML, 7: List, 8 List, 9, TwoModeSociomatrix qDebug() << "Parser: Two-mode SM network has been loaded. Tell MW the statistics and network type"; emit fileType(9, networkName, aNodes, totalLinks, undirected); return true; } /** Tries to load a file as GraphML (not GML) formatted network. If not it returns -1 */ bool Parser::loadGraphML(){ qDebug("\n\nParser: loadGraphML()"); aNodes=0; totalLinks=0; nodeNumber.clear(); bool_key=false; bool_node=false; bool_edge=false; key_id = ""; key_name = ""; key_type = ""; key_value = ""; initEdgeWeight = 1; QFile file ( fileName ); if ( ! file.open(QIODevice::ReadOnly )) return false; QXmlStreamReader *xml = new QXmlStreamReader(); xml->setDevice(&file); while (!xml->atEnd()) { xml->readNext(); qDebug()<< " loadGraphML(): xml->token "<< xml->tokenString(); if (xml->isStartElement()) { qDebug()<< " loadGraphML(): element name "<< xml->name().toString()<<" version " << xml->attributes().value("version").toString() ; if (xml->name() == "graphml") { //this is a GraphML document, call method. qDebug()<< " loadGraphML(): OK. NamespaceUri is "<< xml->namespaceUri().toString(); readGraphML(*xml); } else { //not a GraphML doc, return false. xml->raiseError(QObject::tr(" loadGraphML(): The file is not an GraphML version 1.0 file.")); qDebug()<< "*** loadGraphML(): Error in startElement - The file is not an GraphML version 1.0 file "; file.close(); return false; } } else if ( xml->tokenString() == "Invalid" ){ xml->raiseError(QObject::tr(" loadGraphML(): The file is not an GraphML version 1.0 file.")); qDebug()<< "*** loadGraphML(): Error in startElement - The file is not an GraphML version 1.0 file "; file.close(); return false; } } //The network has been loaded. Tell MW the statistics and network type // 0: no format, 1: GraphML, 2:Pajek, 3:Adjacency, 4: Dot, 5:DL, 6:GML, 7: List emit fileType(1, networkName, aNodes, totalLinks, undirected); //clear our mess - remove every hash element... keyFor.clear(); keyName.clear(); keyType.clear(); keyDefaultValue.clear(); nodeNumber.clear(); return true; } /* * Called from loadGraphML * This method checks the xml token name and calls the appropriate function. */ void Parser::readGraphML(QXmlStreamReader &xml){ qDebug()<< " Parser: readGraphML()"; bool_node=false; bool_edge=false; bool_key=false; //Q_ASSERT(xml.isStartElement() && xml.name() == "graph"); while (!xml.atEnd()) { //start reading until QXmlStreamReader end(). xml.readNext(); //read next token if (xml.isStartElement()) { //new token (graph, node, or edge) here qDebug()<< "\n readGraphML(): start of element: "<< xml.name().toString() ; if (xml.name() == "graph") //graph definition token readGraphMLElementGraph(xml); else if (xml.name() == "key") {//key definition token QXmlStreamAttributes xmlStreamAttr = xml.attributes(); readGraphMLElementKey( xmlStreamAttr ); } else if (xml.name() == "default") //default key value token readGraphMLElementDefaultValue(xml); else if (xml.name() == "node") //graph definition token readGraphMLElementNode(xml); else if (xml.name() == "data") //data definition token readGraphMLElementData(xml); else if ( xml.name() == "ShapeNode") { bool_node = true; } else if ( ( xml.name() == "Geometry" || xml.name() == "Fill" || xml.name() == "BorderStyle" || xml.name() == "NodeLabel" || xml.name() == "Shape" ) && bool_node ) { readGraphMLElementNodeGraphics(xml); } else if (xml.name() == "edge") {//edge definition token QXmlStreamAttributes xmlStreamAttr = xml.attributes(); readGraphMLElementEdge( xmlStreamAttr ); } else if ( xml.name() == "BezierEdge") { bool_edge = true; } else if ( ( xml.name() == "Path" || xml.name() == "LineStyle" || xml.name() == "Arrows" || xml.name() == "EdgeLabel" ) && bool_edge ) { readGraphMLElementEdgeGraphics(xml); } else readGraphMLElementUnknown(xml); } if (xml.isEndElement()) { //token ends here qDebug()<< " readGraphML(): element ends here: "<< xml.name().toString() ; if (xml.name() == "node") //node definition end endGraphMLElementNode(xml); else if (xml.name() == "edge") //edge definition end endGraphMLElementEdge(xml); } } } // this method reads a graph definition // called at Graph element void Parser::readGraphMLElementGraph(QXmlStreamReader &xml){ qDebug()<< " Parser: readGraphMLElementGraph()"; QXmlStreamAttributes xmlStreamAttr = xml.attributes(); QString defaultDirection = xmlStreamAttr.value("edgedefault").toString(); qDebug()<< " edgedefault "<< defaultDirection; if (defaultDirection=="undirected"){ undirected = 2; } else { undirected = 0; } networkName = xmlStreamAttr.value("id").toString(); qDebug()<< " graph id " << networkName; //store graph id to return it afterwards } // this method is needed because the QXmlStreamReader::hasAttribute // has been implemented in Qt 4.5. Therefore we need this ugly hack to // be able to compile SocNetV in all previous Qt4 version. :( //FIXME: This will be obsolete soon bool Parser::xmlStreamHasAttribute( QXmlStreamAttributes &xmlStreamAttr, QString str) const { int size = xmlStreamAttr.size(); for (register int i = 0 ; i < size ; i++) { qDebug() << " xmlStreamHasAttribute(): " << xmlStreamAttr.at(i).name().toString() << endl; if ( xmlStreamAttr.at(i).name() == str) return true; } return false; } // this method reads a key definition // called at key element void Parser::readGraphMLElementKey ( QXmlStreamAttributes &xmlStreamAttr ) { qDebug()<< " Parser: readGraphMLElementKey()"; key_id = xmlStreamAttr.value("id").toString(); qDebug()<< " key id "<< key_id; key_what = xmlStreamAttr.value("for").toString(); keyFor [key_id] = key_what; qDebug()<< " key for "<< key_what; // if (xmlStreamAttr.hasAttribute("attr.name") ) { // to be enabled in later versions.. if ( xmlStreamHasAttribute( xmlStreamAttr , QString ("attr.name") ) ) { key_name =xmlStreamAttr.value("attr.name").toString(); keyName [key_id] = key_name; qDebug()<< " key attr.name "<< key_name; } //if (xmlStreamAttr.hasAttribute("attr.type") ) { if ( xmlStreamHasAttribute( xmlStreamAttr , QString ("attr.type") ) ) { key_type=xmlStreamAttr.value("attr.type").toString(); keyType [key_id] = key_type; qDebug()<< " key attr.type "<< key_type; } //else if (xmlStreamAttr.hasAttribute("yfiles.type") ) { else if ( xmlStreamHasAttribute( xmlStreamAttr , QString ("yfiles.type") ) ) { key_type=xmlStreamAttr.value("yfiles.type").toString(); keyType [key_id] = key_type; qDebug()<< " key yfiles.type "<< key_type; } } // this method reads default key values // called at a default element (usually nested inside key element) void Parser::readGraphMLElementDefaultValue(QXmlStreamReader &xml) { qDebug()<< " Parser: readGraphMLElementDefaultValue()"; key_value=xml.readElementText(); keyDefaultValue [key_id] = key_value; //key_id is already stored qDebug()<< " key default value is "<< key_value; if (keyName.value(key_id) == "size" && keyFor.value(key_id) == "node" ) { qDebug()<< " this key default value "<< key_value << " is for node size"; conv_OK=false; initNodeSize= key_value.toInt(&conv_OK); if (!conv_OK) initNodeSize = 8; } if (keyName.value(key_id) == "shape" && keyFor.value(key_id) == "node" ) { qDebug()<< " this key default value "<< key_value << " is for nodes shape"; initNodeShape= key_value; } if (keyName.value(key_id) == "color" && keyFor.value(key_id) == "node" ) { qDebug()<< " this key default value "<< key_value << " is for nodes color"; initNodeColor= key_value; } if (keyName.value(key_id) == "label.color" && keyFor.value(key_id) == "node" ) { qDebug()<< " this key default value "<< key_value << " is for node labels color"; initNodeLabelColor= key_value; } if (keyName.value(key_id) == "label.size" && keyFor.value(key_id) == "node" ) { qDebug()<< " this key default value "<< key_value << " is for node labels size"; conv_OK=false; initNodeLabelSize= key_value.toInt(&conv_OK); if (!conv_OK) initNodeLabelSize = 8; } if (keyName.value(key_id) == "weight" && keyFor.value(key_id) == "edge" ) { qDebug()<< " this key default value "<< key_value << " is for edges weight"; conv_OK=false; initEdgeWeight= key_value.toFloat(&conv_OK); if (!conv_OK) initEdgeWeight = 1; } if (keyName.value(key_id) == "color" && keyFor.value(key_id) == "edge" ) { qDebug()<< " this key default value "<< key_value << " is for edges color"; initEdgeColor= key_value; } } // this method reads basic node attributes and sets the nodeNumber. // called at the start of a node element void Parser::readGraphMLElementNode(QXmlStreamReader &xml){ QXmlStreamAttributes xmlStreamAttr = xml.attributes(); node_id = (xmlStreamAttr.value("id")).toString(); aNodes++; qDebug()<<" Parser: readGraphMLElementNode() node id "<< node_id << " index " << aNodes << " added to nodeNumber map"; nodeNumber[node_id]=aNodes; //copy default node attribute values. //Some might change when reading element data, some will stay the same... nodeColor = initNodeColor; nodeShape = initNodeShape; nodeSize = initNodeSize; nodeNumberSize=initNodeNumberSize; nodeNumberColor=initNodeNumberColor; nodeLabel = node_id; nodeLabelSize=initNodeLabelSize; nodeLabelColor=initNodeLabelColor; bool_node = true; randX=rand()%gwWidth; randY=rand()%gwHeight; } // this method emits the node creation signal. // called at the end of a node element void Parser::endGraphMLElementNode(QXmlStreamReader &xml){ Q_UNUSED(xml); qDebug()<<" Parser: endGraphMLElementNode() *** signal to create node with id " << node_id << " nodenumber "<< aNodes << " coords " << randX << ", " << randY; emit createNode( aNodes, nodeSize, nodeColor, nodeNumberColor, nodeNumberSize, nodeLabel, nodeLabelColor, nodeLabelSize, QPointF(randX,randY), nodeShape, false ); bool_node = false; } // this method reads basic edge creation properties. // called at the start of an edge element void Parser::readGraphMLElementEdge(QXmlStreamAttributes &xmlStreamAttr){ qDebug()<< " Parser: readGraphMLElementEdge() id: " << xmlStreamAttr.value("id").toString(); QString s = xmlStreamAttr.value("source").toString(); QString t = xmlStreamAttr.value("target").toString(); if ( (xmlStreamAttr.value("directed")).toString() == "false") undirected = 2; source = nodeNumber [s]; target = nodeNumber [t]; edgeWeight=initEdgeWeight; bool_edge= true; qDebug()<< " edge source "<< s << " num "<< source; qDebug()<< " edge target "<< t << " num "<< target; } // this method emits the edge creation signal. // called at the end of edge element void Parser::endGraphMLElementEdge(QXmlStreamReader &xml){ Q_UNUSED(xml); qDebug()<<" Parser: endGraphMLElementEdge() *** emitting signal to create edge from "<< source << " to " << target; //FIXME need to return edge label as well! emit createEdge(source, target, edgeWeight, edgeColor, undirected, arrows, bezier); totalLinks++; bool_edge= false; } /* * this method reads data for edges and nodes * called at a data element (usually nested inside a node an edge element) */ void Parser::readGraphMLElementData (QXmlStreamReader &xml){ QXmlStreamAttributes xmlStreamAttr = xml.attributes(); key_id = xmlStreamAttr.value("key").toString(); key_value=xml.text().toString(); qDebug()<< " Parser: readGraphMLElementData(): key_id: " << key_id << " key_value "<< key_value; if (key_value.trimmed() == "") { qDebug()<< " Parser: readGraphMLElementData(): text: " << key_value; xml.readNext(); key_value=xml.text().toString(); qDebug()<< " Parser: readGraphMLElementData(): text: " << key_value; if ( key_value.trimmed() != "" ) { //if there's simple text after the StartElement, qDebug()<< " Parser: readGraphMLElementData(): key_id " << key_id << " value is simple text " < nodeSequence; //holds edges QList nodesDiscovered; //holds nodes; undirected=0; arrows=TRUE; bezier=FALSE; source=0, target=0; QFile file ( fileName ); if ( ! file.open(QIODevice::ReadOnly )) return false; QTextStream ts( &file ); aNodes=0; while (!ts.atEnd() ) { str= ts.readLine() ; str=str.simplified(); str=str.trimmed(); if ( isComment (str) ) continue; fileLine++; qDebug ()<<"Reading fileLine "<< fileLine; if ( fileLine == 1 ) { if ( str.contains("vertices",Qt::CaseInsensitive) //Pajek || str.contains("network",Qt::CaseInsensitive) //Pajek? || str.contains("[",Qt::CaseInsensitive) // GML || str.contains("DL",Qt::CaseInsensitive) //DL format || str.contains("list",Qt::CaseInsensitive) //list || str.startsWith("",Qt::CaseInsensitive) ) { qDebug()<< "* A node definition must be here ..." << str; end=str.indexOf('['); if (end!=-1) { temp=str.right(str.size()-end-1); //keep the properties temp=temp.remove(']'); temp=temp.remove(';'); node=str.left(end-1); node=node.remove('\"'); qDebug()<<"node named "<",Qt::CaseInsensitive) ){ //non directed = symmetric links if ( str.contains("--",Qt::CaseInsensitive) ) nodeSequence=str.split("--"); else nodeSequence=str.split("-"); } else { //is directed nodeSequence=str.split("->"); } //Create all nodes defined in nodeSequence for ( QList::iterator it=nodeSequence.begin(); it!=nodeSequence.end(); it++ ) { node=(*it).simplified(); qDebug () << " nodeSequence node "<< node; if ( (aNum=nodesDiscovered.indexOf( node ) ) == -1) { aNodes++; randX=rand()%gwWidth; randY=rand()%gwHeight; qDebug()<<" *** Creating node "<< aNodes << " at "<< randX <<","<< randY <<" label "< 2 ) {//there is a node definition here node=str.left(start).remove('\"').simplified(); qDebug()<<"node label: "<. * ********************************************************************************/ #include //for writing the adjacency matrix to a file #include //allows the use of pow(float/double, float/double) function #include //allows the use of RAND_MAX macro #include #include //used for qDebug messages #include // used in exporting centrality files #include #include //for list iterators #include //for BFS queue Q #include "graph.h" Graph::Graph() { m_totalVertices=0; outEdgesVert=0; inEdgesVert=0; reciprocalEdgesVert=0; order=true; //returns true if the indexes of the list is ordered. graphModified=false; m_undirected=false; symmetricAdjacencyMatrix=true; adjacencyMatrixCreated=false; distanceMatrixCreated=false; calculatedIDC=false; calculatedODC=false; calculatedCentralities=false; dynamicMovement=false; timerId=0; layoutType=0; parser.setParent(this); connect ( &parser, SIGNAL( createNode (int,int,QString, QString, int, QString, QString, int, QPointF, QString, bool) ), this, SLOT(createVertex(int,int,QString, QString, int, QString, QString, int, QPointF, QString, bool) ) ) ; connect ( &parser, SIGNAL(createEdge (int, int, float, QString, int, bool, bool)), this, SLOT(createEdge (int, int, float, QString, int, bool, bool) ) ); connect ( &parser, SIGNAL(fileType(int, QString, int, int, bool)), this, SLOT(setFileType(int, QString, int, int, bool)) ); connect ( &parser, SIGNAL(removeDummyNode(int)), this, SLOT (removeDummyNode(int)) ); connect ( &crawler, SIGNAL( createNode (QString, int) ), this, SLOT(createVertex(QString, int ) ) ) ; connect ( &crawler, SIGNAL(createEdge (int, int)), this, SLOT(createEdge (int, int) ) ); } /** main node creation slot, associated with homonymous signal from Parser. Adds a Vertex to the Graph and calls addNode of GraphicsWidget p holds the desired position of the new node. The new Vertex is named i and stores its color, label, label color, shape and position p. */ void Graph::createVertex(int i, int size, QString nodeColor, QString numColor, int numSize, QString label, QString lColor, int lSize, QPointF p, QString nodeShape, bool signalMW){ int value = 1; addVertex(i, value, size, nodeColor, numColor, numSize, label, lColor, lSize, p, nodeShape); emit drawNode( i, size, nodeColor, numColor, numSize, label, lColor, lSize, p, nodeShape, initShowLabels, initNumbersInsideNodes, true); if (signalMW) emit graphChanged(); initVertexColor=nodeColor; //draw new user-clicked nodes with the same color with that of the file loaded initVertexShape=nodeShape; initVertexSize=size; } /** auxilliary node creation slot. Called from GW, with i and p as parameters. p holds the desired position of the new node. Calls the main creation slot with init node values. */ void Graph::createVertex(int i, QPointF p){ if ( i < 0 ) i = lastVertexNumber() +1; qDebug("Graph::createVertex(). Using vertex number %i with FIXED coords...", i); createVertex( i, initVertexSize, initVertexColor, initVertexNumberColor, initVertexNumberSize, QString::number(i), initVertexLabelColor, initVertexLabelSize, p, initVertexShape, true ); } /** second auxilliary node creation slot. Called from MW only with parameter i. Calculates a random position p from canvasWidth and Height. Then calls the main creation slot with init node values. */ void Graph::createVertex(int i, int cWidth, int cHeight){ if ( i < 0 ) i = lastVertexNumber() +1; qDebug("Graph::createVertex(). Using vertex number %i with RANDOM node coords...", i); QPointF p; p.setX(rand()%cWidth); p.setY(rand()%cHeight); createVertex( i, initVertexSize, initVertexColor, initVertexNumberColor, initVertexNumberSize, QString::number(i), initVertexLabelColor, initVertexLabelSize, p, initVertexShape, true ); } /** third auxilliary node creation slot. Called from WebCrawler with parameter i. Calculates a random position p from canvasWidth and Height. Then calls the main creation slot with init node values. */ void Graph::createVertex(QString label, int i) { if ( i < 0 ) i = lastVertexNumber() +1; qDebug("Graph::createVertex(). Using vertex number %i with RANDOM node coords but with LABEL...", i); QPointF p; p.setX(rand()%canvasWidth); p.setY(rand()%canvasHeight); createVertex( i, initVertexSize, initVertexColor, initVertexNumberColor, initVertexNumberSize, label, initVertexLabelColor, initVertexLabelSize, p, initVertexShape, true ); } void Graph::setCanvasDimensions(int w, int h){ qDebug() << "Graph:: setCanvasDimensions() to " << w << " " << h ; canvasWidth = w; canvasHeight= h; } /** Called from homonymous signal of Parser class. Adds an Edge to the Graph, then emits drawEdge() which calls GraphicsWidget::addEdge() to draw the new edge. Also called from MW when user clicks on the "add link" button Alse called from GW (via createEdge() below) when user middle-clicks. */ void Graph::createEdge(int v1, int v2, float weight, QString color, int reciprocal=0, bool drawArrows=true, bool bezier=false){ if ( reciprocal == 2) { qDebug()<<"*** Graph: createEdge() from "<hasEdge( v2, v1) ) { qDebug()<<"*** Graph: createEdge() from "<hasEdge(source, target) ) { qDebug()<< " Graph::createEdge - Edge from " << source << " to " << target << " already exists - returning..."; return; } qDebug()<< " Graph::createEdge - New edge from " << source << " to " << target ; float weight = 1.0; bool reciprocal=false; bool drawArrows=true; bool bezier=false; createEdge(source, target, weight, initEdgeColor, reciprocal, drawArrows, bezier); } /** * This is called from loadPajek method of Parser in order to delete any redundant (dummy) nodes. */ void Graph::removeDummyNode(int i){ qDebug("**Graph: RemoveDummyNode %i", i); removeVertex(i); // emit selectedVertex(i); } /** Adds a Vertex named v1, valued val, sized nszm colored nc, labeled nl, labelColored lc, shaped nsp, at point p This method is called by createVertex() method */ void Graph::addVertex ( int v1, int val, int size, QString color, QString numColor, int numSize, QString label, QString labelColor, int labelSize, QPointF p, QString shape ){ if (order) index[v1]=m_totalVertices; else index[v1]=m_graph.size(); m_graph.append( new Vertex(this, v1, val, size, color, numColor, numSize, label, labelColor, labelSize, p, shape) ); m_totalVertices++; qDebug() << "Graph: addVertex(): Vertex named " << m_graph.back()->name() << " appended with index= "<0) return m_graph.back()->name(); else return 0; } /** Returns the name of the first vertex. Used by slotRemoveNode of MW */ int Graph::firstVertexNumber() { if (m_totalVertices>0) return m_graph.front()->name(); else return 0; } /** Removes the vertex named Doomed from the graph First, it removes all edges to Doomed from other vertices Then it changes the index of all subsequent vertices inside m_graph Finally, it removes the vertex. */ void Graph::removeVertex(long int Doomed){ qDebug() << "Graph: removeVertex " << m_graph[ index[Doomed] ]->name() << " with index= " << index[Doomed] ; long int indexOfDoomed=index[Doomed]; //Remove links to Doomed from each other vertex for (QList::iterator it=m_graph.begin(); it!=m_graph.end(); it++){ if ( (*it)->isLinkedTo(Doomed) != 0) { qDebug()<< "Graph: Vertex " << (*it)->name() << " is linked to selected and has outDegree " << (*it)->outDegree() ; if ( (*it)->outDegree() == 1 && (*it)->isLinkedFrom(Doomed) != 0 ) { qDebug() << "Graph: decreasing reciprocalEdgesVert"; (*it)->setReciprocalLinked(FALSE); } (*it)->removeLinkTo(Doomed) ; } if ( (*it)->isLinkedFrom(Doomed) != 0 ) { (*it)->removeLinkFrom(Doomed); } } qDebug()<< "Graph: Finished with vertices. Update the index which maps vertices inside m_graph " ; long int prevIndex=indexOfDoomed; long int tempIndex=0; //Find the position of the Vertex inside m_graph map::iterator pos=index.find(Doomed); qDebug() << "Graph: vertex " << (pos)->first << " index "<< (pos)->second << " to be erased. "; //find next active vertex inside index (pos)->second = -1; while ( (pos)->second == -1 ) ++pos; qDebug() << "Graph: posNext " << (pos)->first << " index "<< (pos)->second ; //Update the index of all subsequent vertices map::iterator it1; for (it1=pos; it1!=index.end(); it1++) { qDebug() << "Graph: vertex " << (it1)->first << " with index "<< (it1)->second << " will take index" << prevIndex; tempIndex=(it1)->second; (it1)->second=prevIndex; prevIndex=tempIndex; qDebug() << "Graph: now vertex " << (it1)->first << " has index "<< (it1)->second ; } //Now remove vertex Doomed from m_graph qDebug() << "Graph: graph vertices=size="<< vertices() << "=" << m_graph.size() << " removing vertex at index " << indexOfDoomed ; m_graph.removeAt( indexOfDoomed ) ; m_totalVertices--; qDebug() << "Graph: Now graph vertices=size="<< vertices() << "=" << m_graph.size() << " total edges now " << totalEdges(); order=false; graphModified=true; emit graphChanged(); emit eraseNode(Doomed); } /** Creates an edge between v1 and v2 */ void Graph::addEdge (int v1, int v2, float weight, QString color, int reciprocal) { int source=index[v1]; int target=index[v2]; qDebug()<< "Graph: addEdge() from vertex "<< v1 << "["<< source<< "] to vertex "<< v2 << "["<< target << "] of weight "<setOutLinked(TRUE) ; m_graph [ source ]->addLinkTo(v2, weight ); m_graph [ target ]->setInLinked(TRUE) ; m_graph [ target ]->addLinkFrom(v1, weight); m_totalEdges++; if (reciprocal == 1){ m_graph [ source ]->setReciprocalLinked(TRUE); m_graph [ target ]->setReciprocalLinked(TRUE); } else if (reciprocal == 2){ m_graph [ source ]->setReciprocalLinked(TRUE); m_graph [ target ]->setReciprocalLinked(TRUE); m_graph [ target ]->addLinkTo(v1, weight ); m_graph [ source ]->addLinkFrom(target, weight); m_totalEdges++; } qDebug()<<"Graph: addEdge() now a("<< v1 << ","<< v2<< ") = " << m_graph [ source ]->isLinkedTo(v2) << " with color "<< color<<" . Storing edge color..." << ". Total Links " <setOutLinkColor(v2, color); graphModified=true; } /** Change edge (arc) weight between v1 and v2 */ void Graph::setEdgeWeight (int v1, int v2, float weight) { qDebug() << "Graph: setEdgeWeight between " << v1 << "[" << index[v1] << "] and " << v2 << "[" << index[v2] << "]" << " = " << weight; m_graph [ index[v1] ]->changeLinkWeightTo(v2, weight); graphModified=true; emit graphChanged(); } /** Removes the edge (arc) between v1 and v2 */ void Graph::removeEdge (int v1, int v2) { qDebug ()<< "Graph: removeEdge edge " << v1 << " to " << v2 << " to be removed from graph"; qDebug() << "Graph: Vertex named " << m_graph[ index[v1] ]->name() << " has index = " << index[v1]; m_graph [ index[v1] ]->removeLinkTo(v2); m_graph [ index[v2] ]->removeLinkFrom(v1); qDebug()<< "Graph: removeEdge between " << v1 << " i " << index[v1] << " and " << v2 << " i "<< index[v2] << " NOW vertex v1 reports edge weight " << m_graph [ index[v1] ]->isLinkedTo(v2) ; if ( this->hasEdge(v2,v1) !=0) symmetricAdjacencyMatrix=false; m_totalEdges--; if (m_totalEdges<0) m_totalEdges=0; graphModified=true; qDebug("Graph: removeEdge(): emitting eraseEdge to GW"); emit eraseEdge(v1,v2); emit graphChanged(); } //Called by MW to start a web crawler... void Graph::webCrawl( QString seed, int maxNodes, int maxRecursion, bool goOut){ qDebug() << "Graph:: webCrawl - Calling thread for " << seed ; crawler.load(seed, maxNodes, maxRecursion, goOut); qDebug("Graph:: See the thread? :)"); } /** Called from filterOrphanNodes via MainWindow to filter nodes with no links For each orphan Vertex in the Graph, emits the filterVertex() */ void Graph::filterOrphanVertices(bool filterFlag){ if (filterFlag) qDebug() << "Graph: filterOrphanVertices() enabling all orphan nodes"; else qDebug() << "Graph: filterOrphanVertices() disabling all orphan nodes"; QList::iterator it; for (QList::iterator it=m_graph.begin(); it!=m_graph.end(); it++){ if ( (*it)->isOutLinked() || (*it)->isInLinked() ){ continue; } else { qDebug() << "Graph:filterOrphanNodes() Vertex " << (*it)->name() << " not linked. Toggling it and emitting setVertexVisibility signal to GW..."; (*it)->setEnabled (filterFlag) ; emit setVertexVisibility( (*it)-> name(), filterFlag ); } } } /** Called from filterEdgesDialog via MainWindow to filter edges over or under a specified weight (m_threshold) For each Vertex in the Graph, calls the homonymous method of Vertex class. */ void Graph::filterEdgesByWeight(float m_threshold, bool overThreshold){ if (overThreshold) qDebug() << "Graph: filterEdgesByWeight() over " << m_threshold ; else qDebug() << "Graph: filterEdgesByWeight() below "<< m_threshold ; QList::iterator it; for (QList::iterator it=m_graph.begin(); it!=m_graph.end(); it++){ if ( (*it)->isOutLinked() ){ (*it)->filterEdgesByWeight ( m_threshold, overThreshold ); } else qDebug() << "Graph:filterEdgesByWeight() Vertex " << (*it)->name() << " not linked. Proceeding..."; } } void Graph::slotSetEdgeVisibility ( int source, int target, bool visible) { qDebug() << "Graph: slotSetEdgeVisibility - emitting signal to GW"; emit setEdgeVisibility ( source, target, visible); } /** Checks if there is a specific vertex in the graph Returns the index or -1 Complexity: O(logN) for index retrieval */ int Graph::hasVertex(long int num){ qDebug () << "Graph: hasVertex() v: " << num << " with index " << index[num] << " named " << m_graph[ index[num]] ->name(); if ( m_graph[ index[num]] ->name() == num) return index[num]; else return -1; } /** Checks if there is a vertex with a specific label in the graph Returns the index or -1 Complexity: O(N) */ int Graph::hasVertex(QString label){ qDebug ()<<"Graph: hasVertex( "<< label.toAscii() <<" ) ?" ; QList::iterator it; int i=0; for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( (*it) ->label() == label) { qDebug()<< "Graph: hasVertex() at pos %i" << i; return i; } i++; } qDebug("Graph: hasVertex() NO - returning -1"); return -1; } void Graph::setInitVertexSize (long int size) { initVertexSize=size; } //Changes the size.of vertex v void Graph::setVertexSize(long int v, int size) { m_graph[ index[v] ]->setSize(size); graphModified=true; emit graphChanged(); } void Graph::setInitVertexShape(QString shape) { initVertexShape=shape; } //Changes the shape.of vertex v void Graph::setVertexShape(int v1, QString shape){ m_graph[ index[v1] ]->setShape(shape); graphModified=true; emit graphChanged(); } //returns the shape of this vertex QString Graph::shape(int v1){ return m_graph[ index[v1] ]->shape(); } //Changes the initial color of vertices numbers void Graph::setInitVertexNumberColor (QString color) { initVertexNumberColor = color; } //Changes the initial size of vertices numbers void Graph::setInitVertexNumberSize (int size) { initVertexNumberSize = size; } /**Changes the label.of vertex v */ void Graph::setVertexLabel(int v1, QString label){ qDebug()<< "Graph: setVertexLabel for "<< v1 << ", index " << index[v1]<< " with label"<< label; m_graph[ index[v1] ]->setLabel ( label); graphModified=true; emit graphChanged(); } //Changes the init size of new vertices labels void Graph::setInitVertexLabelSize(int newSize) { initVertexLabelSize = newSize; } //Changes the size of a vertex label void Graph::setVertexLabelSize(int v1, int newSize) { qDebug()<< "Graph: setVertexLabelSize for "<< v1 << ", index " << index[v1]<< " with size "<< newSize; m_graph[ index[v1] ] -> setLabelSize ( newSize ); graphModified=true; emit graphChanged(); } //Changes the shape.of vertex v void Graph::setVertexLabelColor(int v1, QString color){ m_graph[ index[v1] ]->setLabelColor(color); graphModified=true; emit graphChanged(); } void Graph::setInitVertexLabelColor(QString color){ initVertexLabelColor=color; } QString Graph::label(int v1){ return m_graph[ index[v1] ]->label (); } /** Changes the color of vertice v1 */ void Graph::setVertexColor(long int v1, QString color){ qDebug()<< "Graph: setVertexColor for "<< v1 << ", index " << index[v1]<< " with color "<< color; m_graph[ index[v1] ]->setColor ( color ); graphModified=true; emit graphChanged(); } void Graph::setInitVertexColor(QString color){ initVertexColor=color; } void Graph::setInitEdgeColor(QString color){ initEdgeColor=color; } /** Changes the color of edge (s,t). */ void Graph::setEdgeColor(long int s, long int t, QString color){ qDebug()<< "Graph: setEdgeColor for edge ("<< s << ","<< t<<")"<<" with index ("<< index[s]<< ","<setOutLinkColor(t, color); if (isSymmetric()) { m_graph[ index[t] ]->setOutLinkColor(s, color); } emit graphChanged(); } //Returns the edgeColor QString Graph::edgeColor (long int s, long int t){ return m_graph[ index[s] ]->outLinkColor(t); } /** Checks if there is an edge from v1 to v2 Complexity: O(logN) for index retrieval + O(1) for QList index rerieval + O(logN) for checking edge(v2) */ float Graph::hasEdge (int v1, int v2) { float weight=0; if ( ! m_graph[ index[v1] ] -> isEnabled() || ! m_graph[ index[v2] ] -> isEnabled()) return 0; if ( (weight= m_graph[ index[v1] ] -> isLinkedTo(v2) ) != 0 ) { //qDebug() << "Graph: hasEdge() between " << v1 << " " << index[v1] << " and " << v2 << " " << index[v2] << " = " << weight; return weight; } else { return 0; } } /** Called from MainWindow */ void Graph::updateVertCoords(int v1, int x, int y){ //qDebug("Graph: updateVertCoords() for %i with index %i with %i, %i", v1, index[v1], x,y); m_graph[ index[v1] ]->setX( x ); m_graph[ index[v1] ]->setY( y ); graphModified=true; } /** Returns the number of edges (arcs) from vertex v1 */ int Graph::edgesFrom (int v1) { qDebug("Graph: edgesFrom()"); return m_graph[ index[v1] ]->outDegree(); } /** Returns the number of edges (arcs) to vertex v1 */ int Graph::edgesTo (int v1) { qDebug("Graph: edgesTo()"); QList::iterator it; int m_outEdgesTo=0; for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( (*it)->isLinkedTo(v1) != 0) m_outEdgesTo++; } return m_outEdgesTo; } /** Returns |E| of graph */ int Graph::totalEdges () { qDebug("Graph: totalEdges()"); int tEdges=0; QList::iterator it; for (it=m_graph.begin(); it!=m_graph.end(); it++){ tEdges+=(*it)->outDegree(); } qDebug() << "Graph: m_totalEdges = " << m_totalEdges << ", tEdges=" << tEdges; return tEdges; } /** Returns |V| of graph */ int Graph::vertices () { qDebug("Graph: vertices()"); return m_totalVertices; } float Graph::density() { qDebug("Graph: density()"); int vert=vertices(); if (vert!=0 && vert!=1) return (float) totalEdges() / (float)(vert*(vert-1.0)); else return 0; } /** Returns the sum of vertices having outEdges */ int Graph::verticesWithOutEdges(){ return outEdgesVert; } /** Returns the sum of vertices having inEdges */ int Graph::verticesWithInEdges(){ return inEdgesVert; } /** Returns the sum of vertices having reciprocal edges */ int Graph:: verticesWithReciprocalEdges(){ return reciprocalEdgesVert; } /** Clears all vertices */ void Graph::clear() { //qDebug("Graph: m_graph reports size %i", m_graph.size()); m_graph.clear(); index.clear(); discreteIDCs.clear(); discreteODCs.clear(); m_totalVertices=0; m_totalEdges=0; outEdgesVert=0; inEdgesVert=0; reciprocalEdgesVert=0; order=true; //returns true if the indexes of the list is ordered. m_undirected=false; calculatedIDC=false; calculatedODC=false; calculatedCentralities=false; adjacencyMatrixCreated=false; graphModified=false; symmetricAdjacencyMatrix=true; if (parser.isRunning() ) //tell the other thread that we must quit! parser.quit(); if (crawler.isRunning() ){ //tell the other thread that we must quit! crawler.terminateReaderQuit(); crawler.quit(); } //qDebug("Graph: m_graph cleared. Now reports size %i", m_graph.size()); } /** Returns TRUE if the adjacency matrix is symmetric */ bool Graph::isSymmetric(){ qDebug("Graph: isSymmetric "); if (graphModified){ symmetricAdjacencyMatrix=TRUE; imap_f::iterator it1; int y=0; QList::iterator it; for (it=m_graph.begin(); it!=m_graph.end(); it++){ //for all edges of u, (u,y) //qDebug("Graph: isSymmetric(): GRAPH CHANGED! Iterate over all edges of u..."); for( it1 = (*it)->m_outEdges.begin(); it1 != (*it)->m_outEdges.end(); it1++ ) { y=index[it1->first]; if ( ! m_graph[y]->isLinkedTo( (*it)->name() )) { //qDebug("Graph: isSymmetric(): u = %i IS NOT inLinked from y = %i", (*it)->name(), it1->first ); symmetricAdjacencyMatrix=FALSE; qDebug("Graph: isSymmetric() NO"); return symmetricAdjacencyMatrix; } else { // qDebug("Graph: isSymmetric(): u = %i IS inLinked from y = %i",it1->first, (*it)->name() ); } } } graphModified=false; } qDebug("Graph: isSymmetric() YES"); return symmetricAdjacencyMatrix; } /** * Transform the directed network to symmetric (all edges reciprocal) */ void Graph::symmetrize(){ qDebug("Graph: symmetrize"); QList::iterator it; imap_f::iterator it1; int y; for (it=m_graph.begin(); it!=m_graph.end(); it++){ //for all edges (u,y) of u, do qDebug("Graph: making all edges reciprocal. First iterate over all edges of u..."); for( it1 = (*it)->m_outEdges.begin(); it1 != (*it)->m_outEdges.end(); it1++ ) { y=index[it1->first]; if ( ! m_graph[y]->isLinkedTo( (*it)->name() )) { qDebug() << "Graph: symmetrize: u = " << (*it)->name() << " IS NOT inLinked from y = " << it1->first ; createEdge(it1->first, (*it)->name(), it1->second, initEdgeColor, false, true, false); } else qDebug() << "Graph: symmetrize: u = " << it1->first << " IS inLinked from y = " << (*it)->name() ; } } graphModified=TRUE; symmetricAdjacencyMatrix=TRUE; emit graphChanged(); } bool Graph::symmetricEdge(int v1, int v2){ qDebug("***Graph: symmetricEdge()"); if ( (this->hasEdge ( v1, v2 ) ) > 0 && (this->hasEdge ( v2, v1 ) ) > 0 ) { qDebug("Graph: symmetricEdge: YES"); return true; } else { qDebug("Graph: symmetricEdge: NO"); return false; } } /** * Returns the distance between nodes numbered (i-1) and (j-1) */ int Graph::distance(int i, int j){ if (graphModified || !distanceMatrixCreated ){ createDistanceMatrix(false); graphModified=false; } return DM.item(index[i],index[j]); } /** * Returns the diameter of the graph, aka the largest geodesic distance between any two vertices */ int Graph::diameter(){ if (graphModified){ createDistanceMatrix(false); graphModified=false; } return graphDiameter; } /** * Returns the average distance of the graph */ float Graph::averageGraphDistance(){ if (graphModified){ createDistanceMatrix(false); graphModified=false; } return averGraphDistance; } /** * Writes the matrix of distances to a file */ void Graph::writeDistanceMatrix (const char* fn, const char* fn1, const char* netName) { qDebug ("Graph::writeDistanceMatrix()"); createDistanceMatrix(false); qDebug ("Graph::writeDistanceMatrix() writing to file"); ofstream file (fn); ofstream file1 (fn1); int dist=-1, sigma=-1; char one_space[] = " "; Q_UNUSED (one_space); char two_spaces[] = " "; char three_spaces[] = " "; Q_UNUSED (three_spaces); char four_spaces[] = " "; char five_spaces[] = " "; Q_UNUSED (five_spaces); char six_spaces[] = " "; char seven_spaces[] = " "; char eight_spaces[] = " "; char nine_spaces[] = " "; char ten_spaces[] = " "; file << "-Social Network Visualizer- \n"; if (!netName) netName="Unnamed network"; file << "Distance matrix of "<< netName<<": \n\n"; //write out matrix of geodesic distances QList::iterator it, it1; int i=0, j=0; file << ten_spaces << two_spaces; for (it=m_graph.begin(); it!=m_graph.end(); it++){ file << ++i ; if (i>9999) file << six_spaces; else if (i>999) file << seven_spaces; else if (i>99) file << eight_spaces; else if(i>9) file << nine_spaces; else file << ten_spaces ; } file<9999) file << two_spaces; if (i>999) file << four_spaces; else if (i>99) file << six_spaces ; else if(i>9) file << eight_spaces; else file << ten_spaces; j=0; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ ++j; if ( (dist= DM.item( index[(*it)->name()], index[(*it1)->name()] ) )!=-1 ) { file << dist; if (dist>999) file << seven_spaces; else if (dist>99) file << eight_spaces; else if(dist>9) file << nine_spaces; else file << ten_spaces; } else file << "0"<< ten_spaces; } file << endl; } file.close(); //write out matrix of sigmas for (it=m_graph.begin(); it!=m_graph.end(); it++){ for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( (sigma= TM.item( index[(*it)->name()], index[(*it1)->name()] ) )!=-1 ) { file1 << sigma<<" "; } else file1 << "0 "; } file1 << endl; } file1.close(); } /** Creates a matrix DM which stores geodesic distances between all vertices INPUT: boolean doCalculcateCentralities OUTPUT: DM(i,j)=geodesic distance between vertex i and vertex j TM(i,j)=number of shortest paths from vertex i to vertex j, called sigma(i,j). graphDiameter is set to the length of the longest shortest path between every (i,j) Also, if doCalculcateCentralities==TRUE, it calculates the centralities for every u in V: - Betweeness: BC(u) = Sum ( sigma(i,j,u)/sigma(i,j) ) for every s,t in V - Stress: SC(u) = Sum ( sigma(i,j) ) for every s,t in V - Graph: CC(u) = 1/maxDistance(u,t) for some t in V - Closeness: CC(u) = 1 / Sum( DM(u,t) ) for every t in V */ void Graph::createDistanceMatrix(bool doCalculcateCentralities) { qDebug ("Graph::createDistanceMatrix()"); if ( !graphModified && distanceMatrixCreated && !doCalculcateCentralities) { qDebug("Graph: distanceMatrix not mofified. Escaping."); return; } //Create a NxN DistanceMatrix. Initialise values to zero. qDebug() << "Graph::createDistanceMatrix() Resizing Matrices to hold " << m_totalVertices << " vertices"; DM.resize(m_totalVertices); TM.resize(m_totalVertices); int aVertices=vertices(); int aEdges = totalEdges(); //maybe we will use m_totalEdges here to save some time?... if ( aEdges == 0 ) DM.fillMatrix(0); else { qDebug() << " for all vertices set their distances to -1 (infinum)"; DM.fillMatrix(-1); qDebug () << " for all vertices set their sigmas as 0"; TM.fillMatrix(0); QList::iterator it, it1; QList::iterator it2; int w=0, u=0,s=0, i=0; float d_sw=0, d_su=0; float CC=0, BC=0, SC= 0, GC=0, EC=0, PC=0, stdGC=0, stdEC=0; int progressCounter=0; graphDiameter=0; distanceMatrixCreated = false; averGraphDistance=0; nonZeroDistancesCounter=0; qDebug() << " graphDiameter "<< graphDiameter << " averGraphDistance " <setBC( 0.0 ); (*it)->setSC( 0.0 ); (*it)->setGC( 0.0 ); (*it)->setCC( 0.0 ); (*it)->setPC( 0.0 ); } qDebug("MAIN LOOP: for every s in V do (solve the single source shortest path problem..."); for (it=m_graph.begin(); it!=m_graph.end(); it++){ progressCounter++; emit updateProgressDialog( progressCounter ); if ( ! (*it)->isEnabled() ) continue; s=index[(*it)->name()]; qDebug() << "Source vertex s = " << (*it)->name() << " of BFS algorithm has index " << s << ". Clearing Stack ..."; if (doCalculcateCentralities){ qDebug("Empty stack Stack which will return vertices in order of their (non increasing) distance from S ..."); //- Complexity linear O(n) while ( !Stack.empty() ) Stack.pop(); i=0; qDebug("...and for each vertex: empty list Ps of predecessors"); for (it1=m_graph.begin(); it1!=m_graph.end(); it1++) { (*it1)->clearPs(); //initialize all sizeOfNthOrderNeighborhood to zero sizeOfNthOrderNeighborhood[ i ]=0; i++; } } qDebug() << "PHASE 1 (SSSP): Call BFS for source vertex " << (*it)->name() << " to determine distances and shortest path counts from s to every vertex t" ; BFS(s,doCalculcateCentralities ); qDebug("***** FINISHED PHASE 1 (SSSP) BFS ALGORITHM. Continuing to calculate centralities"); if (doCalculcateCentralities){ qDebug() << "Set centrality for current source vertex " << (*it)->name() << " with index s = " << s ; if ( (*it)->CC() != 0 ) //Closeness centrality must be inverted CC=1.0/(*it)->CC(); else CC=0; (*it)->setSCC ( CC * ( aVertices-1.0) ); (*it)->setCC( CC ); //Resolve classes Closeness centrality qDebug("=========Resolving CC classes..."); resolveClasses(CC, discreteCCs, classesCC,(*it)->name() ); sumCC+=CC; minmax( (*it)->SCC(), (*it), maxCC, minCC, maxNodeCC, minNodeCC) ; //And graph centrality must be inverted... if ( (*it)->GC() != 0 ) { EC=(*it)->GC(); //Eccentricity Centrality is max geodesic GC=1.0/EC; //Graph Centrality is inverted Eccentricity } else { GC=0; EC=0;} (*it)->setGC( GC ); //Set Graph Centrality (*it)->setEC( EC ); //Set Eccentricity Centrality //Resolve classes Graph centrality resolveClasses(GC, discreteGCs, classesGC); stdGC =(aVertices-1.0)*GC ; (*it)->setSGC(stdGC); sumGC+=GC; minmax( GC, (*it), maxGC, minGC, maxNodeGC, minNodeGC) ; stdEC =EC/(aVertices-1.0); (*it)->setSEC(stdEC); sumEC+=EC; minmax( EC, (*it), maxEC, minEC, maxNodeEC, minNodeEC) ; i=1; //used in calculating power centrality sizeOfComponent = 1; PC=0; qDebug("PHASE 2 (ACCUMULATION): Start back propagation of dependencies. Set dependency delta[u]=0 on each vertex"); for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ (*it1)->setDelta(0.0); //Calculate Power Centrality: In = [ 1/(N-1) ] * ( Nd1 + Nd2 * 1/2 + ... + Ndi * 1/i ) // where Ndi (sizeOfNthOrderNeighborhood) is the number of nodes at distance i from this node. PC += ( 1.0 / (float) i ) * sizeOfNthOrderNeighborhood[i]; // where N is the sum Nd0 + Nd1 + Nd2 + ... + Ndi, that is the amount of nodes in the same component as the current node sizeOfComponent += sizeOfNthOrderNeighborhood[i]; i++; } (*it)->setPC( PC ); //Set Power Centrality sumPC += PC; minmax( PC, (*it), maxPC, minPC, maxNodePC, minNodePC) ; //Find min & max PC - not using stdSC if ( sizeOfComponent != 1 ) PC = ( 1.0/(sizeOfComponent-1.0) ) * PC; else PC = 0; (*it)->setSPC( PC ); //Set Standardized Power Centrality qDebug() << "Visit all vertices in reverse order of their discovery (from s = " << s << " ) to sum dependencies. Initial Stack size has " << Stack.size(); while ( !Stack.empty() ) { w=Stack.top(); qDebug("Stack top is vertex w=%i. This is the furthest vertex from s. Popping it.", w); Stack.pop(); QList lst=m_graph[w]->Ps(); qDebug("preLOOP: Checking size of predecessors list Ps[w]... = %i ",lst.size()); qDebug("LOOP: for every other vertex u in the list of predecessors Ps[w] of w...."); if (lst.size() > 0) // just in case...do a sanity check for ( it2=lst.begin(); it2 != lst.end(); it2++ ){ u=(*it2); qDebug("Selecting Ps[w] element u=%i with delta_u=%f. sigma(u)=TM(s,u)=%f, sigma(w)=TM(s,w)=%f, delta_w=%f ", u, m_graph[u]->delta(),TM.item(s,u), TM.item(s,w), m_graph[w]->delta()); if ( TM.item(s,w) > 0) { //delta[u]=delta[u]+(1+delta[w])*(sigma[u]/sigma[w]) ; d_su=m_graph[u]->delta()+(1.0+m_graph[w]->delta() ) * ( (float)TM.item(s,u)/(float)TM.item(s,w) ); } else { d_su=m_graph[u]->delta(); qDebug("TM (s,w) zero, i.e. zero shortest path counts from s to w - using SAME DELTA for vertex u"); } qDebug("Assigning new delta d_su = %f to u = %i", d_su, u); m_graph[u]->setDelta( d_su); } qDebug()<<" Adding delta_w to BC of w"; if (w!=s) { qDebug("w!=s. For this furthest vertex we need to add its new delta %f to old BC index: %f",m_graph[w]->delta(), m_graph[w]->BC()); d_sw = m_graph[w]->BC() + m_graph[w]->delta(); qDebug("New BC = d_sw = %f", d_sw); m_graph[w]->setBC (d_sw); } } } } if (averGraphDistance!=0) averGraphDistance = averGraphDistance / (nonZeroDistancesCounter); if (doCalculcateCentralities) { for (it=m_graph.begin(); it!=m_graph.end(); it++) { if (symmetricAdjacencyMatrix) { qDebug("Betweeness centrality must be divided by two if the graph is undirected"); (*it)->setBC ( (*it)->BC()/2.0); } BC=(*it)->BC(); qDebug("Resolving BC classes..."); resolveClasses(BC, discreteBCs, classesBC); qDebug("******************* BC %f maxIndex: %f", BC, maxIndexBC); (*it)->setSBC( BC/maxIndexBC ); //Find min & max BC - not using stdBC: Wasserman & Faust, pp. 191-192 sumBC+=BC; minmax( BC, (*it), maxBC, minBC, maxNodeBC, minNodeBC) ; qDebug("Resolving SC classes..."); SC=(*it)->SC(); resolveClasses(SC, discreteSCs, classesSC); (*it)->setSSC ( SC/maxIndexSC ); //Find min & max SC - not using stdSC sumSC+=SC; minmax( SC, (*it), maxSC, minSC, maxNodeSC, minNodeSC) ; } for (it=m_graph.begin(); it!=m_graph.end(); it++) { //Find denominal of groupSC BC=(*it)->BC(); SC=(*it)->SC(); nomSC +=(maxSC - SC ); //Calculate the numerator of groupBC according to Freeman's group Betweeness nomBC +=(maxBC - BC ); //nomBC +=(maxBC - (*it)->SBC()); //Find denominal of groupGC nomGC += maxGC-(*it)->SGC(); //Find denominal of groupCC nomCC += maxCC- (*it)->SCC(); } maxCC = (aVertices-1.0)*maxCC; //standardize minimum and maximum Closeness centrality minCC = (aVertices-1.0)*minCC; denomCC = (( aVertices-2.0) * (aVertices-1.0))/ (2.0*aVertices-3.0); groupCC = nomCC/denomCC; //Calculate group Closeness centrality nomBC*=2.0; denomBC = (aVertices-1.0) * (aVertices-1.0) * (aVertices-2.0); //denomBC = (aVertices-1.0); groupBC=nomBC/denomBC; //Calculate group Betweeness centrality denomGC = ( ( aVertices-2.0) * (aVertices-1.0) )/ (2.0*aVertices-3.0); groupGC= nomGC/denomGC; //Calculate group Graph centrality nomSC*=2.0; denomSC = (aVertices-1.0) * (aVertices - 1.0) * (aVertices-2.0); groupSC = nomSC/denomSC; //Calculate group Stress centrality calculatedCentralities=TRUE; } } distanceMatrixCreated=TRUE; graphModified=FALSE; } /** * Breadth-First Search (BFS) method for unweighted graphs (directed or not) INPUT: a 'source' vertex with index s and a boolean doCalculcateCentralities. (Implicitly, BFS uses the m_graph structure) OUTPUT: For every vertex t: DM(s, t) is set to the distance of each t from s For every vertex t: TM(s, t) is set to the number of shortest paths between s and t Also, if doCalculcateCentralities is TRUE then BFS does extra operations: a) For source vertex s: it calculates CC(s) as the sum of its distances from every other vertex. it calculates GC(s) as the maximum distance from all other vertices. it increases sizeOfNthOrderNeighborhood [ N ] by one, to store the number of nodes at distance n from source s b) For every vertex u: it increases SC(u) by one, when it finds a new shor. path from s to t through u. appends each neighbor y of u to the list Ps, thus Ps stores all predecessors of y on all all shortest paths from s c) Each vertex u popped from Q is pushed to a stack Stack */ void Graph::BFS(int s, bool doCalculcateCentralities){ int u,w, dist_u=0, temp=0, dist_w=0; //set distance of s from s equal to 0 DM.setItem(s,s,0); //set sigma of s from s equal to 1 TM.setItem(s,s,1); qDebug("BFS: Construct a queue Q of integers and push source vertex s=%i to Q as initial vertex", s); queue Q; // qDebug("BFS: Q size %i", Q.size()); Q.push(s); qDebug("BFS: LOOP: While Q not empty "); while ( !Q.empty() ) { qDebug("BFS: Dequeue: first element of Q is u=%i", Q.front()); u=Q.front(); Q.pop(); if ( ! m_graph [ u ]->isEnabled() ) continue ; if (doCalculcateCentralities){ qDebug("BFS: If we are to calculate centralities, we must push u=%i to global stack Stack ", u); Stack.push(u); } imap_f::iterator it; qDebug("BFS: LOOP over every edge (u,w) e E, that is all neighbors w of vertex u"); for( it = m_graph [ u ]->m_outEdges.begin(); it != m_graph [ u ]->m_outEdges.end(); it++ ) { w=index[it->first]; qDebug("BFS: u=%i is connected with w=%i of index %i. ", u, it->first, w); qDebug("BFS: Start path discovery"); if ( DM.item(s, w) == -1 ) { //if distance (s,w) is infinite, w found for the first time. qDebug("BFS: first time visiting w=%i. Enqueuing w to the end of Q", w); Q.push(w); qDebug()<<"First check if distance(s,u) = -1 (aka infinite :)) and set it to zero"; dist_u=DM.item(s,u); if (dist_u < 0 ) dist_w = 0; else dist_w = dist_u + 1; qDebug("BFS: Setting distance of w=%i from s=%i equal to distance(s,u) plus 1. New distance = %i",w,s, dist_w ); DM.setItem(s, w, dist_w); averGraphDistance += dist_w; nonZeroDistancesCounter++; if (doCalculcateCentralities){ qDebug()<<"Calculate PC: store the number of nodes at distance " << dist_w << "from s"; sizeOfNthOrderNeighborhood[dist_w]=sizeOfNthOrderNeighborhood[dist_w]+1; qDebug()<<"Calculate CC: the sum of distances (will invert it l8r)"; m_graph [s]->setCC (m_graph [s]->CC() + dist_w); qDebug()<<"Calculate GC: the maximum distance (will invert it l8r) - also for Eccentricity"; if (m_graph [s]->GC() < dist_w ) m_graph [s]->setGC(dist_w); } qDebug("BFS: Checking graphDiameter"); if ( dist_w > graphDiameter){ graphDiameter=dist_w; qDebug() << "BFS: new graphDiameter = " << graphDiameter ; } } qDebug("BFS: Start path counting"); //Is edge (u,w) on a shortest path from s to w via u? if ( DM.item(s,w)==DM.item(s,u)+1) { temp= TM.item(s,w)+TM.item(s,u); qDebug("BFS: Found a NEW SHORTEST PATH from s=%i to w=%i via u=%i. Setting Sigma(%i, %i) = %i",s, w, u, s, w,temp); if (s!=w) TM.setItem(s,w, temp); if (doCalculcateCentralities){ qDebug("If we are to calculate centralities, we must calculate SC as well"); m_graph[u]->setSC(m_graph[u]->SC()+1); qDebug("BFS: appending u=%i to list Ps[w=%i] with the predecessors of w on all shortest paths from s ", u, w); m_graph[w]->appendToPs(u); } } } } } /** minmax() facilitates the calculations of minimum and maximum centralities during createDistanceMatrix() */ void Graph::minmax(float C, Vertex *v, float &max, float &min, int &maxNode, int &minNode) { qDebug() << "MINMAX C = " << C << " max = " << max << " min = " << min << " name = " << v->name(); if (C > max ) { max=C; maxNode=v->name(); } if (C < min ) { min=C; minNode=v->name(); } } /** This method calculates the number of discrete centrality classes of all vertices It stores that number in a QHash type where the centrality value is the key. Called from createDistanceMatrix() */ void Graph::resolveClasses(float C, hash_si &discreteClasses, int &classes){ hash_si::iterator it2; it2 = discreteClasses.find(QString::number(C)); //Amort. O(1) complexity if (it2 == discreteClasses.end() ) { classes++; qDebug("######This is a new centrality class. Amount of classes = %i", classes); discreteClasses.insert(QString::number(C), classes); } } /* * Overloaded method. It only adds displaying current vertex for debugging purposes. */ void Graph::resolveClasses(float C, hash_si &discreteClasses, int &classes, int vertex){ hash_si::iterator it2; it2 = discreteClasses.find(QString::number(C)); //Amort. O(1) complexity if (it2 == discreteClasses.end() ) { classes++; qDebug("######Vertex %i belongs to a new centrality class. Amount of classes = %i", vertex, classes); discreteClasses.insert(QString::number(C), classes); } } //Calculates the Information centrality of each vertex - diagonal included void Graph::centralityInformation(){ qDebug()<< "Graph:: centralityInformation()"; discreteICs.clear(); sumIC=0; maxIC=0; minIC=RAND_MAX; classesIC=0; groupIC=0; TM.resize(m_totalVertices); isolatedVertices=0; int i=0, j=0, n=vertices(); float m_weight=0, weightSum=1, diagonalEntriesSum=0, rowSum=0; float IC=0, SIC=0; /* Note: isolated nodes must be dropped from the AM Otherwise, the TM might be singular, therefore non-invertible. */ bool dropIsolates=true; createAdjacencyMatrix(dropIsolates); n-=isolatedVertices; qDebug() << "Graph:: centralityInformation() - computing node ICs for total n = " << n; for (i=0; iname() << " isolated"; continue; } IC= 1.0 / ( invM.item(i,i) + (diagonalEntriesSum - 2.0 * rowSum) / n ); if ( IC > maxIC ) { maxIC = IC; maxNodeIC=(*it)->name(); } if ( IC < minIC ) { minIC = IC; minNodeIC=(*it)->name(); } (*it) -> setIC ( IC ); sumIC += IC; qDebug()<< "Graph:: centralityInformation() vertex: " << (*it)->name() << " IC " << IC ; i++; } for (it=m_graph.begin(); it!=m_graph.end(); it++){ IC = (*it)->IC(); SIC = IC / sumIC ; (*it)->setSIC( SIC ); } graphModified=false; } //Writes the information centralities to a file void Graph::writeCentralityInformation(const QString fileName){ QFile file ( fileName ); if ( !file.open( QIODevice::WriteOnly ) ) { qDebug()<< "Error opening file!"; emit statusMessage (QString(tr("Could not write to %1")).arg(fileName) ); return; } QTextStream outText ( &file ); emit statusMessage ( (tr("Calculating information centralities. Please wait...")) ); centralityInformation(); emit statusMessage ( QString(tr("Writing information centralities to file: ")).arg(fileName) ); outText << tr("INFORMATION CENTRALITY (IC) OF EACH NODE")<<"\n"; outText << tr("IC measures how much information is contained in the paths that originate or end at each node.")<<"\n"; outText << tr("IC' is the standardized IC")<<"\n"; outText << tr("IC range: 0 < C < inf (this index has no max value)") << "\n"; outText << tr("IC' range: 0 < C'< 1")<<"\n\n"; outText << "Node"<<"\tIC\t\tIC'\t\t%IC\n"; QList::iterator it; float IC=0, SIC=0, sumSIC=0; for (it=m_graph.begin(); it!=m_graph.end(); it++){ IC = (*it)->SIC(); SIC = (*it)->SIC(); sumSIC += SIC; outText << (*it)->name()<<"\t"<< IC << "\t\t"<< SIC << "\t\t" << ( 100* SIC )<name() << " SIC " << SIC; } qDebug ("min %f, max %f", minIC, maxIC); if ( minIC == maxIC ) outText << tr("\nAll nodes have the same IC value.\n"); else { outText << "\n"; outText << tr("Max IC' = ") << maxIC <<" (node "<< maxNodeIC << ") \n"; outText << tr("Min IC' = ") << minIC <<" (node "<< minNodeIC << ") \n"; outText << tr("IC classes = ") << classesIC<<" \n"; } outText << "\n"; outText << tr("The IC index measures the information that is contained in the paths passing through each actor.\n"); outText << tr("The standardized values IC' can be seen as the proportion of total information flow that is controlled by each actor. Note that standard IC' values sum to unity, unlike any other centrality index.\n"); outText << "(Wasserman & Faust, p. 196)\n"; outText << "\n"; float x=0; float n = ( this->vertices() - isolatedVertices ); averageIC = sumSIC / n ; qDebug() << "sumSIC = " << sumSIC << " n = " << n << " averageIC = " << averageIC; groupIC=0; for (it=m_graph.begin(); it!=m_graph.end(); it++){ x = ( (*it)->SIC() - averageIC ) ; x *=x; qDebug() << "SIC " << (*it)->SIC() << " x " << (*it)->SIC() - averageIC << " x*x" << x ; groupIC += x; } qDebug() << "groupIC " << groupIC << " n " << n ; groupIC = groupIC / (n-1); qDebug() << "groupIC " << groupIC ; outText << tr("\nGROUP INFORMATION CENTRALISATION (GIC)\n\n"); outText << tr("GIC = ") << groupIC<<"\n\n"; outText << tr("GIC range: 0 < GIC < inf \n"); outText << tr("GIC is computed using a simple variance formula. \n"); outText << tr("In fact, following the results of Wasserman & Faust, we are using a bias-corrected sample variance.\n "); outText << tr("GIC = 0, when all nodes have the same IC value, i.e. a complete or a circle graph).\n"); outText << tr("Larger values of GIC mean larger variability between the nodes' IC values.\n"); outText <<"(Wasserman & Faust, formula 5.20, p. 197)\n\n"; outText << tr("Information Centrality report, \n"); outText << tr("created by SocNetV on: ")<< actualDateTime.currentDateTime().toString ( QString ("ddd, dd.MMM.yyyy hh:mm:ss")) << "\n\n"; file.close(); } /** * Calculates In-Degree Centralities of each vertex - diagonal included * Also the mean value and the variance of the in-degrees. */ void Graph::centralityInDegree(bool weights){ qDebug()<< "Graph:: centralityInDegree()"; float IDC=0, nom=0, denom=0; float weight; classesIDC=0; sumIDC=0; maxIDC=0; minIDC=vertices()-1; discreteIDCs.clear(); varianceDegree=0; meanDegree=0; QList::iterator it, it1; hash_si::iterator it2; int vert=vertices(); for (it=m_graph.begin(); it!=m_graph.end(); it++){ IDC=0; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( (weight=this->hasEdge ( (*it1)->name(), (*it)->name() ) ) !=0 ) { if (weights) IDC+=weight; else IDC++; } } (*it) -> setIDC ( IDC ) ; //Set InDegree (*it) -> setSIDC( IDC / (vert-1.0) ); //Set Standard InDegree qDebug() << "Graph: vertex = " << (*it)->name() << " has IDC = " << IDC << " and SIDC " << (*it)->SIDC (); sumIDC += IDC; it2 = discreteIDCs.find(QString::number(IDC)); if (it2 == discreteIDCs.end() ) { classesIDC++; qDebug("This is a new IDC class"); discreteIDCs.insert ( QString::number(IDC), classesIDC ); } qDebug("IDC classes = %i ", classesIDC); if (maxIDC < IDC ) { maxIDC = IDC ; maxNodeIDC=(*it)->name(); } if (minIDC > IDC ) { minIDC = IDC ; minNodeIDC=(*it)->name(); } } if (minIDC == maxIDC) maxNodeIDC=-1; meanDegree = sumIDC / (float) vert; /** BUG? WEIGHTS???? */ qDebug("Graph: sumIDC = %f, meanDegree = %f", sumIDC, meanDegree); // Calculate Variance and the Degree Centralisation of the whole graph. for (it=m_graph.begin(); it!=m_graph.end(); it++){ IDC= (*it)->IDC(); //qDebug("Graph: IDC = %f, meanDegree = %f", IDC, meanDegree); varianceDegree += (IDC-meanDegree) * (IDC-meanDegree) ; nom+= maxIDC-IDC; } if (symmetricAdjacencyMatrix) denom=(vert-1.0)*(vert-2.0); else denom=(vert-1.0)*(vert-1.0); varianceDegree=varianceDegree/(float) vert; groupIDC=nom/denom; qDebug("Graph: varianceDegree = %f, groupIDC = %f", varianceDegree, groupIDC); minIDC/=(float)(vert-1); // standardize maxIDC/=(float)(vert-1); calculatedIDC=TRUE; graphModified=false; } void Graph::writeCentralityInDegree (const QString fileName, const bool considerWeights) { QFile file ( fileName ); if ( !file.open( QIODevice::WriteOnly ) ) { qDebug()<< "Error opening file!"; emit statusMessage (QString(tr("Could not write to %1")).arg(fileName) ); return; } QTextStream outText ( &file ); centralityInDegree(considerWeights); float maximumIndexValue=vertices()-1.0; outText << tr("IN-DEGREE CENTRALITIES (IDC) OF EACH NODE\n\n"); outText << tr("IDC range: 0 < C < ")<::iterator it; for (it=m_graph.begin(); it!=m_graph.end(); it++){ outText <<(*it)->name()<<"\t"<<(*it)->IDC() << "\t"<< (*it)->SIDC() << "\t" << (100* ((*it)->IDC()) / sumIDC)<::iterator it, it1; hash_si::iterator it2; for (it=m_graph.begin(); it!=m_graph.end(); it++){ ODC=0; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( (weight=this->hasEdge ( (*it)->name(), (*it1)->name() ) ) !=0 ) { qDebug() << "Graph: vertex " << (*it)->name() << " isLinkedTo = " << (*it1)->name(); if (weights) ODC+=weight; else ODC++; } } (*it) -> setODC ( ODC ) ; //Set OutDegree (*it) -> setSODC( ODC / (vert-1.0) ); //Set Standard OutDegree qDebug() << "Graph: vertex " << (*it)->name() << " has ODC = " << ODC << " and SODC "<< (*it)->SODC (); sumODC += ODC; it2 = discreteODCs.find(QString::number(ODC)); if (it2 == discreteODCs.end() ) { classesODC++; qDebug("This is a new ODC class"); discreteODCs.insert ( QString::number(ODC), classesODC ); } qDebug("ODC classes = %i ", classesODC); if (maxODC < ODC ) { maxODC = ODC ; maxNodeODC=(*it)->name(); } if (minODC > ODC ) { minODC = ODC ; minNodeODC=(*it)->name(); } } if (minODC == maxODC) maxNodeODC=-1; meanDegree = sumODC / (float) vert; /** BUG? WEIGHTS???? */ qDebug("Graph: sumODC = %f, meanDegree = %f", sumODC, meanDegree); // Calculate Variance and the Degree Centralisation of the whole graph. for (it=m_graph.begin(); it!=m_graph.end(); it++){ ODC= (*it)->ODC(); qDebug() << "Graph: ODC = " << ODC << " meanDegree = " << meanDegree << " vertices " << vert; varianceDegree += (ODC-meanDegree) * (ODC-meanDegree) ; nom+= maxODC-ODC; } if (symmetricAdjacencyMatrix) denom=(vert-1.0)*(vert-2.0); else denom=(vert-1.0)*(vert-1.0); varianceDegree=varianceDegree/(float) vert; groupODC=nom/denom; qDebug("Graph: varianceDegree = %f, groupODC = %f", varianceDegree, groupODC); minODC/=(float)(vert-1); // standardize maxODC/=(float)(vert-1); calculatedODC=TRUE; graphModified=false; } void Graph::writeCentralityOutDegree ( const QString fileName, const bool considerWeights) { QFile file ( fileName ); if ( !file.open( QIODevice::WriteOnly ) ) { qDebug()<< "Error opening file!"; emit statusMessage (QString(tr("Could not write to %1")).arg(fileName) ); return; } QTextStream outText ( &file ); centralityOutDegree(considerWeights); float maximumIndexValue=vertices()-1.0; outText << tr("OUT-DEGREE CENTRALITIES (ODC) FOR EACH NODE\n\n"); outText << tr("ODC range: 0 < C < ")<::iterator it; for (it=m_graph.begin(); it!=m_graph.end(); it++){ outText << (*it)->name()<<"\t"<<(*it)->ODC() << "\t"<< (*it)->SODC() << "\t" << (100* ((*it)->ODC()) / sumODC)<< "\n"; } if (symmetricAdjacencyMatrix) { outText << "\n"; outText << tr("Mean Node Degree = ") << meanDegree<<"\n" ; outText << tr("Degree Variance = ") << varianceDegree<<"\n"; } else{ outText << "\n" ; outText << tr("Mean Node OutDegree = ") << meanDegree<<"\n" ; outText << tr("OutDegree Variance = ") << varianceDegree<<"\n"; } if ( minODC == maxODC ) outText << tr("All nodes have the same ODC value.") << "\n"; else { outText << tr("Max ODC' = ") << maxODC <<" (node "<< maxNodeODC << ") \n"; outText << tr("Min ODC' = ") << minODC <<" (node "<< minNodeODC << ") \n"; outText << tr("ODC classes = ") << classesODC<<" \n"; } outText << "\nGROUP OUT-DEGREE CENTRALISATION (GODC)\n\n"; outText << "GODC = " << groupODC<<"\n\n"; outText << "GODC range: 0 < GODC < 1\n"; outText << "GODC = 0, when all out-degrees are equal (i.e. regular lattice).\n"; outText << "GODC = 1, when one node completely dominates or overshadows the other nodes.\n"; outText << "(Wasserman & Faust, formula 5.5, p. 177)\n\n"; outText << "The degree of the node is a measure of the \'activity\' of the node it represents\n"; outText << "(Wasserman & Faust, p. 101)\n"; outText << "\n\n"; outText << tr("Out-Degree Centrality Report, \n"); outText << tr("created by SocNetV: ")<< actualDateTime.currentDateTime().toString ( QString ("ddd, dd.MMM.yyyy hh:mm:ss")) << "\n\n"; file.close(); } //Writes the closeness centralities to a file void Graph::writeCentralityCloseness( const QString fileName, const bool considerWeights) { Q_UNUSED(considerWeights); QFile file ( fileName ); if ( !file.open( QIODevice::WriteOnly ) ) { qDebug()<< "Error opening file!"; emit statusMessage (QString(tr("Could not write to %1")).arg(fileName) ); return; } QTextStream outText ( &file ); emit statusMessage ( (tr("Calculating shortest paths")) ); createDistanceMatrix(true); emit statusMessage ( QString(tr("Writing closeness centralities to file:")).arg(fileName) ); outText << tr("CLOSENESS CENTRALITY (CC) OF EACH NODE")<<"\n"; outText << tr("CC is the invert sum of the distances of node u from all other nodes.")<<"\n"; outText << tr("CC' is the standardized CC")<<"\n"; outText << tr("CC range: 0 < C < ")<::iterator it; for (it=m_graph.begin(); it!=m_graph.end(); it++){ outText << (*it)->name()<<"\t"<<(*it)->CC() << "\t\t"<< (*it)->SCC() << "\t\t" << (100* ((*it)->CC()) / sumCC)<::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ outText <<(*it)->name()<<"\t"<<(*it)->BC() << "\t\t"<< (*it)->SBC() << "\t\t" << (100* ((*it)->BC()) / sumBC)< distance from other nodes is max 1)\n"; outText << tr("GC' range: 0 < GC'< 1 (GC'=1 => directly linked with all nodes)")<<"\n\n"; outText << "Node"<<"\tGC\t\tGC'\t\t%GC\n"; QList::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ outText <<(*it)->name()<<"\t"<<(*it)->GC() << "\t\t"<< (*it)->SGC() << "\t\t" << (100* ((*it)->GC()) / sumGC)<::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ outText <<(*it)->name()<<"\t"<<(*it)->SC() << "\t\t"<< (*it)->SSC() << "\t\t" << (100* ((*it)->SC()) / sumSC)<::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ outText << (*it)->name()<<"\t"<<(*it)->EC() << "\t\t"<< (*it)->SEC() << "\t\t" << (100* ((*it)->EC()) / sumEC)<::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ outText << (*it)->name()<<"\t"<<(*it)->PC() << "\t\t"<< (*it)->SPC() << "\t\t" << (100* ((*it)->PC()) / sumPC)<::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ cliques=this->numberOfCliques((*it)->name()); outText << (*it)->name()<<"\t"<< cliques < 3) outText << tr("CLQSUM Range: 0 < CLQSUM < ") << N * (N-1) * (N-2)/ 3 << endl; outText <<"\n\n" ; outText << tr("Number of Cliques Report,\n"); outText << tr("created by SocNetV: ")<< actualDateTime.currentDateTime().toString ( QString ("ddd, dd.MMM.yyyy hh:mm:ss")) << "\n\n"; file.close(); } void Graph::writeClusteringCoefficient( const QString fileName, const bool considerWeights) { Q_UNUSED(considerWeights); QFile file ( fileName ); if ( !file.open( QIODevice::WriteOnly ) ) { qDebug()<< "Error opening file!"; emit statusMessage (QString(tr("Could not write to %1")).arg(fileName) ); return; } QTextStream outText ( &file ); emit statusMessage ( (tr("Calculating shortest paths")) ); float clucof= clusteringCoefficient(); Q_UNUSED(clucof); emit statusMessage ( QString(tr("Writing clustering coefficients to file:")).arg(fileName) ); outText << tr("CLUSTERING COEFFICIENT (CLC) OF EACH NODE\n"); outText << tr("CLC range: 0 < C < 1") <<"\n"; outText << "Node"<<"\tCLC\n"; QList::iterator it; for (it= m_graph.begin(); it!= m_graph.end(); it++){ outText << (*it)->name()<<"\t"<<(*it)->CLC() < 2 && CentralityType != 9 ) { qDebug("Graph: Calling createDistanceMatrix() to calc centralities"); createDistanceMatrix(true); } else if ((graphModified || !calculatedIDC) && CentralityType == 1) centralityInDegree(true); else if ((graphModified || !calculatedODC) && CentralityType == 2) centralityOutDegree(true); else if ( CentralityType == 9 ){ centralityInformation(); } double rad=0; double i=0, std=0; float C=0, maxC=0, offset=0.06; //offset controls how far from the centre the central nodes be positioned double new_radius=0, new_x=0, new_y=0; double Pi = 3.14159265; int vert=vertices(); for (QList::iterator it=m_graph.begin(); it!=m_graph.end(); it++){ switch (CentralityType) { case 1 : { qDebug("Layout according to InDegree Centralities"); C=(*it)->SIDC(); std= (*it)->SIDC(); maxC=maxIDC; break; } case 2 : { qDebug("Layout according to OutDegree Centralities"); C=(*it)->SODC(); std= (*it)->SODC(); maxC=maxODC; break; } case 3 : { qDebug("Layout according to Closeness Centralities"); C=(*it)->CC(); std= (*it)->SCC(); maxC=maxCC; break; } case 4 : { qDebug("Layout according to Betweeness Centralities"); C=(*it)->BC(); std= (*it)->SBC(); maxC=maxBC; break; } case 5 : { qDebug("Layout according to Graph Centralities"); C=(*it)->GC(); std= (*it)->SGC(); maxC=maxGC; break; } case 6 : { qDebug("Layout according to Stress Centralities"); C=(*it)->SC(); std= (*it)->SSC(); maxC=maxSC; break; } case 7 : { qDebug("Layout according to Eccentricity Centralities"); C=(*it)->EC(); std= (*it)->SEC(); maxC=maxEC; break; } case 8 : { qDebug("Layout according to Power Centralities"); C=(*it)->PC(); std= (*it)->SPC(); maxC=maxPC; break; } case 9 : { qDebug("Layout according to Information Centralities"); C=(*it)->IC(); std= (*it)->SIC(); maxC=maxIC; break; } }; qDebug () << "Vertice " << (*it)->name() << " at x=" << (*it)->x() << ", y= "<< (*it)->y() << ": C=" << C << ", stdC=" << std << ", maxradius " << maxRadius << ", maxC " << maxC << ", C/maxC " << (C/maxC) << ", *maxRadius " << (C/maxC - 0.06)*maxRadius; switch (static_cast (ceil(maxC)) ){ case 0: { qDebug("maxC=0. Using maxHeight"); new_radius=maxRadius; break; } default: { new_radius=(maxRadius- (C/maxC - offset)*maxRadius); break; } }; qDebug ("new radius %f", new_radius); //Calculate new position rad= (2.0* Pi/ vert ); new_x=x0 + new_radius * cos(i * rad); new_y=y0 + new_radius * sin(i * rad); (*it)->setX( new_x ); (*it)->setY( new_y ); qDebug("Finished Calculation. Vertice will move to x=%f and y=%f ",new_x, new_y); //Move node to new position emit moveNode((*it)->name(), new_x, new_y); i++; emit addBackgrCircle ( static_cast (x0), static_cast (y0), static_cast (new_radius) ); } graphModified=false; } /** * Repositions all nodes on different random positions * Emits moveNode(i, x,y) to tell GW that the node item should be moved. */ void Graph::layoutRandom(double maxWidth, double maxHeight){ qDebug("Graph: layoutRandom..."); double new_x=0, new_y=0; for (Vertices::iterator it=m_graph.begin(); it!=m_graph.end(); it++){ new_x= rand() % ( static_cast (maxWidth) ); new_y= rand() % ( static_cast (maxHeight) ); (*it)->setX( new_x ); (*it)->setY( new_y ); qDebug()<< "Graph: Emitting moveNode to move Vertice " << (*it)->name() //<< "indexed " << index((*it)->name()) << " to new position " << new_x << " , "<< new_y; emit moveNode((*it)->name(), new_x, new_y); } } /** * Repositions all nodes on different top-down levels according to their centrality * Emits moveNode(i, x,y) to tell GW that the node item should be moved. */ void Graph::layoutLayeredCentrality(double maxWidth, double maxHeight, int CentralityType){ qDebug("Graph: layoutLevelCentrality..."); //first calculate centralities if ((graphModified || !calculatedCentralities) && CentralityType > 2) { qDebug("Graph: Calling createDistanceMatrix() to calc centralities"); createDistanceMatrix(true); } else if ((graphModified || !calculatedIDC) && CentralityType == 1) centralityInDegree(true); else if ((graphModified || !calculatedODC) && CentralityType == 2) centralityOutDegree(true); double i=0, std=0; float C=0, maxC=0, offset=50; //offset controls how far from the top the central nodes will be positioned double new_x=0, new_y=0; // int vert=vertices(); maxHeight-=offset; maxWidth-=offset; for (QList::iterator it=m_graph.begin(); it!=m_graph.end(); it++){ switch (CentralityType) { case 1 : { qDebug("Layout according to InDegree Centralities"); C=(*it)->SIDC(); std= (*it)->SIDC(); maxC=maxIDC; break; } case 2 : { qDebug("Layout according to OutDegree Centralities"); C=(*it)->SODC(); std= (*it)->SODC(); maxC=maxODC; break; } case 3 : { qDebug("Layout according to Closeness Centralities"); C=(*it)->CC(); std= (*it)->SCC(); maxC=maxCC; break; } case 4 : { qDebug("Layout according to Betweeness Centralities"); C=(*it)->BC(); std= (*it)->SBC(); maxC=maxBC; break; } case 5 : { qDebug("Layout according to Graph Centralities"); C=(*it)->GC(); std= (*it)->SGC(); maxC=maxGC; break; } case 6 : { qDebug("Layout according to Stress Centralities"); C=(*it)->SC(); std= (*it)->SSC(); maxC=maxSC; break; } }; qDebug()<< "Vertice " << (*it)->name() << " at x="<< (*it)->x() << ", y="<< (*it)->y() << ": C=" << C << ", stdC=" << std << ", maxC "<< maxC << ", maxWidth " << maxWidth <<" , maxHeight "< (ceil(maxC)) ){ case 0: { qDebug("maxC=0. Using maxHeight"); new_y=maxHeight; break; } default: { new_y=offset/2.0+maxHeight-(C/maxC)*maxHeight; break; } }; new_x=offset/2.0 + rand() % ( static_cast (maxWidth) ); qDebug ("new_x %f, new_y %f", new_x, new_y); (*it)->setX( new_x ); (*it)->setY( new_y ); qDebug("Finished Calculation. Vertice will move to x=%f and y=%f ",new_x, new_y); //Move node to new position emit moveNode((*it)->name(), new_x, new_y); i++; emit addBackgrHLine(static_cast ( new_y ) ); } graphModified=false; } /** layman's attempt to create a random network */ void Graph::createRandomNetErdos(int vert, double probability){ qDebug("Graph: createRandomNetErdos"); int progressCounter=0; for (register int i=0; i< vert ; i++) { int x=10+rand() %640; int y=10+rand() %480; qDebug("Graph: createRandomNetErdos, new node i=%i, at x=%i, y=%i", i+1, x,y); createVertex ( i+1, initVertexSize, initVertexColor, initVertexNumberColor, initVertexNumberSize, QString::number (i+1), initVertexLabelColor, initVertexLabelSize, QPoint(x, y), initVertexShape, false ); progressCounter++; emit updateProgressDialog( progressCounter ); } for (register int i=0;i>>>> REWIRING: Check if "<< i << " is linked to " << j; if ( this-> hasEdge(i, j) ) { qDebug()<<">>>>> REWIRING: They're linked. Do a random REWIRING Experiment between "<< i<< " and " << j << " Beta parameter is " << beta; if (rand() % 100 < (beta * 100)) { qDebug(">>>>> REWIRING: We'l break this edge!"); removeEdge(i, j); removeEdge(j, i); qDebug()<<">>>>> REWIRING: OK. Let's create a new edge!"; for (;;) { //do until we create a new edge candidate=rand() % (vert+1) ; //pick another vertex. if (candidate == 0 || candidate == i) continue; qDebug()<<">>>>> REWIRING: Candidate: "<< candidate; if (! this->hasEdge(i, candidate) ) //Only if differs from i and hasnot edge with it qDebug("<----> Random New Edge Experiment between %i and %i:", i, candidate); if (rand() % 100 > 0.5) { qDebug("Creating new link!"); createEdge(i, candidate, 1, "black", true, true, false); break; } } } else qDebug("Will not break link!"); } } } } /** layman's attempt to create a random network where nodes have the same degree. */ void Graph::createSameDegreeRandomNetwork(int vert, int degree){ qDebug("Graph: createSameDegreeRandomNetwork"); int progressCounter=0; for (register int i=0; i< vert ; i++) { int x=10+rand() %640; int y=10+rand() %480; qDebug("Graph: createUniformRandomNetwork, new node i=%i, at x=%i, y=%i", i+1, x,y); createVertex( i+1, initVertexSize,initVertexColor, initVertexNumberColor, initVertexNumberSize, QString::number (i+1), initVertexLabelColor, initVertexLabelSize, QPoint(x, y), initVertexShape,false ); progressCounter++; emit updateProgressDialog( progressCounter ); } int target = 0; for (register int i=0;i m_inEdges.begin(); it1 != m_graph[ index[v1] ] ->m_inEdges.end(); it1++ ) { connectedVertex1=it1->first; qDebug() << "Graph::numberOfCliques() In-connectedVertex1 " << connectedVertex1 << "[" << index[connectedVertex1] << "] ...Checking inLinks...."; for( it2 = m_graph[ index[v1] ] -> m_inEdges.begin(); it2 != m_graph[ index[v1] ] ->m_inEdges.end(); it2++ ) { connectedVertex2=it2->first; if (connectedVertex1 == connectedVertex2) continue; else { qDebug() << "Graph::numberOfCliques() Out-connectedVertex2 " << connectedVertex2 << "[" << index[connectedVertex2] << "]"; if ( this->hasEdge( connectedVertex1, connectedVertex2 ) ) { qDebug("Graph::numberOfCliques() %i is connected to %i. Therefore we found a clique!", connectedVertex1, connectedVertex2); cliques++; qDebug("Graph::numberOfCliques() cliques = %f" , cliques); } } } qDebug("Graph::numberOfCliques() .....Checking outLinks.... "); for( it2 = m_graph[ index[v1] ] -> m_outEdges.begin(); it2 != m_graph[ index[v1] ] ->m_outEdges.end(); it2++ ) { connectedVertex2=it2->first; if (connectedVertex1 == connectedVertex2) continue; else { qDebug() << "Graph::numberOfCliques() Out-connectedVertex2 " << connectedVertex2 << "[" << index[connectedVertex2] << "]"; if ( this->hasEdge( connectedVertex1, connectedVertex2 ) || this-> hasEdge( connectedVertex2, connectedVertex1 ) ) { qDebug("Graph::numberOfCliques() %i is connected to %i. Therefore we found a clique!", connectedVertex1, connectedVertex2); cliques++; qDebug("Graph::numberOfCliques() cliques = %f" , cliques); } } } } } for( it1 = m_graph[ index[v1] ] -> m_outEdges.begin(); it1 != m_graph[ index[v1] ] ->m_outEdges.end(); it1++ ) { connectedVertex1=it1->first; qDebug() << "Graph::numberOfCliques() Out-connectedVertex1 " << connectedVertex1 << "[" << index[connectedVertex1] << "]"; for( it2 = m_graph[ index[v1] ] -> m_outEdges.begin(); it2 != m_graph[ index[v1] ] ->m_outEdges.end(); it2++ ) { connectedVertex2=it2->first; if (connectedVertex1 == connectedVertex2) continue; else if ( connectedVertex1 >= connectedVertex2 && symmetric) continue; else { qDebug() << "Graph::numberOfCliques() Out-connectedVertex2 " << connectedVertex2 << "[" << index[connectedVertex2] << "]"; if ( this->hasEdge( connectedVertex1, connectedVertex2 ) ) { qDebug("Graph::numberOfCliques() %i is out-connected to %i. Therefore we found a clique!", connectedVertex1, connectedVertex2); cliques++; qDebug("Graph::numberOfCliques() cliques = %f" , cliques); } if (!symmetric) if ( this->hasEdge( connectedVertex2, connectedVertex1 ) ) { qDebug("Graph::numberOfCliques() %i is also in-connected to %i. Therefore we found a clique!", connectedVertex2, connectedVertex1); cliques++; qDebug("Graph::numberOfCliques() cliques = %f" , cliques); } } } } return cliques; } /** Calculates and returns the total number of cliques in the graph. Calls numberOfCliques(v1) to calculate the number of cliques of each vertex v1, sums the total number, then divides it by 3 because each vertex has been counted three times. */ float Graph::numberOfCliques(){ qDebug("Graph:: numberOfCliques()"); float cliques=0; foreach (Vertex *v1, m_graph) { cliques += numberOfCliques(v1->name()); qDebug("Graph:: numberOfCliques now %f", cliques ); } cliques = cliques / 3.0; qDebug("Graph:: numberOfCliques Dividing by three we get %f", cliques ); return cliques ; } /** Returns the number of triples of vertex v1 A triple Υ at a vertex v is a path of length two for which v is the center vertex. */ float Graph::numberOfTriples(int v1){ float totalDegree=0; if (isSymmetric()){ totalDegree=edgesFrom(v1); return totalDegree * (totalDegree -1.0) / 2.0; } totalDegree=edgesFrom(v1) + edgesTo(v1); //FIXEM return totalDegree * (totalDegree -1.0); } /** Returns the clustering coefficient (CLUCOF) of a vertex v1 CLUCOF in a graph quantifies how close the vertex and its neighbors are to being a clique This is used to determine whether a graph is a small-world network. */ float Graph:: clusteringCoefficient(int v1){ float clucof=0; if ( !graphModified && (m_graph[ index [v1] ] -> hasCLC() ) ) { float clucof=m_graph[ index [v1] ] ->CLC(); qDebug("Graph: clusteringCoefficient(%i) not modified. Returning previous clucof = %f", v1, clucof); return clucof; } qDebug("Graph:: clusteringCoefficient(v1) - Graph changed or clucof not calculated. Calling numberOfCliques() for vertex %i", v1); float totalCliques=numberOfCliques(v1); qDebug("Graph:: Number of Cliques for %i is %f.", v1, totalCliques); if (totalCliques==0) return 0; //stop if we're at a leaf. float denom=0, totalDegree=0; if (isSymmetric()){ totalCliques = totalCliques / 2.0; qDebug(" Graph::Calculating number of triples"); totalDegree=edgesFrom(v1); denom = totalDegree * (totalDegree -1.0) / 2.0; qDebug("Graph:: Symmetric. Number of triples is %f. Dividing number of cliques with it", denom); } else { qDebug(" Graph::Calculating number of triples"); totalDegree=edgesFrom(v1) + edgesTo(v1); //FIXME denom = totalDegree * (totalDegree -1.0); qDebug("Graph:: Symmetric. Number of triples is %f. Dividing number of cliques with it", denom); } clucof = totalCliques / denom; qDebug() << "=== Graph::clusteringCoefficient() - vertex " << v1 << " ["<< index[v1] << "]" << " has CLUCOF = "<< clucof; m_graph[ index [v1] ] ->setCLC(clucof); return clucof; } /** Calculates and returns the Clustering Coefficient for the whole graph */ float Graph::clusteringCoefficient (){ qDebug("=== Graph::graphClusteringCoefficient() "); averageCLC=0; maxCLC=0; minCLC=1; float temp=0; foreach (Vertex *v1, m_graph) { temp = clusteringCoefficient(v1->name()); if (temp > maxCLC) { maxCLC = temp; maxNodeCLC = v1->name(); } if ( temp < minCLC ) { minNodeCLC = v1->name(); minCLC= temp; } averageCLC += temp; } averageCLC = averageCLC / vertices(); qDebug("=== Graph::graphClusteringCoefficient() is equal to %f", averageCLC); return averageCLC; } /*tri * Conducts a triad census and updates QList::triadTypeFreqs, * which is the list carrying all triad type frequencies * Complexity:O(n!) */ bool Graph::triadCensus(){ int mut=0, asy=0, nul =0; int temp_mut=0, temp_asy=0, temp_nul =0, counter_021=0; int ver1, ver2, ver3; QString last_char; int progressCounter = 0; /* * QList::triadTypeFreqs stores triad type frequencies with the following order: * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * 003 012 102 021D 021U 021C 111D 111U 030T 030C 201 120D 120U 120C 210 300 */ for (int i = 0; i < 15; ++i) { triadTypeFreqs.append(0); } QList::iterator v1; QList::iterator v2; QList::iterator v3; for (v1=m_graph.begin(); v1!=m_graph.end(); v1++) { for (v2=(v1+1); v2!=m_graph.end(); v2++) { ver1=(*v1)->name(); ver2=(*v2)->name(); temp_mut=0, temp_asy=0, temp_nul =0; if ( (*v1)->isLinkedTo( ver2 ) ) { if ( (*v2)->isLinkedTo( ver1 ) ) temp_mut++; else temp_asy++; } else if ( (*v2)->isLinkedTo( ver1 ) ) temp_asy++; else temp_nul++; for (v3=(v2+1); v3!=m_graph.end(); v3++){ mut = temp_mut ; asy = temp_asy ; nul = temp_nul ; ver3=(*v3)->name(); if ( (*v1)->isLinkedTo( ver3 ) ) { if ( (*v3)->isLinkedTo( ver1 ) ) mut++; else asy++; } else if ( (*v3)->isLinkedTo( ver1 ) ) asy++; else nul++; if ( (*v2)->isLinkedTo( ver3 ) ) { if ( (*v3)->isLinkedTo( ver2 ) ) mut++; else asy++; } else if ( (*v3)->isLinkedTo( ver2 ) ) asy++; else nul++; //qDebug()<< "triad of ("<< ver1 << ","<< ver2 << ","<< ver3 << ") = (" < m_triad; bool isDown=false, isUp=false, isCycle=false, isTrans=false; bool isOutLinked=false, isInLinked=false; m_triad<name() << ", "<< vert2->name()<< ", "<< vert3->name()<< " ) = (" <name() ; isOutLinked=false; isInLinked=false; foreach (Vertex *target, m_triad) { if ( source->name() == target->name() ) continue; if ( source->isLinkedTo(target->name()) ){ if ( isOutLinked ){ triadTypeFreqs[3] ++;//"021D" break; } else if (isInLinked){ triadTypeFreqs[5] ++;//"021C" break; } else{ isOutLinked=true; } } else if( target->isLinkedTo(source->name()) ){ // qDebug() << " Vertex " << source->name() << " is IN linked from " <name(); if ( isInLinked ){ triadTypeFreqs[4] ++;//"021U" break; } else if (isOutLinked){ triadTypeFreqs[5] ++;//"021C" break; } else{ isInLinked=true; } } } } break; case 3: qDebug() << "triad vertices: ( "<< vert1->name() << ", "<< vert2->name()<< ", "<< vert3->name()<< " ) = (" <name() ; isOutLinked=false; foreach (Vertex *target, m_triad) { if ( source->name() == target->name() ) continue; if ( source->isLinkedTo(target->name()) ){ if ( isOutLinked ){ triadTypeFreqs[8] ++;//"030T" isTrans=true; break; } else{ isOutLinked=true; } } } } if ( ! isTrans ) {//"030C" triadTypeFreqs[9] ++; } break; } break; case 1: switch (asy){ case 0: //"102"; triadTypeFreqs[2] ++; break; case 1: isDown=false; isUp=false; //qDebug() << "triad vertices: ( "<< vert1->name() << ", "<< vert2->name()<< ", "<< vert3->name()<< " ) = (" <name() ; isInLinked=false; foreach (Vertex *target, m_triad) { if ( source->name() == target->name() ) continue; if ( target->isLinkedTo(source->name()) ){ if ( isInLinked ){ triadTypeFreqs[6] ++;//"030T" isUp=true; break; } else{ isInLinked=true; } } } } if ( ! isUp ) {//"111U" triadTypeFreqs[7] ++; } break; case 2: isDown=false; isUp=false; isCycle=true; qDebug() << "triad vertices: ( "<< vert1->name() << ", "<< vert2->name()<< ", "<< vert3->name()<< " ) = (" <name() ; isOutLinked=false; isInLinked=false; foreach (Vertex *target, m_triad) { if ( source->name() == target->name() ) continue; if ( source->isLinkedTo(target->name()) ){ if (target->isLinkedTo(source->name() ) ){ isInLinked=true; isOutLinked=true; continue; } else if ( isOutLinked && !isInLinked ){ triadTypeFreqs[11] ++;//"120D" isDown=true; isCycle=false; break; } else{ isOutLinked=true; } } else if( target->isLinkedTo(source->name()) ){ // qDebug() << " Vertex " << source->name() << " is IN linked from " <name(); if (source->isLinkedTo(target->name())){ isOutLinked=true; isInLinked=true; continue; } else if ( isInLinked && !isOutLinked ){ triadTypeFreqs[12] ++;//"120U" isUp=true; isCycle=false; break; } else{ isInLinked=true; } } } if (isUp || isDown) break; } if ( isCycle ) { //"120C" triadTypeFreqs[13] ++; } break; case 3: // nothing here! break; } break; case 2: switch (asy){ case 0: // "201" triadTypeFreqs[10] ++; break; case 1: // "210" triadTypeFreqs[14] ++; break; } break; case 3: // "300" if (asy==0 && nul==0) triadTypeFreqs[15] ++; break; } } /** Calculates and returns x! factorial... */ int Graph:: factorial(int x) { int tmp; if(x <= 1) return 1; tmp = x * factorial(x - 1); return tmp; } /** Our almost universal network loader. :) Actually it calls the load() method of parser/qthread class. */ bool Graph::loadGraph ( QString fileName, bool iSL, int maxWidth, int maxHeight, int fileFormat, int two_sm_mode){ initShowLabels = iSL; bool loadGraphStatus = parser.load( fileName, initVertexSize, initVertexColor, initVertexShape, initVertexNumberColor, initVertexNumberSize, initVertexLabelColor, initVertexLabelSize, initEdgeColor, maxWidth, maxHeight, fileFormat, two_sm_mode ); return loadGraphStatus; } /** Our almost universal graph saver. :) Actually it just checks the requested file type and calls the right saveGraphTo...() method */ bool Graph::saveGraph ( QString fileName, int fileType, QString networkName, int maxWidth, int maxHeight ) { qDebug() << "Graph::saveGraph to ..."; switch (fileType) { case 1 : { //Pajek qDebug() << " ... Pajek formatted file"; return saveGraphToPajekFormat(fileName, networkName, maxWidth, maxHeight); break; } case 2: { // Adjacency qDebug() << " ... Adjacency formatted file"; return saveGraphToAdjacencyFormat(fileName, maxWidth,maxHeight); break; } case 3: { // Dot qDebug() << " ... Dot formatted file"; return saveGraphToDotFormat(fileName, networkName, maxWidth, maxHeight); break; } case 4: { // GraphML qDebug() << " ... GraphML formatted file"; return saveGraphToGraphMLFormat(fileName, networkName, maxWidth, maxHeight); break; } default: { qDebug() << " ... Error! What format number is this anyway?"; break; } }; return true; } /** Saves the active graph to a Pajek-formatted file Preserves node properties (positions, colours, etc) */ bool Graph::saveGraphToPajekFormat ( QString fileName, QString networkName, int maxWidth, int maxHeight) { qDebug () << " Graph::saveGraphToPajekFormat to file: " << fileName.toAscii(); int weight=0; QFile f( fileName ); if ( !f.open( QIODevice::WriteOnly ) ) { emit statusMessage (QString(tr("Could not write to %1")).arg(fileName)); return false; } QTextStream t( &f ); t<<"*Network "<::iterator it; QList::iterator jt; for (it=m_graph.begin(); it!=m_graph.end(); it++){ qDebug()<<" Name x "<< (*it)->name() ; t<<(*it)->name() <<" "<<"\""<<(*it)->label()<<"\"" ; t << " ic "; t<< (*it)->color() ; qDebug()<<" Coordinates x " << (*it)->x()<< " "<y()<< " "<x()/(maxWidth)<<" \t"<<(*it)->y()/(maxHeight); t << "\t"<<(*it)->shape(); t<<"\n"; } t<<"*Arcs \n"; qDebug()<< "Graph::saveGraphToPajekFormat: Arcs"; for (it=m_graph.begin(); it!=m_graph.end(); it++){ for (jt=m_graph.begin(); jt!=m_graph.end(); jt++){ qDebug() << "Graph::saveGraphToPajekFormat: it=" << (*it)->name() << ", jt=" << (*jt)->name() ; if ( (weight=this->hasEdge( (*it)->name(), (*jt)->name())) !=0 && ( this->hasEdge((*jt)->name(), (*it)->name())) == 0 ) { qDebug()<<"Graph::saveGraphToPajekFormat weight "<< weight << " color "<< (*it)->outLinkColor( (*jt)->name() ) ; t << (*it)->name() <<" "<<(*jt)->name()<< " "<outLinkColor( (*jt)->name() ); t <<"\n"; } } } t<<"*Edges \n"; qDebug() << "Graph::saveGraphToPajekFormat: Edges"; for (it=m_graph.begin(); it!=m_graph.end(); it++){ for (jt=m_graph.begin(); jt!=m_graph.end(); jt++){ qDebug() << "Graph::saveGraphToPajekFormat: it=" << (*it)->name() << ", jt=" <<(*jt)->name() ; if ( (weight=this->hasEdge((*it)->name(), (*jt)->name()))!=0 && (this->hasEdge((*jt)->name(), (*it)->name()))!=0 ) { if ( (*it)->name() > (*jt)->name() ) continue; t << (*it)->name() <<" "<<(*jt)->name()<< " "<outLinkColor( (*jt)->name() ); t <<"\n"; } } } f.close(); QString fileNameNoPath=fileName.split("/").last(); emit statusMessage (QString(tr( "File %1 saved" ) ).arg( fileNameNoPath )); return true; } bool Graph::saveGraphToAdjacencyFormat ( QString fileName, int maxWidth, int maxHeight) { Q_UNUSED(maxWidth); Q_UNUSED(maxHeight); QFile f( fileName ); if ( !f.open( QIODevice::WriteOnly ) ) { emit statusMessage(QString(tr("Could not write to %1")).arg(fileName)); return false; } QTextStream t( &f ); qDebug("Graph: saveGraphToAdjacencyFormat() for %i vertices", vertices()); writeAdjacencyMatrixTo(t); f.close(); QString fileNameNoPath=fileName.split("/").last(); emit statusMessage (QString( tr("Adjacency matrix-formatted network saved into file %1") ).arg( fileNameNoPath )); return true; } // Writes a known dataset to a file void Graph::writeDataSetToFile (QString fileName) { QFile f( fileName ); if ( !f.open( QIODevice::WriteOnly ) ) { emit statusMessage( QString(tr("Could not write to %1")).arg(fileName) ); return; } QTextStream outText( &f ); qDebug()<< " ... writing"; if ( fileName == "Krackhardt_High-tech_managers_Advice_relation.sm" ) { outText << "0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 1" << endl << "0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 1" << endl << "1 1 0 0 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 1 1" << endl << "1 1 0 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 1 0 0 0 1 0 0 0 0 1 1 0 1 0 0 1 1 0 0 1" << endl << "0 1 0 1 0 1 1 0 0 1 1 0 0 0 0 0 0 1 0 0 1" << endl << "1 1 0 0 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1" << endl << "1 1 1 1 1 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1 0" << endl << "1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "1 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0" << endl << "0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1" << endl << "1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1" << endl << "1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0" << endl << "1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1" << endl << "1 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0" << endl << "1 1 0 0 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1" << endl << "0 1 1 1 0 1 1 1 0 0 0 1 0 1 0 0 1 1 0 1 0"; } else if (fileName == "Krackhardt_High-tech_managers_Friendship_relation.sm"){ outText<< "0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0" << endl << "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0" << endl << "1 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0" << endl << "0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1" << endl << "0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 0" << endl << "1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 1 1 0 0" << endl << "1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1" << endl << "0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0" << endl << "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0 0 0 1 0 0" << endl << "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 1" << endl << "0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 1 1 0 1 0 0 0 0 0 1 1 0 1 1 0 0 0 0 1 0" << endl << "0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0" << endl << "0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0" ; } else if (fileName == "Krackhardt_High-tech_managers_ReportsTo_relation.sm"){ outText<< "0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; } else if (fileName == "Padgett_Florentine_Families_Marital_relation.sm"){ outText<< "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0" << endl << "0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0" << endl << "0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0" << endl << "1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0" << endl << "0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1" << endl << "0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0" << endl << "0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0" << endl << "0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0" ; } else if (fileName == "Padgett_Florentine_Families_Business_relation.sm"){ outText<< "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0" << endl << "0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0" << endl << "0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0" << endl << "0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0" << endl << "0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0" << endl << "0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1" << endl << "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0"; } else if (fileName == "Zachary_Karate_Club_Simple_Ties.sm"){ outText<< "0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0" << endl << "1 0 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0" << endl << "1 1 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0" << endl << "1 1 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1" << endl << "0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1" << endl << "0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1" << endl << "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1" << endl << "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1" << endl << "0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1" << endl << "0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 1" << endl << "0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1" << endl << "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 1" << endl << "0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 0 0 1 1 1 0 1" << endl << "0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 0" ; } else if (fileName == "Zachary_Karate_Club_Weighted_Ties.sm"){ outText<< "0 4 5 3 3 3 3 2 2 0 2 3 1 3 0 0 0 2 0 2 0 2 0 0 0 0 0 0 0 0 0 2 0 0" << endl << "4 0 6 3 0 0 0 4 0 0 0 0 0 5 0 0 0 1 0 2 0 2 0 0 0 0 0 0 0 0 2 0 0 0" << endl << "5 6 0 3 0 0 0 4 5 1 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 2 0" << endl << "3 3 3 0 0 0 0 3 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "3 0 0 0 0 0 2 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "3 0 0 0 0 0 5 0 0 0 3 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "3 0 0 0 2 5 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "2 4 4 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "2 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 3 4" << endl << "0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2" << endl << "2 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "1 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "3 5 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 2" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 4" << endl << "0 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2" << endl << "2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 1" << endl << "2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 3" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 4 0 3 0 0 5 4" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 3 0 0 0 2 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 2 0 0 0 0 0 0 7 0 0" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 2" << endl << "0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 3 0 0 0 0 0 0 0 0 4" << endl << "0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 2" << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 4 0 0 0 0 0 4 2" << endl << "0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3" << endl << "2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 7 0 0 2 0 0 0 4 4" << endl << "0 0 2 0 0 0 0 0 3 0 0 0 0 0 3 3 0 0 1 0 3 0 2 5 0 0 0 0 0 4 3 4 0 5" << endl << "0 0 0 0 0 0 0 0 4 2 0 0 0 3 2 4 0 0 2 1 1 0 3 4 0 0 2 4 2 2 3 4 5 0"; } else if (fileName == "Galaskiewicz_CEOs_and_clubs_affiliation_network_data.2sm"){ outText<< "0 0 1 1 0 0 0 0 1 0 0 0 0 0 0" << endl << "0 0 1 0 1 0 1 0 0 0 0 0 0 0 0" << endl << "0 0 1 0 0 0 0 0 0 0 0 1 0 0 0" << endl << "0 1 1 0 0 0 0 0 0 0 0 0 0 0 1" << endl << "0 0 1 0 0 0 0 0 0 0 0 0 1 1 0" << endl << "0 1 1 0 0 0 0 0 0 0 0 0 0 1 0" << endl << "0 0 1 1 0 0 0 0 0 1 1 0 0 0 0" << endl << "0 0 0 1 0 0 1 0 0 1 0 0 0 0 0" << endl << "1 0 0 1 0 0 0 1 0 1 0 0 0 0 0" << endl << "0 0 1 0 0 0 0 0 1 0 0 0 0 0 0" << endl << "0 1 1 0 0 0 0 0 1 0 0 0 0 0 0" << endl << "0 0 0 1 0 0 1 0 0 0 0 0 0 0 0" << endl << "0 0 1 1 1 0 0 0 1 0 0 0 0 0 0" << endl << "0 1 1 1 0 0 0 0 0 0 1 1 1 0 1" << endl << "0 1 1 0 0 1 0 0 0 0 0 0 1 0 1" << endl << "0 1 1 0 0 1 0 1 0 0 0 0 0 1 0" << endl << "0 1 1 0 1 0 0 0 0 0 1 1 0 0 1" << endl << "0 0 0 1 0 0 0 0 1 0 0 1 1 0 1" << endl << "1 0 1 1 0 0 1 0 1 0 0 0 0 0 0" << endl << "0 1 1 1 0 0 0 0 0 0 1 0 0 0 1" << endl << "0 0 1 1 0 0 0 1 0 0 0 0 0 0 0" << endl << "0 0 1 0 0 0 0 1 0 0 0 0 0 0 1" << endl << "0 1 1 0 0 1 0 0 0 0 0 0 0 0 1" << endl << "1 0 1 1 0 1 0 0 0 0 0 0 0 0 1" << endl << "0 1 1 0 0 0 0 0 0 0 0 0 1 0 0" << endl << "0 1 1 0 0 0 0 0 0 0 0 1 0 0 0"; } else if (fileName == "Bernard_Killworth_Fraternity_Symmetric_Observer_Data.sm"){ /* Bernard & Killworth recorded the interactions among students living in a fraternity at a West Virginia college. Subjects had been residents in the fraternity from 3 months to 3 years. This matrix counts the number of times a pair of subjects were seen in conversation by an "unobtrusive" observer (observation time: 21 hours a day, for five days). */ outText<< "0 0 2 1 0 0 2 0 0 0 1 1 2 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 2 1 1 1 0 2 1 2 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 1 4 1 1 " << endl << "0 0 10 0 0 2 1 0 2 0 0 0 6 2 0 1 0 0 0 1 0 10 2 0 4 0 3 0 1 1 0 0 0 0 5 1 0 4 0 0 0 0 0 1 1 0 0 5 3 0 0 0 0 1 0 1 4 0" << endl << "2 10 0 6 11 14 15 4 12 0 5 4 3 8 10 8 11 0 2 19 2 15 1 2 6 1 5 0 12 5 4 0 1 4 15 3 1 3 6 0 2 3 0 9 8 2 1 3 6 2 0 2 2 16 4 5 19 1" << endl << "1 0 6 0 2 3 9 1 8 0 0 5 0 0 2 4 3 2 2 6 0 1 1 3 1 0 5 1 1 3 0 1 1 4 1 0 1 3 2 0 1 0 0 1 1 1 1 2 1 3 0 0 2 1 2 2 3 5 " << endl << "0 0 11 2 0 2 8 1 1 1 0 0 2 0 1 1 0 0 0 3 0 0 0 0 0 0 8 0 1 5 0 0 1 0 0 0 0 0 9 2 1 0 1 8 25 0 0 0 0 0 0 0 1 2 0 0 4 0 " << endl << "0 2 14 3 2 0 30 2 8 0 4 4 1 6 2 14 9 0 1 51 0 3 2 1 0 1 6 0 3 11 2 0 15 5 3 1 0 2 2 1 3 1 0 3 2 2 6 1 3 4 0 2 8 9 3 2 18 2" << endl << "2 1 15 9 8 30 0 10 4 2 7 3 0 12 9 10 9 2 3 40 2 2 5 2 0 1 19 1 10 14 5 3 14 7 7 5 3 4 5 7 8 5 0 2 4 7 3 7 7 2 0 0 6 5 14 16 20 4" << endl << "0 0 4 1 1 2 10 0 3 0 2 0 1 3 3 3 5 0 0 6 1 0 2 3 0 1 6 0 2 0 9 1 0 1 2 4 2 5 1 0 3 5 0 0 5 0 1 3 1 1 0 1 2 5 0 2 4 2 " << endl << "0 2 12 8 1 8 4 3 0 0 5 5 2 2 4 5 6 1 0 5 0 5 0 3 3 3 3 1 2 3 1 0 2 4 4 3 5 1 2 0 1 1 1 2 0 0 4 0 1 4 0 6 1 4 3 2 7 1 " << endl << "0 0 0 0 1 0 2 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 6 0 1 0 1 0 0 0 0 0 0 1 2 2 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 " << endl << "1 0 5 0 0 4 7 2 5 0 0 0 0 1 3 3 5 3 0 7 4 1 0 3 0 0 4 0 5 1 3 0 0 2 2 3 5 3 2 0 0 1 0 2 1 4 5 2 1 0 0 0 0 4 6 6 12 0 " << endl << "1 0 4 5 0 4 3 0 5 0 0 0 0 0 0 0 0 0 0 3 0 1 0 1 1 0 0 0 2 0 2 0 1 2 3 2 2 1 0 0 0 1 0 1 1 1 0 0 1 2 0 0 1 2 0 7 3 3 " << endl << "2 6 3 0 2 1 0 1 2 0 0 0 0 2 1 3 3 0 1 0 0 6 2 0 0 0 3 0 1 0 0 0 1 1 1 0 0 1 1 1 1 1 1 0 2 1 0 0 2 0 0 0 2 4 1 0 0 0 " << endl << "0 2 8 0 0 6 12 3 2 0 1 0 2 0 3 8 11 1 4 8 0 1 0 0 1 1 4 0 8 4 6 0 3 1 5 1 1 0 0 0 1 3 0 2 2 1 1 1 0 0 0 0 1 0 2 1 5 1 " << endl << "0 0 10 2 1 2 9 3 4 1 3 0 1 3 0 9 14 0 6 9 0 2 1 2 1 0 4 0 3 0 2 1 1 4 2 3 0 6 1 0 7 1 0 7 1 1 0 0 1 1 0 0 7 6 4 9 4 0 " << endl << "0 1 8 4 1 14 10 3 5 2 3 0 3 8 9 0 26 3 1 12 0 2 0 0 1 0 7 0 5 6 5 4 2 2 2 2 0 4 4 0 2 5 1 3 2 1 1 4 0 2 0 0 8 4 2 0 11 3 " << endl << "1 0 11 3 0 9 9 5 6 0 5 0 3 11 14 26 0 3 0 9 0 1 0 0 1 0 5 0 5 2 2 4 2 1 4 2 0 1 1 1 2 3 0 3 1 0 0 3 1 2 0 0 7 7 4 0 11 0 " << endl << "0 0 0 2 0 0 2 0 1 0 3 0 0 1 0 3 3 0 0 0 3 0 0 0 0 0 0 0 1 0 0 3 0 1 1 1 1 0 1 0 0 0 0 1 0 2 0 2 0 0 0 0 0 0 2 1 0 1 " << endl << "1 0 2 2 0 1 3 0 0 0 0 0 1 4 6 1 0 0 0 5 0 0 2 1 3 0 0 0 0 1 1 0 0 1 1 1 1 2 0 1 14 1 0 1 0 0 1 0 3 0 0 0 1 0 0 3 1 2 " << endl << "0 1 19 6 3 51 40 6 5 0 7 3 0 8 9 12 9 0 5 0 3 2 3 2 1 1 7 1 10 6 6 1 13 12 9 2 1 6 2 1 10 4 0 2 2 1 2 1 6 1 0 0 12 17 11 9 23 5 " << endl << "0 0 2 0 0 0 2 1 0 0 4 0 0 0 0 0 0 3 0 3 0 0 1 0 0 0 0 0 2 0 2 0 0 1 1 1 0 1 0 0 1 1 0 0 0 5 0 1 1 0 0 0 0 1 2 4 2 1 " << endl << "1 10 15 1 0 3 2 0 5 0 1 1 6 1 2 2 1 0 0 2 0 0 1 1 7 2 1 0 3 1 0 0 0 0 1 1 1 0 2 0 0 0 0 1 0 3 0 0 2 1 0 0 0 2 1 1 3 0 " << endl << "0 2 1 1 0 2 5 2 0 0 0 0 2 0 1 0 0 0 2 3 1 1 0 0 1 0 1 0 2 0 2 0 3 1 2 1 2 2 2 1 7 1 0 1 2 0 2 0 11 1 1 0 1 4 1 2 3 1 " << endl << "0 0 2 3 0 1 2 3 3 0 3 1 0 0 2 0 0 0 1 2 0 1 0 0 0 1 0 0 1 1 1 0 0 2 1 1 0 2 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 2 1 1 " << endl << "0 4 6 1 0 0 0 0 3 0 0 1 0 1 1 1 1 0 3 1 0 7 1 0 0 0 0 0 3 1 0 0 0 0 3 0 1 1 0 0 4 0 0 1 0 0 0 0 0 0 0 0 2 1 1 1 5 0 " << endl << "0 0 1 0 0 1 1 1 3 0 0 0 0 1 0 0 0 0 0 1 0 2 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 3 0 0 0 0 0 1 0 0 1 2 0 0 2 0 1 1 1 2 0 " << endl << "0 3 5 5 8 6 19 6 3 6 4 0 3 4 4 7 5 0 0 7 0 1 1 0 0 1 0 0 6 6 2 1 1 4 0 1 0 2 4 0 3 2 1 1 4 1 0 5 2 0 0 0 1 2 2 4 6 2 " << endl << "0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 " << endl << "2 1 12 1 1 3 10 2 2 1 5 2 1 8 3 5 5 1 0 10 2 3 2 1 3 0 6 0 0 3 1 0 0 0 20 2 2 3 3 2 1 2 0 3 3 0 1 1 1 1 0 0 0 7 1 2 10 1 " << endl << "1 1 5 3 5 11 14 0 3 0 1 0 0 4 0 6 2 0 1 6 0 1 0 1 1 1 6 0 3 0 3 0 1 0 6 1 1 1 3 1 4 1 2 0 1 0 5 1 3 1 0 0 3 2 1 6 10 2 " << endl << "1 0 4 0 0 2 5 9 1 1 3 2 0 6 2 5 2 0 1 6 2 0 2 1 0 0 2 0 1 3 0 4 0 3 1 3 0 1 0 1 3 3 0 0 1 3 0 2 1 0 0 0 1 4 1 1 3 2 " << endl << "1 0 0 1 0 0 3 1 0 0 0 0 0 0 1 4 4 3 0 1 0 0 0 0 0 0 1 0 0 0 4 0 0 2 0 0 0 0 0 0 1 0 0 0 0 3 0 6 0 0 0 0 0 0 0 0 0 1 " << endl << "0 0 1 1 1 15 14 0 2 0 0 1 1 3 1 2 2 0 0 13 0 0 3 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 3 1 0 0 0 0 0 0 0 1 0 0 2 8 1 0 1 3 0 " << endl << "2 0 4 4 0 5 7 1 4 0 2 2 1 1 4 2 1 1 1 12 1 0 1 2 0 0 4 1 0 0 3 2 1 0 3 1 0 0 1 1 2 1 0 0 0 3 2 2 1 3 0 0 2 4 3 4 3 6 " << endl << "1 5 15 1 0 3 7 2 4 0 2 3 1 5 2 2 4 1 1 9 1 1 2 1 3 1 0 0 20 6 1 0 1 3 0 2 1 3 2 2 3 4 2 2 0 0 1 0 6 1 0 0 1 12 2 3 6 2 " << endl << "2 1 3 0 0 1 5 4 3 0 3 2 0 1 3 2 2 1 1 2 1 1 1 1 0 0 1 0 2 1 3 0 1 1 2 0 0 0 1 0 1 2 0 1 0 3 0 0 3 0 0 0 1 0 2 10 1 1 " << endl << "0 0 1 1 0 0 3 2 5 0 5 2 0 1 0 0 0 1 1 1 0 1 2 0 1 0 0 0 2 1 0 0 0 0 1 0 0 0 3 0 1 0 0 0 1 0 4 0 2 0 1 0 2 1 0 1 3 0 " << endl << "0 4 3 3 0 2 4 5 1 1 3 1 1 0 6 4 1 0 2 6 1 0 2 2 1 1 2 0 3 1 1 0 0 0 3 0 0 0 0 1 2 1 0 0 1 0 2 0 0 1 0 0 1 6 1 1 4 2 " << endl << "0 0 6 2 9 2 5 1 2 2 2 0 1 0 1 4 1 1 0 2 0 2 2 0 0 3 4 0 3 3 0 0 0 1 2 1 3 0 0 1 0 0 0 4 9 2 1 2 5 4 3 0 0 2 2 1 2 0 " << endl << "0 0 0 0 2 1 7 0 0 2 0 0 1 0 0 0 1 0 1 1 0 0 1 0 0 0 0 0 2 1 1 0 3 1 2 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 2 0 " << endl << "1 0 2 1 1 3 8 3 1 0 0 0 1 1 7 2 2 0 14 10 1 0 7 0 4 0 3 0 1 4 3 1 1 2 3 1 1 2 0 0 0 1 1 1 1 0 0 0 9 0 0 0 4 1 1 5 1 2 " << endl << "0 0 3 0 0 1 5 5 1 0 1 1 1 3 1 5 3 0 1 4 1 0 1 0 0 0 2 0 2 1 3 0 0 1 4 2 0 1 0 0 1 0 1 1 1 1 1 1 1 0 0 0 2 1 1 0 3 1 " << endl << "0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 2 0 0 0 0 2 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 " << endl << "0 1 9 1 8 3 2 0 2 0 2 1 0 2 7 3 3 1 1 2 0 1 1 1 1 0 1 0 3 0 0 0 0 0 2 1 0 0 4 0 1 1 0 0 2 0 1 0 2 1 0 0 0 2 1 2 3 0 " << endl << "0 1 8 1 25 2 4 5 0 0 1 1 2 2 1 2 1 0 0 2 0 0 2 0 0 1 4 0 3 1 1 0 0 0 0 0 1 1 9 0 1 1 0 2 0 0 1 2 4 1 1 0 0 4 0 0 1 0 " << endl << "0 0 2 1 0 2 7 0 0 1 4 1 1 1 1 1 0 2 0 1 5 3 0 1 0 0 1 0 0 0 3 3 0 3 0 3 0 0 2 0 0 1 0 0 0 0 0 5 1 0 0 0 0 0 1 2 4 1 " << endl << "0 0 1 1 0 6 3 1 4 0 5 0 0 1 0 1 0 0 1 2 0 0 2 0 0 0 0 0 1 5 0 0 0 2 1 0 4 2 1 1 0 1 0 1 1 0 0 1 2 0 2 0 3 0 0 2 6 1 " << endl << "0 5 3 2 0 1 7 3 0 0 2 0 0 1 0 4 3 2 0 1 1 0 0 1 0 1 5 0 1 1 2 6 0 2 0 0 0 0 2 0 0 1 0 0 2 5 1 0 3 2 0 0 0 2 1 0 2 0 " << endl << "1 3 6 1 0 3 7 1 1 0 1 1 2 0 1 0 1 0 3 6 1 2 11 0 0 2 2 0 1 3 1 0 1 1 6 3 2 0 5 0 9 1 0 2 4 1 2 3 0 4 0 1 4 4 2 2 3 1 " << endl << "0 0 2 3 0 4 2 1 4 0 0 2 0 0 1 2 2 0 0 1 0 1 1 0 0 0 0 0 1 1 0 0 0 3 1 0 0 1 4 0 0 0 0 1 1 0 0 2 4 0 1 0 0 1 1 1 0 3 " << endl << "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 3 0 0 0 0 0 1 0 2 0 0 1 0 0 0 0 0 0 0 0 " << endl << "0 0 2 0 0 2 0 1 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 " << endl << "0 0 2 2 1 8 6 2 1 0 0 1 2 1 7 8 7 0 1 12 0 0 1 0 2 0 1 1 0 3 1 0 8 2 1 1 2 1 0 1 4 2 0 0 0 0 3 0 4 0 0 0 0 5 1 2 4 3 " << endl << "1 1 16 1 2 9 5 5 4 1 4 2 4 0 6 4 7 0 0 17 1 2 4 0 1 1 2 0 7 2 4 0 1 4 12 0 1 6 2 2 1 1 0 2 4 0 0 2 4 1 0 0 5 0 5 3 10 0 " << endl << "1 0 4 2 0 3 14 0 3 0 6 0 1 2 4 2 4 2 0 11 2 1 1 0 1 1 2 0 1 1 1 0 0 3 2 2 0 1 2 0 1 1 1 1 0 1 0 1 2 1 0 0 1 5 0 12 7 1 " << endl << "4 1 5 2 0 2 16 2 2 0 6 7 0 1 9 0 0 1 3 9 4 1 2 2 1 1 4 0 2 6 1 0 1 4 3 10 1 1 1 0 5 0 0 2 0 2 2 0 2 1 0 0 2 3 12 0 12 0 " << endl << "1 4 19 3 4 18 20 4 7 0 12 3 0 5 4 11 11 0 1 23 2 3 3 1 5 2 6 0 10 10 3 0 3 3 6 1 3 4 2 2 1 3 0 3 1 4 6 2 3 0 0 0 4 10 7 12 0 1 " << endl << "1 0 1 5 0 2 4 2 1 0 0 3 0 1 0 3 0 1 2 5 1 0 1 1 0 0 2 0 1 2 2 1 0 6 2 1 0 2 0 0 2 1 0 0 0 1 1 0 1 3 0 0 3 0 1 0 1 0 "; } else if (fileName == "Bernard_Killworth_Fraternity_Non_Symmetric_Cognitive_Data.sm"){ /* Bernard & Killworth recorded the interactions among students living in a fraternity at a West Virginia college. Subjects had been residents in the fraternity from 3 months to 3 years. This matrix depicts rankings made by the subjects themselves of how frequently they interacted with other subjects in the observation week. */ outText<< "0 3 2 4 2 3 2 5 2 3 3 2 2 3 2 3 2 5 3 3 3 2 2 4 2 3 4 3 2 5 4 5 3 4 2 5 2 2 2 2 3 2 2 3 2 4 3 4 4 5 2 2 2 2 2 3 2 3" << endl << "3 0 2 4 3 2 1 3 2 3 3 3 5 2 1 3 2 3 3 2 1 5 3 1 4 3 2 3 3 2 2 3 3 3 4 1 3 5 2 3 2 1 3 2 3 2 3 4 4 4 2 2 2 3 2 1 1 2" << endl << "2 2 0 5 5 5 3 3 5 5 3 4 4 5 3 4 5 2 4 4 2 5 4 2 5 4 5 3 5 5 4 4 3 4 5 2 3 3 3 3 2 4 4 4 4 3 3 3 2 2 2 3 3 5 3 3 5 2" << endl << "4 4 5 0 5 5 4 3 4 4 3 4 2 4 3 4 3 5 4 4 2 3 4 5 3 4 5 3 3 5 4 4 5 5 3 5 4 3 4 1 5 1 3 4 4 1 3 3 5 5 3 3 5 3 2 4 5 5" << endl << "2 3 5 5 0 2 2 2 2 4 3 2 4 3 4 3 3 3 2 2 1 3 5 2 3 4 5 3 3 1 2 3 2 3 3 1 2 2 5 4 3 2 2 4 5 1 4 3 4 3 4 2 2 3 2 2 5 2" << endl << "3 2 5 5 2 0 5 2 3 4 3 3 3 5 4 5 4 3 2 5 2 3 3 2 2 2 3 3 3 3 4 4 5 4 4 4 4 3 3 3 4 3 2 3 2 2 4 3 4 4 2 2 5 5 3 5 3 4" << endl << "2 1 3 4 2 5 0 3 3 3 3 2 2 5 5 5 4 5 3 5 3 2 4 3 2 2 5 3 4 2 5 4 5 4 4 5 3 2 3 4 4 3 2 3 1 3 2 3 3 4 2 4 5 3 4 5 4 2" << endl << "5 3 3 3 2 2 3 0 2 3 3 2 2 2 2 2 2 5 2 2 1 2 3 5 2 2 3 3 2 3 5 4 2 4 2 1 3 2 2 2 2 2 1 2 1 3 2 3 2 4 2 2 1 2 2 3 1 3" << endl << "2 2 5 4 2 3 3 2 0 2 3 5 2 4 3 3 3 3 4 3 2 4 4 4 3 5 1 3 3 3 3 3 3 4 3 3 4 3 3 1 2 1 3 2 1 3 5 3 4 4 2 4 2 4 2 5 4 3" << endl << "3 3 5 4 4 4 3 3 2 0 3 3 2 3 2 2 3 2 3 3 2 2 2 3 1 2 5 3 4 1 3 3 2 3 4 3 3 3 4 2 4 1 2 1 3 4 1 4 3 5 5 2 1 3 3 3 1 3" << endl << "3 3 3 3 3 3 3 3 3 3 0 3 2 3 2 3 3 5 3 3 5 2 2 4 3 3 5 3 3 5 5 5 3 3 3 5 3 3 4 1 2 3 2 4 4 4 5 5 3 5 2 3 3 2 4 4 5 3" << endl << "2 3 4 4 2 3 2 2 5 3 3 0 2 3 1 3 3 5 3 3 2 3 3 3 4 3 3 3 2 1 3 3 4 3 4 5 4 3 5 2 2 1 2 2 3 3 3 3 4 3 2 4 2 4 2 5 2 4" << endl << "2 5 4 2 4 3 2 2 2 2 2 2 0 3 1 4 2 4 3 2 1 4 2 2 4 2 1 3 3 2 2 2 3 2 3 2 3 3 4 5 2 4 2 3 2 2 2 3 1 3 3 2 2 4 3 2 2 1" << endl << "3 2 5 4 3 5 5 2 4 3 3 3 3 0 3 4 4 4 4 4 2 3 4 2 2 2 4 3 5 2 3 4 4 2 3 5 3 3 4 3 4 4 3 4 4 3 2 2 4 3 3 3 4 2 3 4 3 3" << endl << "2 1 3 3 4 4 5 2 3 2 2 1 1 3 0 5 5 3 5 3 2 3 4 3 2 2 4 3 4 3 4 5 4 3 4 3 3 4 3 3 4 3 2 5 4 3 3 3 4 4 2 3 3 2 3 5 3 3" << endl << "3 3 4 4 3 5 5 2 3 2 3 3 4 4 5 0 5 5 5 4 1 2 2 4 1 2 2 3 4 3 3 4 4 3 2 4 3 4 5 3 3 5 3 3 4 3 3 4 4 3 2 2 4 3 2 5 4 3" << endl << "2 2 5 3 3 4 4 2 3 3 3 3 2 4 5 5 0 4 5 3 1 3 2 2 3 2 1 3 4 1 3 4 3 3 5 2 2 4 3 2 3 5 2 5 2 2 3 3 4 2 2 2 4 3 2 5 3 2" << endl << "5 3 2 5 3 3 5 5 3 2 5 5 4 4 3 5 4 0 2 2 4 2 2 2 1 2 2 3 1 1 3 5 3 4 2 3 2 2 2 2 2 1 1 5 1 4 1 4 1 2 2 3 1 1 4 1 1 3" << endl << "3 3 4 4 2 2 3 2 4 3 3 3 3 4 5 5 5 2 0 3 1 3 5 4 4 3 1 3 3 2 3 4 4 5 4 5 5 4 2 4 5 3 4 3 1 3 5 1 5 2 3 3 4 2 1 5 2 3" << endl << "3 2 4 4 2 5 5 2 3 3 3 3 2 4 3 4 3 2 3 0 3 4 3 2 2 1 5 3 3 5 4 5 5 5 4 5 3 4 4 4 5 3 2 3 1 4 3 4 4 5 1 2 5 5 5 3 5 2" << endl << "3 1 2 2 1 2 3 1 2 2 5 2 1 2 2 1 1 4 1 3 0 3 1 1 2 2 2 3 1 2 4 5 2 3 2 5 2 2 2 1 2 1 1 5 1 4 1 5 1 4 1 4 1 2 4 3 3 2" << endl << "2 5 5 3 3 3 2 2 4 2 2 3 4 3 3 2 3 2 3 4 3 0 2 3 5 4 4 3 4 2 3 4 2 2 4 2 3 2 5 2 4 2 2 4 2 3 3 3 3 3 1 4 1 5 3 3 2 2" << endl << "2 3 4 4 5 3 4 3 4 2 2 3 2 4 4 2 2 2 5 3 1 2 0 2 4 3 3 3 3 1 4 3 4 5 3 1 5 3 5 1 5 1 2 4 4 3 5 3 5 3 5 3 4 2 2 3 2 4" << endl << "4 1 2 5 2 2 3 5 4 3 4 3 2 2 3 4 2 2 4 2 1 3 2 0 2 3 4 3 1 3 5 4 2 5 2 1 2 2 2 2 2 1 2 2 1 2 2 1 3 4 1 3 1 1 2 3 1 4" << endl << "2 4 5 3 3 2 2 2 3 1 3 4 4 2 2 1 3 1 4 2 2 5 4 2 0 4 1 3 4 3 3 3 3 3 5 1 4 3 5 3 3 2 5 2 2 1 3 3 3 3 1 3 3 5 5 4 1 2" << endl << "3 3 4 4 4 2 2 2 5 2 3 3 2 2 2 2 2 2 3 1 2 4 3 3 4 0 1 3 1 1 2 2 3 4 3 1 4 2 4 2 2 2 4 2 3 1 3 4 3 3 4 4 1 2 1 2 1 2" << endl << "4 2 5 5 5 3 5 3 1 5 5 3 1 4 4 2 1 2 1 5 2 4 3 4 1 1 0 3 5 3 4 4 3 4 3 3 3 2 4 2 2 2 2 2 3 3 1 4 3 4 2 3 1 4 3 4 4 3" << endl << "3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 2 1 2 2 4 2 2 3 2 3 2 1 2 1 2 4 1 1 2 2 2 3 1 2 5 3 1 1 1 1" << endl << "2 3 5 3 3 3 4 2 3 4 3 2 3 5 4 4 4 1 3 3 1 4 3 1 4 1 5 2 0 3 4 2 3 3 5 3 2 4 5 4 3 4 3 3 1 4 3 3 3 2 2 2 3 5 4 4 5 2" << endl << "5 2 5 5 1 3 2 3 3 1 5 1 2 2 3 3 1 1 2 5 2 2 1 3 3 1 3 1 3 0 2 5 3 4 4 2 3 3 2 1 4 3 3 2 1 3 5 3 2 3 2 2 5 3 2 4 5 3" << endl << "4 2 4 4 2 4 5 5 3 3 5 3 2 3 4 3 3 3 3 4 4 3 4 5 3 2 4 2 4 2 0 5 2 4 3 2 3 3 2 1 3 3 2 3 3 4 3 4 4 3 2 2 2 2 4 3 1 3" << endl << "5 3 4 4 3 4 4 4 3 3 5 3 2 4 5 4 4 5 4 5 5 4 3 4 3 2 4 2 2 5 5 0 3 4 2 2 2 3 2 1 2 1 1 2 1 5 2 5 3 2 2 2 2 1 1 3 1 2" << endl << "3 3 3 5 2 5 5 2 3 2 3 4 3 4 4 4 3 3 4 5 2 2 4 2 3 3 3 4 3 3 2 3 0 5 4 5 3 4 2 2 4 2 2 3 1 1 2 2 4 3 2 3 5 4 3 4 3 2" << endl << "4 3 4 5 3 4 4 4 4 3 3 3 2 2 3 3 3 4 5 5 3 2 5 5 3 4 4 2 3 4 4 4 5 0 2 4 4 2 3 3 3 2 1 2 1 2 2 2 5 5 1 3 4 2 3 4 2 5" << endl << "2 4 5 3 3 4 4 2 3 4 3 4 3 3 4 2 5 2 4 4 2 4 3 2 5 3 3 2 5 4 3 2 4 2 0 4 4 5 5 3 4 5 5 2 1 3 4 2 4 3 3 3 3 5 3 5 5 3" << endl << "5 1 2 5 1 4 5 1 3 3 5 5 2 5 3 4 2 3 5 5 5 2 1 1 1 1 3 3 3 2 2 2 5 4 4 0 2 3 2 3 4 1 3 3 1 4 3 3 3 2 1 2 1 3 2 5 5 2" << endl << "2 3 3 4 2 4 3 3 4 3 3 4 3 3 3 3 2 2 5 3 2 3 5 2 4 4 3 2 2 3 3 2 3 4 4 2 0 3 5 2 3 1 2 4 1 1 4 2 4 3 5 3 1 2 1 3 1 2" << endl << "2 5 3 3 2 3 2 2 3 3 3 3 3 3 4 4 4 2 4 4 2 2 3 2 3 2 2 3 4 3 3 3 4 2 5 3 3 0 2 2 3 4 3 3 1 2 3 2 3 3 2 2 3 4 2 1 2 2" << endl << "2 2 3 4 5 3 3 2 3 4 4 5 4 4 3 5 3 2 2 4 2 5 5 2 5 4 4 2 5 2 2 2 2 3 5 2 5 2 0 3 3 2 3 3 5 3 5 3 4 3 5 2 2 3 1 2 3 2" << endl << "2 3 3 1 4 3 4 2 1 2 1 2 5 3 3 3 2 2 4 4 1 2 1 2 3 2 2 1 4 1 1 1 2 3 3 3 2 2 3 0 2 1 2 2 3 2 2 2 3 3 2 4 1 4 1 4 2 2" << endl << "3 2 2 5 3 4 4 2 2 4 2 2 2 4 4 3 3 2 5 5 2 4 5 2 3 2 2 2 3 4 3 2 4 3 4 4 3 3 3 2 0 2 3 1 2 1 3 2 5 2 3 2 4 2 1 4 1 4" << endl << "2 1 4 1 2 3 3 2 1 1 3 1 4 4 3 5 5 1 3 3 1 2 1 1 2 2 2 1 4 3 3 1 2 2 5 1 1 4 2 1 2 0 4 3 1 1 2 3 2 3 1 2 4 4 2 3 3 2" << endl << "2 3 4 3 2 2 2 1 3 2 2 2 2 3 2 3 2 1 4 2 1 2 2 2 5 4 2 2 3 3 2 1 2 1 5 3 2 3 3 2 3 4 0 3 1 1 3 2 2 3 2 3 3 4 2 4 2 2" << endl << "3 2 4 4 4 3 3 2 2 1 4 2 3 4 5 3 5 5 3 3 5 4 4 2 2 2 2 4 3 2 3 2 3 2 2 3 4 3 3 2 1 3 3 0 3 4 5 3 5 4 2 3 1 3 2 4 3 2" << endl << "2 3 4 4 5 2 1 1 1 3 4 3 2 4 4 4 2 1 1 1 1 2 4 1 2 3 3 1 1 1 3 1 1 1 1 1 1 1 5 3 2 1 1 3 0 1 2 2 5 3 2 3 1 3 2 2 4 2" << endl << "4 2 3 1 1 2 3 3 3 4 4 3 2 3 3 3 2 4 3 4 4 3 3 2 1 1 3 1 4 3 4 5 1 2 3 4 1 2 3 2 1 1 1 4 1 0 1 5 2 5 1 3 1 2 3 5 2 2" << endl << "3 3 3 3 4 4 2 2 5 1 5 3 2 2 3 3 3 1 5 3 1 3 5 2 3 3 1 2 3 5 3 2 2 2 4 3 4 3 5 2 3 2 3 5 2 1 0 2 4 3 5 3 1 2 4 3 5 2" << endl << "4 4 3 3 3 3 3 3 3 4 5 3 3 2 3 4 3 4 1 4 5 3 3 1 3 4 4 2 3 3 4 5 2 2 2 3 2 2 3 2 2 3 2 3 2 5 2 0 2 5 1 3 1 2 2 5 1 2" << endl << "4 4 2 5 4 4 3 2 4 3 3 4 1 4 4 4 4 1 5 4 1 3 5 3 3 3 3 2 3 2 4 3 4 5 4 3 4 3 4 3 5 2 2 5 5 2 4 2 0 4 3 3 4 3 2 3 3 5" << endl << "5 4 2 5 3 4 4 4 4 5 5 3 3 3 4 3 2 2 2 5 4 3 3 4 3 3 4 3 2 3 3 2 3 5 3 2 3 3 3 3 2 3 3 4 3 5 3 5 4 0 2 3 2 4 4 5 2 4" << endl << "2 2 2 3 4 2 2 2 2 5 2 2 3 3 2 2 2 2 3 1 1 1 5 1 1 4 2 1 2 2 2 2 2 1 3 1 5 2 5 2 3 1 2 2 2 1 5 1 3 2 0 2 1 2 1 1 1 1" << endl << "2 2 3 3 2 2 4 2 4 2 3 4 2 3 3 2 2 3 3 2 4 4 3 3 3 4 3 2 2 2 2 2 3 3 3 2 3 2 2 4 2 2 3 3 3 3 3 3 3 3 2 0 1 2 1 4 2 3" << endl << "2 2 3 5 2 5 5 1 2 1 3 2 2 4 3 4 4 1 4 5 1 1 4 1 3 1 1 5 3 5 2 2 5 4 3 1 1 3 2 1 4 4 3 1 1 1 1 1 4 2 1 1 0 4 2 3 3 3" << endl << "2 3 5 3 3 5 3 2 4 3 2 4 4 2 2 3 3 1 2 5 2 5 2 1 5 2 4 3 5 3 2 1 4 2 5 3 2 4 3 4 2 4 4 3 3 2 2 2 3 4 2 2 4 0 5 5 3 3" << endl << "2 2 3 2 2 3 4 2 2 3 4 2 3 3 3 2 2 4 1 5 4 3 2 2 5 1 3 1 4 2 4 1 3 3 3 2 1 2 1 1 1 2 2 2 2 3 4 2 2 4 1 1 2 5 0 4 1 3" << endl << "3 1 3 4 2 5 5 3 5 3 4 5 2 4 5 5 5 1 5 3 3 3 3 3 4 2 4 1 4 4 3 3 4 4 5 5 3 1 2 4 4 3 4 4 2 5 3 5 3 5 1 4 3 5 4 0 5 3" << endl << "2 1 5 5 5 3 4 1 4 1 5 2 2 3 3 4 3 1 2 5 3 2 2 1 1 1 4 1 5 5 1 1 3 2 5 5 1 2 3 2 1 3 2 3 4 2 5 1 3 2 1 2 3 3 1 5 0 3" << endl << "3 2 2 5 2 4 2 3 3 3 3 4 1 3 3 3 2 3 3 2 2 2 4 4 2 2 3 1 2 3 3 2 2 5 3 2 2 2 2 2 4 2 2 2 2 2 2 2 5 4 1 3 3 3 3 3 3 0"; } else if (fileName == "Mexican_Power_Network_1940s.lst"){ outText<< "18 8 10 23 21" << endl << "19 11 21" << endl << "29 5 9 10" << endl << "23 8 9 18 11" << endl << "4 7 6 8 20 5 21" << endl << "5 4 29 20 7 6 8 9 26 21" << endl << "6 5 7 4 20 21 8" << endl << "7 4 6 5 8 20 21" << endl << "9 5 8 23 29 20 21 11 10" << endl << "8 18 23 4 5 6 7 21 24 26 25 9 10 37 20" << endl << "10 18 29 8 11 9 20 25 26" << endl << "11 19 23 9 10 25 21 36" << endl << "20 4 5 6 7 8 9 10" << endl << "24 8 26" << endl << "26 5 8 24 10" << endl << "21 19 4 5 6 7 8 9 11 18" << endl << "36 37 11" << endl << "37 8 36" << endl << "25 10 11 8"; } f.close(); } /** Returns the adjacency matrix of G This is called from saveGraphToAdjacency() using << operator of Matrix class The resulting matrix HAS spaces between elements. */ void Graph::writeAdjacencyMatrixTo(QTextStream& os){ qDebug("Graph: adjacencyMatrix(), writing matrix with %i vertices", vertices()); QList::iterator it, it1; float weight=-1; for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( ! (*it)->isEnabled() ) continue; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( ! (*it1)->isEnabled() ) continue; if ( (weight = this->hasEdge ( (*it)->name(), (*it1)->name() ) ) !=0 ) { os << static_cast (weight) << " "; } else os << "0 "; } os << endl; } graphModified=false; } /** Outputs adjacency matrix to a text stream * Used in slotExportSM() of MainWindow class. */ QTextStream& operator << (QTextStream& os, Graph& m){ QList::iterator it, it1; float weight=-1; for (it=m.m_graph.begin(); it!=m.m_graph.end(); it++){ for (it1=m.m_graph.begin(); it1!=m.m_graph.end(); it1++){ if ( (weight = m.hasEdge ( (*it)->name(), (*it1)->name() ) ) !=0 ) { os << static_cast (weight) << " "; } else os << "0 "; } os << endl; } return os; } /** Writes the adjacency matrix of G to a specified file This is called by MainWindow::slotViewAdjacencyMatrix() The resulting matrix HAS NO spaces between elements. */ void Graph::writeAdjacencyMatrix (const char* fn, const char* netName) { qDebug()<<"Graph::writeAdjacencyMatrix() "; ofstream file (fn); int sum=0; float weight=0; file << "-Social Network Visualizer- \n"; file << "Adjacency matrix of "<< netName<<": \n\n"; QList::iterator it, it1; for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( ! (*it)->isEnabled() ) continue; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( ! (*it1)->isEnabled() ) continue; if ( (weight = this->hasEdge ( (*it)->name(), (*it1)->name() ) )!=0 ) { sum++; if (weight >= 1) file << static_cast (weight); else file << "1"; } else file << "0"; } file << endl; } qDebug("Graph: Found a total of %i edge",sum); if ( sum != totalEdges() ) qDebug ("Error in edge count found!!!"); else qDebug("Edge count OK!"); file.close(); } void Graph::createAdjacencyMatrix(bool dropIsolates){ qDebug() << "Graph::createAdjacencyMatrix()"; float m_weight=-1; int i=0, j=0; bool isolatedNode=true; isolatedVertices = 0; AM.resize(m_totalVertices); QList::iterator it, it1; QList isolatesList; for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( ! (*it)->isEnabled() ) continue; j=0; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( ! (*it1)->isEnabled() ) continue; if ( (m_weight = this->hasEdge ( (*it)->name(), (*it1)->name() ) ) !=0 ) { AM.setItem(i,j, m_weight ); isolatedNode=false; } else{ AM.setItem(i,j, 0); } qDebug()<<" AM("<< i+1 << ","<< j+1 << ") = " << AM.item(i,j); j++; } if (isolatedNode){ qDebug()<< "Graph::createAdjacencyMatrix() - node " << i+1 << " is isolated. Marking it." ; (*it1)->setIsolated(true); isolatesList << i; } i++; } if (dropIsolates){ qDebug()<< "Graph::createAdjacencyMatrix() - Dropping all isolated nodes."; for (int k = 0; k < isolatesList.size(); ++k) { AM.deleteRowColumn( isolatesList.at(k) ); } isolatedVertices=isolatesList.size(); qDebug() << "Graph::createAdjacencyMatrix() - Total isolates found: " << isolatedVertices; } qDebug() << "Graph::createAdjacencyMatrix() - Done."; } void Graph::invertAdjacencyMatrix(){ qDebug() << "Graph::invertAdjacencyMatrix()"; invAM.resize(m_totalVertices); qDebug()<<"Graph::invertAdjacencyMatrix() - first create the Adjacency Matrix AM"; bool dropIsolates=false; createAdjacencyMatrix(dropIsolates); qDebug()<<"Graph::invertAdjacencyMatrix() - invert the Adjacency Matrix AM and store it to invAM"; invAM.inverseByGaussJordanElimination(AM); } void Graph::writeInvertAdjacencyMatrix(const char* fn, const char* netName){ qDebug("Graph::writeInvertAdjacencyMatrix() "); int i=0, j=0; QList::iterator it, it1; ofstream file (fn); file << "-Social Network Visualizer- \n"; file << "Invert Matrix of "<< netName<<": \n\n"; invertAdjacencyMatrix(); for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( ! (*it)->isEnabled() ) continue; j=0; for (it1=m_graph.begin(); it1!=m_graph.end(); it1++){ if ( ! (*it1)->isEnabled() ) continue; file << invAM.item(i,j)<< " "; qDebug() << invAM.item(i,j)<< " "; j++; } i++; file << endl; qDebug() << endl; } file.close(); } bool Graph::saveGraphToDotFormat ( QString fileName, QString networkName, int maxWidth, int maxHeight) { Q_UNUSED(fileName); Q_UNUSED(networkName); Q_UNUSED(maxWidth); Q_UNUSED(maxHeight); return true; } bool Graph::saveGraphToGraphMLFormat ( QString fileName, QString networkName, int maxWidth, int maxHeight) { qDebug () << " Graph::saveGraphToGraphMLFormat to file: " << fileName.toAscii(); int weight=0, source=0, target=0, edgeCount=0, m_size=1, m_labelSize; QString m_color, m_labelColor, m_label; bool openToken; QFile f( fileName ); if ( !f.open( QIODevice::WriteOnly ) ) { emit statusMessage( QString(tr("Could not write to %1")).arg(fileName) ); return false; } QTextStream outText( &f ); qDebug()<< " ... writing xml version"; outText << " \n"; outText << " \n" ; outText << "" "\n"; qDebug()<< " ... writing keys "; outText << " \n" " " " \n" " \n"; outText << " \n" " " << "0.0" << " \n" " \n"; outText << " \n" " " << "0.0" << " \n" " \n"; outText << " \n" " "<< initVertexSize << " \n" " \n"; outText << " \n" " " << initVertexColor << " \n" " \n"; outText << " \n" " " << initVertexShape << " \n" " \n"; outText << " \n" " " << initVertexLabelColor << " \n" " \n"; outText << " \n" " " << initVertexLabelSize << " \n" " \n"; outText << " \n" " 1.0 \n" " \n"; outText << " \n" " " << initEdgeColor << " \n" " \n"; qDebug()<< " ... writing graph tag"; if (networkName == "") networkName = "G"; if (m_undirected) outText << " \n"; else outText << " \n"; QList::iterator it; QList::iterator jt; qDebug()<< " writing nodes data"; for (it=m_graph.begin(); it!=m_graph.end(); it++){ if ( ! (*it)->isEnabled () ) continue; qDebug() << " Node id: "<< (*it)->name() ; outText << " name() << "\"> \n"; m_color = (*it)->color(); m_size = (*it)->size() ; m_labelSize=(*it)->labelSize() ; m_labelColor=(*it)->labelColor() ; m_label=(*it)->label(); if (m_label.contains('&') ){ m_label=m_label.replace('&',"&"); } if (m_label.contains('<') ){ m_label=m_label.replace('<',"<"); } if (m_label.contains('>') ){ m_label=m_label.replace('>',">"); } if (m_label.contains('\"') ){ m_label=m_label.replace('\"',"""); } if (m_label.contains('\'') ){ m_label=m_label.replace('\'',"'"); } outText << " " << m_label <<"\n"; qDebug()<<" ... Coordinates x " << (*it)->x()<< " "<y()<< " "<" << (*it)->x()/(maxWidth) <<"\n"; outText << " " << (*it)->y()/(maxHeight) <<"\n"; if ( initVertexSize != m_size ) { outText << " " << m_size <<"\n"; } if ( QString::compare ( initVertexColor, m_color, Qt::CaseInsensitive) != 0) { outText << " " << m_color <<"\n"; } outText << " " << (*it)->shape() <<"\n"; if ( QString::compare ( initVertexLabelColor, m_labelColor, Qt::CaseInsensitive) != 0) { outText << " " << m_labelColor <<"\n"; } if ( initVertexLabelSize != m_labelSize ) { outText << " " << m_labelSize <<"\n"; } outText << " \n"; } qDebug() << " ... writing edges data"; edgeCount=0; for (it=m_graph.begin(); it!=m_graph.end(); it++) { for (jt=m_graph.begin(); jt!=m_graph.end(); jt++) { source=(*it)->name(); target=(*jt)->name(); if ( (weight= this->hasEdge( source,target ) ) !=0 ) { ++edgeCount; m_color = (*it)->outLinkColor( target ); qDebug()<< " edge no "<< edgeCount << " from n1=" << source << " to n2=" << target << " with weight " << weight << " and color " << m_color.toAscii() ; outText << " 1) { outText << "> \n"; outText << " " << weight<<"" <<" \n"; openToken=false; } if ( QString::compare ( initEdgeColor, m_color, Qt::CaseInsensitive) != 0) { if (openToken) outText << "> \n"; outText << " " << m_color <<"" <<" \n"; openToken=false; } if (openToken) outText << "/> \n"; else outText << " \n"; } } } outText << " \n"; outText << "\n"; f.close(); QString fileNameNoPath=fileName.split("/").last(); emit statusMessage( QString(tr( "File %1 saved" ) ).arg( fileNameNoPath ) ); return true; } void Graph::setShowLabels(bool toggle){ initShowLabels=toggle; } void Graph::setShowNumbersInsideNodes(bool toggle){ initNumbersInsideNodes=toggle; } /** This slot is activated when the user clicks on the relevant MainWindow checkbox (SpringEmbedder, Fruchterman) to start or stop the movement of nodes, according to the requested model. PARAMETERS: state: movement on/off toggle type: controls the type of layout model requested. Available options 1: Spring Embedder 2: FruchtermanReingold cW, cH: control the current canvasWidth and canvasHeight */ void Graph::nodeMovement(int state, int type, int cW, int cH){ qDebug()<< "Graph: startNodeMovement() - state " << state; canvasWidth = cW; canvasHeight = cH; int factor=100; //factor controls speed. Decrease it to increase speed... if (state == Qt::Checked){ qDebug()<< "Graph: startNodeMovement() - STARTING dynamicMovement" ; dynamicMovement = TRUE; layoutType=type; if (!timerId) { qDebug("Graph: startTimer()"); timerId = startTimer(factor); } } else { qDebug()<< "Graph: startNodeMovement() - STOPPING dynamicMovement" ; dynamicMovement = FALSE; killTimer(timerId); timerId = 0; } } /** This method is automatically invoked when a QTimerEvent occurs It checks layoutType to call the appropriate method with the Force Directed Placement algorithm. */ void Graph::timerEvent(QTimerEvent *event) { qDebug("Graph: timerEvent()"); Q_UNUSED(event); switch (layoutType){ case 1: { layoutForceDirectedSpringEmbedder(dynamicMovement); break; } case 2: { layoutForceDirectedFruchtermanReingold(dynamicMovement); break; } } if (!graphModified) { qDebug("Timer will be KILLED since no vertex is movin any more..."); killTimer(timerId); timerId = 0; } } /** The Spring Embedder model (Eades, 1984), part of the Force Directed Placement (FDP) family, assigns forces to all vertices and edges, as if nodes were electrically charged particles (Coulomb's law) and all edges were springs (i.e. Hooke's law). These forces are applied to the nodes iteratively, pulling them closer together or pushing them further apart, until the system comes to an equilibrium state (node positions do not change anymore). Note that, following Eades, we do not need to have a faithful simulation; we can -and we do- apply unrealistic forces in an unrealistic manner. For instance, instead of the forces described by Hooke's law, we will assume weaker logarithmic forces between far apart vertices... */ void Graph::layoutForceDirectedSpringEmbedder(bool dynamicMovement){ qreal xvel = 0, yvel = 0, dx=0, dy=0, ulv_x=0, ulv_y=0; qreal c_rep=3, c_spring=3, dux=0, duy=0, natural_length=70; double dist = 0; QPointF curPos, newPos, pos ; if (dynamicMovement){ qDebug () << "max dx "<< canvasWidth << "max dy "<< canvasHeight; foreach (Vertex *v1, m_graph) { xvel=0; yvel=0; qDebug() << "**************** Calculate forces for vertex " << v1->name() << " with index " << index[v1->name()] << " and pos "<< v1->x() << ", "<< v1->y(); foreach (Vertex *v2, m_graph) { qDebug () << " v2 = "<< v2->name() << " with pos (" << v2->x() << "," << v2->y() << ")"; if (v2 == v1) { qDebug() << " v1==v2, continuing"; continue; } dx = v2->x() - v1->x(); dy = v2->y() - v1->y(); dist = sqrt (dx * dx + dy * dy); //the euclideian distance of the two vertices qDebug()<< "v1= " << v1->name() << " v2= " << v2->name() << " - euclideian distance = " << dist; if ( this->hasEdge (v1->name(), v2->name()) ) { //calculate spring forces (pulling) force ulv_x = + dx / dist; ulv_y = + dy / dist; dux = (ulv_x * c_spring) * log ( dist / natural_length ); duy = (ulv_y * c_spring) * log ( dist / natural_length ); xvel += dux; yvel += duy; qDebug() << " v1= "<name() << " connected to and pulled by v2= "<< v2->name() <<" c_spring=" << c_spring <<" nat_length =" << natural_length <<" ulv_x="<name() << "xvel, yvel "<< xvel << ", "<< yvel; continue; } else { //calculate electric (repulsive) forces between non-adjacent vertices. ulv_x = - dx / dist; ulv_y = - dy / dist; dux = (ulv_x * c_rep) / (dist * dist); duy = (ulv_y * c_rep) / ( dist * dist) ; qDebug() << " v1 = "<name() << " NOT connected to and pushed away from v2 = "<< v2->name() <<" c_rep=" << c_rep <<" ulv_x="<name() << "xvel, yvel "<< xvel << ", "<< yvel; } } //Move node to new position newPos = QPointF(v1->x()+ xvel, v1->y()+yvel); qDebug("current x and y: %f, %f. Possible new pos is to new x new y = %f, %f", v1->x(), v1->y(), newPos.x(), newPos.y()); if (newPos.x() < 5.0 ||newPos.y() < 5.0 || newPos.x() >= (canvasWidth -5)|| newPos.y() >= (canvasHeight-5)|| (v1->x() == newPos.x() && v1->y() == newPos.y() )) continue; qDebug("current x and y: %f, %f. This node will move to new x new y = %f, %f", v1->x(), v1->y(), newPos.x(), newPos.y()); emit moveNode((*v1).name(), newPos.x(), newPos.y()); } } } /** Fruchterman and Reingold (1991) refined the Spring Embedder model by replacing the forces. In this model, "the vertices behave as atomic particles or celestial bodies, exerting attractive and repulsive forces on one another." (ibid). Again, only vertices that are neighbours attract each other but, unlike Spring Embedder, all vertices repel each other. These forces induce movement. The algorithm might resemble molecular or planetary simulations, sometimes called n-body problems. */ void Graph::layoutForceDirectedFruchtermanReingold(bool dynamicMovement){ qreal xvel = 0, yvel = 0, dx=0, dy=0, ulv_x=0, ulv_y=0; qreal c_rep=10, dux=0, duy=0, natural_length=100, temperature=2; double dist = 0; QPointF curPos, newPos, pos ; if (dynamicMovement){ qDebug() << "Graph: layoutForceDirectedFruchtermanReingold() " << "max dx "<< canvasWidth << "max dy "<< canvasHeight; natural_length= sqrt ( (canvasWidth - 10)* (canvasHeight-10) / vertices() ); qDebug () << "Graph: Setting natural_length = "<< natural_length << "...following Fruchterman-Reingold (1991) formula "; foreach (Vertex *v1, m_graph) { qDebug() << "***** Calculate forces for vertex " << v1->name() << " with index " << index[v1->name()] << " and pos "<< v1->x() << ", "<< v1->y(); if ( ! v1->isEnabled() ) { qDebug() << " vertex " << v1->name() << " not enabled. Continuing..."; continue; } xvel=0; yvel=0; dux=0; duy=0; foreach (Vertex *v2, m_graph) { if ( ! v2->isEnabled() ) continue; qDebug () << " v2 = "<< v2->name() << " with pos (" << v2->x() << "," << v2->y() << ")"; if (v2 == v1) { qDebug() << " v1==v2, continuing"; continue; } dx = v2->x() - v1->x(); dy = v2->y() - v1->y(); dist = (dx * dx + dy * dy); dist = sqrt ( dist ); //the euclideian distance of the two vertices qDebug()<< " v1= " << v1->name() << " v2= " << v2->name() << " - euclideian distance = " << dist; if ( this->hasEdge (v1->name(), v2->name()) ) { //calculate spring (pulling) force ulv_x = dx / dist; ulv_y = dy / dist; dux = ( ulv_x ) * ( dist * dist ) / natural_length; duy = ( ulv_y ) * ( dist * dist ) / natural_length; //limit the maximum displacement to a maximum temperature xvel = ( dux / abs (dux) ) * qMin( abs(dux), temperature) ; yvel = ( duy / abs (duy) ) * qMin( abs(duy), temperature) ; qDebug() << " v1= "<name() << " connected to and pulled by v2= "<< v2->name() <<" nat_length =" << natural_length <<" ulv_x="<>> current x and y: %f, %f. Possible new pos is to new x new y = %f, %f", v1->x(), v1->y(), newPos.x(), newPos.y()); if (newPos.x() < 5.0 ||newPos.y() < 5.0 || newPos.x() >= (canvasWidth -5)|| newPos.y() >= (canvasHeight-5)|| (v1->x() == newPos.x() && v1->y() == newPos.y() )) continue; qDebug(">>> current x and y: %f, %f. This node will move to new x new y = %f, %f", v1->x(), v1->y(), newPos.x(), newPos.y()); emit moveNode((*v1).name(), newPos.x(), newPos.y()); } } } Graph::~Graph() { clear(); index.clear(); } socnetv-0.90/src/nodelabel.cpp0000755000175000017500000000403711423751762016614 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 nodelabel.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "nodelabel.h" #include "node.h" #include NodeLabel::NodeLabel( Node *jim , int size, QString labelText, QGraphicsScene *scene) :QGraphicsTextItem(0,scene) { source=jim; jim -> addLabel(this); setParentItem(jim); //auto disables child items like this, when node is disabled. setPlainText( labelText ); setFont( QFont ("Times", size, QFont::Light, TRUE) ); setZValue (253); } void NodeLabel::removeRefs(){ source->deleteLabel(); } NodeLabel::~NodeLabel(){ } socnetv-0.90/src/filteredgesbyweightdialog.h0000644000175000017500000000371711423751762021555 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 filteredgesbyweightdialog.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef FILTEREDGESBYWEIGHTDIALOG_H #define FILTEREDGESBYWEIGHTDIALOG_H #include #include "ui_filteredgesbyweightdialog.h" class FilterEdgesByWeightDialog : public QDialog { Q_OBJECT public: FilterEdgesByWeightDialog (QWidget *parent = 0); public slots: void gatherData (); signals: void userChoices( float, bool); private: Ui::FilterEdgesByWeightDialog ui; }; #endif socnetv-0.90/src/datasetselectdialog.h0000644000175000017500000000363611423751762020342 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 datasetselectdialog.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef DATASETSELECTDIALOG_H #define DATASETSELECTDIALOG_H #include #include "ui_datasetselectdialog.h" class DataSetSelectDialog: public QDialog { Q_OBJECT public: DataSetSelectDialog (QWidget *parent = 0); public slots: void gatherData(); signals: void userChoices(QString); private: Ui::DataSetSelectDialog ui; }; #endif socnetv-0.90/src/backgrcircle.h0000755000175000017500000000437111444336706016750 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 backgrcircle.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef BACKGRCIRCLE_H #define BACKGRCIRCLE_H #include #include class GraphicsWidget; static const int TypeBackgrCircle = QGraphicsItem::UserType+6; class BackgrCircle : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES (QGraphicsItem) public: BackgrCircle(GraphicsWidget *, int, int, int ); BackgrCircle(GraphicsWidget *, int, int ); enum { Type = UserType + 6 }; int type() const { return Type; } void die(); protected: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: GraphicsWidget *graphicsWidget; int m_x0, m_y0, m_radius, width; bool circle; }; #endif socnetv-0.90/src/webcrawlerdialog.cpp0000644000175000017500000000510511423751762020176 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 webcrawlerdialog.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "webcrawlerdialog.h" #include #include WebCrawlerDialog::WebCrawlerDialog(QWidget *parent) : QDialog (parent) { ui.setupUi(this); connect ( ui.buttonBox,SIGNAL(accepted()), this, SLOT(gatherData()) ); (ui.buttonBox) -> button (QDialogButtonBox::Ok) -> setDefault(true); (ui.goOutCheckBox)-> setChecked(true); (ui.websiteLineEdit)->setFocus(); } void WebCrawlerDialog::gatherData(){ qDebug()<< "Dialog: gathering Data!..."; bool goOut=false; QString website = (ui.websiteLineEdit)->text() ; int maxRecursion = (ui.maxRecursionLevelSpinBox) -> value(); int maxNodes = (ui.maxNodesSpinBox) -> value(); if ( ui.goOutCheckBox -> isChecked() ) { qDebug()<< " We will go out of this site... " ; goOut = true; } else { qDebug()<< " We will not go out of this site... "; goOut = false; } qDebug()<< " Website: " << website; qDebug()<< " maxRecursion " << maxRecursion << " maxNodes " << maxNodes ; emit userChoices( website, maxNodes, maxRecursion, goOut ); } socnetv-0.90/src/application.qrc0000755000175000017500000000040111261401574017155 0ustar dimitrisdimitris editcopy.xpm editcut.xpm filenew.xpm fileopen.xpm editpaste.xpm filesave.xpm socnetv-0.90/src/forms/0000755000175000017500000000000011455100156015270 5ustar dimitrisdimitrissocnetv-0.90/src/forms/webcrawlerdialog.ui0000644000175000017500000001544411261401573021156 0ustar dimitrisdimitris WebCrawlerDialog 0 0 477 288 14 0 Dialog SocNetV includes a simple web crawler. A web crawler (or spider) is a tool which scans and reports all links found in a given website. All links will appear as edges while the original site and all other sites found will appear as nodes. Enter below the web address of the site you wish to crawl, and set the maximum recursion depth: Qt::RichText true Qt::Horizontal 40 20 201 0 Maximum recursion depth level Qt::Horizontal 40 20 46 0 Enter a value to set the recursion maximum depth level. That is the maximum nodes to be considered as source. Set value to 1, if you just want to display links from the source website... 1 230 0 Maximum nodes to display 46 0 Enter a non-zero value to set the maximum nodes to be crawled. Set value to 0, if you don't want any limits... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Maximum Nodes to display</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">In this spinbox, you define the maximum nodes to be displayed by SocNetV when running in Web Crawler mode. Set value to 0, if you don't want any limits...</p></body></html> 0 9999 0 Go outside of this domain Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok Qt::Horizontal Source Website: 300 32 16777215 32 buttonBox accepted() WebCrawlerDialog accept() 248 254 157 274 buttonBox rejected() WebCrawlerDialog reject() 316 260 286 274 socnetv-0.90/src/forms/datasetselectdialog.ui0000644000175000017500000001024111421271560021633 0ustar dimitrisdimitris DataSetSelectDialog 0 0 383 172 400 175 Select Data Set 200 90 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:8pt;">SocNetV is able to automatically create known data sets, such as </span><span style=" font-family:'DejaVu Sans'; font-size:8pt; font-style:italic;">Padgett</span><span style=" font-family:'DejaVu Sans'; font-size:8pt;">'s florentine families etc.</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:8pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:8pt;">Please select the data set you want to create from the combo box below.</span></p></body></html> Qt::RichText true Select 300 0 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok Qt::Vertical buttonBox accepted() DataSetSelectDialog accept() 248 254 157 274 buttonBox rejected() DataSetSelectDialog reject() 316 260 286 274 socnetv-0.90/src/forms/filteredgesbyweightdialog.ui0000644000175000017500000000632211261401573023054 0ustar dimitrisdimitris FilterEdgesByWeightDialog 0 0 368 191 Dialog Qt::Vertical With this temporary action, you will make invisible some links according to their weight. Select a threshold then click on the desired radiobox below: Qt::RichText true Weight Threshold 1 -100.000000000000000 Qt::Vertical Filter edges with weight over threshold Filter edges with weight below threshold Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() FilterEdgesByWeightDialog accept() 248 254 157 274 buttonBox rejected() FilterEdgesByWeightDialog reject() 316 260 286 274 socnetv-0.90/src/icon.rc0000644000175000017500000000006111261401574015420 0ustar dimitrisdimitrisIDI_ICON1 ICON DISCARDABLE "images/socnetv.ico" socnetv-0.90/src/main.cpp0000755000175000017500000000652511423751762015617 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 main.cpp - description ------------------- begin : 9 21:10:04 EET 2005 copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include //core Qt functionality #include //for text translations #include #include //used for cout #include "mainwindow.h" //main application window using namespace std; int main(int argc, char *argv[]) { Q_INIT_RESOURCE(src); QApplication app(argc, argv); QTranslator tor( 0 ); QLocale locale; // set the location where your .qm files are in load() below as the last parameter instead of "." // for development, use "/" to use the english original as // .qm files are stored in the base project directory. tor.load( QString("socnetv.") + locale.name(), "." ); app.installTranslator( &tor ); //Check if a filename is passed when this program is called. QString option; if ( app.argc() > 1 ) { option = app.argv()[1]; if (option=="--help" || option=="-h" || option=="--h" ) { cout<<"\nSocial Networks Visualizer v." << qPrintable(VERSION)<< "\n" <<"\nUsage: socnetv [flags] [file]\n" <<"-h, --help Displayes this help message\n" <<"-V, --version Displays version number\n\n" <<"You can load a network from a file using \n" <<"socnetv file.net \n" <<"where file.net/csv/dot/graphml must be of valid format. See README\n\n" <<"Please send any bug reports to dimitris.kalamaras@gmail.com.\n\n"; return -1; } else if (option=="-V" || option=="--version") { cout<<"\nSocial Networks Visualizer v." << qPrintable(VERSION) << "\nCopyright Dimitris V. Kalamaras, \nLicense: GPL3\n\n"; return -1; } else { cout<<"\nSocial Networks Visualizer v." << qPrintable(VERSION); cout<<"\nLoading file: " << qPrintable(option) << "\n\n"; } } MainWindow *socnetv=new MainWindow(option); socnetv->show(); return app.exec(); } socnetv-0.90/src/htmlviewer.h0000755000175000017500000000404711423751762016523 0ustar dimitrisdimitris/**************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop htmlviewer.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com *****************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef HTMLVIEWER_H #define HTMLVIEWER_H #include class QComboBox; class QWebView; class HTMLViewer : public QMainWindow { Q_OBJECT public: HTMLViewer( const QString& manualPath, QWidget* parent = 0); ~HTMLViewer(); private slots: void openFile(); void pathSelected( const QString & ); private: QWebView *view; QAction *fileOpen, *filePrint, *fileQuit, *fileHome, *fileBack, *fileForward; QComboBox *pathCombo; }; #endif socnetv-0.90/src/nodelabel.h0000755000175000017500000000374311423751762016264 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 nodelabel.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef NODELABEL_H #define NODELABEL_H #include class Node; static const int TypeLabel = QGraphicsItem::UserType+4; class NodeLabel : public QGraphicsTextItem{ public: NodeLabel(Node * , int size, QString, QGraphicsScene * ); void removeRefs(); enum { Type = UserType + 4 }; int type() const { return Type; } ~NodeLabel(); Node* node() { return source; } private: Node *source; }; #endif socnetv-0.90/src/vertex.cpp0000755000175000017500000002373611444336706016213 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 vertex.cpp - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "vertex.h" #include //used for qDebug messages #include #include "graph.h" Vertex::Vertex( Graph* parent, int v1, int val, int size, QString color, QString numColor, int numSize, QString label, QString labelColor, int labelSize, QPointF p, QString shape): parentGraph (parent) { m_name=v1; m_value=val; m_size=size; m_color=color; m_numberColor=numColor; m_numberSize=numSize; m_label=label; m_labelColor=labelColor; m_labelSize=labelSize; m_shape=shape; m_x=p.x(); m_y=p.y(); //FIXME outLinkColors list need update when we remove vertices/edges // outLinkColors=new QString[1500]; //Q_CHECK_PTR(outLinkColors); outLinkColors.reserve(1600); m_outLinks=0; m_inLinks=0; m_ODC=0; m_SODC=0; m_IDC=0; m_SIDC=0; m_CC=0; m_SCC=0; m_BC=0; m_SBC=0; m_GC=0; m_SGC=0; m_SC=0; m_SSC=0; m_CLC=0; m_hasCLC=FALSE; m_inLinked=FALSE; m_outLinked=FALSE; m_reciprocalLinked=FALSE; m_enabled = TRUE; connect (this, SIGNAL (setEdgeVisibility ( int, int, bool) ), parent, SLOT (slotSetEdgeVisibility ( int, int, bool)) ); } Vertex::Vertex(int v1) { m_name=v1; m_value=1; m_size=9; m_color="black"; m_label=""; m_labelColor="black"; m_shape="circle"; m_outLinks=0; m_inLinks=0; m_ODC=0; m_SODC=0; m_IDC=0; m_SIDC=0; m_CC=0; m_SCC=0; m_BC=0; m_SBC=0; m_GC=0; m_SGC=0; m_SC=0; m_SSC=0; m_inLinked=FALSE; m_outLinked=FALSE; m_reciprocalLinked=FALSE; } void Vertex::addLinkTo (long int v2, float weight) { //qDebug() <<"Vertex: "<< name() << " addLinkTo() "<< v2 << " of weight "<< weight; m_outEdges[v2]=weight; m_enabled_outEdges [v2]=1; m_outLinks++; } void Vertex::addLinkFrom (long int source, float weight) { //qDebug() <<"Vertex: "<< name() << " addLinkFrom() "<< source; m_inEdges[source]=weight; m_inLinks++; } void Vertex::changeLinkWeightTo(long int target, float weight){ qDebug() << "Vertex: changeEdgeWeightTo " << target; m_outEdges[target]=weight; m_enabled_outEdges[target] = 1; } //finds and removes a link to vertice v2 void Vertex::removeLinkTo (long int v2) { qDebug() << "Vertex: removeLinkTo() vertex " << m_name << " has " <0) { m_outLinks--; imap_f::iterator it=m_outEdges.find(v2); if ( it != m_outEdges.end() ) { qDebug("Vertex: edge exists. Removing it"); m_outEdges.erase(it); m_enabled_outEdges[ it->first ] = 0; if ( m_outLinks == 0 ) setOutLinked(FALSE); } else { qDebug("Vertex: edge doesnt exist."); } qDebug() << "Vertex: vertex " << m_name << " now has " << outDegree() << " edges"; } else { qDebug() << "Vertex: vertex " << m_name << " has no edges" ; } } void Vertex::removeLinkFrom(long int v2){ qDebug() << "Vertex: removeLinkFrom() vertex " << m_name << " has " << outDegree() << " edges. RemovingEdgeFrom " << v2 ; if (outDegree()>0) { m_inLinks--; imap_f::iterator i=m_inEdges.find(v2); if ( i != m_inEdges.end() ) { qDebug("Vertex: edge exists. Removing it"); m_inEdges.erase(i); if ( m_inLinks == 0 ) setInLinked(FALSE); } else { qDebug() << "Vertex: edge doesnt exist."; } qDebug() << "Vertex: vertex " << m_name << " now has " << inDegree() << " edges" ; } else { qDebug() << "Vertex: vertex " << m_name << " has no edges"; } } /** Called from Graph parent to filter edges over or under a specified weight (m_threshold) */ void Vertex::filterEdgesByWeight(float m_threshold, bool overThreshold){ qDebug() << "Vertex::filterEdgesByWeight of vertex " << this->m_name; imap_f::iterator it1; int target=0; float m_weight=0; for( it1 = m_outEdges.begin(); it1 != m_outEdges.end(); it1++ ) { target=it1->first; m_weight = it1->second; if (overThreshold) { if ( m_weight >= m_threshold ) { qDebug() << "Vertex::filterEdgesByWeight(). Edge to " << target << " has weight " << m_weight << ". It will be disabled. Emitting signal to Graph...."; m_enabled_outEdges[target] = 0; emit setEdgeVisibility ( m_name, target, false ); } else { qDebug() << "Vertex::filterEdgesByWeight(). Edge to " << target << " has weight " << m_weight << ". It will be enabled. Emitting signal to Graph...."; m_enabled_outEdges[target] = 1; emit setEdgeVisibility ( m_name, target, true ); } } else { if ( m_weight <= m_threshold ) { qDebug() << "Vertex::filterEdgesByWeight(). Edge to " << target << " has weight " << m_weight << ". It will be disabled. Emitting signal to Graph...."; m_enabled_outEdges[target] = 0; emit setEdgeVisibility ( m_name, target, false ); } else { qDebug() << "Vertex::filterEdgesByWeight(). Edge to " << target << " has weight " << m_weight << ". It will be enabled. Emitting signal to Graph...."; m_enabled_outEdges[target] = 1; emit setEdgeVisibility ( m_name, target, true ); } } } } //Returns the numbers of links from this vertice long int Vertex::outDegree() { //return m_outLinks; return m_outEdges.size(); //FIXME: What if the user has filtered out links? } //Returns the numbers of links to this vertice long int Vertex::inDegree() { return m_inLinks; //FIXME: What if the user has filtered out links? } /** localDegree is the outDegree + inDegree minus the edges counted twice. */ long int Vertex::localDegree(){ imap_f::iterator it1; long int v2=0; long int m_localDegree = (outDegree() + inDegree() ); for( it1 = m_outEdges.begin(); it1 != m_outEdges.end(); it1++ ) { v2=it1->first; if (this->isLinkedFrom (v2) ) m_localDegree--; } qDebug() << "Vertex:: localDegree() for " << this->name() << "is " << m_localDegree; return m_localDegree; } //Checks if this vertex is outlinked to v2 and returns the weight of the link float Vertex::isLinkedTo(long int v2){ imap_f::iterator weight=m_outEdges.find(v2); if (weight != m_outEdges.end()) { if ( m_enabled_outEdges[ (*weight).first ] == 1) { qDebug()<< "Vertex::isLinkedTo() - a (" << this->name() << ", " << v2 << ") = "<<(*weight).second; return (*weight).second; } else { qDebug()<< "Vertex::isLinkedTo() - a (" << this->name() << ", " << v2 << ") = "<<(*weight).second << " but not in enabled_outEdges"; return 0; } } qDebug()<< "Vertex::isLinkedTo() - a (" << this->name() << ", " << v2 << ") = 0 "; return 0; } float Vertex::isLinkedFrom(long int v2){ imap_f::iterator weight=m_inEdges.find(v2); if (weight != m_inEdges.end()) { // qDebug()<< "link to " << v2 << " weight "<<(*weight).second; return (*weight).second; } else return 0; } long int Vertex::name() { return m_name; } void Vertex::setName (long int v1) { m_name=v1; } void Vertex::setEnabled (bool flag ){ m_enabled=flag; } bool Vertex::isEnabled (){ return m_enabled; } void Vertex::setSize(int size) { m_size=size; } int Vertex::size(){ return m_size; } void Vertex::setShape(QString shape){ m_shape=shape; } QString Vertex::shape(){ return m_shape; } void Vertex::setColor(QString color){ m_color=color; } QString Vertex::color(){ return m_color; } void Vertex::setNumberColor (QString color) { m_numberColor = color; } QString Vertex::numberColor(){ return m_numberColor; } void Vertex::setNumberSize (int size){ m_numberSize=size; } int Vertex::numberSize(){ return m_numberSize; } void Vertex::setLabel(QString label){ m_label=label; } QString Vertex::label(){ return m_label; } void Vertex::setLabelColor(QString labelColor){ m_labelColor=labelColor; } QString Vertex::labelColor(){ return m_labelColor; } void Vertex::setLabelSize(int newSize){ m_labelSize=newSize; } int Vertex::labelSize(){ return m_labelSize; } void Vertex::setX(float x){ // qDebug("Vertex setX with %f",x); m_x=x; } float Vertex::x(){ return m_x; } void Vertex::setY(float y){ // qDebug("Vertex setY with %f", y); m_y=y; } float Vertex::y(){ return m_y; } QPointF Vertex::pos () { return QPointF ( x(), y() ); } void Vertex::setOutLinkColor(long int target, QString color){ qDebug()<<"Vertex: update linkColor to vertex "<< target<< " color: "<< color; outLinkColors[target]=color; } //FIXME: See MW line 1965 QString Vertex::outLinkColor(int target){ if (outLinkColors.contains(target)) return outLinkColors.value(target); else return "black"; } void Vertex::clearPs() { myPs.clear(); } void Vertex::appendToPs(long int vertex ) { qDebug() << "adding " << vertex << " to myPs"; myPs.append(vertex); } ilist Vertex::Ps(void) { return myPs; } Vertex::~Vertex() { m_outEdges.clear(); } socnetv-0.90/src/backgrcircle.cpp0000755000175000017500000000550011444336706017276 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 with KDevelop backgrcircle.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #include "backgrcircle.h" #include "graphicswidget.h" BackgrCircle::BackgrCircle ( GraphicsWidget *gw, int x0, int y0, int radius ) : graphicsWidget ( gw ){ graphicsWidget->scene()->addItem ( this ); m_x0=x0; m_y0=y0; m_radius=radius; setZValue ( 250 ); circle=true; } BackgrCircle::BackgrCircle ( GraphicsWidget *gw, int y0, int w) : graphicsWidget ( gw ){ graphicsWidget->scene()->addItem ( this ); m_y0=y0; width= w; setZValue ( 250 ); circle=false; } /** Returns the bounding rectangle of the background circle*/ QRectF BackgrCircle::boundingRect() const { if (circle) { return QRectF ( -m_x0 - m_radius-5, -m_y0 - m_radius-5, m_x0 + m_radius + 5, m_y0 + m_radius +5 ); } else { return QRectF ( 1, m_y0 -5, width, m_y0 + 5 ); } } void BackgrCircle::paint ( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget * ){ Q_UNUSED(option); painter->setPen ( QPen ( QColor ( "red" ), 1, Qt::DotLine ) ); if (circle) { painter->drawArc ( m_x0-m_radius, m_y0-m_radius, 2*m_radius, 2*m_radius, 0, 5760 ); } else { painter->drawLine ( 10 , m_y0, width-10 , m_y0); } } void BackgrCircle::die (){ this->prepareGeometryChange(); this->hide(); this->update(); graphicsWidget->scene()->removeItem(this); this->update(); } socnetv-0.90/src/node.h0000755000175000017500000001015711444336706015261 0ustar dimitrisdimitris/*************************************************************************** SocNetV: Social Networks Visualizer version: 0.90 Written in Qt 4.4 node.h - description ------------------- copyright : (C) 2005-2010 by Dimitris B. Kalamaras email : dimitris.kalamaras@gmail.com ***************************************************************************/ /******************************************************************************* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ********************************************************************************/ #ifndef NODE_H #define NODE_H using namespace std; #include #include #include class GraphicsWidget; class QGraphicsSceneMouseEvent; class Edge; class NodeLabel; class NodeNumber; static const int TypeNode = QGraphicsItem::UserType+1; /** * This is actually a container-class. * Contains the graphical objects called Nodes, * which are displayed as triangles, boxes, circles, etc, on the canvas. * Each node "knows" the others with which she is connected. */ // class Node : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES (QGraphicsItem) public: Node(GraphicsWidget*, int num, int size, QString col, QString shape, bool, int, int, QPointF p) ; // ~Node(); enum { Type = UserType + 1 }; int type() const { return Type; } void calculateForcesSpringEmbedder(bool dynamicMovement); void calculateForcesFruchterman(bool dynamicMovement); QRectF boundingRect() const; QPainterPath shape() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void die(); long int nodeNumber() {return m_num;} void setSize(int); int size(); void setShape (QString); QString nodeShape() {return m_shape;} void setColor(QString str); void setColor(QColor color); QString color (); void setLabelText ( QString label) ; // Used by MW:: slotChangeNodeLabel() QString labelText () ; // Used by GW:: hasNode() NodeLabel* label(); void addLabel (NodeLabel* gfxLabel ) ; void deleteLabel(); void clearLabel(); void addInLink( Edge *edge ) ; void deleteInLink(Edge*); void addOutLink( Edge *edge ) ; void deleteOutLink(Edge*); void setNumberInside(bool); void addNumber (NodeNumber *gfxNum ) ; void deleteNumber(); void toggleAntialiasing(bool); protected: QVariant itemChange(GraphicsItemChange change, const QVariant &value); void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); signals: void nodeClicked(Node*); void startNodeMovement(int); void openNodeContextMenu(); void startEdge(Node *); void adjustOutEdge(); void adjustInEdge(); void removeOutEdge(); void removeInEdge(); private: GraphicsWidget *graphicsWidget; QPainterPath *m_path; QPointF newPos; QPolygon *m_poly_t, *m_poly_d; int m_size, m_nd, m_ld; long int m_num; QString m_shape, m_col_str, m_labelIn; QColor m_col; bool m_hasNumber, m_hasLabel, m_isNumberInside; /**Lists of elements attached to this node */ list inEdgeList, outEdgeList; list gfxNumberList; NodeLabel *m_label; NodeNumber *m_number; }; #endif socnetv-0.90/config.h.in0000644000175000017500000000171311261401575015404 0ustar dimitrisdimitris/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if debugging is enabled. */ #undef CONFIG_DEBUG /* Define if IEEE 32bit float optimizations are enabled. */ #undef CONFIG_FLOAT32 /* Default installation prefix. */ #undef CONFIG_PREFIX /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `X11' library (-lX11). */ #undef HAVE_LIBX11 /* Define to 1 if you have the `Xext' library (-lXext). */ #undef HAVE_LIBXEXT /* Define to 1 if you have the `system' function. */ #undef HAVE_SYSTEM /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION socnetv-0.90/socnetv.pro.in0000644000175000017500000000304511455000077016166 0ustar dimitrisdimitrisTEMPLATE = app CONFIG += qt thread warn_on @ac_debug@ LANGUAGE = C++ # support QT += webkit QT += xml QT += network INCLUDEPATH += ./src FORMS += src/forms/filteredgesbyweightdialog.ui \ src/forms/webcrawlerdialog.ui \ src/forms/datasetselectdialog.ui HEADERS += src/backgrcircle.h \ src/graphicswidget.h \ src/edge.h \ src/edgeweight.h \ src/graph.h \ src/htmlviewer.h \ src/mainwindow.h \ src/matrix.h \ src/node.h \ src/nodelabel.h \ src/nodenumber.h \ src/texteditor.h \ src/vertex.h \ src/parser.h \ src/filteredgesbyweightdialog.h \ src/webcrawlerdialog.h \ src/webcrawler.h \ src/datasetselectdialog.h SOURCES += src/backgrcircle.cpp \ src/graphicswidget.cpp \ src/edge.cpp \ src/edgeweight.cpp \ src/graph.cpp \ src/htmlviewer.cpp \ src/main.cpp \ src/mainwindow.cpp \ src/matrix.cpp \ src/node.cpp \ src/nodelabel.cpp \ src/nodenumber.cpp \ src/texteditor.cpp \ src/vertex.cpp \ src/parser.cpp \ src/filteredgesbyweightdialog.cpp \ src/webcrawlerdialog.cpp \ src/webcrawler.cpp \ src/datasetselectdialog.cpp # Extra optimization flags QMAKE_CXXFLAGS += @ac_cflags@ #LIBS += @ac_libs@ INCPATH += @ac_incpath@ RESOURCES = src/src.qrc win32 { RC_FILE = src/icon.rc } TRANSLATIONS = translations/socnetv_es.ts socnetv-0.90/manual/0000755000175000017500000000000011455100156014630 5ustar dimitrisdimitrissocnetv-0.90/manual/analysis.html0000755000175000017500000002327111444336706017363 0ustar dimitrisdimitris

Analysis

Once a network is loaded or created, you may use the various options in the Statistics menu to analyse it.

For instance, the first option of Statistics menu (Network Symmetry) tells you whether the network is symmetric or not. A network is symmetric when for every edge (i,j) in the set E, the 'opposite' (j,i) edge also exists in E.

Distances & Diameter

The next few options in the Statistics menu (Graph Distance, Average Graph Distance, Distance Matrix and Diameter) let you calculate the geodesic distance between any two nodes and the mean distance between all nodes, print the network distance matrix and calculate the network diameter, respectively. Each option is explained below.

Distance

The geodesic distance is the length of the shortest path between two connected nodes. By clicking on the "Geodesic Distance" option (or Ctrl+G) you will be asked for source and target nodes, and then their geodesic will be calculated and displayed.

Distance Matrix

The 'Distance Matrix' option calculates and displays two matrices; the first is the matrix of distances and the second (sigma) the matrix of the number of shortest paths between any two nodes. The latter is used in Centralities calculation (see below).

Graph Diameter

The diameter of a network is the maximum length of all shortest paths between any two connected nodes.

Clustering Coefficient

The Clustering Coefficient of a node quantifies how close the node and its neighbors are to being a clique. This is used to determine whether a network is a small-world or not.
This option calculates and displays the clustering coefficients of all nodes.

Tip: All the basic network statistics, such as nodes, edges and density are constantly displayed in the Statistics tab of the left dock.

Triad Census

When you click on the "Triad Census" menu option, SocNetV examines each of the triads present in your network, and counts how many of these belong to a certain triad type.
Some background:

In any network of N actors, there are C(N,3) triads.
For instance, in a network of 6 actors there are C(4,3)=20 triads, whereas in a network of 10 actors there are C(10,3)=60 triads.

In a any case, though, there can be only sixteen different triad types (isomophism classes).
Every one of the C(N,3) triads of a network must belong (be isomorphic) to one of these sixteen types.

A Triad Census is a method which counts all the different types (classes) of observed triads within a network.
The triad types are coded and labeled according to their number of mutual, asymmetric and non-existent (null) dyads.

We follow the M-A-N labeling scheme, as described by Holland, Leinhardt and Davis in their studies.
In the M-A-N scheme, each triad type has a label with four characters:

- The first character is the number of mutual (M) duads in the triad. Possible values: 0, 1, 2, 3.
- The second character is the number of asymmetric (A) duads in the triad. Possible values: 0, 1, 2, 3.
- The third character is the number of null (N) duads in the triad. Possible values: 0, 1, 2, 3.
- The fourth character is infered from features or the nature of the triad, i.e. presence of cycle or transitivity. Possible values: none, D ("Down"), U ("Up"), C ("Cyclic"), T ("Transitive")

In the seven rows below, you can see all the sixteen triad types (classes).
Within each row, all the triad types have the same number of arcs present:
003
012
102 021D 021U 021C
111D 111U 030T 030C
201 120D 120U 120C
210
300


So, when you click on Triad Census menu option, SocNetV calculates and displays a vector T of length 16.
Each vector element (Tu) is the frequency of each one triad type inside the active network, i.e. T003 = 3.
Furthermore, the order of the elements of vector T is the same as the aforementioned ordering of the triad types:

T = [ T003, T012, T102, T021D, T021U, T021C, T111D, T111U, T030T, T030C, T201, T120D, T120U, T120C, T210, T300 ]

Apparently, the sum of all these frequencies Tu is C(N,3).

Centralities

The last option in the Statistics menu opens the Centralities sub-menu.

Social network analysts use various metrics (measures or indeces) to calculate how 'central' or important each actor (node) is inside a network (graph). For instance, we might want to know how important is a person inside her friendship network or how critical is a power station inside the power company grid... There are various metrics, calculating different things, but they are usually refered to as 'centralities' collectively. For instance, SocNetV can calculate betweeness, closeness, degree, stress, graph and eccentricity centralities.

Centralities are calculated for each node and for the whole network. Thus, when you click on a centrality option, SocNetV will calculate the corresponding index of every node and the whole network and it will display them in a new window (a small text editor). From there you can save the analysis into a text file of your choice. By default, analysis files are saved on bin/ subfolder.

In-Degree Centrality

In-Degree Centrality (IDC) is the number of arcs ending at each node. The degree is a measure of the 'activity' of the node. Most in-degree central node might be considered more prominent among others.

Out-Degree Centrality

Out-Degree Centrality (ODC) is the number of arcs starting from each node. This is oftenly a measure of activity.

Closeness Centrality

Closeness Centrality (CC) is the invert sum of the shortest distances between each node and every other node. It is interpreted as the ability to access information through the "grapevine" of network members.

Betweeness Centrality

The Betweeness Centrality (BC) is the ratio of all geodesics between pairs of nodes which run through each node. It reflects how often an node lies on the geodesics between the other nodes of the network.

Stress Centrality

The Stress Centrality (SC) of a node k is the total number of geodesics between all other nodes which run through k. When one node falls on all other geodesics between all the remaining (N-1) nodes, then we have a star graph with maximum Graph Centrality.

Graph Centrality

Graph Centrality (GC) is the invert of the maximum of all geodesic distances from a node to all other nodes in the network. Nodes with high GC have short distances to all other nodes in the graph. In not-connected networks, the centrality values of all nodes will be zero, since the distance to some nodes is infinite.

Eccentricity Centrality

The Eccentricity Centrality (EC) of a node k is the largest geodesic distance (k,t) from every other vertex. Therefore, EC(u) reflects how far, at most, is each node from every other node.

Power Centrality

The Power Centrality (PC) is a centrality measure suggested by Gil and Schmidt. For each node k, the index sums its degree (with weight 1), with the size of the 2nd-order neighbourhood (with weight 2), and in general, with the size of the kth order neighbourhood (with weight k).

Thus, for each node in the network the most important other nodes are its immediate neighbours and then in decreasing importance the nodes of the 2nd-order neighbourhood, 3rd-order neighbourhood etc.

For each node, the sum obtained is normalised by the total numbers of nodes in the same component minus 1.

Information Centrality

The Information Centrality (IC) is an index suggested by Stephenson and Zelen (1989). It tries to measure the information which is contained in all paths starting with each actor.

In order to calculate the IC of each actor, we create a N x N matrix A with:

Aii=1+weighted_degree_ni
Aij=1 if (i,j)=0
Aij=1-wij if (i,j)=wij

Next, we compute the inverse matrix of A, for instance C. Note that we can always compute C since the matrix A is always a diagonally strong matrix, hence it is always invertible.

Finally, IC is computed by the formula:

IC(i) - 1 / [ Cii + (T-2R)/ N]

where:
T is the trace of matrix C (the sum of diagonal elements) and R is the sum of the elements of any row (since all rows of C have the same sum)

IC has a minimum value but not a maximum.

socnetv-0.90/manual/socnetv-logo-manual.png0000644000175000017500000003736111261401575021246 0ustar dimitrisdimitrisPNG  IHDR=AbSsRGBbKGD pHYs  tIME < tEXtCommentCreated with GIMPW IDATh5>DA7z f(kA7g)7րmgTMS/( y!|5N2^W  5#& ZjW=06(B FA9H79'` DpJ#%B_ X($h8+? ҂7 K-A  iD6PR: 4f  j!V ?:1>eOJ %R2 Ha+ T'%  -"7 .V"*#t )  @)2/4%"{Zd ( !f SyM6{ >*v 1 #U,E "2+F(pg' L NcAm:I_ ]$ V'^0\ W#iG$>[    RR 0_ i> 8uY 'G5 w 5  (#pF;  8'6RBDM(= J]*V'*^  '`/; bH @!Ch2Q5(1J%> G+0Ee Qa@ ,{ZK-n# Xz5R2M=F)MS #E4Yin-u;"-FlQN e;lR ^j:=H573>$ ' $.   & rM\r<6]+<)h# &'P3: 4 Q 8 4U 'c(! #  &  /#% L۞&<  *7#@IDAT R ;0+ }$s#! > ,3Vz7I-3}dH*eA_OIn9mWP'j/kV6#dg |jGJJT/a Ph 0  k Xs/8D( 75 k~HA4d  g$9\H,0"|3 lsDfH1PL9N @C [&L1$& h)?>0 h7&9 ;j B!V[| q#&nZmO#2,@H T (0O0'vPWOQ31* 0E K -y 80,s>860=x f E> y6%T N$M V/BLr@0$D#[ ) V \9  ) $'TO_8)7#1@D #+ 43+ ʾ  PBWp *JI&l'o>;< E  MzDF55ֶ S0I nr  _& \*E6%89&G5YS/^P1`bQ YJ<"bY/ M1N/J3H ^"a] Nq)P\.9:a"JoK3b0   ܬU`*e ݲ 9;7:;O$C$f(k`+aUZ.PD7~FS^IENDB`socnetv-0.90/manual/visualisation.html0000755000175000017500000000373611261401575020430 0ustar dimitrisdimitris

Layout algorithms

SocNetV implements special algorithms to layout the network so that each node has a position that reflects her centrality status, index or rank.

You can apply these algorithms from the menu "Layout" or by clicking on the checkboxes on the left dock. Not all layouts methods appear on the dock though.

A variety of layout methods are supported. Most of them are based on centralities, while others follow energy models (such as spring-embedder). The former reposition all nodes in circles or levels, so that more central nodes appear near the centre or the top of the canvas, respectively.

Radial Layout

Radial layout means that nodes will be repositioned onto the circumferences of concentric circles of different radiuses. Circles of smaller radius hold nodes of greater centrality. Thus, more central nodes will be positioned closer to the centre of the canvas. Please note that this kind of layout does not take care of crossing links. It is only meaningful as a visual representation of the status of each node.

Level Layout

In level layout methods the nodes are repositioned into levels of different height. More central nodes appear at the top of the screen.

Energy based

Spring Embedder
In this model, nodes are regarded as physical bodies (i.e. electrons) which exert repelling forces to each other, while edges are springs connecting adjacents nodes. Non-adjacent nodes repel each other while connected nodes are The algorithm continues until the system retains an equilibrium state in which all forces cancel each other.

Fruchterman-Reingold

socnetv-0.90/manual/toc.html0000755000175000017500000000464311434417714016325 0ustar dimitrisdimitris

Table of Contents

socnetv-0.90/manual/header.html0000755000175000017500000000125111261401575016754 0ustar dimitrisdimitris

The SocNetV Manual

socnetv-0.90/manual/bugs.html0000755000175000017500000000156711261401575016476 0ustar dimitrisdimitris

Known Bugs

Technically, our only limit is our code quality :) But we keep improve it. In any case, if you have any questions, just ask or submit a bug report (see below)

Antialiasing is on by default. To boost the speed of node movement, you can disable it by pressing F8.

Report a bug

In order to send a meaningful bug report, run socnetv from a terminal, press F9 and repeat the steps which lead to bug manifestation. SocNetV will be printing debug messages on the standard output -- the terminal in Linux.

Then post the bug report in our bug tracker: https://bugs.launchpad.net/socnetv

socnetv-0.90/manual/gui.html0000755000175000017500000002362211434417714016322 0ustar dimitrisdimitris

Interface overview

SocNetV has a simple Graphical User Interface (GUI) which is composed of:

  • a menu bar
  • a toolbar
  • a dock
  • a "canvas"
  • a status bar.

At the top, you' ll find the menu bar, filled with commands and options, organized in 6 menus:

  • Network menu has options to load and save a network, export it, create random nets etc.
  • Edit menu with action to add/remove nodes and edges, change colors, filter links/nodes, etc.
  • Layout menu enables you to select a layout method, i.e. reposition all nodes according to their centrality.
  • Statistics menu gives you tools to analyse the active network (density, diameter, centralities, distance matrix, etc).
  • Options menu allows you to show/hide edges, edge arrows, turn on/off antialiasing, etc.

Below the menu, the toolbar provides the usual icons: new network creation, load a network, save, zoom in-out and display help messages for the menu options.

The middle part of the window is occupied by the dock (left-side) and a virtual "canvas" (right-side) where network nodes and edges appear.

The dock, on the left of the window, has 4 buttons (add/remove node, add/remove link), some LCDs and some checkboxes. The LCDs display statistics for the active network (i.e. node and edges counters, density, counters of inLinked/outLinked nodes, etc) as well as the selected node (its number, in-Links and out-Links). Below the LCDs, there are some checkboxes to activate dynamic layout methods (i.e. Force directed) and/or change the way node sizes are calculated.

The canvas is the main area of interaction. The initial background color is set to "gainboro", but you can changed it from the Edit menu. Below, we describe how to work with SocNetV.

Network creation

To start working with SocNetV you need network data, i.e. a graph of nodes (vertices) and links (edges). SocNetV enables you to create such networks or load them from files. There are multiple ways to create or edit nodes and links in SocNetV:

  • from the menus
  • from the dock buttons, or
  • by right/left/middle-clicking on the canvas.

Creating a new node

To create a new node, you can double-click on the canvas or click on the "Add node" button. The keyboard shortcut is Ctrl+A.

You can move a node by left-clicking on it and moving the mouse.

Creating a new link

To create a new link, middle-click on the source node and then middle-click again on the target node. By default, all links created this way are weighted 1. If your mouse doesn't have middle button (did you try pressing the mouse wheel?), or you find it difficult, you can right-click on the source node, then select "Create Link". In the dialog, just enter the target node number and the desired link weight. Alternatively, you can click on the "Add link" button from the dock. In that case, you will be asked for both the source and the target node numbers (and the link weight). The keyboard shortcut for this action is Ctrl+L.

Link Creation Example: Say you created two nodes, numbered 1 and 2, on the canvas. To create a new link from node 1 to node 2, middle click on node 1 (the mouse pointer will become a hand) and afterwards middle-click on node 2. A new link will be drawn instantly. If you want an edge (double link) repeat the process from node 2 to node 1.

Remember, each link you create this way has the default weight 1 and black colour.

Interaction and Group Selection

As mentioned earlier, you move any node by left-clicking and dragging it.

If you want to select more than one node, press and hold down the left mouse button on the canvas. By moving your mouse, a rectangle will be drawed. All nodes inside this rectangle will be selected the moment you release the mouse button.

Warning: in networks with thousands of edges, the group selection process is dramatically slow...

Node Menu and Node Shapes

When you right-click on a node, a context menu appears. From there you can remove the node, change its color, label, size as well as its shape. A similar menu appears when you right click on a link.

SocNetV supports many kinds of node shapes, i.e rectangles, diamond, ellipse, circle, etc. To change the shape of a node, right-click on it and in the context menu select Options > Change shape to...

Loading a network

The easiest way to start working with SocNetV is when you have already a network in a supported format (see Formats).

For instance, you might have another program (for example a simulation) creating adjacency networks which you want to visualise. In that case, from the SocNetV's menu go File > Load. In the dialogue that will appear, navigate to the desired folder and select the appropriate network file. SocNetV will automatically recognise the format and, if it is supported, it will visualise the network.

Saving the active network

To save the active network, just press Ctrl+S or click on the menu entry File > Save. By default, it will be saved in GraphML format.

If you like, you can export it to another supported format (menu Network > Export To). Note that some formats are supported only for loading - not for saving.

View the adjacency matrix

The adjacency matrix of a network is a matrix where each element a(i,j) is equal to the weight of the link from node i to node j. If the nodes are not connected, then a(i,j)=0.

To view the adjacency matrix of a network, press F6.

By default, SocNetV displays the adjacency matrix as integer-valued only (although we do allow float weights).

Random network creation

SocNetV can create a random network for you. At the moment, it can create the following types of random networks:

  • Small Worlds: According to the Watts and Strogatz model, a 'small world' is a random network with short average path lengths and high clustering. From the menu Network select Create Random Network > Small World (or press Shift+W). You will be asked for the number of nodes, their initial degree and a rewiring probability.
  • Erdos-Renyi networks: According to G(n, p) model (Erdos-Renyi), a random network is created by connecting nodes randomly. Each edge is included in the graph with equal probability p, independently of the other edges From the menu Network select Create Random Network > Erdos-Reny (or press Shift+R). You will be asked for the number of nodes and a link probability.
  • Ring lattices: Ring lattices (or physicist's lattices) are 'random' networks where all nodes are positioned in a ring and each one has the same even degree (number of links) L with her "neighbourhood", namely she is linked with the L/2 nodes before and L/2 nodes after her. For instance in a lattice of 4-lattice of 10 nodes, node 6 will be linked with 4,5,7,8. To create such a network do Network > Create Random Network > Lattice (or press Shift+L). You will be asked for the number of nodes and the number of links each node will have.
  • Same degree networks: these are random networks where each node has the same degree but is arbitrarily linked with other nodes (not just the neighbours).

Web Crawler

SocNetV offers a built-in web crawler, allowing you to automatically create networks from all links found in a given website.

A Web Crawler is a software bot (an algorithm), which starts with a given URL (website or webpage) to visit.

As the algorithm crawls that webpage, it identifies all the links in the page and adds them to a list of URLs (called frontier). Then, all the URLs from the frontier are recursively visited.

To start the web crawler, go to menu Network > Web Crawler or press Shift+C. A dialog will appear, where you must enter initial web address (seed), the maximum recursion level (how many URLs from the frontier will be visited) and the maximum running time...

Printing and Exporting

To print the network directly to your printer, press Ctrl+P.

Keep in mind, that SocNetV follows the "what you see is what you print" principle:
we print what is viewable in the canvas, i.e. if you zoom-in to a network, the application will only print that specific network portion. So, you might need to zoom-out enough so that the whole network is viewable and therefore printable.

Except printing, you can export your work into raster (BMP and PNG) images, as well as PDF documents. The latter are vector-based, and therefore offer the best quality. Again, keep in mind the rule "what you see is what you print".

socnetv-0.90/manual/socnetv.css0000755000175000017500000000476211261401575017043 0ustar dimitrisdimitris body { background: white none; color: black; font-family: sans-serif; padding: 0 15px 0 5px; margin: 0; } p, h1, h2, h3, h4, h5, h6, td, th { font-family: sans-serif; } h1, h2, h3, h4, h5, h6 { color: #377aeb; background-color: transparent; vertical-align: bottom; } h1 { font-size: 18px; } h2 { font-size: 16px; } h3 { font-size: 14px; } h4 { padding: 0px 0px 0px 0px; margin: 20px 0px 5px 0px; font-size: 14px; } h5 { padding: 0px 0px 0px 0px; margin: 20px 0px 5px 5px; font-size: 11px; } p { text-align: justify; } .text { color: #1e3a47; font-size: 11px; padding: 0 0px 0 5px; } .author { color: rgb(82,80,82); font-size: 11px; font-weight: bold; padding: 0; margin: 0; } .credits { line-height: 1em; color: #1e3a47; font-size: 11px; } .legalnotice, .copyright { padding: 0; margin: 0; } a { color: #2d2b8b; text-decoration: none; border-bottom: thin dotted black; margin:0; padding:0; } a:hover { background-color: #f6ffd5 ; // #aaaa00; color: #2d2bff; } a:visited { color: #8587f7; } .toc { font-size: 11px; } .toc ul { color: rgb(160,80,82); } .toc ol { color: #8598f7; color: rgb(160,80,82); } .toc a { color: #8598f7; border-bottom: none; } .header { /* background: #f6ffd5 none; */ background: #e0f2fe none; border-top: 1px solid #CFD1D5; border-bottom: 1px solid #CFD1D5; margin: 0px; padding: 0px 0px 0px 0px; } .title { vertical-align: bottom; color: #377aeb; padding: 0px 0px 0px 0px; font-size: 20px; font-family: serif; font-weight: bold; } .logo { background: transparent; margin: 0px; padding: 0px 15px 0px 15px; float: left; } .footer{ /* background: #f6ffd5 none; */ background: #e0f2fe none; border-top: 1px solid #CFD1D5; border-bottom: 1px solid #CFD1D5; font-size: 10px; margin: 0px; padding: 0px 0em 0px 0px; text-align: left; } .footer a { border-top: 0px solid #CFD1D5; text-decoration: none; border-bottom: none; } .footer a:visited { border-top: 0px solid #CFD1D5; text-decoration: none; border-bottom: none; } .contents{ font-size: small; text-align: center; vertical-align: middle; } .license { font-family: monospace; color: rgb(0,0,0); font-size: small; padding: 5px 1em 0px 0px; } .code { color: black; font: normal 10px monospace; background-color: #eceae9; border: 1px dashed lightgray; text-align: left; margin-bottom:10px; margin-top:0px; padding: 0 15px 0 25px; } socnetv-0.90/manual/intro.html0000755000175000017500000002561211261401575016666 0ustar dimitrisdimitris

What is Social Network Analysis?

A Social Network is the social structure which facilitates communication between a group of actors (individuals or organizations) that are related somehow (i.e. by common interests, shared values, financial exchanges, friendship, dislike, etc). For instance, your friends and you form a social network. But, social networks operate on many more levels, from family relations and disease spreading up to the level of company strategies, social movements or even nations. Furthermore, research in many scientific areas has shown that social networks are important when we study the way problems are solved, diseases are spreaded, organizations are run, and the degree to which individuals succeed in achieving their goals.

Social Network Analysis (SNA) is a beautiful blend of Sociology and Mathematics, composed of various interdisciplinary techniques for the study of such social networks. SNA researchers conceptualize social relationships in terms of nodes and edges (links) in mathematical graphs. Nodes represent the individual actors within the networks, while edges visualise the relationships between those actors. The result is graph-based structures which are often very complex.

What is SocNetV?

Social Networks Visualizer (SocNetV) is our project to build a flexible and user-friendly, cross-platform tool for the analysis and visualisation of social networks, targeting primarily the researcher. SocNetV lets you construct social networks with a few clicks on a virtual canvas or load networks of various formats (GraphML, GraphViz, Adjacency (Sociomatrix), Pajek, UCINET, etc) and modify them to suit your needs.

The application can compute all the basic network properties, such as graph diameter, and distances (shortest path lengths), as well as more advanced structural statistics, such as node and network centralities (i.e. Closeness , Betweeness, Graph, etc), clustering coefficient, etc.

Various layout algorithms (i.e. Energy-based, in circles and in levels according to various centrality indeces) are supported for meaningful visualisations of your networks. Furthermore, random networks (Erdos-Renyi, Watts-Strogatz, ring lattice, etc) can be created with a few clicks.

SocNetV is a work in progress and is being developed in C++ and Qt, an open-source GUI development toolkit from Nokia. Our primary target platform is Linux, but you can compile and run SocNetV on OS X and Windows as well, as long as you have Qt4 libraries installed.

Installation

The latest version of SocNetV can be found at http://socnetv.sourceforge.net. It is distributed both in source code and binary packages for Linux distributions, and executables for Windows. Mac OS X users may install SocNetV using the Fink project. See instructions below.

Source Code Compilation

In any Linux distribution, to compile SocNetV from source code, you need the Qt4 development libraries installed - most Linux distros offer Qt4 via their package manager (i.e. Synaptic in Ubuntu). You also need QtWebKit development files. For instance, in openSUSE 11+ and Debian-based distros, install libQtWebKit-devel and libqt4-webkit, respectively. If you have Qt4 and QtWebKit installed, download the archive with the source code from the Downloads menu, untar it, enter the new directory, and compile with the following commands:

tar zxfv SocNetV-0.XX.tar.gz
cd socnetv
./configure
make
sudo make install

In Windows, to compile SocNetV, you need to have installed Qt4 development files, and a compiler, like MinGW. If you wish you can avoid compilation, by using the Windows XP executables we offer (see below).

To avoid compiling in Linux, we also offer binary packages for Ubuntu, Debian, Fedora, Mandriva and openSUSE available from the project's website. Debian users may prefer the SocNetV version in the debian unstable repository.

Debian packages

For Debian & Debian-derived distros, a (not always updated) version of SocNetV is in the 'unstable' repository (thanks to Serafeim Zanikolas). Add the line:

deb http://ftp.debian.org/debian/ unstable main

to your sources.list; save it, then type in:

sudo apt-get update
sudo apt-get install socnetv

Ubuntu packages

Ubuntu users may use our repository. All you have to do is add the following lines in your /etc/apt/sources.list file:

deb http://ppa.launchpad.net/dimitris-kalamaras/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/dimitris-kalamaras/ppa/ubuntu intrepid main

Then save it, exit the text editor, and type in:

sudo apt-get update
sudo apt-get install socnetv

This repository is signed with 61AE869C37A4FCC5A73FD02EE088941209CFE071 OpenPGP key. Until you add the PPA's key to your own system, you'll see warnings that you're downloading from an untrusted source. To add our PPA's key to your system, open a terminal and enter this command:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 61AE869C37A4FCC5A73FD02EE088941209CFE071

If you want more information about keys and repository signing in Ubuntu, read the official instructions.

openSUSE packages

For openSUSE and Novell SLED, you may download binary RPM packages from our our repository. When you download the RPM, become root user and install it, like this:

su rpm -ivh socnetv-0.80.1.i586.rpm

Fedora packages

Fedora and RedHat users may download binary RPM packages from our our repository. Afterwards, become root user and install the package, i.e.:

su rpm -ivh socnetv-0.80-1.i586.rpm

Mandriva packages

Mandriva users may download binary RPM packages from our our repository. To install the package, use commands like these:

su rpm -ivh socnetv-0.80-2.1.i586.rpm

Gentoo builders

Markos Chandras (hwoarang) added SocNetV into the 'qting-edge' overlay, which also houses new Qt4 and KDE4 software. To install the qting-edge overlay type in this command:

layman -a qting-edge

Windows executables

To run SocNetV version 0.70 and later in Windows XP/Vista, just download the latest SocNetV zip for Windows from the Downloads menu, unzip it, and double-click on the "socnetv" executable. The program will run immediately. For older SocNetV versions, you need to install Qt4 libraries for Windows. Warning: the Windows version is not properly tested. But feel free to notify us for any bugs you encounter!

Mac OS installation

If you are a Mac user, you can install and run SocNetV using the Fink project tools. Fink is like "bringing linux to Mac" - you install some base programs and files, and then you can install applications like SocNetV. Please note that, we do not own a Mac so everything that follows is just an outline of what you should do to run SocNetV in your Mac! Anyway, SocNetV is in the unstable section of Fink. Therefore, you will need to configure Fink to use the unstable. You'll find usefull instructions for this here: http://www.finkproject.org/faq/usage-fink.php#unstable After that, you only need commands like these (I think!):

sudo apt-get update
sudo apt-get install socnetv

Development version

If you want to test the latest/current development version of SocNetV, check it out using this command (you need the Subversion package):

svn co http://socnetv.svn.sourceforge.net/svnroot/socnetv/trunk

or download the latest tarball from the Sourceforge SVN repository. Then, type in the commands:

cd trunk
chmod +x configure
./configure
make
socnetv

Please note that this version is not always stable.

Execution Options

If you run SocNetV from the command prompt, there are three (at the moment) options:

--version | -V

Displays the version of the program.

--help | -H

Displays a short help message.

file.net

The name of the file you want to open.
socnetv-0.90/manual/manual.html0000755000175000017500000000160611261401575017005 0ustar dimitrisdimitris SocNetV Handbook socnetv-0.90/manual/formats.html0000755000175000017500000003007311444336706017211 0ustar dimitrisdimitris

Supported Formats

SocNetV supports many network formats:
  • GraphML (.graphml),
  • GraphViz (.dot),
  • Adjacency matrix (.net, .txt)
  • Pajek-like (.net),
  • UCINET's Data Language (.dl)
You can load these kinds of files by clicking on menu File > Load or by specifying them explicitly at the command line. SocNetV uses simple inspection routines to check the format of the given file. In most cases, it will load the file, no matter what the file extension is.

WARNING: The default file format of SocNetV is GraphML. If you create a new network and press Ctrl+S to save it, then by default SocNetV will save it in GraphML format.

GraphML files

Each GraphML document is written in a special form of XML and defines a graph. For instance the code below, contains 11 nodes and 12 edges:

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="undirected">
<node id="n0"/>
<node id="n1"/>
<node id="n2"/>
<node id="n3"/>
<node id="n4"/>
<node id="n5"/>
<node id="n6"/>
<node id="n7"/>
<node id="n8"/>
<node id="n9"/>
<node id="n10"/>
<edge source="n0" target="n2"/>
<edge source="n1" target="n2"/>
<edge source="n2" target="n3"/>
<edge source="n3" target="n5"/>
<edge source="n3" target="n4"/>
<edge source="n4" target="n6"/>
<edge source="n6" target="n5"/>
<edge source="n5" target="n7"/>
<edge source="n6" target="n8"/>
<edge source="n8" target="n7"/>
<edge source="n8" target="n9"/>
<edge source="n8" target="n10"/>
</graph>
</graphml>

All GraphML files consist of a graphml element and a variety of subelements: graph, node, edge, keys. SocNetV understands all of them.

Nodes are defined by the <node id="n1" /> where id is a unique node identification string. This id is used in edge declaration, below.
Edges are defined by the <edge source="n1" target="n1" /> where source and target are equal to existing node ids.

GraphViz files

This is the file format of the graphviz layout package. Unfortunately, I have not yet managed to implement the whole specifications of this nice format. The features that are recognized by SocNetV are displayed in the following example:

digraph mydot {
node [color=red, shape=box];
a -> b -> c ->d
node [color=pink, shape=circle];
d->e->a->f->j->k->l->o
[weight=1, color=black];
}

Nodes are defined by the "node" declaration. In this you can define the color and the shape of the nodes that will follow. Each link is denoted by an "->" for directed graphs (digraphs) and a "-" for undirected graphs (graphs) between nodes' labels. For instance, "a -> b" means a directed edge from a to b. Moreover, links can have weights and colours.

Adjacency Matrix files

The adjacency sociomatrix format is a very easy one.
It describes one-mode networks and contains a simple matrix NxN, where N is the amount of nodes. Each (i,j) element is a number.
If (i,j)=0 then nodes i and j are not connected.
If (i,j)=x where x a non-zero number then there will be an arc from node i to node j.
Again, negative weights are allowed. Those are depicted as dashed lines when the network is visualised on the canvas.

This is an example of an adjacency sociomatrix formatted network.

 
0000000011
0000101100
0001100000
0010000010
0110001000
0000001100
0100110001
0100010000
1001000000
1000001000 

Two-mode Sociomatrix files

Unlike one-mode networks which describe direct links between actors of the same type, networks can be two-mode as well. Two-mode networks describe either two sets of actors or a set of actors and a set of associated events.

In the first case, which usually is called dyadic two-mode network, there are two sets of actors. The sociomatrix codifies the relations between actors in the first set and actors in the second set.

In the second case, which usually is called affiliation network, there is a set of actors and a set of events or organizations. The sociomatrix measures the attendance or affiliations of the actors (first mode) with a particular event or organization (second mode).

Two-mode networks are described by affiliation network matrices, where A(i,j) codes the events/organizations each actor is affiliated.
A two-mode sociomatrix is a matrix NxM, where N is the amount of nodes and M is the amount of events. Each (i,j) element can be 0 or 1.

If A(i,j)=1 then actor i is affiliated with event j.

This is an example of an two-mode sociomatrix formatted network.

0 0 1 1 0 0 0 0 1 
0 0 1 0 1 0 1 0 0 
0 0 1 0 0 0 0 0 0 
0 1 1 0 0 0 0 0 0 
0 0 1 0 0 0 0 0 0
0 1 1 0 0 0 0 0 0
0 0 1 1 0 0 0 0 0
0 0 0 1 0 0 1 0 0
1 0 0 1 0 0 0 1 0
0 0 1 0 0 0 0 0 1
0 1 1 0 0 0 0 0 1
0 0 0 1 0 0 1 0 0
0 0 1 1 1 0 0 0 1

Pajek-like formatted files

Note the 'Pajek-like' part. This is because real Pajek files can be much more complicate than the ones recognised by SocNetV. To be more precise, here is an example of the Pajek-like form that SocNetV understands. The numbers to the left are just indicating line numbers.

 1) *Network 
 2) *Vertices 6
 3) 1 "pe0" ic LightGreen 0.5 0.5 box
 4) 2 "pe1" ic LightYellow 0.8473 0.4981 ellipse
 5) 3 "pe2" ic LightYellow 0.6112 0.8387 triangle
 6) 4 "pe3" ic LightYellow 0.201 0.7205 diamond
 7) 5 "pe4" ic LightYellow 0.2216 0.2977 ellipse
 8) 6 "pe5" ic LightYellow 0.612 0.1552 circle
 9) *Arcs 
 10) 1 2 1 c black
 11) 1 3 -1 c red
 12) 2 4 1 c black
 13) 3 5 1 c black
 14) *Edges 
 15) 6 4 1 c black 
 16) 5 6 1 c yellow

Let me analyse this a little bit:

The first line (*Network) declares that this is a Pajek network.

The second line (*Vertices 6) declares the number of vertices of the network and identifies that the following lines describe node properties.

Each one of the following 6 lines (3-8) construct one node. Each node's line has 7 columns-properties:
Column 1 denotes the node's number.
Column 2 denotes the node's label.
Column 3 indicates that the next column carries the colour of the node's shape.
Column 4 denotes the colour of the node's shape.
Column 5 denotes the proportional X coordinate of the specific node on the canvas.
Column 6 denotes the proportional Y coordinate of the specific node on the canvas.
Column 7 denotes the node's shape.

Line 9 (*Arcs) identifies that the following lines will describe arcs from an node to another. Each one of the lines 10-13 construct one arc. For instance, Line 10 constructs an arc from node 1 to node 2 with weight 1 and black colour.

Line 14 identifies that the following lines will describe edges (double arcs) between nodes. Each one of the lines construct one edge. For instance, Line 10 constructs an arc from node 1 to node 2 with weight 1 and black color.

Note that it is legal to have mixed columns in Pajek-like network file. For instance you can have an node's specification line like this:

4 "label" 0.201 0.7205 ic LightYellow diamond.

Also, it is not necessary to declare X and Y coordinates or colors and shapes. In that case SocNetV will use the defaults, that is red diamonds scattered randomly across the canvas. Nevertheless, the first two columns must be valid node numbers and labels.

Note also that weights might be negative as in line 11. Negative weights are depicted as dashed lines on the canvas.

Colour names are not arbitrarily created. Valid colour names for nodes and arcs/edges are those specified in the X11 file: /usr/X11R6/lib/X11/rgb.txt, i.e. red, gray, violet, navy, green, etc. You can change colours of all network elements from inside SocNetV.

SocNetV also supports Pajek files which declare edges/arcs in matrices, like this:

*Vertices     11
     1 "minister1"                              0.2912    0.2004 ellipse
     2 "pminister"                              0.4875    0.0153 diamond
     3 "minister2"                              0.3537    0.3416 ellipse
     3 "minister2"                              0.3537    0.3416 ellipse
     4 "minister3"                              0.4225    0.5477 ellipse
     5 "minister4"                              0.4538    0.1603 ellipse
     6 "minister5"                              0.4900    0.3836 ellipse
     7 "minister6"                              0.6212    0.5038 ellipse
     8 "minister7"                              0.6450    0.2023 ellipse
     9 "advisor1"                               0.6488    0.6031 box
    10 "advisor2"                               0.3212    0.5515 box
    11 "advisor3"                               0.7188    0.4218 box
*Matrix
 0 1 1 0 0 1 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0 0
 1 1 0 1 0 1 1 1 0 0 0
 0 0 0 0 0 0 1 1 0 0 0
 0 1 0 1 0 1 1 1 0 0 0
 0 1 0 1 1 0 1 1 0 0 0
 0 0 0 1 0 0 0 1 1 0 1
 0 1 0 1 0 0 1 0 0 0 1
 0 0 0 1 0 0 1 1 0 0 1
 1 0 1 1 1 0 0 0 0 0 0
 0 0 0 0 0 1 0 1 1 0 0

Here, the *Matrix tag replaces *Arcs or *Edges. An ordinary adjacency matrix follows describing all links.

Another possibility, is the *ArcsList tag. When SocNetV finds that tag in a Pajek file, it expects each node to declare list of its link to other nodes. Here is an example:

*Vertices 9
1
2
3
4
5
6
7
8
9
*Arcslist
2 1 3 9
1 3 4 5
3 1 4 7
4 1 2 3
5 1 3 4
7 2 8 9

For instance, the first line after *Arcslist means: "node 2 is connected to nodes 1, 3 and 9". It is very simple.

UCINET's DL files

UCINET's DL format is one of the easiest to understand. For the moment, we support only FULL MATRIX mode. Each file starts with the "DL" mark; then the amount N of nodes is declared and the format (i.e. if a diagonal is present or not). Then, after the "LABELS:" mark we read the labels of each node line by line. That is, if N was 100 then we expect to read 100 labels. In the end, a DL file declares network data ("DATA") which is only the edges. For instance the network below, contains 4 nodes and 7 arcs/edges:

DL
N=4
FORMAT = FULLMATRIX DIAGONAL PRESENT
LABELS:
On the normalization and visualization of author co-citation data:Salton's cosine versus the Jaccard index
Caveats for the use of citation indicators in research and journalevaluations
Should co-occurrence data be normalized? A rejoinder
Home on the range - What and where is the middle in science andtechnology studies?
DATA:
0 0 0.158114 0
0.201234 0 1 0
1 0 0 0
0.1 1 1 0
socnetv-0.90/manual/gfdl.html0000644000175000017500000005407611261401575016452 0ustar dimitrisdimitris

GNU Free Documentation License

Version 1.3, 3 November 2008

Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

The "publisher" means any person or entity that distributes copies of the Document to the public.

A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

  • A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
  • B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
  • C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
  • D. Preserve all the copyright notices of the Document.
  • E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
  • F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
  • G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
  • H. Include an unaltered copy of this License.
  • I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
  • J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
  • K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
  • L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
  • M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.
  • N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
  • O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements".

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License.

However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document.

11. RELICENSING

"Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site.

"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization.

"Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document.

An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008.

The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.

socnetv-0.90/manual/footer.html0000755000175000017500000000053111423751762017030 0ustar dimitrisdimitris socnetv-0.90/manual/credits.html0000755000175000017500000001006211444336706017167 0ustar dimitrisdimitris

License

Copyright © 2005-2010 by Dimitris V. Kalamaras.
Blog: http://dimitris.apeiro.gr

This documentation is licensed under the terms of the GNU Free Documentation License.

This program is licensed under the terms of the GNU General Public License as published by the Free Software Foundation http://www.gnu.org/licenses/gpl.html. You have the right to use and copy it, study, modify and then redistribute the revised source code as long as you keep the source code free for the others. For a complete list of your rights and obligations by using this program please read the GPL.

Credits

Many thanks to:

  • Serafeim Zanikolas (Debian packager)
  • Markos Chandras (Gentoo packager)
  • Tom Tryfonidis (Arch packager)
  • Daniel Pinto dos Santos, for the German translation
  • Andre Somers, for bug fixing and useful comments
  • Thomas Ingold, for betweeness bug reporting
  • Steven Orr, for bug reporting
  • Fred March, for bug reporting
  • Alejandro Garrido Mota (Debian packager)
  • Martin Hohenberg
  • Victor Cardoso
  • Paul Johnson
  • David de Ugarte, for an older Spanish translation

References

  • Brandes, Ulrik (2001). A Faster Algorithm for Betweeness Centrality. Journal of Mathematical Sociology 25(2), pp.163-177.
  • Brandes, Ulrik (2001). Drawing on Physical Analogies.In M. Kaufmann and D. Wagner (Eds.): Drawing Graphs: Methods and Models. LNCS Tutorial 2025, pp. 71-86.
  • Dasgupta S., Papadimitriou C.H. & Vazirani U.V. (2006). Algorithms.
  • Davis, J. A. & Leinhardt S. (1972). The Structure of Positive Relations in Small Groups.In J. Berger (Ed.), Sociological Theories in Progress , vol. 2. pp. 218-51. Boston, MA: Houghton Mifflin.
  • Holland, P.W. & Leinhardt. S. (1970). A Method for Detecting Structure in Sociometric Data. American Journal of Sociology 70: 492-513.
  • Holland, P.W. & S. Leinhardt. (1971). Transitivity in Structural Models of Small Groups. Comparative Group Studies 2:107-124.
  • Holland, P.W. & S. Leinhardt. (1975). Local Structure in Social Networks. Sociological Methodology<.em> 1976: 1-45.
  • Eades, P, (1984). A Heuristic for Graph Drawing. Congressus Numerantuum, 42:149-160.
  • Erdos, P. and Renyi, A. (1959). On Random Graphs. I. Publicationes Mathematicae 6: 290-297.
  • Erdos, P. and Renyi, A. (1960). The Evolution of Random Graphs. Magyar Tud. Akad. Mat. Kutat Int. Kol. 5: 17-61.
  • Watts, D.J., Strogatz, S.H. (1998). Collective dynamics of 'small-world' networks. Nature 393 (6684): 409–10.
  • Schank, T and Wagner. D (2005). Approximating Clustering Coefficient and Transitivity. J. Graph Algorithms Appl. 9(2): 265-275
  • Fruchterman, T.M.J. & Reingold, E.M. (1991). Graph Drawing by Force-Directed Placement. Software-Practice & Experience. Vol. 21, Is. 11, pp. 1129-1164.
  • Liu, C.L. (2000). Elements of Discrete Mathematics 2nd Edition. Greek Translation.
  • Press W., Teukolsky S., Vetterling W. & Flannery B. (1992). Numerical Recipes in C, the art of scientific computing.
  • Stroustrup B. (1997). The C++ Programming Language.
  • Scott, J. (2000). Social Network Analysis, A handbook.
  • Trolltech ASA (2009). QtAssistant. Version 4.4 Open Source Edition.
  • Wasserman S., Faust K. (2000). Social Network Analysis. Methods and Applications.
  • socnetv-0.90/translations/0000755000175000017500000000000011455100156016074 5ustar dimitrisdimitrissocnetv-0.90/translations/socnetv_de.ts0000644000175000017500000062321711261401572020611 0ustar dimitrisdimitris HTMLViewer &File Datei &Open Öffnen Ctrl+O Strg+O Opens another helpfile Öffnet andere Hilfequelle &Print Drucken Ctrl+P Strg+P Prints out the actual network Druckt das aktuelle Netzwerk E&xit Beenden Ctrl+X Strg+X Close Manual Schließe Handbuch &Back Zurück Ctrl+B Strg+B &Backward Rückwärts &Forward Vorwärts Ctrl+F Strg+F &Home Start Ctrl+H Strg+H &Go Los MainWindow Welcome to Social Networks Visualiser, Version Willkommen zu Social Networks Visualiser, Version &New Neu Ctrl+N Strg+N Creates a new network Erstellt neues Netzwerk New network (Ctrl+N) Neues Netzwerk (Strg+N) New Creates a new network Neu Erstellt neues Netzwerk &Open Öffnen Ctrl+O Strg+O Open network (Ctrl+O) Öffne Netzwerk (Strg+O) Opens a a file of an existing network Öffnet Datei mit existierendem Netzwerk Open Opens a file of an existing network Öffnen Öffnet Datei mit existierendem Netzwerk &Save Speichern Ctrl+S Strg+S Save network (Ctrl+S) Speichere Netzwerk (Srtg+S) Saves the actual network to the current file Speichert aktuelles Netzwerk aktueller Datei Save. Saves the actual network Speichern Speichert aktuelles Netzwerk Save &As... Speichern unter Ctrl+Shift+S Strg+Shift+S Saves the actual network under a new filename Speichere aktuelles Netzwerk unter neuer Datei Save As Saves the actual network under a new filename Speichern unter Speichert aktuelles Netzwerk unter neuer Datei &BMP... BMP Export network to a BMP image Exportiere Netzwerk als BMP Bild Export BMP Export network to a BMP image Export BMP Exportiere Netzwerk als BMP Bild &PNG... PNG Export network to a PNG image Exportiere Netzwerk als PNG Bild Export PNG Export network to a PNG image Export PNG Exportiert Netzwerk als PNG Bild &PDF... PDF Export network to a PDF file Exportiere Netzwerk als PDF Datei Export PDF Export network to a PDF document Export PDF Exportiere Netzwerk als PDF Dokument &Adjacency Matrix Adjacency Matrix Export network to an adjacency matrix file Exportiere Netzwerk als Adjacency Matrix Datei Export Sociomatrix Export network to a adjacency matrix-formatted file Export Sociomatrix Exportiere Netzwerk als Adjacency Matrix-formatierte Datei &Pajek Pajek Export network to a Pajek-formatted file Exportiere Netzwerk als Pajek-formatierte Datei Export Pajek Export network to a Pajek-formatted file Export Pajek Exportiere Netzwerk als Pajek-formatierte Datei &List List Export network to a List-formatted file. Exportiere Netzwerk als List-formatierte Datei. Export List Export network to a List-formatted file Export List Exportiere Netzwerk als List-formatierte Datei &DL... DL... Export network to a DL-formatted file Exportiere Netzwerk als DL-formatierte Datei Export DL Export network to a DL-formatted Export DL Exportiere Netzwerk als DL-formatierte Datei &GW... GW... Export network to a GW-formatted file Exportiere Netzwerk als GW-formatierte Datei Export Export network to a GW formatted file Exportiere Exportiere Netzwerk als GW-formatierte Datei &Close Schließen Closes the actual network Schließt das aktuelle Netzwerk Close Closes the actual network Schließen Schließt das aktuelle Netzwerk &Print Drucken Ctrl+P Strg+P Prints whatever is viewable on the canvas. Druckt sichtbaren Bereich Printing This function prints whatever is viewable on the canvas. To print the whole network, you might want to zoom-out. Drucken Diese Funktion druckt den sichtbaren Bereich. Um das gesamte Netzwerk zu drucken ggf. herauszoomen E&xit Beenden Ctrl+Q Strg+Q Quits the application Beendet die Anwendung Exit Quits the application Beenden Beendet die Anwendung View Loaded File Betrachte geladene Datei F5 F5 Displays the loaded network file Zeigt geladene Netzwerk-Datei an View Loaded File Displays the file of the loaded network Betrachte geladene Datei Zeigt die geladene Netzwerk-Datei an View Adjacency Matrix Zeige Adjacency Matrix F6 F6 Displays the adjacency matrix of the active network Zeigt Adjacency Matrix des aktiven Netzwerkes View Network file Displays the adjacency matrix of the active network Zeige Netzwerk-Datei an Zeigt die Adjacency Matrix des aktiven Netzwerkes Erdos-Renyi G(n,p) Erdos-Renyi G(n,p) Shift+U Shift+U Creates a random network where each edge is included with a given probability Erschafft ein zufälliges Netzwerk in dem jede Kante mit gegebener Wahrscheinlichkeit eingeschlossen ist Uniform Creates a random network of G(n, p) model by connecting nodes randomly. Each edge is included in the graph with equal probability p, independently of the other edges Uniform Erschafft ein zufälliges Netzwerk im G(n, p) Model durch zufälliges Verbinden der Knoten. Jede Kante ist mit gleicher Wahrscheinlichkeit p im Graphen eingschlossen, unabhängig von den anderen Kanten Connected Verbunden Creates a connected random network Erschafft ein verbundenes zufälliges Netzwerk Uniform Connected Creates a connected random network Uniform Connected Erschafft ein verbundenes zufälliges Netzwerk Ring Lattice Ring Lattice Shift+L Shift+L Creates a ring lattice random network Erschafft ein zufälliges Ring Lattice Netzwerk Ring Lattice A ring lattice or a physicist's lattice is a graph with N nodes each connected to K neighbors, K / 2 on each side. Ring Lattice Ein Ring Lattice oder Physicist' Lattice ist ein Graph mit N Knoten, jeder verbunden mit K Nachbarn, K / 2 auf jeder Seite. Same Degree Same Degree Creates a random network where all nodes have the same degree. Erschafft ein Netzwerk in dem alle Knoten den gleichen Grad besitzen. Same Degree Creates a random network where all nodes have the same degree Same Degree Erschafft ein zufälliges Netzwerk in dem alle Knoten den selben Grad besitzen Gaussian Gaussian Creates a Gaussian distributed random network Erschafft ein zufälliges normalverteiltes Netzwerk Gaussian Creates a random network of Gaussian distribution Gaussian Erschafft ein zufälliges Netzwerk mit Gauß'scher Verteilung Small World Small World Shift+W Shift+W Creates a random network with small world properties Erschafft ein zufälliges Netzwerk mit Small World Eigenschaften Small World A Small World, according to the Watts and Strogatz model, is a random network with short average path lengths and high clustering coefficient. Small World Eine Small World, nach Watts' und Strogatz' Model, ist ein zufälliges Netzwerk mit kurzen mittleren Pfadlängen und hohem Clustering Koeffizienten Find Node Finde Knoten Ctrl+F Strg+F Finds and highlights a node by number or label. Press Ctrl+F again to undo. Findet einen Knoten nach Nummer oder Label und hebt ihn hervor. Umschalten mit Strg+F Find Node Finds a node with a given number or label and doubles its size. Ctrl+F again resizes back the node Finde Knoten Findet einen Knoten mit gegebener Nummer oder Label und verdoppelt dessen Größe. Strg+F setzt die Skalierung wieder zurück Add Node Füge Knoten hinzu Ctrl+A Strg+A Adds a node Fügt einen Knoten hinzu Add Node Adds a node to the network Füge Knoten hinzu Fügt dem Netzwerk einen Knoten hinzu Remove Node Entferne Knoten Ctrl+Shift+A Strg+Shift+A Removes a node Entfernt einen Knoten Remove Node Removes a node from the network Entferne Knoten Entfernt einen Knoten des Netzwerkes Change Label Ändere Label Changes the Label of a node Ändert das Label eines Knotens Change Label Changes the label of a node Ändere Label Ändert das Label eines Knotens Change Color Ändere Farbe Changes the color of a node Ändert die Farbe eines Knotens Change Color Changes the Color of a node Ändere Farbe Ändert die Farbe eines Knotens Change Size Ändere Größe Changes the actual size of a node Ändert die Größe eines Knotens Change Size Changes the actual size of a node Ändere Größe Ändert die Größe eines Knotens Change Value Ändere Wert Changes the value of a node Ändert den Wert eines Knotens Change Value Changes the value of a node Ändere Wert Ändert den Wert eines Knotens Change all Nodes Size Ändere Größe aller Knoten This option lets you change the size of all nodes Diese Option erlaubt die Größe aller Knoten zu ändern Nodes Size This option lets you change the size of all nodes Knoten Größe Dies Option erlaubt die Größe aller Knoten zu ändern Change all Nodes Shape Ändere Form aller Knoten This option lets you change the shape of all nodes Diese Option erlaubt die Form aller Knoten zu ändern Nodes Shape This option lets you change the shape of all nodes Knoten Form Diese Option erlaubt die Form aller Knoten zu ändern Change Node Shape to Box Ändere Knotenform zu Box This option lets you change the shape of a node to a box Diese Option erlaubt die Form eines Knotens zu Box zu ändern Node as a box This option lets you change the shape of a node to a box Knoten als Box Diese Option erlaubt die Form eines Knotens zu Box zu ändern Change Node Shape to Triangle Ändere Knotenform zu Dreieck Change Node Shape to Circle Ändere Knotenform zu Kreis Change Node Shape to Diamond Ändere Knotenform zu Diamant Change Node Shape to Ellipse Ändere Knotenform zu Ellipse Change all Numbers Size Ändere Größe aller Nummern It lets you change the font size of the numbers of all nodes Erlaubt die Schrifftgröße der Nummern aller Knoten zu ändern Numbers Size Changes the size of the numbers of all nodes Nummern Größe Ändert die Größe der Nummern aller Knoten Change all Labels Size Ändere Größe aller Labels You can change the font size of the labels of all nodes Erlaubt die Schrifftgröße der Labels aller Knoten zu ändern Labels Size Change the fontsize of the labels of all nodes Label Größe Ändere die Schrifftgröße der Label aller Knoten Add Link Füge Link hinzu Ctrl+L Strg+L Adds a Link to a Node Fügt einem Knoten einen Link hinzu Add Link Adds a Link to the network Fügt dem Netzwerk einen Link hinzu Remove Entfernen Ctrl+Shift+L Strg+Shift+L Removes a Link Entfernt einen Link Remove Link Removes a Link from the network Entferne Link Entfernt einen Link vom Netzwerk Changes the Label of a Link Ändere Label eines Links Change Label Changes the label of a Link Ändere Label Ändert das Label eines Links Changes the Color of a Link Ändert die Farbe eines Links Change Color Changes the Color of a Link Ändere Farbe Ändert die Farbe eines Links Change Weight Ändere Gewichtung Changes the Weight of a Link Ändert die Gewichtung eines Links Change Value Changes the Weight of a Link Ändere Wert Ändert die Gewichtung eines Links Filter Nodes Filtere Knoten Filters Nodes of some value out of the network Filtert Knoten eines bestimmten Wertes aus dem Netzwerk Filter Nodes Filters Nodes of some value out of the network. Filter Knoten Filtert Knoten eines bestimmten Wertes aus dem Netzwerk Filter Links Filtere Links Filters Links of some weight out of the network Filtert Links einer bestimmten Gewichtung aus dem Netzwerk Filter Links Filters Link of some specific weight out of the network. Filter Links Filtert Links einer bestimmten Gewichtung aus dem Netzwerk Change Background Color Ändere Hintergrundfarbe Click to change the background color Klicken um Hintergrundfarbe zu ändern Background Changes background color Hintergrund Ändert Hintergrundfarbe Change all Nodes Colors Ändere Farbe aller Knoten Click to choose a new color for all nodes. Klicken um neue Farbe für alle Knoten zu wählen All Nodes Changes all nodes color at once. Alle Knoten Ändert die Farbe aller Knoten. Change all Numbers Colors Ändere Farbe aller Nummern Click to change the color of all numbers. Klicken um Farbe aller Nummern zu ändern Numbers Changes the color of all numbers. Nummern Ändert die Farbe aller Nummern Change all Labels Colors Ändere Farbe aller Label Click to change the color of all node labels. Klicken um Farbe aller Labels zu ändern Numbers Changes the color of all node labels. Nummern Ändert die Farbe aller Label Change all Links Colors Ändere Farbe aller Links Click to change the color of all links. Klicken um Farbe aller Links zu ändern Background Changes all links color Hintergrund Ändert die Farbe aller Links Transform Nodes to Links Transformiere Knoten zu Link Transforms the network so that nodes become links and vice versa Transformiert das Netzwerk so dass Knoten zu Links werden und umgekehrt Transform Nodes LinksAct Transforms network so that nodes become links and vice versa Transformiere Knoten LinksAct Transformiert das Netzwerk so dass Knoten zu Links werden und umgekehrt Symmetrize Links Mache Links symmetrisch Shift+R Shift+R Makes all edges reciprocal (thus, a symmetric graph). Macht alle Kanten reziprok (d.h. einen symmetrischen Graphen) Symmetrize Edges Transforms all arcs to double links (edges). The result is a symmetric network Mache Kanten symmetrisch Transformiert alle Bögen zu doppelten Links (Kanten). Das Ergebnis ist ein symmetrisches Netzwerk Strong Structural Strong Structural Nodes are assigned the same color if they have identical in and out neighborhoods Knoten erhalten die selbe Farbe wenn sie identische In- und Out-Nachbarn besitzen Click this to colorize nodes; Nodes are assigned the same color if they have identical in and out neighborhoods Klicken um Knoten zu färben; Knoten erhalten die selbe Farbe wenn sie identische In- und Out-Nachbarn besitzen Regular Regular Nodes are assigned the same color if they have neighborhoods of the same set of colors Knoten erhalten die selbe Farbe wenn sie Nachbarschaften gleicher Farbsets besitzen Click this to colorize nodes; Nodes are assigned the same color if they have neighborhoods of the same set of colors Klicken um Knoten zu färben; Knoten erhalten die selbe Farbe wenn sie Nachbarschaften gleicher Farbsets besitzen Random Random Repositions the nodes in random places Setzt die Knoten in zufälliger Verteilung zurück Random Layout Repositions the nodes in random places Zufälliges Layout Setzt die Knoten in zufälliger Verteilung zurück Random Circle Zufälliger Kreis Repositions the nodes randomly on a circle Verteilt die Knoten zufällig auf einen Kreis Random Circle Layout Repositions the nodes randomly on a circle Kreis Layout Verteilt die Knoten zufällig auf einen Kreis In-Degree In-Degree Ctrl+1 Strg+1 Repositions the nodes on circles of different radius. More In-Degree Central Nodes are positioned towards the centre. Circle In-Degree Centrality Layout Repositions the nodes on circles of different radius. More In-Degree Central Nodes are positioned towards the centre. Out-Degree Ctrl+2 Repositions the nodes on circles of different radius. More Out-Degree Central Nodes are positioned towards the centre. Circle Out-Degree Centrality Layout Repositions the nodes on circles of different radius. More Out-Degree Central Nodes are positioned towards the centre. Closeness Ctrl+3 Repositions the nodes on circles of different radius. More Closeness Central Nodes are positioned towards the centre. Circle Closeness Centrality Layout Repositions the nodes on circles of different radius. More Closeness Central Nodes are positioned towards the centre. Betweeness Ctrl+4 Repositions the nodes on circles of different radius. More Betweeness Central Nodes are positioned towards the centre. Circle Betweeness Centrality Layout Repositions the nodes on circles of different radius. More Betweeness Central Nodes are positioned towards the centre. Informational Ctrl+5 Repositions the nodes on circles of different radius. More Informational Central Nodes are situated towards the centre. Circle Informational Centrality Layout Repositions the nodes on circles of different radius. More Informational Central Nodes are positioned towards the centre. Stress Ctrl+6 Repositions the nodes on circles of different radius. More Stressed Central Nodes are positioned towards the centre. Circle Stress Centrality Layout Repositions the nodes on circles of different radius. Nodes having greater Stress Centrality are situated towards the centre. Graph Ctrl+7 Repositions the nodes on circles of different radius. More Graphed Central Nodes are positioned towards the centre. Circle Graph Centrality Layout Repositions the nodes on circles of different radius. Nodes having greater Graph Centrality are situated towards the centre. Eccentricity Ctrl+8 Repositions the nodes on circles of different radius. Nodes of large eccentricity are positioned towards the centre. Circle Eccentricity Centrality Layout Repositions the nodes on circles of different radius. Nodes having greater Eccentricity Centrality are situated towards the centre. Remove Layout GuideLines Removes Red GuideLines from the canvas. Remove GuideLines Removes any guidelines (circles or horizontal lines) created for the network layout. Ctrl+Shift+1 Repositions the nodes on levels of different height. More In-Degree Central Nodes are situated on higher levels. Level In-Degree Centrality Layout Repositions the nodes on levels of different height. More In-Degree Central Nodes are situated on higher levels. Ctrl+Shift+2 Repositions the nodes on levels of different height. More Out-Degree Central Nodes are situated on higher levels. Level Out-Degree Centrality Layout Repositions the nodes on levels of different height. More Out-Degree Central Nodes are situated on higher levels. Ctrl+Shift+3 Repositions the nodes on levels of different height. More Closeness Central Nodes are situated on higher levels. level Closeness Centrality Layout Repositions the nodes on levels of different height. More Closeness Central Nodes are situated on higher levels. Ctrl+Shift+4 Repositions the nodes on levels of different height. More Betweeness Central Nodes are situated on higher levels. level Betweeness Centrality Layout Repositions the nodes on levels of different height. More Betweeness Central Nodes are situated on higher levels. Ctrl+Shift+5 Repositions the nodes on levels of different height. More Informational Central Nodes are situated on higher levels. Level Informational Centrality Layout Repositions the nodes on levels of different height. More Informational Central Nodes are situated on higher levels. Spring Embedder Alt+1 All nodes repel each other while the connected ones are attracted as if connected by springs. Spring Embedder Layout In this model, nodes are regarded as physical bodies (i.e. electrons) which exert repelling forces to each other, while edges are springs connecting adjacents nodes. Non-adjacent nodes repel each other while connected nodes are The algorithm continues until the system retains an equilibrium state in which all forces cancel each other. Fruchterman-Reingold Alt+2 Repelling forces between all nodes, and attracting forces between adjacent nodes. Fruchterman-Reingold Layout Embeds a layout all nodes according to a model in which repelling forces are used between every pair of nodes, while attracting forces are used only between adjacent nodes. The algorithm continues until the system retains its equilibrium state where all forces cancel each other. Zoom &in Ctrl++ Zoom in (Ctrl++) Zooms inside the actual network. Zoom In. Zooms in. What else did you expect? Zoom &out Ctrl+- Zoom out (Ctrl+-) Zooms out of the actual network. Zoom out. Zooms out. What else did you expect? NodeSize = F (OutDegree) Alt+3 Resizes all nodes according to their out edges. NodeSize = F (OutDegree) Adjusts the size of each node according to their out-edges (OutDegree). The more out-likned a node is, the bigger will appear... NodeSize = F (InDegree) Alt+4 Resizes all nodes according to their in edges. NodeSize = F (InDegree) This method adjusts the size of each node according to their in-edges (InDegree). The more in-linked a node is, the bigger will appear... Network Symmetry Shift+S Tests if the network is symmetric or not Network Symmetry A network is symmetric when all edges are reciprocal, or, in mathematical language, when the adjacency matrix is symmetric. Graph Distance Ctrl+G Calculates the length of the shortest path between two nodes... Graph Distance The graph distance (or geodesic distance) of two nodes is the length (number of edges) of the shortest path between them. Distance &Matrix Ctrl+M Displays the matrix of graph distances between all nodes Distance Matrix A distance matrix is a NxN matrix, where the (i,j) element is the graph distance from node i to node j. Diameter Ctrl+D Calculates and displays the diameter of the network. Diameter The Diameter of a network is the maximum graph distance (maximum shortest path length) between any two nodes of the network. Average Graph Distance Ctrl+B Calculates and displays the average shortest path length. Average Graph Distance This the average length of all shortest paths between the connected pair of nodes of the network. Clustering Coefficient Ctrl+C Calculates and displays the average Clustering Coefficient of the network. Clustering Coefficient The Clustering Coefficient of a vertex quantifies how close the vertex and its neighbors are to being a clique. OutDegree Calculates and displays OutDegree Centralities OutDegree Centrality For each node k, this is the number of arcs starting from it. This is oftenly a measure of activity. InDegree Calculates and displays InDegree Centralities InDegree Centrality For each node k, this the number of arcs ending at k. Most in-degree central node might be considered more prominent among others. Calculates and displays Closeness Centralities Closeness Centrality For each node k, this the invert sum of the shortest distances between k and every other node. It is interpreted as the ability to access information through the "grapevine" of network members. Calculates and displays Betweeness Centralities Betweeness Centrality For each node k, this is the ratio of all geodesics between pairs of nodes which run through k. It reflects how often an node lies on the geodesics between the other nodes of the network. It can be interpreted as a measure of control. Calculates and displays Graph Centralities Graph Centrality For each node k, this is the invert of the maximum of all geodesic distances from k to all other nodes in the network. Nodes with high GC have short distances to all other nodes in the graph. Calculate and display Stress Centrality Stress Centrality For each node k, this is the total number of geodesics between all other nodes which run through k. When one node falls on all other geodesics between all the remaining (N-1) nodes, then we have a star graph with maximum Stress Centrality Calculate and display Eccentricity Centrality Stress Centrality For each node k, this is the largest geodesic distance (k,t) from every other vertex t. Therefore, EC(u) reflects how far, at most, is each node from every other node. Calculate and display Informational Centrality Informational Centrality Calculate and display Informational Centrality Display Num&bers Toggles displaying of node numbers Display Numbers Enables/disables node numbers Display Labels Toggles displaying of node labels Display Labels Enables/disables node labels Display Links Toggle to display or not links Display Links Click to enable or disable displaying of links Display Weight Numbers Toggles displaying of numbers of links weights Display Weight Numbers Click to enable or disable displaying numbers of links weight Display Arrows Toggles displaying of arrows in the end of links Display Arrows Click to enable or disable displaying of arrows in the end of links Thickness=Weight Draws links as thick as their weights (if specified) Draw As Thick As Weights Click to toggle having all links as thick as their weight (if specified) Bezier Curves Draws links as Bezier curves Links Bezier Enables/Disables drawing Links as Bezier curves. Anti-Aliasing F8 Enables/disables anti-aliasing Enable or disable Anti-Aliasing Anti-aliasing is a technique which makes nodes, lines and text, smoother and fancier. But it comes at the cost of speed... Progress Bars F10 Enables/disables Progress Bars Enable or disable Progress Bars Progress Bars may appear during time-cost operations. Enabling progressBar has a significant cpu cost but lets you know about the progress of a given operation. Debug Messages F9 Enables/disables printing debug messages to stdout Enables or disable Debug Messages Printing debug messages to strerr. Enabling has a significant cpu cost but lets you know what SocNetV is actually doing. Toolbar Enables/disables the toolbar Enable or disable Toolbar The toolbar is the widget right below the menu, and carries useful icons. You can disable it if you like... Statusbar Enables/disables the statusbar Enable or disable Statusbar The statusbar is the widget at the bottom of the window, where messages appear. You might want to disable it... Manual F1 Read the manual... Manual Displays the documentation of SocNetV Tip of the Day Read useful tips Quick Tips Displays some useful and quick tips About SocNetV About Basic information about SocNetV About Qt About About Qt &Network Create Random Network Export... &Edit Node... Link... Filter... Colors &Layout In circles by centrality... In levels by centrality... Physical... &Statistics Centralities &Options Nodes Links &View &Help 25% 50% 75% 100% 125% 150% 175% Rotation: &Add Node Add a new node to the network (Ctrl+A). Alternately, you can create a new node in a specific position by double-clicking on that spot of the canvas. &Remove Node Remove a node from the network (Ctrl+Shift+A). Alternately, you can remove a node by right-clicking on it. Add &Link Add a new link to the network (Ctrl+L). Alternately, you can create a new link between two nodes by middle-clicking on them consequetively. Remove Link Remove a link from the network Alternately, you can remove a link by right-clicking on it. Edit Network Edit Total Nodes Total Links Counts how many nodes (vertices) exist in the whole network. Counts how many links (in and out) exist in the whole network. Density The density of a network is the ratio of existing links to all possible links (n(n-1)) between nodes. OutLinked Nodes: This the number of nodes with outLinks to another node. They may also have inLinks or reciprocal links. Meaningful on directed graphs. InLinked Nodes: This the number of nodes with inLinks from another node. These may also have outLinks or reciprocal links. Meaningful on directed graphs. Reciprocal-Linked: This the number of nodes with reciprocal links, namely, both inLinks and outLinks to another node. Active Node Node Number: This is the number of the last selected node. Node In-Degree: This is the number of edges ending at the node you clicked on. Node Out-Degree: This is the number of edges starting from the node you clicked on. Clustering Coef. The Clustering Coefficient quantifies how close the vertex and its neighbors are to being a clique. The proportion of links between the vertices within the neighbourhood of the clicked vertex, divided by the number of links that could possibly exist between them. Network Statistics Embeds a spring-gravitational model on the network, where each node is regarded as physical object reppeling all other nodes, while springs between connected nodes attact them. The result is constant movement. This is a very SLOW process on networks with N > 100! In Fruchterman-Reingold model, the vertices behave as atomic particles or celestial bodies, exerting attractive and repulsive forces to each other. Again, only vertices that are neighbours attract each other but, unlike Spring Embedder, all vertices repel each other. Kamanda-Kwei ! If you enable this, all nodes will be resized so that their size reflect their out-degree (the amount of links from them). To put it simply, more out-linked nodes will be bigger... If you enable this, all nodes will be resized so that their size reflect their in-degree (the amount of links to them from other nodes). To put it simply, more in-linked nodes will be bigger... Layout Ready. Social Network Visualiser Ready Do you want to save the changes to the network file? Yes No Cancel Choose a network file... Select one file to open All (*);;GraphML (*.graphml *.gml);;GraphViz (*.dot);;Adjacency (*.txt *.csv *.net);;Pajek (*.net *.pajek);;DL (*.dl *.net) Loaded network: Error loading requested file. Aborted. Opening aborted Saving file... No network loaded. Do you want to save this network in Pajek-formatted or SocioMatrix - formatted file? Pajek Sociomatrix Network saved under filename: . Saving network under new filename... Saving aborted Closing file... Network has not been saved. Do you want to save before closing it? Erasing old network data.... Printing... Pajek formatted network, named %1, loaded with %2 Nodes and %3 total Links. Adjacency formatted network, named %1, loaded with %2 Nodes and %3 total Links. Dot formatted network, named %1, loaded with %2 Nodes and %3 total Links. GraphML formatted network, named %1, loaded with %2 Nodes and %3 total Links. DL-formatted network, named %1, loaded with %2 Nodes and %3 total Links. New node (numbered %1) added. The canvas is empty! Load a network file or create a new network first. Cannot export PNG. Save Image Files (*.png) Image Saved as: Exporting completed Nothing to export! Load a network file or create a new network first. Cannot export BMP. Save Image as Image Files (*.bmp) Export to BMP... Cannot export PDF. Export to PDF Portable Document Format files (*.pdf) Export to PDF... File saved as: Cannot export to Pajek. Could not write to %1 File %1 saved Nothing to export! Load a network file or create a new network first. Cannot export to Adjacency Matrix. Note that exporting to an adjacency matrix does not save floating-point weight values; adjacency matrices consist of integers, only. If your network had any floating point weights in some edges, these are being truncated to the nearest integer or 1.) Adjacency matrix-formatted network saved into file %1 Cannot export to DL. Cannot export to GW. Viewing network file - Loaded network text file Network not saved yet. I will open a dialog for you to save it now. Network has been modified. Please save it now. Empty network! Load a network file first or create and save a new one... Nothing here. Not my fault, though! Empty network! Load a network file or create something by double-clicking on the canvas! Nothing to show! creating adjacency adjacency matrix of %1 nodes View Adjacency Matrix - This will create a new random symmetric network of G(n,p) model, where n is the nodes and p is the edge probability. Please enter the number n of nodes you want: Creating random network. Please wait... Random network created. Nodes: Edges: Average path length: Clustering coefficient: On the average, edges should be This graph is almost surely connected because: probability > ln(n)/n, that is: bigger than This graph is almost surely not connected because: probability < ln(n)/n, that is: Creating uniform random network. Please wait... This will create a same degree network. Please enter the number of nodes you want: Sorry. I cannot create such a network. Links must be even number This will create a small world network, that is an undirected graph with N nodes and N*d/2 edges, where d is the mean edge degree. Please enter the number N of nodes you want: Now, enter an even number d. This is the mean edge degree each new node will have: Now, enter a parameter beta. This is the edge rewiring probability: Erasing any existing network. Creating small world. Please wait... Creating random network. Please wait (or disable me from Options > View > ProgressBar, next time ). Small world random network created: Small world network created. This will create a ring lattice network, where each node has degree d: d/2 edges to the right and d/2 to the left. Please enter the number of nodes you want: Ring lattice network created. No nodes present! Load a network file first or create some nodes... OK Nothing to find! Enter node label or number: Node found! Sorry. There is no such node in this network. Try again. Options (%1, %2); Node %3, with label %4, has %5 in-Links and %6 out-Links. Link from Node %1 to Node %2, has weight %3 and color %4. Link between node %1 and node %2, weight %3 and color %4. Nothing to do! Load a network file or add some nodes first. Nothing to remove. Choose a node to remove between ( Node removed completely. Ready. Nothing to link to! Create some nodes first. There are no nodes yet... This will draw a new link between two nodes. Enter source node ( Aborting. Source node accepted. Now enter target node ( Source and target nodes accepted. Please, enter the weight of new link: Ready. No links present! Load a network file or create a new network first. No links to remove - sorry. Remove link Source node: ( Target node: ( There is no such link. This link is reciprocal. Select what Direction to delete or Both... Both There are no nodes! Load a network file or create a new network first. No nodes created. Please click on a node first... Enter new node label: Changed label to %1. Ready. No label text. Abort. No nodes... Select node: ( Error. There is no such link. Change node color aborted. Cannot change nothing. Change node size to: (1-16) No links here! Load a network file or create a new network first. No links present... Select link source node: ( Select link target node: ( Change link color cancelled. User abort. There are no links here! Load a network file or create a new network first. New link Weight: input error. Abort. Change link weight Select what Direction to change or Both... New link weight: Change link weight cancelled. Weight not changed. Sorry. Nothing to filter! Load a network file or create a new network. Then ask me to compute something! Nothing to filter! All links are reciprocal. Your network is symmetric... There are node nodes yet! Load a network file or create a new network first. Then we can talk about layouts! I am really sorry. You must really load a file first... Embedding a spring-gravitational model on the network.... Click on the checkbox "Spring-Embedder" to stop movement! Movement stopped! There are no nodes yet! Load a network file or create a new network first. Then we can talk about layouts! Embedding a repelling-attracting forces model on the network.... Click on the checkbox "Fruchterman-Reingold" to stop movement! Wake up! Load a network file or create a new network first. Then we can talk about layouts! Embedding node size model on the network.... You must be dreaming! Load a network file or create a new network first. Then we can talk about layouts! Sorry, I can't follow! Load a network file or create a new network first. Then we can talk about layouts! Nothing to layout! Are you dreaming? Calculating new nodes positions. Please wait... Nodes in inner circles have greater In-Degree Centrality. Load a network file or create a new network first! Nodes in inner circles have greater Out-Degree Centrality. Sorry, there are no nodes yet! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Closeness Centrality. No nodes yet! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Betweeness Centrality. Nothing to do! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Stress Centrality. Nothing to do here! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Graph Centrality. Nodes in inner circles have greater Eccentricity Centrality. Nodes in upper levels have greater In-Degree Centrality. Load a network file or create a new network first. Then we can talk about layouts! Nodes in upper levels have greater Out-Degree Centrality. Nodes in upper levels have greater Closeness Centrality. Nodes in upper levels have greater Betweeness Centrality. There are no nodes! Load a network file or create a new network. Then ask me to compute something! There is no network! Adjacency matrix symmetry = YES Adjacency matrix symmetry = NO There are no nodes. Nothing to do... Distance between two nodes Select source node: ( Select target node: ( Distance calculation operation cancelled. Distance Network distance ( The nodes are connected. The nodes are not connected. There are no nodes nor links! Load a network file or create a new network. Then ask me to compute something! Nothing to do! Creating distance matrix. Please wait... Matrix of sigmas Matrix of distances Cannot find the diameter of nothing... Diameter calculated. Ready. Average distance calculated. Ready. Window resized to (%1, %2) pixels. Nothing to do! Load a network file or create a new network. Then ask me to compute something! No network here. Sorry. Nothing to do. CLUSTERING COEFFICIENT REPORT Created: CLUSTERING COEFFICIENT (CLC) OF EACH NODE CLC range: 0 < C < 1 Range: 0 < GCLC < 1 GCLC = 0, when there are no cliques (i.e. acyclic tree). GCLC = 1, when every node and its neighborhood are complete cliques. Take weights into account (Default: No)? OUT-DEGREE CENTRALITY REPORT OUT-DEGREE CENTRALITIES (ODC) OF EACH NODE ODC range: 0 < C < ODC' range: 0 < C'< 1 GODC range: 0 < GODC < 1 GODC = 0, when all in-degrees are equal (i.e. regular lattice). GODC = 1, when one node completely dominates or overshadows the other nodes. The degree of the node is a measure of the 'activity' of the node it represents Nothing to do! Load a network file or create a new network. Then ask me to compute something! Nothing to do... IN-DEGREE CENTRALITY REPORT IN-DEGREE CENTRALITIES (IDC) OF EACH NODE IDC range: 0 < C < IDC' range: 0 < C'< 1 GIDC range: 0 < GIDC < 1 GIDC = 0, when all in-degrees are equal (i.e. regular lattice). GIDC = 1, when one node is linked from every other node. The in-degree of the node is a measure of the 'activity' of the node it represents CLOSENESS - CENTRALITY REPORT CLOSENESS CENTRALITY (CC) OF EACH NODE CC(u) is the invert sum of the distances of node u from all other nodes. CC' is the standardized CC CC range: 0 < C < CC' range: 0 < C'< 1 All nodes have the same CC value. Node has the maximum ACC value (std): has the minimum ACC value (std): There are different Closeness Centrality classes. GROUP CLOSENESS CENTRALISATION (GCC) GCC = GCC range: 0 < GCC < 1 GCC = 0, when the lengths of the geodesics are all equal (i.e. a complete or a circle graph). GCC = 1, when one node has geodesics of length 1 to all the other nodes, and the other nodes have geodesics of length 2 to the remaining (N-2) nodes. This is exactly the situation realised by a star graph. This measure focuses on how close a node is to all the other nodes in the set of nodes. The idea is that a node is central if it can quickly interact with all others Nothing to do... Please wait... Finished with shortest-path distances... BETWEENESS - CENTRALITY REPORT BETWEENESS CENTRALITY (BC) OF EACH NODE BC of a node u is the sum of delta (s,t,u) for all s,t in V Delta(s,t,u) is the ratio of all geodesics between s and t which run through u. Therefore, BC(u) reflects how often the node u lies on the geodesics between the other nodes of the network BC' is the standardized BC BC range: 0 < BC < (Number of pairs of nodes excluding i) BC' range: 0 < BC'< 1 (C' is 1 when the node falls on all geodesics) All nodes have the same BC value. Node has the maximum BC value: has the minimum BC value: different Betweeness Centrality classes. GROUP BETWEENESS CENTRALISATION (GBC) GBC = GBC range: 0 < GBC < 1 GBC = 0, when all the nodes have exactly the same betweeness index. GBC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. Nothing to do! Why dont you try creating something first? STRESS CENTRALITY REPORT STRESS CENTRALITY (SC) OF EACH NODE SC(u) is the sum of sigma(s,t,u): the number of geodesics from s to t through u. SC(u) reflects the total number of geodesics between all other nodes which run through u SC range: 0 < SC < SC' range: 0 < SC'< 1 (SC'=1 when the node falls on all geodesics) All nodes have the same SC value. has the maximum SC value: has the minimum SC value: different Stress Centrality classes. GROUP STRESS CENTRALISATION (GSC) GSC = GSC range: 0 < GSC < 1 GSC = 0, when all the nodes have exactly the same stress index. GSC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. Try creating a network first. Then I compute whatever you want... GRAPH - CENTRALITY REPORT GRAPH CENTRALITY (GC) OF EACH NODE GC range: 0 < GC < GC' range: 0 < GC'< 1 (GC'=1 => directly linked with all nodes) All nodes have the same GC value. has the maximum GC value: has the minimum GC value: different Graph Centrality classes. GROUP GRAPH CENTRALISATION (GGC) GGC = GGC range: 0 < GGC < 1 GGC = 0, when all the nodes have exactly the same graph index. GGC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. ECCENTRICITY- CENTRALITY REPORT ECCENTRICITY CENTRALITY (EC) OF EACH NODE EC of a node u is the largest geodesic distance (u,t) for t in V Therefore, EC(u) reflects how far, at most, is each node from every other node. EC' is the standardized EC EC range: 0 < EC < (max geodesic distance) EC' range: 0 < EC'< 1 All nodes have the same EC value. has the maximum EC value: has the minimum EC value: different eccentricity Centrality classes. GROUP ECCENTRICITY CENTRALISATION (GEC) GEC = GEC range: 0 < GEC < 1 GEC = 0, when all the nodes have exactly the same betweeness index. GEC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. Eccentricity Centralities saved as: There are no nodes! Load a network file or create a new network. Errr...no nodes here. Sorry! Toggle Nodes Numbers. Please wait... Node Numbers are invisible now. Click the same option again to display them. Node Labels are visible again... There are no nodes! Load a network file or create a new network first. No nodes found. Sorry... Toggle Nodes Labels. Please wait... Node Labels are invisible now. Click the same option again to display them. Select new size for all nodes: (1-16) All shapes have been changed. Ready Change node shapes aborted... Change all nodenumbers size to: (1-16) Change font size: Aborted. Changed numbers size. Ready. There are no links! Load a network file or create a new network first. No nodes or edges found. Sorry... Toggle Edges Weights. Please wait... Edge weights are invisible now. Click the same option again to display them. Edge weights are visible again... There are no nodes nor links! Load a network file or create a new network first! No links found... Toggle Edges Arrows. Please wait... Links are invisible now. Click again the same menu to display them. Links visible again... There are no links! Load a network file or create a new network first! There are no links! Load a network file or create a new network! There are NO links here! Toggle links bezier. Please wait... Change link color aborted. Numbers' colors changed. Ready. Label colors changed. Ready. Toggle anti-aliasing. This will take some time if the network is large (>500)... Anti-aliasing off. Anti-aliasing on. Toggle progressbar... Progress bars off. Progress bars on. Debug messages off. Debug messages on. Toggle toolbar... Toolbar off. Toolbar on. Toggle statusbar... Status bar off. Status bar on. Tip Of The Day You can add a new node by double-clicking on the scene. You can add a new node by clicking on Add button. You can remove a node by clicking on Remove button. You can rotate the network by selecting a new angle on the dock. You can add a new link between two nodes, by middle-clicking (or pressing both mouse buttons simultanesously) on the first and then on the second node. You can remove a node by right-clicking on it and selecting Remove. You can change background color (from the menu Edit > Colors). Nodes can have the colors of your choice. Just right-click on a node and then select > Options > Change Color. You can select every color supported by the X.org pallette. The tabs on the left dock show information about the network (nodes, edges, density, etc) as well as information about any node you clicked on (inDegrees, outDegrees, clustering). You can move a node easily by dragging it with your mouse. SocNetV can save the positions of the nodes in a network, if you save it in Pajek/GraphML format. You can apply layout algorithms on the network from the menu Layout or by clicking on the Dock > Layout tab checkboxes You can change the label of node by right-clicking on it, and selecting Options > Change Label. All basic operations of SocNetV are available from the dock on the left, or by right-clicking on a node or a link. Node information is displayed on the Status bar, when you left-click on it. Link information is displayed on the Status bar, when you left-click on it. Manual TextEditor &New Ctrl+N Create a new file &Open... Ctrl+O Open an existing file &Save Ctrl+S Save the document to disk Save &As... Save the document under a new name E&xit Ctrl+Q Exit the application Cu&t Ctrl+X Cut the current selection's contents to the clipboard &Copy Ctrl+C Copy the current selection's contents to the clipboard &Paste Ctrl+V Paste the clipboard's contents into the current selection &About Show the application's About box About &Qt Show the Qt library's About box &File &Edit &Help File Edit Ready TextEditor The document has been modified. Do you want to save your changes? Application Cannot read file %1: %2. File loaded Cannot write file %1: %2. File saved %1[*] - %2 socnetv-0.90/translations/socnetv_es.ts0000644000175000017500000060475411261401572020635 0ustar dimitrisdimitris HTMLViewer &File &Open Ctrl+O Opens another helpfile &Print Ctrl+P Prints out the actual network E&xit Ctrl+X Close Manual &Back Ctrl+B &Backward &Forward Ctrl+F &Home Ctrl+H &Go MainWindow Welcome to Social Networks Visualiser, Version &New Ctrl+N Creates a new network New network (Ctrl+N) New Creates a new network &Open Ctrl+O Open network (Ctrl+O) Opens a a file of an existing network Open Opens a file of an existing network &Save Ctrl+S Save network (Ctrl+S) Saves the actual network to the current file Save. Saves the actual network Save &As... Ctrl+Shift+S Saves the actual network under a new filename Save As Saves the actual network under a new filename &BMP... Export network to a BMP image Export BMP Export network to a BMP image &PNG... Export network to a PNG image Export PNG Export network to a PNG image &PDF... Export network to a PDF file Export PDF Export network to a PDF document &Adjacency Matrix Export network to an adjacency matrix file Export Sociomatrix Export network to a adjacency matrix-formatted file &Pajek Export network to a Pajek-formatted file Export Pajek Export network to a Pajek-formatted file &List Export network to a List-formatted file. Export List Export network to a List-formatted file &DL... Export network to a DL-formatted file Export DL Export network to a DL-formatted &GW... Export network to a GW-formatted file Export Export network to a GW formatted file &Close Closes the actual network Close Closes the actual network &Print Ctrl+P Prints whatever is viewable on the canvas. Printing This function prints whatever is viewable on the canvas. To print the whole network, you might want to zoom-out. E&xit Ctrl+Q Quits the application Exit Quits the application View Loaded File F5 Displays the loaded network file View Loaded File Displays the file of the loaded network View Adjacency Matrix F6 Displays the adjacency matrix of the active network View Network file Displays the adjacency matrix of the active network Erdos-Renyi G(n,p) Shift+U Creates a random network where each edge is included with a given probability Uniform Creates a random network of G(n, p) model by connecting nodes randomly. Each edge is included in the graph with equal probability p, independently of the other edges Connected Creates a connected random network Uniform Connected Creates a connected random network Ring Lattice Shift+L Creates a ring lattice random network Ring Lattice A ring lattice or a physicist's lattice is a graph with N nodes each connected to K neighbors, K / 2 on each side. Same Degree Creates a random network where all nodes have the same degree. Same Degree Creates a random network where all nodes have the same degree Gaussian Creates a Gaussian distributed random network Gaussian Creates a random network of Gaussian distribution Small World Shift+W Creates a random network with small world properties Small World A Small World, according to the Watts and Strogatz model, is a random network with short average path lengths and high clustering coefficient. Find Node Ctrl+F Finds and highlights a node by number or label. Press Ctrl+F again to undo. Find Node Finds a node with a given number or label and doubles its size. Ctrl+F again resizes back the node Add Node Ctrl+A Adds a node Add Node Adds a node to the network Remove Node Ctrl+Shift+A Removes a node Remove Node Removes a node from the network Change Label Changes the Label of a node Change Label Changes the label of a node Change Color Changes the color of a node Change Color Changes the Color of a node Change Size Changes the actual size of a node Change Size Changes the actual size of a node Change Value Changes the value of a node Change Value Changes the value of a node Change all Nodes Size This option lets you change the size of all nodes Nodes Size This option lets you change the size of all nodes Change all Nodes Shape This option lets you change the shape of all nodes Nodes Shape This option lets you change the shape of all nodes Change Node Shape to Box This option lets you change the shape of a node to a box Node as a box This option lets you change the shape of a node to a box Change Node Shape to Triangle Change Node Shape to Circle Change Node Shape to Diamond Change Node Shape to Ellipse Change all Numbers Size It lets you change the font size of the numbers of all nodes Numbers Size Changes the size of the numbers of all nodes Change all Labels Size You can change the font size of the labels of all nodes Labels Size Change the fontsize of the labels of all nodes Add Link Ctrl+L Adds a Link to a Node Add Link Adds a Link to the network Remove Ctrl+Shift+L Removes a Link Remove Link Removes a Link from the network Changes the Label of a Link Change Label Changes the label of a Link Changes the Color of a Link Change Color Changes the Color of a Link Change Weight Changes the Weight of a Link Change Value Changes the Weight of a Link Filter Nodes Filters Nodes of some value out of the network Filter Nodes Filters Nodes of some value out of the network. Filter Links Filters Links of some weight out of the network Filter Links Filters Link of some specific weight out of the network. Change Background Color Click to change the background color Background Changes background color Change all Nodes Colors Click to choose a new color for all nodes. All Nodes Changes all nodes color at once. Change all Numbers Colors Click to change the color of all numbers. Numbers Changes the color of all numbers. Change all Labels Colors Click to change the color of all node labels. Numbers Changes the color of all node labels. Change all Links Colors Click to change the color of all links. Background Changes all links color Transform Nodes to Links Transforms the network so that nodes become links and vice versa Transform Nodes LinksAct Transforms network so that nodes become links and vice versa Symmetrize Links Shift+R Makes all edges reciprocal (thus, a symmetric graph). Symmetrize Edges Transforms all arcs to double links (edges). The result is a symmetric network Strong Structural Nodes are assigned the same color if they have identical in and out neighborhoods Click this to colorize nodes; Nodes are assigned the same color if they have identical in and out neighborhoods Regular Nodes are assigned the same color if they have neighborhoods of the same set of colors Click this to colorize nodes; Nodes are assigned the same color if they have neighborhoods of the same set of colors Random Repositions the nodes in random places Random Layout Repositions the nodes in random places Random Circle Repositions the nodes randomly on a circle Random Circle Layout Repositions the nodes randomly on a circle In-Degree Ctrl+1 Repositions the nodes on circles of different radius. More In-Degree Central Nodes are positioned towards the centre. Circle In-Degree Centrality Layout Repositions the nodes on circles of different radius. More In-Degree Central Nodes are positioned towards the centre. Out-Degree Ctrl+2 Repositions the nodes on circles of different radius. More Out-Degree Central Nodes are positioned towards the centre. Circle Out-Degree Centrality Layout Repositions the nodes on circles of different radius. More Out-Degree Central Nodes are positioned towards the centre. Closeness Ctrl+3 Repositions the nodes on circles of different radius. More Closeness Central Nodes are positioned towards the centre. Circle Closeness Centrality Layout Repositions the nodes on circles of different radius. More Closeness Central Nodes are positioned towards the centre. Betweeness Ctrl+4 Repositions the nodes on circles of different radius. More Betweeness Central Nodes are positioned towards the centre. Circle Betweeness Centrality Layout Repositions the nodes on circles of different radius. More Betweeness Central Nodes are positioned towards the centre. Informational Ctrl+5 Repositions the nodes on circles of different radius. More Informational Central Nodes are situated towards the centre. Circle Informational Centrality Layout Repositions the nodes on circles of different radius. More Informational Central Nodes are positioned towards the centre. Stress Ctrl+6 Repositions the nodes on circles of different radius. More Stressed Central Nodes are positioned towards the centre. Circle Stress Centrality Layout Repositions the nodes on circles of different radius. Nodes having greater Stress Centrality are situated towards the centre. Graph Ctrl+7 Repositions the nodes on circles of different radius. More Graphed Central Nodes are positioned towards the centre. Circle Graph Centrality Layout Repositions the nodes on circles of different radius. Nodes having greater Graph Centrality are situated towards the centre. Eccentricity Ctrl+8 Repositions the nodes on circles of different radius. Nodes of large eccentricity are positioned towards the centre. Circle Eccentricity Centrality Layout Repositions the nodes on circles of different radius. Nodes having greater Eccentricity Centrality are situated towards the centre. Remove Layout GuideLines Removes Red GuideLines from the canvas. Remove GuideLines Removes any guidelines (circles or horizontal lines) created for the network layout. Ctrl+Shift+1 Repositions the nodes on levels of different height. More In-Degree Central Nodes are situated on higher levels. Level In-Degree Centrality Layout Repositions the nodes on levels of different height. More In-Degree Central Nodes are situated on higher levels. Ctrl+Shift+2 Repositions the nodes on levels of different height. More Out-Degree Central Nodes are situated on higher levels. Level Out-Degree Centrality Layout Repositions the nodes on levels of different height. More Out-Degree Central Nodes are situated on higher levels. Ctrl+Shift+3 Repositions the nodes on levels of different height. More Closeness Central Nodes are situated on higher levels. level Closeness Centrality Layout Repositions the nodes on levels of different height. More Closeness Central Nodes are situated on higher levels. Ctrl+Shift+4 Repositions the nodes on levels of different height. More Betweeness Central Nodes are situated on higher levels. level Betweeness Centrality Layout Repositions the nodes on levels of different height. More Betweeness Central Nodes are situated on higher levels. Ctrl+Shift+5 Repositions the nodes on levels of different height. More Informational Central Nodes are situated on higher levels. Level Informational Centrality Layout Repositions the nodes on levels of different height. More Informational Central Nodes are situated on higher levels. Spring Embedder Alt+1 All nodes repel each other while the connected ones are attracted as if connected by springs. Spring Embedder Layout In this model, nodes are regarded as physical bodies (i.e. electrons) which exert repelling forces to each other, while edges are springs connecting adjacents nodes. Non-adjacent nodes repel each other while connected nodes are The algorithm continues until the system retains an equilibrium state in which all forces cancel each other. Fruchterman-Reingold Alt+2 Repelling forces between all nodes, and attracting forces between adjacent nodes. Fruchterman-Reingold Layout Embeds a layout all nodes according to a model in which repelling forces are used between every pair of nodes, while attracting forces are used only between adjacent nodes. The algorithm continues until the system retains its equilibrium state where all forces cancel each other. Zoom &in Ctrl++ Zoom in (Ctrl++) Zooms inside the actual network. Zoom In. Zooms in. What else did you expect? Zoom &out Ctrl+- Zoom out (Ctrl+-) Zooms out of the actual network. Zoom out. Zooms out. What else did you expect? NodeSize = F (OutDegree) Alt+3 Resizes all nodes according to their out edges. NodeSize = F (OutDegree) Adjusts the size of each node according to their out-edges (OutDegree). The more out-likned a node is, the bigger will appear... NodeSize = F (InDegree) Alt+4 Resizes all nodes according to their in edges. NodeSize = F (InDegree) This method adjusts the size of each node according to their in-edges (InDegree). The more in-linked a node is, the bigger will appear... Network Symmetry Shift+S Tests if the network is symmetric or not Network Symmetry A network is symmetric when all edges are reciprocal, or, in mathematical language, when the adjacency matrix is symmetric. Graph Distance Ctrl+G Calculates the length of the shortest path between two nodes... Graph Distance The graph distance (or geodesic distance) of two nodes is the length (number of edges) of the shortest path between them. Distance &Matrix Ctrl+M Displays the matrix of graph distances between all nodes Distance Matrix A distance matrix is a NxN matrix, where the (i,j) element is the graph distance from node i to node j. Diameter Ctrl+D Calculates and displays the diameter of the network. Diameter The Diameter of a network is the maximum graph distance (maximum shortest path length) between any two nodes of the network. Average Graph Distance Ctrl+B Calculates and displays the average shortest path length. Average Graph Distance This the average length of all shortest paths between the connected pair of nodes of the network. Clustering Coefficient Ctrl+C Calculates and displays the average Clustering Coefficient of the network. Clustering Coefficient The Clustering Coefficient of a vertex quantifies how close the vertex and its neighbors are to being a clique. OutDegree Calculates and displays OutDegree Centralities OutDegree Centrality For each node k, this is the number of arcs starting from it. This is oftenly a measure of activity. InDegree Calculates and displays InDegree Centralities InDegree Centrality For each node k, this the number of arcs ending at k. Most in-degree central node might be considered more prominent among others. Calculates and displays Closeness Centralities Closeness Centrality For each node k, this the invert sum of the shortest distances between k and every other node. It is interpreted as the ability to access information through the "grapevine" of network members. Calculates and displays Betweeness Centralities Betweeness Centrality For each node k, this is the ratio of all geodesics between pairs of nodes which run through k. It reflects how often an node lies on the geodesics between the other nodes of the network. It can be interpreted as a measure of control. Calculates and displays Graph Centralities Graph Centrality For each node k, this is the invert of the maximum of all geodesic distances from k to all other nodes in the network. Nodes with high GC have short distances to all other nodes in the graph. Calculate and display Stress Centrality Stress Centrality For each node k, this is the total number of geodesics between all other nodes which run through k. When one node falls on all other geodesics between all the remaining (N-1) nodes, then we have a star graph with maximum Stress Centrality Calculate and display Eccentricity Centrality Stress Centrality For each node k, this is the largest geodesic distance (k,t) from every other vertex t. Therefore, EC(u) reflects how far, at most, is each node from every other node. Calculate and display Informational Centrality Informational Centrality Calculate and display Informational Centrality Display Num&bers Toggles displaying of node numbers Display Numbers Enables/disables node numbers Display Labels Toggles displaying of node labels Display Labels Enables/disables node labels Display Links Toggle to display or not links Display Links Click to enable or disable displaying of links Display Weight Numbers Toggles displaying of numbers of links weights Display Weight Numbers Click to enable or disable displaying numbers of links weight Display Arrows Toggles displaying of arrows in the end of links Display Arrows Click to enable or disable displaying of arrows in the end of links Thickness=Weight Draws links as thick as their weights (if specified) Draw As Thick As Weights Click to toggle having all links as thick as their weight (if specified) Bezier Curves Draws links as Bezier curves Links Bezier Enables/Disables drawing Links as Bezier curves. Anti-Aliasing F8 Enables/disables anti-aliasing Enable or disable Anti-Aliasing Anti-aliasing is a technique which makes nodes, lines and text, smoother and fancier. But it comes at the cost of speed... Progress Bars F10 Enables/disables Progress Bars Enable or disable Progress Bars Progress Bars may appear during time-cost operations. Enabling progressBar has a significant cpu cost but lets you know about the progress of a given operation. Debug Messages F9 Enables/disables printing debug messages to stdout Enables or disable Debug Messages Printing debug messages to strerr. Enabling has a significant cpu cost but lets you know what SocNetV is actually doing. Toolbar Enables/disables the toolbar Enable or disable Toolbar The toolbar is the widget right below the menu, and carries useful icons. You can disable it if you like... Statusbar Enables/disables the statusbar Enable or disable Statusbar The statusbar is the widget at the bottom of the window, where messages appear. You might want to disable it... Manual F1 Read the manual... Manual Displays the documentation of SocNetV Tip of the Day Read useful tips Quick Tips Displays some useful and quick tips About SocNetV About Basic information about SocNetV About Qt About About Qt &Network Create Random Network Export... &Edit Node... Link... Filter... Colors &Layout In circles by centrality... In levels by centrality... Physical... &Statistics Centralities &Options Nodes Links &View &Help 25% 50% 75% 100% 125% 150% 175% Rotation: &Add Node Add a new node to the network (Ctrl+A). Alternately, you can create a new node in a specific position by double-clicking on that spot of the canvas. &Remove Node Remove a node from the network (Ctrl+Shift+A). Alternately, you can remove a node by right-clicking on it. Add &Link Add a new link to the network (Ctrl+L). Alternately, you can create a new link between two nodes by middle-clicking on them consequetively. Remove Link Remove a link from the network Alternately, you can remove a link by right-clicking on it. Edit Network Edit Total Nodes Total Links Counts how many nodes (vertices) exist in the whole network. Counts how many links (in and out) exist in the whole network. Density The density of a network is the ratio of existing links to all possible links (n(n-1)) between nodes. OutLinked Nodes: This the number of nodes with outLinks to another node. They may also have inLinks or reciprocal links. Meaningful on directed graphs. InLinked Nodes: This the number of nodes with inLinks from another node. These may also have outLinks or reciprocal links. Meaningful on directed graphs. Reciprocal-Linked: This the number of nodes with reciprocal links, namely, both inLinks and outLinks to another node. Active Node Node Number: This is the number of the last selected node. Node In-Degree: This is the number of edges ending at the node you clicked on. Node Out-Degree: This is the number of edges starting from the node you clicked on. Clustering Coef. The Clustering Coefficient quantifies how close the vertex and its neighbors are to being a clique. The proportion of links between the vertices within the neighbourhood of the clicked vertex, divided by the number of links that could possibly exist between them. Network Statistics Embeds a spring-gravitational model on the network, where each node is regarded as physical object reppeling all other nodes, while springs between connected nodes attact them. The result is constant movement. This is a very SLOW process on networks with N > 100! In Fruchterman-Reingold model, the vertices behave as atomic particles or celestial bodies, exerting attractive and repulsive forces to each other. Again, only vertices that are neighbours attract each other but, unlike Spring Embedder, all vertices repel each other. Kamanda-Kwei ! If you enable this, all nodes will be resized so that their size reflect their out-degree (the amount of links from them). To put it simply, more out-linked nodes will be bigger... If you enable this, all nodes will be resized so that their size reflect their in-degree (the amount of links to them from other nodes). To put it simply, more in-linked nodes will be bigger... Layout Ready. Social Network Visualiser Ready Do you want to save the changes to the network file? Yes No Cancel Choose a network file... Select one file to open All (*);;GraphML (*.graphml *.gml);;GraphViz (*.dot);;Adjacency (*.txt *.csv *.net);;Pajek (*.net *.pajek);;DL (*.dl *.net) Loaded network: Error loading requested file. Aborted. Opening aborted Saving file... No network loaded. Do you want to save this network in Pajek-formatted or SocioMatrix - formatted file? Pajek Sociomatrix Network saved under filename: . Saving network under new filename... Saving aborted Closing file... Network has not been saved. Do you want to save before closing it? Erasing old network data.... Printing... Pajek formatted network, named %1, loaded with %2 Nodes and %3 total Links. Adjacency formatted network, named %1, loaded with %2 Nodes and %3 total Links. Dot formatted network, named %1, loaded with %2 Nodes and %3 total Links. GraphML formatted network, named %1, loaded with %2 Nodes and %3 total Links. DL-formatted network, named %1, loaded with %2 Nodes and %3 total Links. New node (numbered %1) added. The canvas is empty! Load a network file or create a new network first. Cannot export PNG. Save Image Files (*.png) Image Saved as: Exporting completed Nothing to export! Load a network file or create a new network first. Cannot export BMP. Save Image as Image Files (*.bmp) Export to BMP... Cannot export PDF. Export to PDF Portable Document Format files (*.pdf) Export to PDF... File saved as: Cannot export to Pajek. Could not write to %1 File %1 saved Nothing to export! Load a network file or create a new network first. Cannot export to Adjacency Matrix. Note that exporting to an adjacency matrix does not save floating-point weight values; adjacency matrices consist of integers, only. If your network had any floating point weights in some edges, these are being truncated to the nearest integer or 1.) Adjacency matrix-formatted network saved into file %1 Cannot export to DL. Cannot export to GW. Viewing network file - Loaded network text file Network not saved yet. I will open a dialog for you to save it now. Network has been modified. Please save it now. Empty network! Load a network file first or create and save a new one... Nothing here. Not my fault, though! Empty network! Load a network file or create something by double-clicking on the canvas! Nothing to show! creating adjacency adjacency matrix of %1 nodes View Adjacency Matrix - This will create a new random symmetric network of G(n,p) model, where n is the nodes and p is the edge probability. Please enter the number n of nodes you want: Creating random network. Please wait... Random network created. Nodes: Edges: Average path length: Clustering coefficient: On the average, edges should be This graph is almost surely connected because: probability > ln(n)/n, that is: bigger than This graph is almost surely not connected because: probability < ln(n)/n, that is: Creating uniform random network. Please wait... This will create a same degree network. Please enter the number of nodes you want: Sorry. I cannot create such a network. Links must be even number This will create a small world network, that is an undirected graph with N nodes and N*d/2 edges, where d is the mean edge degree. Please enter the number N of nodes you want: Now, enter an even number d. This is the mean edge degree each new node will have: Now, enter a parameter beta. This is the edge rewiring probability: Erasing any existing network. Creating small world. Please wait... Creating random network. Please wait (or disable me from Options > View > ProgressBar, next time ). Small world random network created: Small world network created. This will create a ring lattice network, where each node has degree d: d/2 edges to the right and d/2 to the left. Please enter the number of nodes you want: Ring lattice network created. No nodes present! Load a network file first or create some nodes... OK Nothing to find! Enter node label or number: Node found! Sorry. There is no such node in this network. Try again. Options (%1, %2); Node %3, with label %4, has %5 in-Links and %6 out-Links. Link from Node %1 to Node %2, has weight %3 and color %4. Link between node %1 and node %2, weight %3 and color %4. Nothing to do! Load a network file or add some nodes first. Nothing to remove. Choose a node to remove between ( Node removed completely. Ready. Nothing to link to! Create some nodes first. There are no nodes yet... This will draw a new link between two nodes. Enter source node ( Aborting. Source node accepted. Now enter target node ( Source and target nodes accepted. Please, enter the weight of new link: Ready. No links present! Load a network file or create a new network first. No links to remove - sorry. Remove link Source node: ( Target node: ( There is no such link. This link is reciprocal. Select what Direction to delete or Both... Both There are no nodes! Load a network file or create a new network first. No nodes created. Please click on a node first... Enter new node label: Changed label to %1. Ready. No label text. Abort. No nodes... Select node: ( Error. There is no such link. Change node color aborted. Cannot change nothing. Change node size to: (1-16) No links here! Load a network file or create a new network first. No links present... Select link source node: ( Select link target node: ( Change link color cancelled. User abort. There are no links here! Load a network file or create a new network first. New link Weight: input error. Abort. Change link weight Select what Direction to change or Both... New link weight: Change link weight cancelled. Weight not changed. Sorry. Nothing to filter! Load a network file or create a new network. Then ask me to compute something! Nothing to filter! All links are reciprocal. Your network is symmetric... There are node nodes yet! Load a network file or create a new network first. Then we can talk about layouts! I am really sorry. You must really load a file first... Embedding a spring-gravitational model on the network.... Click on the checkbox "Spring-Embedder" to stop movement! Movement stopped! There are no nodes yet! Load a network file or create a new network first. Then we can talk about layouts! Embedding a repelling-attracting forces model on the network.... Click on the checkbox "Fruchterman-Reingold" to stop movement! Wake up! Load a network file or create a new network first. Then we can talk about layouts! Embedding node size model on the network.... You must be dreaming! Load a network file or create a new network first. Then we can talk about layouts! Sorry, I can't follow! Load a network file or create a new network first. Then we can talk about layouts! Nothing to layout! Are you dreaming? Calculating new nodes positions. Please wait... Nodes in inner circles have greater In-Degree Centrality. Load a network file or create a new network first! Nodes in inner circles have greater Out-Degree Centrality. Sorry, there are no nodes yet! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Closeness Centrality. No nodes yet! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Betweeness Centrality. Nothing to do! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Stress Centrality. Nothing to do here! Load a network file or create a new network first. Then we can talk about layouts! Nodes in inner circles have greater Graph Centrality. Nodes in inner circles have greater Eccentricity Centrality. Nodes in upper levels have greater In-Degree Centrality. Load a network file or create a new network first. Then we can talk about layouts! Nodes in upper levels have greater Out-Degree Centrality. Nodes in upper levels have greater Closeness Centrality. Nodes in upper levels have greater Betweeness Centrality. There are no nodes! Load a network file or create a new network. Then ask me to compute something! There is no network! Adjacency matrix symmetry = YES Adjacency matrix symmetry = NO There are no nodes. Nothing to do... Distance between two nodes Select source node: ( Select target node: ( Distance calculation operation cancelled. Distance Network distance ( The nodes are connected. The nodes are not connected. There are no nodes nor links! Load a network file or create a new network. Then ask me to compute something! Nothing to do! Creating distance matrix. Please wait... Matrix of sigmas Matrix of distances Cannot find the diameter of nothing... Diameter calculated. Ready. Average distance calculated. Ready. Window resized to (%1, %2) pixels. Nothing to do! Load a network file or create a new network. Then ask me to compute something! No network here. Sorry. Nothing to do. CLUSTERING COEFFICIENT REPORT Created: CLUSTERING COEFFICIENT (CLC) OF EACH NODE CLC range: 0 < C < 1 Range: 0 < GCLC < 1 GCLC = 0, when there are no cliques (i.e. acyclic tree). GCLC = 1, when every node and its neighborhood are complete cliques. Take weights into account (Default: No)? OUT-DEGREE CENTRALITY REPORT OUT-DEGREE CENTRALITIES (ODC) OF EACH NODE ODC range: 0 < C < ODC' range: 0 < C'< 1 GODC range: 0 < GODC < 1 GODC = 0, when all in-degrees are equal (i.e. regular lattice). GODC = 1, when one node completely dominates or overshadows the other nodes. The degree of the node is a measure of the 'activity' of the node it represents Nothing to do! Load a network file or create a new network. Then ask me to compute something! Nothing to do... IN-DEGREE CENTRALITY REPORT IN-DEGREE CENTRALITIES (IDC) OF EACH NODE IDC range: 0 < C < IDC' range: 0 < C'< 1 GIDC range: 0 < GIDC < 1 GIDC = 0, when all in-degrees are equal (i.e. regular lattice). GIDC = 1, when one node is linked from every other node. The in-degree of the node is a measure of the 'activity' of the node it represents CLOSENESS - CENTRALITY REPORT CLOSENESS CENTRALITY (CC) OF EACH NODE CC(u) is the invert sum of the distances of node u from all other nodes. CC' is the standardized CC CC range: 0 < C < CC' range: 0 < C'< 1 All nodes have the same CC value. Node has the maximum ACC value (std): has the minimum ACC value (std): There are different Closeness Centrality classes. GROUP CLOSENESS CENTRALISATION (GCC) GCC = GCC range: 0 < GCC < 1 GCC = 0, when the lengths of the geodesics are all equal (i.e. a complete or a circle graph). GCC = 1, when one node has geodesics of length 1 to all the other nodes, and the other nodes have geodesics of length 2 to the remaining (N-2) nodes. This is exactly the situation realised by a star graph. This measure focuses on how close a node is to all the other nodes in the set of nodes. The idea is that a node is central if it can quickly interact with all others Nothing to do... Please wait... Finished with shortest-path distances... BETWEENESS - CENTRALITY REPORT BETWEENESS CENTRALITY (BC) OF EACH NODE BC of a node u is the sum of delta (s,t,u) for all s,t in V Delta(s,t,u) is the ratio of all geodesics between s and t which run through u. Therefore, BC(u) reflects how often the node u lies on the geodesics between the other nodes of the network BC' is the standardized BC BC range: 0 < BC < (Number of pairs of nodes excluding i) BC' range: 0 < BC'< 1 (C' is 1 when the node falls on all geodesics) All nodes have the same BC value. Node has the maximum BC value: has the minimum BC value: different Betweeness Centrality classes. GROUP BETWEENESS CENTRALISATION (GBC) GBC = GBC range: 0 < GBC < 1 GBC = 0, when all the nodes have exactly the same betweeness index. GBC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. Nothing to do! Why dont you try creating something first? STRESS CENTRALITY REPORT STRESS CENTRALITY (SC) OF EACH NODE SC(u) is the sum of sigma(s,t,u): the number of geodesics from s to t through u. SC(u) reflects the total number of geodesics between all other nodes which run through u SC range: 0 < SC < SC' range: 0 < SC'< 1 (SC'=1 when the node falls on all geodesics) All nodes have the same SC value. has the maximum SC value: has the minimum SC value: different Stress Centrality classes. GROUP STRESS CENTRALISATION (GSC) GSC = GSC range: 0 < GSC < 1 GSC = 0, when all the nodes have exactly the same stress index. GSC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. Try creating a network first. Then I compute whatever you want... GRAPH - CENTRALITY REPORT GRAPH CENTRALITY (GC) OF EACH NODE GC range: 0 < GC < GC' range: 0 < GC'< 1 (GC'=1 => directly linked with all nodes) All nodes have the same GC value. has the maximum GC value: has the minimum GC value: different Graph Centrality classes. GROUP GRAPH CENTRALISATION (GGC) GGC = GGC range: 0 < GGC < 1 GGC = 0, when all the nodes have exactly the same graph index. GGC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. ECCENTRICITY- CENTRALITY REPORT ECCENTRICITY CENTRALITY (EC) OF EACH NODE EC of a node u is the largest geodesic distance (u,t) for t in V Therefore, EC(u) reflects how far, at most, is each node from every other node. EC' is the standardized EC EC range: 0 < EC < (max geodesic distance) EC' range: 0 < EC'< 1 All nodes have the same EC value. has the maximum EC value: has the minimum EC value: different eccentricity Centrality classes. GROUP ECCENTRICITY CENTRALISATION (GEC) GEC = GEC range: 0 < GEC < 1 GEC = 0, when all the nodes have exactly the same betweeness index. GEC = 1, when one node falls on all other geodesics between all the remaining (N-1) nodes. This is exactly the situation realised by a star graph. Eccentricity Centralities saved as: There are no nodes! Load a network file or create a new network. Errr...no nodes here. Sorry! Toggle Nodes Numbers. Please wait... Node Numbers are invisible now. Click the same option again to display them. Node Labels are visible again... There are no nodes! Load a network file or create a new network first. No nodes found. Sorry... Toggle Nodes Labels. Please wait... Node Labels are invisible now. Click the same option again to display them. Select new size for all nodes: (1-16) All shapes have been changed. Ready Change node shapes aborted... Change all nodenumbers size to: (1-16) Change font size: Aborted. Changed numbers size. Ready. There are no links! Load a network file or create a new network first. No nodes or edges found. Sorry... Toggle Edges Weights. Please wait... Edge weights are invisible now. Click the same option again to display them. Edge weights are visible again... There are no nodes nor links! Load a network file or create a new network first! No links found... Toggle Edges Arrows. Please wait... Links are invisible now. Click again the same menu to display them. Links visible again... There are no links! Load a network file or create a new network first! There are no links! Load a network file or create a new network! There are NO links here! Toggle links bezier. Please wait... Change link color aborted. Numbers' colors changed. Ready. Label colors changed. Ready. Toggle anti-aliasing. This will take some time if the network is large (>500)... Anti-aliasing off. Anti-aliasing on. Toggle progressbar... Progress bars off. Progress bars on. Debug messages off. Debug messages on. Toggle toolbar... Toolbar off. Toolbar on. Toggle statusbar... Status bar off. Status bar on. Tip Of The Day You can add a new node by double-clicking on the scene. You can add a new node by clicking on Add button. You can remove a node by clicking on Remove button. You can rotate the network by selecting a new angle on the dock. You can add a new link between two nodes, by middle-clicking (or pressing both mouse buttons simultanesously) on the first and then on the second node. You can remove a node by right-clicking on it and selecting Remove. You can change background color (from the menu Edit > Colors). Nodes can have the colors of your choice. Just right-click on a node and then select > Options > Change Color. You can select every color supported by the X.org pallette. The tabs on the left dock show information about the network (nodes, edges, density, etc) as well as information about any node you clicked on (inDegrees, outDegrees, clustering). You can move a node easily by dragging it with your mouse. SocNetV can save the positions of the nodes in a network, if you save it in Pajek/GraphML format. You can apply layout algorithms on the network from the menu Layout or by clicking on the Dock > Layout tab checkboxes You can change the label of node by right-clicking on it, and selecting Options > Change Label. All basic operations of SocNetV are available from the dock on the left, or by right-clicking on a node or a link. Node information is displayed on the Status bar, when you left-click on it. Link information is displayed on the Status bar, when you left-click on it. Manual TextEditor &New Ctrl+N Create a new file &Open... Ctrl+O Open an existing file &Save Ctrl+S Save the document to disk Save &As... Save the document under a new name E&xit Ctrl+Q Exit the application Cu&t Ctrl+X Cut the current selection's contents to the clipboard &Copy Ctrl+C Copy the current selection's contents to the clipboard &Paste Ctrl+V Paste the clipboard's contents into the current selection &About Show the application's About box About &Qt Show the Qt library's About box &File &Edit &Help File Edit Ready TextEditor The document has been modified. Do you want to save your changes? Application Cannot read file %1: %2. File loaded Cannot write file %1: %2. File saved %1[*] - %2 socnetv-0.90/configure0000755000175000017500000045237711455077631015317 0ustar dimitrisdimitris#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67 for SocNetV 0.90. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: dimitris.kalamaras@gmail.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='SocNetV' PACKAGE_TARNAME='socnetv' PACKAGE_VERSION='0.90' PACKAGE_STRING='SocNetV 0.90' PACKAGE_BUGREPORT='dimitris.kalamaras@gmail.com' PACKAGE_URL='' ac_unique_file="src/mainwindow.cpp" ac_default_prefix=/usr/local ac_subst_vars='LTLIBOBJS LIBOBJS ac_incpath ac_uic ac_moc ac_qmake ac_cflags EGREP GREP CXXCPP ac_ct_CXX CXXFLAGS CXX CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_debug ac_prefix target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_debug enable_sse with_qt ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures SocNetV 0.90 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/socnetv] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of SocNetV 0.90:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug enable debugging (default=no) --enable-sse enable SSE optimization (default=yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-qt=PATH use alternate Qt install path Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF SocNetV configure 0.90 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_cxx_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by SocNetV $as_me 0.90, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile socnetv.pro socnetv.spec socnetv.desktop" # Set default installation prefix. ac_prefix=$prefix if test "x$ac_prefix" = "xNONE"; then ac_prefix=$ac_default_prefix fi cat >>confdefs.h <<_ACEOF #define CONFIG_PREFIX "$ac_prefix" _ACEOF # Enable debugging argument option. # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; ac_debug="$enableval" fi if test "x$ac_debug" = "xyes"; then $as_echo "#define CONFIG_DEBUG 1" >>confdefs.h ac_debug="debug" else ac_debug="release" fi # Enable SSE optimization. # Check whether --enable-sse was given. if test "${enable_sse+set}" = set; then : enableval=$enable_sse; ac_sse="$enableval" else ac_sse="yes" fi # Standard installation base dirs. ac_with_paths="/usr /usr/local" # Some a-la-debian alternatives... for X in /usr/lib /usr/share; do for Y in qt qt4; do if test -d $X/$Y/bin; then ac_with_paths="$ac_with_paths $X/$Y" fi done done # Set for alternate Qt installation dir. # Check whether --with-qt was given. if test "${with_qt+set}" = set; then : withval=$with_qt; ac_with_paths="$ac_with_paths $withval" fi # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi # Checks for languages. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Prepend alternate dependencies paths. ac_path=$PATH for X in $ac_with_paths; do if test -d $X/bin; then ac_path="$X/bin:$ac_path" fi if test -x $X/qmake; then ac_path="$X:$ac_path" fi if test -d $X/include; then for Y in qt qt4; do if test -d $X/include/$Y; then CFLAGS="-I$X/include/$Y $CFLAGS" CPPFLAGS="-I$X/include/$Y $CPPFLAGS" ac_incpath="$X/include/$Y $ac_incpath" fi done CFLAGS="-I$X/include $CFLAGS" CPPFLAGS="-I$X/include $CPPFLAGS" ac_incpath="$X/include $ac_incpath" fi if test -d $X/lib64; then LIBS="-L$X/lib64 $LIBS" ac_libs="-L$X/lib64 $ac_libs" fi if test -d $X/lib; then LIBS="-L$X/lib $LIBS" ac_libs="-L$X/lib $ac_libs" fi done # Check for proper Qt version. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt library version >= 4.4" >&5 $as_echo_n "checking for Qt library version >= 4.4... " >&6; } if test "${ac_qtlib_version+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "Qt/qglobal.h" int main () { #if QT_VERSION < 0x040400 #error Qt library 4.4 or greater required. #endif ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_qtlib_version="yes" else echo "no; Qt 4.4 or greater is required" exit 1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_qtlib_version" >&5 $as_echo "$ac_qtlib_version" >&6; } # Check for IEEE 32bit float optimizations. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IEEE 32bit float optimizations" >&5 $as_echo_n "checking for IEEE 32bit float optimizations... " >&6; } if test "${ac_float32+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5 ; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main() { return (sizeof(float) == 4 ? 0 : 1); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_float32="yes" else ac_float32="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_float32" >&5 $as_echo "$ac_float32" >&6; } if test "x$ac_float32" = "xyes"; then $as_echo "#define CONFIG_FLOAT32 1" >>confdefs.h fi # Check for SSE optimization. if test "x$ac_sse" = "xyes"; then ac_sse_cflags="-msse -mfpmath=sse -ffast-math" CFLAGS="$ac_sse_cflags $CFLAGS" CPPFLAGS="$ac_sse_cflags $CPPFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE optimization" >&5 $as_echo_n "checking for SSE optimization... " >&6; } if test "${ac_sse_check+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5 ; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !defined(__SSE__) #error SSE optimization disabled. #endif int main() { unsigned int a, b, c, d; __asm__ __volatile__ ("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (1)); return ((d & (1 << 25)) ? 0 : 1); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_sse_check="yes" else ac_sse_check="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_sse_check" >&5 $as_echo "$ac_sse_check" >&6; } ac_sse=$ac_sse_check if test "x$ac_sse" = "xyes"; then ac_cflags="$ac_sse_cflags $ac_cflags" fi fi # A common error message: ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel)." # Check for Qt qmake utility. # Extract the first word of "qmake", so it can be a program name with args. set dummy qmake; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_qmake+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_qmake in [\\/]* | ?:[\\/]*) ac_cv_path_ac_qmake="$ac_qmake" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ac_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_qmake="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_qmake" && ac_cv_path_ac_qmake="no" ;; esac fi ac_qmake=$ac_cv_path_ac_qmake if test -n "$ac_qmake"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_qmake" >&5 $as_echo "$ac_qmake" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_qmake" = "xno"; then as_fn_error $? "qmake $ac_errmsg" "$LINENO" 5 fi # Check for Qt moc utility. # Extract the first word of "moc", so it can be a program name with args. set dummy moc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_moc+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_moc in [\\/]* | ?:[\\/]*) ac_cv_path_ac_moc="$ac_moc" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ac_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_moc="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_moc" && ac_cv_path_ac_moc="no" ;; esac fi ac_moc=$ac_cv_path_ac_moc if test -n "$ac_moc"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_moc" >&5 $as_echo "$ac_moc" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_moc" = "xno"; then as_fn_error $? "moc $ac_errmsg" "$LINENO" 5 fi # Check for Qt uic utility. # Extract the first word of "uic", so it can be a program name with args. set dummy uic; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_uic+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_uic in [\\/]* | ?:[\\/]*) ac_cv_path_ac_uic="$ac_uic" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ac_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_uic="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_uic" && ac_cv_path_ac_uic="no" ;; esac fi ac_uic=$ac_cv_path_ac_uic if test -n "$ac_uic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_uic" >&5 $as_echo "$ac_uic" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_uic" = "xno"; then as_fn_error $? "uic $ac_errmsg" "$LINENO" 5 fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } if test "${ac_cv_lib_m_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_m_main=yes else ac_cv_lib_m_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } if test "x$ac_cv_lib_m_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lX11" >&5 $as_echo_n "checking for main in -lX11... " >&6; } if test "${ac_cv_lib_X11_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_X11_main=yes else ac_cv_lib_X11_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_main" >&5 $as_echo "$ac_cv_lib_X11_main" >&6; } if test "x$ac_cv_lib_X11_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBX11 1 _ACEOF LIBS="-lX11 $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXext" >&5 $as_echo_n "checking for main in -lXext... " >&6; } if test "${ac_cv_lib_Xext_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_Xext_main=yes else ac_cv_lib_Xext_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_main" >&5 $as_echo "$ac_cv_lib_Xext_main" >&6; } if test "x$ac_cv_lib_Xext_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXEXT 1 _ACEOF LIBS="-lXext $LIBS" fi # Checks for header files. #AC_HEADER_STDC #AC_HEADER_SYS_WAIT #AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/stat.h unistd.h signal.h) # Checks for typedefs, structures, and compiler characteristics. # AC_C_CONST # Checks for library functions. for ac_func in system do : ac_fn_cxx_check_func "$LINENO" "system" "ac_cv_func_system" if test "x$ac_cv_func_system" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYSTEM 1 _ACEOF fi done # Finally produce a configure header file and the makefiles. cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by SocNetV $as_me 0.90, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ SocNetV config.status 0.90 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "socnetv.pro") CONFIG_FILES="$CONFIG_FILES socnetv.pro" ;; "socnetv.spec") CONFIG_FILES="$CONFIG_FILES socnetv.spec" ;; "socnetv.desktop") CONFIG_FILES="$CONFIG_FILES socnetv.desktop" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # make clean > /dev/null 2>&1 # Output summary message echo echo " $PACKAGE_NAME $PACKAGE_VERSION" echo echo " Build target . . . . . . . . . . . . . . . . . . .: $ac_debug" echo echo " IEEE 32bit float optimizations . . . . . . . . . .: $ac_float32" echo " SSE optimization support (x86) . . . . . . . . . .: $ac_sse" echo echo " Install prefix . . . . . . . . . . . . . . . . . .: $ac_prefix" echo echo "Now type 'make', followed by 'make install' as root." echo socnetv-0.90/TODO0000755000175000017500000000137711321564652014065 0ustar dimitrisdimitrisKNOWN BUGS ========== 1: Negative weights break centralities 2: UCINET (DL) files in nodelist1 format (one-mode) are not supported. 3: isSymmetric() not 100% (check a-symmetry.net) 4: Some Graphviz (dot) files do not load. See test2.dot. Cant read when one line and nodes dont appear... 5: GROUP Stress & Graph centralities missing 6: Standard Stress Centrality index missing. 7: SocNetV cannot load GraphML files with node labels which contain the & character. OLD, NOT EASILY FIXED BUT NOT CRITICAL BUGS =========================================== 101: When many lines intersect, right-click > removeLink may remove wrong link! TODO ==== To request a feature and/or see the TODO list of SocNetV, visit : https://blueprints.launchpad.net/socnetv socnetv-0.90/README0000755000175000017500000000717611321314011014236 0ustar dimitrisdimitrisSocNetV -A Social Networks Visualizer ------------------------------------- 1. Overview ----------- Social Networks Visualizer (SocNetV) is a graphical and flexible application, which allows you to draw and visualize social networks (think mathematical graphs) and compute network statistics, i.e. distances, centralities, diameter etc. Various network file formats are supported, such as GraphML, Adjacency, Pajek, and GraphViz. You can modify an existing network, draw a new network using your mouse or have SocNetV create random networks for you. Furthermore, SocNetV can crawl an internet website for you and create the network of its outLinks. 2. Availability & License ------------------------- Official Website: http://socnetv.sourceforge.net Author: Dimitris V. Kalamaras My Blog: http://dimitris.apeiro.gr SocNetV is a cross-platform application, developed in Qt4/C++. This means you can compile and run in on Linux, Mac and Windows. SocNetV is Free Software, distributed under the General Public Licence Version 3 (see the COPYING file for details). The application is not a "finished" product. Therefore, there is no warranty of efficiency, correctness or usability. Nevertheless, we are looking forward to help you if you have any problem. See section 6 (bug reporting) below. 3. Installation --------------- You can install SocNetV by: a) compiling it from source or b) using binary packages. In either case, you need Qt toolkit version 4.4+ . See: http://qt.nokia.com/products Most Linux Distros have Qt installed by default. Windows users need to download and install Qt from here: http://qt.nokia.com/products/platform/qt-for-windows Please note that SocNetV uses QtWebKit to display online help. QtWebKit has been added to Qt from version 4.4, which means you can't compile SocNetV in distros with older releases of Qt. a) Compile from Source Code To compile from source code, download the tarball archive with the source code of SocNetV (you probably already have this :P). Then, untar (decompress) the archive using a command like this: tar zxfv SocNetV-v0.XX.tar.gz Then enter the new directory and compile with these commands: cd socnetv-0.XX ./configure make Now you can install it using: su -c 'make install' or sudo make install If everything is ok, then you can run SocNetV by entering: ./socnetv b) Install a binary package (Linux/Mac/Windows) To install SocNetV from a binary package or an executable for Windows, check http://socnetv.sourceforge.net and see if there is a package for your operating system. You can find versions for Mac on the Internet, although these are not supported. See: http://pdb.finkproject.org/pdb/package.php/socnetv-mac 4. Command Line Options ----------------------- SocNetV is primarily a GUI program. Nevertheless, some command line options are available. Type: 1) ./socnetv filename.net to start snv with network named filename.net loaded. 2) ./socnetv -v to print version of snv and exit. 3) ./socnetv -d to enable debugging mode, in which snv prints comprehensive messages about what it is doing. 5. Usage -------- For usage documentation, see online help. Or, when running SocNetV, press F1 to display the SocNetV Manual. There are some example networks inside the /usr/local/doc/socnetv/net folder. Just press Ctrl+O, go there and choose one file. 6. Bug reporting ---------------- Please, file any bug reports in our bug tracker: https://bugs.launchpad.net/socnetv/+filebug 7. Note to packagers -------------------- Packagers: please note that the SocNetV manual is copied to $(DESTDIR)$(prefix)/doc/$(name)/manual