Package prolog.core

Examples of prolog.core.IVertex


    IVertex[] vs=LG.vertices;
    int vsL=vs.length; // total vertices: vsL
    // compute total edges: esL
    int esL=0;
    for(int i=0;i<vsL;i++) {
      IVertex F=vs[i];
      IEdge[] es=F.outLinks;
      esL+=es.length;
    }
   
    if(esL==0) return; // no edges - exception
   
    // allocate vertices, edges
    beginGraph(vsL,esL);
   
    // add vertices
    for(int i=0;i<vsL;i++) {
      IVertex F=vs[i];
      MobilePoint P=(MobilePoint)F.data;
      setVertex(i,mp2p(P,2*LG.radius));
    }
   
    // add edges
    int eCount=0;
    for(int i=0;i<vsL;i++) {
      IVertex F=vs[i];
      IEdge[] es=F.outLinks;
      for(int j=0;j<es.length;j++) {
        IEdge E=es[j];
        setEdge(eCount++,i,E.to);  
      }
View Full Code Here


    N.setZ((double)RP.z);
  }

  public void addGraph(Cat RG,boolean add) {
    for(int i=0;i<size();i++) {
      IVertex V=vertices[i];
  
      RankedData RD=(RankedData)RG.rawVertexData(V.key);
      //Object RS=RG.getSelected(V.key);
      Object RS=getIFilter().filterVertex(RD);
      // V = key + data
      Vertex3D GV;

      int shape=setShape(RD,V);
      Color3f color=comp2col(RD.component,RD.hyper);
 
      if(add) {
        if(shape<Shape.maxSimple)
          GV=jworld.addVertex(shape,color,V);
        else {
          Shape dataShape=new Shape(color);
          GV=jworld.addVertex(dataShape.toNode(shape,RS),RS); //$$
        }
      }
      else GV=(Vertex3D)(V.key);
     
      MobilePoint N=new MobilePoint(RS,RD,GV,radius,size());
      V.data=N; // V contains N && N contains V - careful with toString!!!

      initPosition(V,N);
    }
    for(int i=0;i<size();i++) {
      IVertex F=vertices[i];
    
      MobilePoint MFrom=(MobilePoint)(F.data);
      Vertex3D From=MFrom.V;
      
      IEdge[] es=F.outLinks;
      for(int j=0;j<es.length;j++) {
        IEdge E=es[j];
        IVertex T=vertices[E.to];
        MobilePoint MTo=(MobilePoint)(T.data);
        Vertex3D To=MTo.V;
        if(add) E.data=jworld.addEdge(From,To,E.data); //$$
      }
    }
View Full Code Here

    if(Params.stopAll) running=false;
    if(energy>0) oldenergy=energy;
    energy=0;
    for (int i=0;i<size();i++) {
      if(!running) break;
      IVertex V=vertices[i];
      MobilePoint n = getPoint(i);
      vertexStep(i,n);   
      edgeStep(i,n,V.outLinks);
      energy=applyDelta(n,energy);
    }
View Full Code Here

TOP

Related Classes of prolog.core.IVertex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.