Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(7)  |  Derive(0)  |  Import(5)
Simple Wrapper class for a point in 2D-space. Used for Graph
Embeddings.  Use: Point2D([x,y]) or Point2D(x,y) 

src/g/a/Gato-1.1.2/GraphUtil.py   Gato(Download)
from GatoGlobals import *
import Graph
from DataStructures import Point2D, VertexLabeling, EdgeLabeling, EdgeWeight, VertexWeight, Queue
import logging
log = logging.getLogger("Gato")
                G.vertexWeights[i][v] = w
 
            E[v] = Point2D(x,y)
 
        if lineNr == lastVertexLineNr + 1: # Read Nr of edges
                    VLabel[v] = eval(d['label'])
                    P = PairListToDictionary(d['graphics'])
                    E[v] = Point2D(eval(P['x']), eval(P['y']))
 
                except:
            x = int(m.group(1))
            y = int(m.group(2))
            E[v] = Point2D(x,y)
        else:
            m = re.search('(\d+) -> (\d+)', l)

src/g/a/Gato-1.1.2/Graph.py   Gato(Download)
 
from GatoGlobals import *
from DataStructures import Point2D, VertexLabeling, EdgeLabeling, EdgeWeight
import GraphUtil #import ConnectedComponents, FindBipartitePartitions 
 
    def SetEmbedding(self,v, x, y):
        self.embedding[v] = Point2D(x,y)
 
    def Euclidify(self):
        """ Replace edge weights with weightID = 0 with Euclidean distance 

src/g/a/Gato-1.1.2/ObjectGraph.py   Gato(Download)
 
from GatoGlobals import *
from DataStructures import Point2D, VertexLabeling, EdgeLabeling, EdgeWeight
#from math import log
 
    def SetEmbedding(self,v, x, y):
        self.vertices[v].embedding = Point2D(x,y)
 
 
    def Euclidify(self):

src/g/a/Gato-1.1.2/GraphDisplay.py   Gato(Download)
from GatoUtil import orthogonal
from GatoDialogs import AutoScrollbar
from DataStructures import Point2D, VertexLabeling, EdgeLabeling
import os
import colorsys
            x,y = self.EmbeddingToCanvas(t.x,t.y)
 
        return Point2D(x,y)
 
 

src/g/a/Gato-1.1.2/HMMEd.py   Gato(Download)
################################################################################
 
from DataStructures import Point2D
from Graph import Graph
from Gred import *
                # We only use pos
                pos = XMLNode.getElementsByTagName('pos')[0] # Just one pos ...                
                self.pos = Point2D(float(pos.attributes['x'].nodeValue),
                                   float(pos.attributes['y'].nodeValue))