const Foam::labelListList& Foam::block::cells() const
{
    if (cells_.empty())
    {
        createCells();
    }

    return cells_;
}
Ejemplo n.º 2
0
TableStageStandings::TableStageStandings(const QStringList &teams, int numOfMarks,
                                         int stageNumber, QWidget *parent) :
    TableStandings(teams, numOfMarks, parent), m_stageNumber(stageNumber)
{
    setColumnCount(m_numOfMiddleCells + 3 + (m_stageNumber != 0 ? 1 : 0));

    createHeader();
    createCells();

    connect(this, SIGNAL(cellChanged(int,int)), SLOT(recalculateAverage()));
}
Ejemplo n.º 3
0
CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
                                CSMDoc::Document& document, QWidget *parent)
    :  DragRecordTable(document, parent)
{
    verticalHeader()->hide();
    horizontalHeader()->hide();

    setSelectionMode (QAbstractItemView::ExtendedSelection);

    setModel (document.getData().getTableModel (universalId));

    resizeColumnsToContents();
    resizeRowsToContents();

    mSelectAllAction = new QAction (tr ("Select All"), this);
    connect (mSelectAllAction, SIGNAL (triggered()), this, SLOT (selectAll()));
    addAction (mSelectAllAction);

    mClearSelectionAction = new QAction (tr ("Clear Selection"), this);
    connect (mClearSelectionAction, SIGNAL (triggered()), this, SLOT (clearSelection()));
    addAction (mClearSelectionAction);

    mSelectRegionsAction = new QAction (tr ("Select Regions"), this);
    connect (mSelectRegionsAction, SIGNAL (triggered()), this, SLOT (selectRegions()));
    addAction (mSelectRegionsAction);

    mCreateCellsAction = new QAction (tr ("Create Cells Action"), this);
    connect (mCreateCellsAction, SIGNAL (triggered()), this, SLOT (createCells()));
    addAction (mCreateCellsAction);

    mSetRegionAction = new QAction (tr ("Set Region"), this);
    connect (mSetRegionAction, SIGNAL (triggered()), this, SLOT (setRegion()));
    addAction (mSetRegionAction);

    mUnsetRegionAction = new QAction (tr ("Unset Region"), this);
    connect (mUnsetRegionAction, SIGNAL (triggered()), this, SLOT (unsetRegion()));
    addAction (mUnsetRegionAction);

    mViewAction = new QAction (tr ("View Cells"), this);
    connect (mViewAction, SIGNAL (triggered()), this, SLOT (view()));
    addAction (mViewAction);

    mViewInTableAction = new QAction (tr ("View Cells in Table"), this);
    connect (mViewInTableAction, SIGNAL (triggered()), this, SLOT (viewInTable()));
    addAction (mViewInTableAction);

    setAcceptDrops(true);
}
Ejemplo n.º 4
0
 void aft (vector<Grid>& gr, Grid& finalGrid)
 {
     //cout << "Allocating... " << flush;
     int newGridId = 2;        
     double offsetZ = 1.;
     int phys = 1;
     Grid newGrid (gr[0].mainDir, newGridId);        
     double aveTriArea;
     vector<Point> points;
     vector<Point> edgeCenters;
     vector<Edge> edges;
     vector<Edge> mesh0Edges;
     vector<Edge> mesh1Edges;
     vector<Triangle> triangles;
     vector<FrontMember> frontList;
     EdgeADT edgeADT;
     EdgeADT edge0ADT;
     EdgeADT edge1ADT;
     EdgeADT edge01ADT;
     TriangleADT triangleADT;
     PointADT pointADT;
     PointADT edgeCenterADT;
     CircleADT circleADT;
     //cout << "done!" << endl;
     
     // this should not be in AFT
     //cout << "Trimming/Re-blanking... " << flush;
     gr[0].trimWhoHasFringeNeighbor();
     gr[1].trimWhoHasFringeNeighbor();
     gr[0].trimWhoHasTrimNeighbor (3);
     gr[1].trimWhoHasTrimNeighbor (2);
     //cout << "done!" << endl;
     
     // this too
     //cout << "Outputing after trimming/reblanking... " << flush;
     //gr[0].outAllTecplot();
     //gr[1].outAllTecplot();
     gr[0].outAllVTK(0);
     gr[1].outAllVTK(0);
     //cout << "done!" << endl;
  
     //cout << "Preparing... " << flush;
     setPointsEdges (gr, points, edges, edgeCenters, newGridId);
     createFrontList (edges, frontList, points);
     aveTriArea = getAveTriArea (edges, points);
     //cout << "done!" << endl;
     
     //cout << "Building trees... " << flush;        
     for (Edge& e: edges)
     {
         if (e.belonging == 0)
         {
             mesh0Edges.push_back (e);
         }
         else if (e.belonging == 1)
         {
             mesh1Edges.push_back (e);
         }
     }
     
     edge0ADT.build (points, mesh0Edges);
     edge1ADT.build (points, mesh1Edges);
     edgeADT.build (points, edges);
     edge01ADT.build (points, edges);
     triangleADT.build (edgeADT);
     pointADT.build (points);
     edgeCenterADT.build (edgeCenters);
     circleADT.build (edgeADT);
     //cout << "done!" << endl;
     
     //cout << "Exporting to GMSH... " << flush;
     exportToGMSH (points, mesh0Edges, mesh1Edges, gr[0].mainDir);
     //cout << "done!" << endl;        
     
     //cout << "Advancing front... " << flush;
     advanceFront (frontList, points, aveTriArea, edges, triangles, triangleADT, pointADT, edgeCenterADT, edgeADT, edge01ADT, newGridId, edgeCenters, circleADT);
     //cout << "done!" << endl;
     
     //cout << "Erasing dead elements... " << flush;
     eraseDeadPoints (points, edges, triangles);
     eraseDeadEdges (edges, triangles, points);
     eraseDeadTriangles (triangles, points, edges);
     //cout << "done!" << endl;
     
     //cout << "Outputing unflipped triangles... " << flush;        
     outputTrianglesVTK (points, triangles, gr[0].mainDir, "tri.vtk");
     //cout << "done!" << endl;        
     
     //cout << "Flipping triangles... " << flush;
     flip (triangles, edges, points);
     //cout << "done!" << endl;
     
     //cout << "Flipping triangles... " << flush;
     flip (triangles, edges, points);
     //cout << "done!" << endl;
     
     //cout << "Outputing flipped triangles... " << flush;    
     outputTrianglesVTK (points, triangles, gr[0].mainDir, "triFlip.vtk");
     //cout << "done!" << endl;
     
     //cout << "Creating cells... " << flush;
     createCells (offsetZ, points, newGrid, triangles, phys, newGridId);
     //cout << "done!" << endl;
     
     
     
     
     //cout << "Outputing new grid... " << flush;
     //newGrid.outAllTecplot();
     newGrid.outAllVTK(0);
     //cout << "done!" << endl;
     
     //cout << "Creating final grid... " << flush;
     createFinalGrid (finalGrid, gr, newGrid);
     //cout << "done!" << endl;
     
     
     
     //cout << "Outputing final grid... " << flush;
     //finalGrid.outAllTecplot();
     //finalGrid.outAllVTK(0);
     //cout << "done!" << endl;
     
     cout << "finished AFT" << endl;
 }