void MVertex::deleteLast() { GModel *m = GModel::current(); if(_num == m->getMaxVertexNumber()) m->setMaxVertexNumber(m->getMaxVertexNumber() - 1); delete this; }
MVertex::MVertex(double x, double y, double z, GEntity *ge, int num) : _visible(1), _order(1), _x(x), _y(y), _z(z), _ge(ge) { #if defined(_OPENMP) #pragma omp critical #endif { // we should make GModel a mandatory argument to the constructor GModel *m = GModel::current(); if(num){ _num = num; m->setMaxVertexNumber(std::max(m->getMaxVertexNumber(), _num)); } else{ m->setMaxVertexNumber(m->getMaxVertexNumber() + 1); _num = m->getMaxVertexNumber(); } _index = num; } }