Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

GraphLayout.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2019 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010 * RCS INFORMATION:
00011 *
00012 *      $RCSfile: GraphLayout.h,v $
00013 *      $Author: johns $      $Locker:  $               $State: Exp $
00014 *      $Revision: 1.3 $         $Date: 2020/05/29 16:48:55 $
00015 *
00016 ***************************************************************************/
00024 #include "ResizeArray.h"
00025 
00026 class GraphLayout {
00027 private:
00028   ResizeArray<float> pos_x;    // vertex x coord
00029   ResizeArray<float> pos_y;    // vertex y coord
00030 
00031   ResizeArray<float> dsp_x;    // vertex x displacement
00032   ResizeArray<float> dsp_y;    // vertex y displacement
00033 
00034   ResizeArray<int> edges_v0;   // explicit edge list
00035   ResizeArray<int> edges_v1;   // explicit edge list
00036   ResizeArray<float> weights;  // explicit edge weights
00037 
00038   const float *weight_matrix;  // external N^2 weight matrix
00039 
00040 public:
00041   GraphLayout(int nverts, int nedges); // init size hints
00042   ~GraphLayout();   
00043 
00044   void add_edge(int v0, int v1, float weight);
00045   void add_weight_matrix(const float *weight_matrix);
00046 
00047   void init_positions_box();
00048   void init_positions_circle();
00049 
00050   void compute(int iters, float area, float kscale, 
00051                float tempscale, float distance_epsilon);
00052 
00053   void get_vertex_ptrs(int &numverts, const float * &px, const float * &py) {
00054     numverts = pos_x.num(); 
00055     px = &pos_x[0];
00056     py = &pos_y[0];
00057   }
00058 
00059 };
00060 
00061 
00062 

Generated on Fri Mar 29 02:45:20 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002