# Path: rhino_unwrapper/meshUtils/mesh.py
# def make_test_mesh():
# def make_upright_mesh():
# def make_cube_mesh():
# def get_myMesh(vertices,face_vertices):
#     def __init__(self,mesh):
#     def edge_indices(self):
#     def face_indices(self):
#     def get_set_of_edges(self):
#     def get_set_of_face_idxs(self):
#     def get_mesh_faces(self):
#     def meshTVerts(self):
#     def get_frame_oriented_with_face_normal(self,edge,face):
#     def getOtherFaceIdx(self,edgeIdx, faceIdx):
#     def get_point_for_tVert(self,tVert):
#     def get_point3f_for_tVert(self,vert):
#     def getTVertsForVert(self,tVert):
#     def getEdgesForVert(self,tVert):
#     def get_edge_for_vert_pair(self,vertA,vertB):
#     def getEdgeForTVertPair(self,tVertA, tVertB, facesVertA=None):
#     def getFacesForVert(self,tVert):
#     def getOtherTVert(self,edge, tVert):
#     def get_aligned_points(self,orientedEdge):
#     def set_cuts(self,cutList):
#     def get_cuts(self):
#     def is_cut_edge(self,edge):
#     def is_fold_edge(self,edge):
#     def is_naked_edge(self,edge):
#     def getTangentEdge(self,edge, tVert, angleTolerance, chain):
#     def getChain(self,edge, angleTolerance):
#     def getFacesForEdge(self,edge):
#     def getTVertsForEdge(self,edge):
#     def getEdgeAngle(self,edge):
#     def getDistanceToEdge(self,edge, point):
#     def getEdgeVector(self,edgeIdx): 
#     def get_edge_vec_oriented(self,edgeIdx,faceIdx):
#     def get_oriented_points_for_edge(self,edgIdx,faceIdx):
#     def _get_points_for_tVerts(self,verts):
#     def getPointsForEdge(self,edgeIdx):
#     def get_oriented_TVerts_for_edge(self,edgeIdx,faceIdx):
#     def get_edge_line(self,edgeIdx):
#     def getEdgeLen(self,edgIdx):
#     def get_edge_center_point(self,edgeIdx):
#     def compareEdgeAngle(self,edge, tVert, neighEdge):
#     def _getOrientedVector(self,edgeIdx, tVert, isEnd):
#     def getEdgeLengths(self):
#     def getMedianEdgeLen(self):
#     def get_adjacent_faces(self,faceIdx):
#     def getTVertsForFace(self,faceIdx):
#     def get_points_for_face(self,faceIdx):
#     def getFaceEdges(self,faceIdx):
#     def get_edges_ccw_besides_base(self,baseEdge=None,face=None):
#     def get_edges_and_orientation_for_face(self,faceIdx):
#     def get_edges_except(self,faceIdx,edgeIdx):
#     def face_normal(self,face):
#     def get_face_normal(self,face):
#     def get_naked_or_cut_edge_from_candidate_faces(self,canditate_faces):
#     def get_face_next_to_a_cut(self): 
#     def __init__(self,meshElementFinder):
#     def displayTVertsIdx(self):
#     def displayTVertIdx(self,vert, disp=None, color=(0, 255, 0, 255)):
#     def displayEdgesIdx(self):
#     def displayEdgeIdx(self,edgeIdx,color=(0,0,255,0)):
#     def displayIJEdge(self, edgeIdx):
#     def displayFacesIdx(self):
#     def displayFaceIdx(self, face):
#     def displayNormals(self):
#     def display_face_vert_ordering(self,faceIdx):
#     def display_all_face_vert_ordering(self):
#     def display_edge_direction_IJ(self,edgeIdx):
#     def display_all_edges_direction_IJ(self):
#     def display_edge_direction(self,edgeIdx):
#     def display_all_edges_direction(self):
#     def display_all_elements(self):
#     def display_edges(self, edgeIdxs,color=(0,255,0,255)):
# class Mesh(object): 
# class MeshDisplayer(object):
# 
# Path: rhino_unwrapper/meshUtils/meshLoad.py
# def load_mesh(meshFilePath=None):
#     def __init__(self):
#     def import_file(self,relPath=None):
# def user_select_mesh(message="select a mesh"):
# def get_geom_from_guid(guid):
# def user_select_mesh_rhino_common(message="select a mesh"):
#     def __init__(self):
#     def getRandMeshGUID(self):
#     def getRandMesh(self,select=True):
#     def get_mesh_from_guid(self,guid):
#     def get_all_mesh_guids(self):
#     def getSelectedMesh(self):
#     def getGeomFromGUID(self,guid):
# class FileImporter(object):
# class MeshGetter(object):


