"""@package IO
Generic input/output functions
"""
import numpy as np

def readPointCloudFromPly(path):
    f = open(path, 'r')
    
    points = []
    
    headerSkipped = False
    for line in f:
        if headerSkipped:
            points.append(np.float32(np.array(line.split(' ')[0:3])))
        else:
            headerSkipped = line.find('end_header') != -1
    
    return points
    
def readPointAssignementFromFiles(path):
    f = open(path, 'r')
    
    assignement = []
    
    for line in f:
        if line[0] != '#':
            assignement.append(np.int16(line.split(',')[0:2]))
    
    return assignement
    
    
    

@@ -621,22 +621,889 @@
 nement%0A    %0A
+def readPrimitiveCorrespondancesFromFiles(path, primset1, primset2):%0A    f = open(path, 'r')%0A    %0A    corresp    = %7B%7D%0A    correspUid = %7B%7D%0A    %0A    for line in f:%0A        if line%5B0%5D != '#':%0A            fline = np.int16(line.split(',')%5B0:6%5D)%0A            %0A            p1 = None%0A            p2 = None%0A            %0A            for p in primset1:%0A                if p.uid == fline%5B0%5D and p.did == fline%5B2%5D:%0A                    p1 = p%0A                    break%0A            %0A            for p in primset2:%0A                if p.uid == fline%5B3%5D and p.did == fline%5B5%5D:%0A                    p2 = p%0A                    break%0A            %0A            if (p1 != None and p2 != None):%0A                corresp%5Bp1%5D = p2%0A                correspUid%5Bp1.uid%5D = p2.uid%0A            else: %0A                print %22Cannot find %22,fline%0A            %0A    f%0A    %0A    return corresp, correspUid%0A    %0A
     %0A    %0A

Add new method to read correspondances files