Mesh* pMesh,
int pPosition)
{
+ // debug
+ //cout << "INSERT PARTS BEFORE: " << endl;
+ //cout << (*this) << endl;
+
MeshDisPart* part = new MeshDisPart();
part->create(
// rename id of following parts
for (unsigned i = pPosition + 1 ; i < mParts.size() ; i++)
{
- mParts[i]->mId = i + 1;
+ mParts[i]->mId++;
+ }
+
+ // debug
+ //cout << "INSERT PARTS AFTER: " << endl;
+ //cout << (*this) << endl;
+}
+
+
+void MeshDis::removeParts(const char* pPrefixPartName)
+{
+ // debug
+ //cout << "REMOVE PARTS BEFORE: " << endl;
+ //cout << (*this) << endl;
+
+ if (pPrefixPartName == NULL) throw NullArgumentException("", __FILE__, __LINE__);
+
+ for (vector<MeshDisPart*>::iterator itPart = mParts.begin() ; itPart != mParts.end() ; itPart++)
+ {
+ MeshDisPart* currentPart = (*itPart);
+
+ if (startWith(currentPart->getPartName(), pPrefixPartName))
+ {
+ mParts.erase(itPart);
+
+ // decrement id of following parts
+ for (vector<MeshDisPart*>::iterator itPart2 = itPart ; itPart2 != mParts.end() ; itPart2++)
+ {
+ (*itPart2)->mId--;
+ }
+
+ itPart--;
+ if (currentPart->mMEDFileName != NULL)
+ {
+ remove(currentPart->mMEDFileName);
+ }
+
+ delete currentPart;
+ }
}
+
+ // debug
+ //cout << "REMOVE PARTS AFTER: " << endl;
+ //cout << (*this) << endl;
}
const char* originalFilename = part->getMEDFileName();
string strPrefix = removeExtension(originalFilename, ".med");
+cout << (*this) << endl;
//---------------------------------------------------------------------
// Decimates the given mesh
//---------------------------------------------------------------------
meshLow,
part->mId + 1);
}
+
+cout << (*this) << endl;
}