import unittest,collections
import Rhino.Geometry as geom
import rhinoscriptsyntax as rs
import userCuts
import autoCuts
from rhino_unwrapper.meshUtils import mesh
from rhino_unwrapper.meshUtils import meshLoad
#    * user can use chain deselection
#    * automatically fill in any missing edges needed to unfold
#    * can automatically fill in all edges if user makes no selection
#    * saves cut/fold info to this mesh
#    * displays cut/fold info dynamically as I make selection (feedback)
#    * if mesh already has cut/fold info displays it before user modification


class UserAssignCutsTestCase(unittest.TestCase):
    def setUp(self):
        self.myMesh = mesh.make_test_mesh()

    def tearDown(self):
        delete_all()

    def test_applies_cut_list_to_mesh(self):
        rMesh = meshLoad.load_mesh("/TestMeshes/blob")
        cutList = [0,1,2]
        key = 'cuts'
        userCuts.apply_user_cuts(rMesh,key,cutList)
        self.assertEqual(cutList,list(rMesh.UserDictionary.Item[key]))

    def test_updates_mesh_cut_list(self):
        rMesh = meshLoad.load_mesh("/TestMeshes/blob")

def weight_function(myMesh,edge):
    return 1.0

class AutoCutsTestCase(unittest.TestCase):
    def setUp(self):

# Path: rhino_unwrapper/meshUtils/mesh.py
# def make_test_mesh():
# def make_upright_mesh():
# def make_cube_mesh():
# def get_myMesh(vertices,face_vertices):
#     def __init__(self,mesh):
#     def edge_indices(self):
#     def face_indices(self):
#     def get_set_of_edges(self):
#     def get_set_of_face_idxs(self):
#     def get_mesh_faces(self):
#     def meshTVerts(self):
#     def get_frame_oriented_with_face_normal(self,edge,face):
#     def getOtherFaceIdx(self,edgeIdx, faceIdx):
#     def get_point_for_tVert(self,tVert):
#     def get_point3f_for_tVert(self,vert):
#     def getTVertsForVert(self,tVert):
#     def getEdgesForVert(self,tVert):
#     def get_edge_for_vert_pair(self,vertA,vertB):
#     def getEdgeForTVertPair(self,tVertA, tVertB, facesVertA=None):
#     def getFacesForVert(self,tVert):
#     def getOtherTVert(self,edge, tVert):
#     def get_aligned_points(self,orientedEdge):
#     def set_cuts(self,cutList):
#     def get_cuts(self):
#     def is_cut_edge(self,edge):
#     def is_fold_edge(self,edge):
#     def is_naked_edge(self,edge):
#     def getTangentEdge(self,edge, tVert, angleTolerance, chain):
#     def getChain(self,edge, angleTolerance):
#     def getFacesForEdge(self,edge):
#     def getTVertsForEdge(self,edge):
#     def getEdgeAngle(self,edge):
#     def getDistanceToEdge(self,edge, point):
#     def getEdgeVector(self,edgeIdx): 
#     def get_edge_vec_oriented(self,edgeIdx,faceIdx):
#     def get_oriented_points_for_edge(self,edgIdx,faceIdx):
#     def _get_points_for_tVerts(self,verts):
#     def getPointsForEdge(self,edgeIdx):
#     def get_oriented_TVerts_for_edge(self,edgeIdx,faceIdx):
#     def get_edge_line(self,edgeIdx):
#     def getEdgeLen(self,edgIdx):
#     def get_edge_center_point(self,edgeIdx):
#     def compareEdgeAngle(self,edge, tVert, neighEdge):
#     def _getOrientedVector(self,edgeIdx, tVert, isEnd):
#     def getEdgeLengths(self):
#     def getMedianEdgeLen(self):
#     def get_adjacent_faces(self,faceIdx):
#     def getTVertsForFace(self,faceIdx):
#     def get_points_for_face(self,faceIdx):
#     def getFaceEdges(self,faceIdx):
#     def get_edges_ccw_besides_base(self,baseEdge=None,face=None):
#     def get_edges_and_orientation_for_face(self,faceIdx):
#     def get_edges_except(self,faceIdx,edgeIdx):
#     def face_normal(self,face):
#     def get_face_normal(self,face):
#     def get_naked_or_cut_edge_from_candidate_faces(self,canditate_faces):
#     def get_face_next_to_a_cut(self): 
#     def __init__(self,meshElementFinder):
#     def displayTVertsIdx(self):
#     def displayTVertIdx(self,vert, disp=None, color=(0, 255, 0, 255)):
#     def displayEdgesIdx(self):
#     def displayEdgeIdx(self,edgeIdx,color=(0,0,255,0)):
#     def displayIJEdge(self, edgeIdx):
#     def displayFacesIdx(self):
#     def displayFaceIdx(self, face):
#     def displayNormals(self):
#     def display_face_vert_ordering(self,faceIdx):
#     def display_all_face_vert_ordering(self):
#     def display_edge_direction_IJ(self,edgeIdx):
#     def display_all_edges_direction_IJ(self):
#     def display_edge_direction(self,edgeIdx):
#     def display_all_edges_direction(self):
#     def display_all_elements(self):
#     def display_edges(self, edgeIdxs,color=(0,255,0,255)):
# class Mesh(object): 
# class MeshDisplayer(object):
# 
# Path: rhino_unwrapper/meshUtils/meshLoad.py
# def load_mesh(meshFilePath=None):
#     def __init__(self):
#     def import_file(self,relPath=None):
# def user_select_mesh(message="select a mesh"):
# def get_geom_from_guid(guid):
# def user_select_mesh_rhino_common(message="select a mesh"):
#     def __init__(self):
#     def getRandMeshGUID(self):
#     def getRandMesh(self,select=True):
#     def get_mesh_from_guid(self,guid):
#     def get_all_mesh_guids(self):
#     def getSelectedMesh(self):
#     def getGeomFromGUID(self,guid):
# class FileImporter(object):
# class MeshGetter(object):


# Path: rhino_unwrapper/cutSelection/test_cut.py
import unittest,collections
import Rhino.Geometry as geom
import rhinoscriptsyntax as rs
import userCuts
import autoCuts
from rhino_unwrapper.meshUtils import mesh
from rhino_unwrapper.meshUtils import meshLoad

#    * user can use chain deselection
#    * automatically fill in any missing edges needed to unfold
#    * can automatically fill in all edges if user makes no selection
#    * saves cut/fold info to this mesh
#    * displays cut/fold info dynamically as I make selection (feedback)
#    * if mesh already has cut/fold info displays it before user modification


class UserAssignCutsTestCase(unittest.TestCase):
    def setUp(self):
        self.myMesh = mesh.make_test_mesh()

    def tearDown(self):
        delete_all()

    def test_applies_cut_list_to_mesh(self):
        rMesh = meshLoad.load_mesh("/TestMeshes/blob")
        cutList = [0,1,2]
        key = 'cuts'
        userCuts.apply_user_cuts(rMesh,key,cutList)
        self.assertEqual(cutList,list(rMesh.UserDictionary.Item[key]))

    def test_updates_mesh_cut_list(self):
        rMesh = meshLoad.load_mesh("/TestMeshes/blob")

def weight_function(myMesh,edge):
    return 1.0

class AutoCutsTestCase(unittest.TestCase):
    def setUp(self):

        self.myMesh = mesh.make_test_mesh()