Changeset 3480 for trunk


Ignore:
Timestamp:
Mar 10, 2013 9:59:17 PM (11 years ago)
Author:
gah
Message:

change private method names in mesh object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/mesh.tcl

    r3475 r3480  
    7474    private method ReadUnstructuredGrid { path }
    7575    private method ReadVtk { path }
    76     private method ReadTriangles { xv yv zv triangles }
    77     private method ReadQuads { xv yv zv quads }
    78     private method ReadTetrahedrons { xv yv zv tetrahedrons }
    79     private method ReadHexahedrons { xv yv zv hexhedrons }
    80     private method ReadWedges { xv yv zv wedges }
    81     private method ReadPyramids { xv yv zv pyramids }
    82     private method ReadCells { xv yv zv cells celltypes }
    83     private method ReadCloud { xv yv zv }
     76    private method WriteTriangles { xv yv zv triangles }
     77    private method WriteQuads { xv yv zv quads }
     78    private method WriteTetrahedrons { xv yv zv tetrahedrons }
     79    private method WriteHexahedrons { xv yv zv hexhedrons }
     80    private method WriteWedges { xv yv zv wedges }
     81    private method WritePyramids { xv yv zv pyramids }
     82    private method WriteHybridCells { xv yv zv cells celltypes }
     83    private method WritePointCloud { xv yv zv }
    8484    private method GetCellType { name }
    8585    private method GetNumIndices { type }
     
    401401    append out "$_vtkdata\n"
    402402
    403     # Write the contents to a file just in case it's binary.
     403     # Write the contents to a file just in case it's binary.
    404404    set tmpfile file[pid].vtk
    405405    set f [open "$tmpfile" "w"]
     
    637637}
    638638
    639 itcl::body Rappture::Mesh::ReadCloud { xv yv zv } {
     639itcl::body Rappture::Mesh::WritePointCloud { xv yv zv } {
    640640    set _type "cloud"
    641641    set _numPoints [$xv length]
     
    653653}
    654654
    655 itcl::body Rappture::Mesh::ReadTriangles { xv yv zv triangles } {
     655itcl::body Rappture::Mesh::WriteTriangles { xv yv zv triangles } {
    656656    set _type "triangles"
    657657    if { $triangles == "" } {
     
    686686}
    687687
    688 itcl::body Rappture::Mesh::ReadQuads { xv yv zv quads } {
     688itcl::body Rappture::Mesh::WriteQuads { xv yv zv quads } {
    689689    set _type "quads"
    690690    if { $quads == "" } {
     
    719719}
    720720
    721 itcl::body Rappture::Mesh::ReadTetrahedrons { xv yv zv tetras } {
     721itcl::body Rappture::Mesh::WriteTetrahedrons { xv yv zv tetras } {
    722722    set _type "tetrahedrons"
    723723    if { $tetras == "" } {
     
    752752}
    753753
    754 itcl::body Rappture::Mesh::ReadHexahedrons { xv yv zv hexas } {
     754itcl::body Rappture::Mesh::WriteHexahedrons { xv yv zv hexas } {
    755755    set _type "hexahedrons"
    756756    if { $hexas == "" } {
     
    785785}
    786786
    787 itcl::body Rappture::Mesh::ReadWedges { xv yv zv wedges } {
     787itcl::body Rappture::Mesh::WriteWedges { xv yv zv wedges } {
    788788    set _type "wedges"
    789789    if { $wedges == "" } {
     
    818818}
    819819
    820 itcl::body Rappture::Mesh::ReadPyramids { xv yv zv pyramids } {
     820itcl::body Rappture::Mesh::WritePyramids { xv yv zv pyramids } {
    821821    set _type "pyramids"
    822822    if { $pyramids == "" } {
     
    829829    set celltypes {}
    830830    foreach { a b c d e } $pyramids {
    831         append data " 6 $a $b $c $d $e\n"
     831        append data " 5 $a $b $c $d $e\n"
    832832        append celltypes "14\n"
    833833        incr count
     
    838838        append out " $x $y $z\n"
    839839    }
    840     append out "CELLS $count [expr $count * 5]\n"
     840    append out "CELLS $count [expr $count * 6]\n"
    841841    append out $data
    842842    append out "CELL_TYPES $count\n"
     
    851851}
    852852
    853 itcl::body Rappture::Mesh::ReadCells { xv yv zv cells celltypes } {
     853itcl::body Rappture::Mesh::WriteHybridCells { xv yv zv cells celltypes } {
    854854    set _type "unstructured"
    855855    if { $cells == "" } {
     
    943943    set _type "unstructured"
    944944
    945     # Step 1: Verify that there's only one cell tag.
     945    # Step 1: Verify that there's only one cell tag of any kind.
    946946    set numCells 0
    947947    foreach type { cells triangles quads tetrahedrons
     
    977977        set data    [$_xmlobj get $path.unstructured.points]
    978978        if { $zcoords != "" } {
    979                 error "can't specify <zcoord> with a 2 dimensional mesh"
     979                error "can't specify <zcoords> with a 2D mesh"
    980980        }
    981981        if { $xcoords != "" && $ycoords != "" } {
     
    988988            Rappture::ReadPoints $data dim points
    989989            if { $points == "" } {
    990                 error "no <points> found for <cells> mesh"
     990                error "no <points> found for unstructured grid"
    991991            }
    992992            if { $dim != 2 } {
     
    10341034        }
    10351035    }
    1036     # Step 3: Read the cells and write the vtk data.
     1036    # Step 3: Write the points and cells as vtk data.
    10371037    if { $numCells == 0 } {
    1038         puts stderr "numCells=$numCells call ReadCloud"
    1039         ReadCloud $xv $yv $zv
     1038        WritePointCloud $xv $yv $zv
    10401039    } elseif { $type == "cells" } {
    10411040        set cells [$_xmlobj get $path.unstructured.cells]
    1042         ReadCells $xv $yv $zv $cells $celltypes
     1041        WriteHybridCells $xv $yv $zv $cells $celltypes
    10431042    } else {
    1044         puts stderr "type=$type"
    1045         set cmd "Read[string totitle $type]"
     1043        set cmd "Write[string totitle $type]"
    10461044        set cells [$_xmlobj get $path.unstructured.$type]
    10471045        $cmd $xv $yv $zv $cells
Note: See TracChangeset for help on using the changeset viewer.