Ejemplo n.º 1
0
void FMMMLayout :: update_low_level_options_due_to_high_level_options_settings()
{
  PageFormatType pf = pageFormat();
  double uel = unitEdgeLength();
  bool nip = newInitialPlacement();
  QualityVsSpeed qvs = qualityVersusSpeed();

  //update
  initialize_all_options();
  useHighLevelOptions(true);
  pageFormat(pf);
  unitEdgeLength(uel);
  newInitialPlacement(nip);
  qualityVersusSpeed(qvs);

  if(pageFormat() == pfSquare)
    pageRatio(1.0);
  else if(pageFormat() ==pfLandscape)
    pageRatio(1.4142);
  else //pageFormat() == pfPortrait
    pageRatio(0.7071);

  if(newInitialPlacement())
    initialPlacementForces(ipfRandomTime);
  else
    initialPlacementForces(ipfRandomRandIterNr);

  if(qualityVersusSpeed() == qvsGorgeousAndEfficient)
    {
      fixedIterations(60);
      fineTuningIterations(40);
      nmPrecision(6);
    }
  else if(qualityVersusSpeed() == qvsBeautifulAndFast)
    {
      fixedIterations(30);
      fineTuningIterations(20);
      nmPrecision(4);
    }
  else //qualityVersusSpeed() == qvsNiceAndIncredibleSpeed
    {
      fixedIterations(15);
      fineTuningIterations(10);
      nmPrecision(2);
    }
}
void FMMMLayout::call(GraphAttributes &GA, const EdgeArray<double> &edgeLength)
{
  const Graph &G = GA.constGraph();
  //tms t_total;//helping variable for time measure
  double t_total;
  NodeArray<NodeAttributes> A(G);       //stores the attributes of the nodes (given by L)
  EdgeArray<EdgeAttributes> E(G);       //stores the edge attributes of G
  Graph G_reduced;                      //stores a undirected simple and loopfree copy 
                                        //of G
  EdgeArray<EdgeAttributes> E_reduced;  //stores the edge attributes of G_reduced
  NodeArray<NodeAttributes> A_reduced;  //stores the node attributes of G_reduced 

  if(G.numberOfNodes() > 1)
    {
      GA.clearAllBends();//all are edges straight line
      if(useHighLevelOptions())
	update_low_level_options_due_to_high_level_options_settings();
      import_NodeAttributes(G,GA,A);
      import_EdgeAttributes(G,edgeLength,E);
      
      //times(&t_total);
	  usedTime(t_total);
      max_integer_position = pow(2.0,maxIntPosExponent());
      init_ind_ideal_edgelength(G,A,E);  
      make_simple_loopfree(G,A,E,G_reduced,A_reduced,E_reduced);
      call_DIVIDE_ET_IMPERA_step(G_reduced,A_reduced,E_reduced);
      if(allowedPositions() != apAll)
	make_positions_integer(G_reduced,A_reduced);
      //time_total = get_time(t_total);
	  time_total = usedTime(t_total);
            
      export_NodeAttributes(G_reduced,A_reduced,GA);
    }
  else //trivial cases
    { 
      if(G.numberOfNodes() == 1 )
	{
	  node v = G.firstNode();
	  GA.x(v) = 0;
	  GA.y(v) = 0;
	} 
    }
}
Ejemplo n.º 3
0
void FMMMLayout :: initialize_all_options()
{
    //setting high level options
    useHighLevelOptions(false); pageFormat(pfSquare); unitEdgeLength(100); 
    newInitialPlacement(false); qualityVersusSpeed(qvsBeautifulAndFast);

    //setting low level options
    //setting general options
    randSeed(100);edgeLengthMeasurement(elmBoundingCircle);
    allowedPositions(apInteger);maxIntPosExponent(40);

    //setting options for the divide et impera step
    pageRatio(1.0);stepsForRotatingComponents(10);
    tipOverCCs(toNoGrowingRow);minDistCC(100);
    presortCCs(psDecreasingHeight);
    
    //setting options for the multilevel step
    minGraphSize(50);galaxyChoice(gcNonUniformProbLowerMass);randomTries(20);
    maxIterChange(micLinearlyDecreasing);maxIterFactor(10);
    initialPlacementMult(ipmAdvanced);
    
    //setting options for the force calculation step
    forceModel(fmNew);springStrength(1);repForcesStrength(1);
    repulsiveForcesCalculation(rfcNMM);stopCriterion(scFixedIterationsOrThreshold);
    threshold(0.01);fixedIterations(30);forceScalingFactor(0.05);
    coolTemperature(false);coolValue(0.99);initialPlacementForces(ipfRandomRandIterNr);
   
    //setting options for postprocessing
    resizeDrawing(true);resizingScalar(1);fineTuningIterations(20);
    fineTuneScalar(0.2);adjustPostRepStrengthDynamically(true);
    postSpringStrength(2.0);postStrengthOfRepForces(0.01);

    //setting options for different repulsive force calculation methods
    frGridQuotient(2); 
    nmTreeConstruction(rtcSubtreeBySubtree);nmSmallCell(scfIteratively);
    nmParticlesInLeaves(25); nmPrecision(4);   
}