⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphics.h

📁 一个linux下的各种组播路由算法编程
💻 H
字号:
/*****************************************************************************
***            Project: GUI for a Computer Network Simulator               ***
***                      Author: Hussein F. Salama                         ***
***                       Date: September 9, 1994                          ***
***                            File: graphics.h                            ***
***   A C++ library of classes to represent network nodes, links, paths,   ***
***   .... etc graphically 
*****************************************************************************/

#ifndef GRAPHICS_H
#define GRAPHICS_H

#include <Xm/DrawingA.h>
#include <Xm/Xm.h>
#include <string.h>

#define SIDE 600

class graphics;

#include "node2.h"

class graphics {

   // Holds different graphic contexts and perfoms drawing functions

private:
      GC gcCopy;      //  graphics context for normal drawing
      GC gcThickCopy; //  graphics context for drawing thick lines
      Widget w;       //  the drawing area widget in which drawing occurs,
                      //  it is shared with class drawingArea.    
      void drawPoint(int x, int y, int size);
      void drawSquare(int x, int y, int size);
      void drawLine(int x1, int y1, int x2, int y2);
      void drawThickLine(int x1, int y1, int x2, int y2);
      void drawName(int x, int y, char* s);
      
      unsigned long foreground, background;

public:
      graphics() {};       //default initializer
      graphics(Widget da); //initialze the graphics contexts and set w
      void drawNode(Node *n, int status);
      void drawDestination(Node *n);
      void drawSource(Node *n, int j);
      void drawLink(Node *n1, Node *n2, double w12, double w21);
      void drawLink(Node *n1, Node *n2);
      void drawPath(Node *n1, Node *n2);
      void clearScreen();
}; // graphics end.

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -