Index: /anuga_core/source/anuga/abstract_2d_finite_volumes/pmesh2domain.py
===================================================================
--- /anuga_core/source/anuga/abstract_2d_finite_volumes/pmesh2domain.py	(revision 4900)
+++ /anuga_core/source/anuga/abstract_2d_finite_volumes/pmesh2domain.py	(revision 4901)
@@ -190,9 +190,11 @@
     """
     tri_atts = mesh_dict['triangle_tags']
-    #print "tri_atts", tri_atts
     tagged_elements = {}
-    for tri_att_index in range(len(tri_atts)):
-        tagged_elements.setdefault(tri_atts[tri_att_index],[]).append(tri_att_index)
-    #print "DSG pm2do tagged_elements", tagged_elements
+    if tri_atts is None:
+       tagged_elements[''] = range(len(mesh_dict['triangles']))
+    else:
+        for tri_att_index in range(len(tri_atts)):
+            tagged_elements.setdefault(tri_atts[tri_att_index],
+                                       []).append(tri_att_index)
     return tagged_elements
 
Index: /anuga_core/source/anuga/load_mesh/loadASCII.py
===================================================================
--- /anuga_core/source/anuga/load_mesh/loadASCII.py	(revision 4900)
+++ /anuga_core/source/anuga/load_mesh/loadASCII.py	(revision 4901)
@@ -21,6 +21,5 @@
     segment_tags : [tag,tag,...] list of strings
     triangles : [(v1,v2,v3), (v4,v5,v6),....] lists of points
-    triangle_tags: [s1,s2,...] A list of list of strings (probably not
-    neccecary.  a list of string should be ok)
+    triangle_tags: [s1,s2,...] A list of strings 
     triangle_neighbors: [[t1,t2,t3], [t4,t5,t6],..] lists of triangles
         
@@ -512,5 +511,7 @@
         # with triangle, and it seems to have the option of returning
         # more than one value for triangle attributex
-        if triangles_attributes == [] or triangles_attributes[index] == ['']:
+        if triangles_attributes == None or \
+               triangles_attributes == [] or \
+               triangles_attributes[index] == ['']:
             att = ""
         else:
Index: /anuga_core/source/anuga/mesh_engine/mesh_engine.py
===================================================================
--- /anuga_core/source/anuga/mesh_engine/mesh_engine.py	(revision 4900)
+++ /anuga_core/source/anuga/mesh_engine/mesh_engine.py	(revision 4901)
@@ -148,6 +148,5 @@
     #print "mesh eng generatedtrianglelist", trianglelist
     #print "mesh eng mesh_dict['triangleattributelist'] ",mesh_dict['triangleattributelist']
-    #print "mesh eng mesh_dict['generatedtriangleattributelist'] ", mesh_dict['generatedtriangleattributelist']    
-    
+    #print "mesh eng mesh_dict['generatedtriangleattributelist'] ", mesh_dict['generatedtriangleattributelist']   
     if True: 
         mesh_dict['generatedtriangleattributelist'] = triangleattributelist
@@ -155,9 +154,18 @@
         if mesh_dict['generatedtriangleattributelist'].shape[1] == 0:
             mesh_dict['generatedtriangleattributelist'] = None
+            
         if trianglelist.shape[0] == 0:
             # There are no triangles.
             # this is used by urs_ungridded2sww
             raise NoTrianglesError
-    #print "mesh eng mesh_dict['generatedtriangleattributelist'] ", mesh_dict['generatedtriangleattributelist']    
+    #print "mesh eng mesh_dict['generatedtriangleattributelist'] ", mesh_dict['generatedtriangleattributelist']  
+    
+    # the structure of generatedtriangleattributelist is an list of
+    # list of integers.  It is transformed into a list of list of
+    # strings later on.  This is then inputted into an triangle
+    # object.  The triangle object outputs a list of strings.  Note
+    # the subtle change!  How should I handle this?  For my code, when
+    # the list of list of integers is transformed, transform it into a
+    # list of strings, not a list of list of strings.
     
     return mesh_dict
Index: /anuga_core/source/anuga/pmesh/graphical_mesh_generator.py
===================================================================
--- /anuga_core/source/anuga/pmesh/graphical_mesh_generator.py	(revision 4900)
+++ /anuga_core/source/anuga/pmesh/graphical_mesh_generator.py	(revision 4901)
@@ -1083,18 +1083,6 @@
         """
         if self.Visualise:
-            for triangle in mesh.getTriangulation():
-                self.serial +=1
-                self.uniqueID = 'M*%d' % self.serial
-                self.Triangles.visualise(triangle,
-                                        self.uniqueID,
-                                        self.canvas,
-                                        self.SCALE)
-
-        if self.Visualise:
-            Triangles = mesh.sets[mesh.setID[self.selSet]]
-            for triangle in Triangles:
-                triangle.draw(self.canvas,1,
-                              scale = self.SCALE,
-                              colour = SET_COLOUR)
+            mesh.tri_mesh.draw_triangulation(self.canvas,
+                                             scale = self.SCALE)
 
         for segment in mesh.getUserSegments():
Index: /anuga_core/source/anuga/pmesh/mesh.py
===================================================================
--- /anuga_core/source/anuga/pmesh/mesh.py	(revision 4900)
+++ /anuga_core/source/anuga/pmesh/mesh.py	(revision 4901)
@@ -520,17 +520,43 @@
                  vertices,
                  triangle_tags,
-                 triangle_neighbor,
+                 triangle_neighbors,
                  segment_tags,
                  ):
        
-        self.triangles=ensure_numeric(triangles) 
-        self.triangle_neighbor=ensure_numeric(triangle_neighbor)
-        self.triangle_tags=triangle_tags
-        self.segments=ensure_numeric(segments) 
-        
-        self.segment_tags=segment_tags # string
-        self.vertices=ensure_numeric(vertices)
-
-        
+        self.triangles = ensure_numeric(triangles) 
+        self.triangle_neighbors = ensure_numeric(triangle_neighbors)
+        self.triangle_tags = triangle_tags # list of strings
+        self.segments = ensure_numeric(segments) 
+        
+        self.segment_tags = segment_tags # list of strings
+        self.vertices = ensure_numeric(vertices)
+
+       
+    def draw_triangulation(self, canvas, scale=1, xoffset=0, yoffset=0,
+             colour="green"):
+        """
+        Draw a triangle, returning the objectID
+        """
+        
+        # FIXME(DSG-DSG) This could be a data structure that is
+        # remembered and doesn't have any duplicates.
+        # but I wouldn't be able to use create_polygon.
+        # regard it as drawing a heap of segments
+        
+        for tri in self.triangles:
+            vertices = []
+            for v_index in range(3):
+                vertices.append(self.vertices[tri[v_index]])
+            
+            objectID = canvas.create_polygon(
+                scale*(vertices[1][0] + xoffset),
+                scale*-1*(vertices[1][1] + yoffset),
+                scale*(vertices[0][0] + xoffset),
+                scale*-1*(vertices[0][1] + yoffset),
+                scale*(vertices[2][0] + xoffset),
+                scale*-1*(vertices[2][1] + yoffset),
+                outline = colour,fill = ''
+                )
+ 
         
 class Mesh:
@@ -575,4 +601,7 @@
         self.meshVertices=[]
 
+        # Rigid
+        self.tri_mesh=None
+        
         self.setID={}
         #a dictionary of names.
@@ -1211,5 +1240,4 @@
         #print "generatedMesh",generatedMesh
         #print "##################"
-        
         self.setTriangulation(generatedMesh)
     
@@ -1564,5 +1592,5 @@
                     self.meshTriangles[index].setAttribute("")
                 else:
-                    self.meshTriangles[index].setAttribute(att[0])
+                    self.meshTriangles[index].setAttribute(att)
                 index += 1
             
@@ -1588,4 +1616,14 @@
                                                    ObjectNeighbor[2])
             index += 1
+        
+        # Setting up the rigid triangulation
+        self.tri_mesh = Rigid_triangulation(
+            genDict['generatedtrianglelist']
+            ,genDict['generatedsegmentlist']
+            ,genDict['generatedpointlist']
+            ,genDict['generatedtriangleattributelist']
+            ,genDict['generatedtriangleneighborlist']
+            ,genDict['generatedsegmentmarkerlist']
+            )
             
     def setMesh(self, genDict):
@@ -2206,4 +2244,13 @@
         meshDict['triangle_neighbors'] = triangle_neighbors
         
+        if self.tri_mesh is not None:
+            meshDict['triangles'] = self.tri_mesh.triangles
+            meshDict['triangle_tags'] = self.tri_mesh.triangle_tags
+            #print "mesh meshDict['triangle_tags']", meshDict['triangle_tags']
+            meshDict['triangle_neighbors'] = self.tri_mesh.triangle_neighbors
+        else:
+            meshDict['triangles'] = []
+            meshDict['triangle_tags'] = []
+            meshDict['triangle_neighbors'] = []
         #print "mesh.Mesh2IOTriangulationDict*)*)"
         #print meshDict
@@ -2288,9 +2335,10 @@
         """
         #Clear the current generated mesh values
-        self.meshTriangles=[]
-        self.attributeTitles=[]
-        self.meshSegments=[]
-        self.meshVertices=[]
-
+        self.meshTriangles = []
+        self.attributeTitles = []
+        self.meshSegments = []
+        self.meshVertices = []
+        self.tri_mesh = None
+        
         #print "mesh.setTriangulation@#@#@#"
         #print genDict
@@ -2353,4 +2401,12 @@
             index += 1
 
+        self.tri_mesh = Rigid_triangulation(
+            genDict['triangles']
+            ,genDict['segments']
+            ,genDict['vertices']
+            ,genDict['triangle_tags']
+            ,genDict['triangle_neighbors']
+            ,genDict['segment_tags']
+            )
 
     def IOOutline2Mesh(self, genDict):
@@ -3166,5 +3222,5 @@
         for i in xrange(len(region_list)):
             temp = region_list[i]
-            returned_region_list.append([convertint2string[int(temp[0])]])
+            returned_region_list.append(convertint2string[int(temp[0])])
     return returned_region_list
 
@@ -3932,8 +3988,3 @@
 # instead of functionName
 if __name__ == "__main__":
-    #from mesh import *
-    # THIS CAN BE DELETED
-    m = Mesh()
-    dict = importUngenerateFile("ungen_test.txt")
-    m.addVertsSegs(dict)
-    print m3
+    pass
