mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Some accessor functions in the Mesh class
This commit is contained in:
@@ -168,8 +168,8 @@ void Mesh::addColumn()
|
||||
for (int y=0; y<nRows(); y++)
|
||||
{
|
||||
// Get left and right vertices.
|
||||
QPointF left = *getVertex( _vertices2d[0] [y] );
|
||||
QPointF right = *getVertex( _vertices2d[nColumns()-1][y] );
|
||||
QPointF left = *getVertex2d( 0, y );
|
||||
QPointF right = *getVertex2d( nColumns()-1, y );
|
||||
QPointF diff = right - left;
|
||||
|
||||
// First pass: move middle points.
|
||||
@@ -370,7 +370,7 @@ void Mesh::_reorderVertices()
|
||||
int k = 0;
|
||||
for (int x=0; x<nColumns(); x++)
|
||||
for (int y=0; y<nRows(); y++)
|
||||
newVertices[k++] = getVertex( _vertices2d[x][y] );
|
||||
newVertices[k++] = getVertex2d( x, y );
|
||||
|
||||
// Populate _vertices2d.
|
||||
k = 0;
|
||||
|
||||
@@ -188,6 +188,19 @@ public:
|
||||
{
|
||||
return vertices[_vertices2d[i][j]];
|
||||
}
|
||||
|
||||
void setVertex2d(int i, int j, QPointF v)
|
||||
{
|
||||
vertices[_vertices2d[i][j]]->setValue(v);
|
||||
}
|
||||
|
||||
void setVertex2d(int i, int j, double x, double y)
|
||||
{
|
||||
Point* p = vertices[_vertices2d[i][j]];
|
||||
p->setX(x);
|
||||
p->setY(y);
|
||||
}
|
||||
|
||||
void resizeVertices2d(std::vector< std::vector<int> >& vertices2d, int nColumns, int nRows);
|
||||
|
||||
void init(int nColumns, int nRows);
|
||||
|
||||
Reference in New Issue
Block a user