]> Creatis software - creaVtk.git/commitdiff
#3504 Mesh Manager handle multiple meshes
authorPablo Garzon <gapablo2001@gmail.com>
Thu, 11 May 2023 12:43:30 +0000 (14:43 +0200)
committerPablo Garzon <gapablo2001@gmail.com>
Thu, 11 May 2023 12:43:30 +0000 (14:43 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager.h
bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager_tool.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager_tool.h
lib/creaVtk/MeshManagerModel.cpp
lib/creaVtk/MeshManagerModel.h

index 79b999135824b68eafc2a10a76d7e737a2ccad67..900de4ead329b14b034a92e1551d6a866a3efbd2 100644 (file)
@@ -169,6 +169,9 @@ void CreateMeshFromPoints::CloseContourSides(std::vector<int> lstIndexs, bool uP
                        {
                                bool normalOrder    = isPointingCorrectly(firstIndex, firstIndex+increment, centroid, contraryId);
                                centroidId          = points->InsertNextPoint(centroid[0], centroid[1], centroid[2]);
+                               //vtkSmartPointer<vtkTriangleStrip> triangleStrip = vtkSmartPointer<vtkTriangleStrip>::New();
+                               //triangleStrip->GetPointIds()->SetNumberOfIds(numPointsFace*2 + (!isClosedCont?2:0));
+                               //int triangleIndex = 0;
                                if( normalOrder )
                 {
                        int initial = firstIndex;
@@ -186,11 +189,21 @@ void CreateMeshFromPoints::CloseContourSides(std::vector<int> lstIndexs, bool uP
                                                        triangle->GetPointIds()->SetId(2, centroidId);
                                                        cells->InsertNextCell(triangle);
                                                }
+                                               /*
+                                               triangleStrip->GetPointIds()->SetId(triangleIndex,index);
+                                               triangleStrip->GetPointIds()->SetId(triangleIndex+1,centroidId);//1
+                                               if(index+increment >= end && !isClosedCont){
+                                                       triangleStrip->GetPointIds()->SetId(triangleIndex+2,initial);//2
+                                                       triangleStrip->GetPointIds()->SetId(triangleIndex+3,centroidId);//3
+                                               }
+                                               triangleIndex+=2;
+                                               */
                                        }
+                                       //cells->InsertNextCell(triangleStrip);
                                } else {
                                        int initial = firstIndex-1;
                                        int triangleStripStart = end-1;
-                                       for(int index = triangleStripStart; index > initial; index-=increment){
+                                       for(int index = triangleStripStart; index > initial; index-=increment){ 
                                                if(index-increment <= initial && !isClosedCont){
                                                        vtkNew<vtkTriangle> triangle;
                                                        triangle->GetPointIds()->SetId(0, index);
@@ -204,8 +217,17 @@ void CreateMeshFromPoints::CloseContourSides(std::vector<int> lstIndexs, bool uP
                                                        triangle->GetPointIds()->SetId(2, centroidId);
                                                        cells->InsertNextCell(triangle);
                                                }
+                                               /**triangleStrip->GetPointIds()->SetId(triangleIndex,index);
+                                               triangleStrip->GetPointIds()->SetId(triangleIndex+1,centroidId);
+                                               if(index-increment <= initial && !isClosedCont){
+                                                       triangleStrip->GetPointIds()->SetId(triangleIndex+2,triangleStripStart);
+                                                       triangleStrip->GetPointIds()->SetId(triangleIndex+3,centroidId);
+                                               }
+                                               triangleIndex+=2;
+                                               */
                                        }
-                               }
+                                       //cells->InsertNextCell(triangleStrip);
+                               }//if normalOrder
                        }//if validCentroid
                }//if numPointsFace
        }//for facesIdx
index 25be322b77ae54db2506b330d78485caec30fe62..3fa8d4b50775e338915f2a6b09029889c9ab355d 100644 (file)
@@ -15,11 +15,14 @@ MeshManagerModel_Box::~MeshManagerModel_Box( )
 {
 }
 
-void MeshManagerModel_Box::RefreshOutputs( )
+void MeshManagerModel_Box::RefreshOutputs(bool signalBox)
 {
     mBox->bbSetOutputMeshBase( GetMeshBase() );
     mBox->bbSetOutputMeshTemp( GetMeshTemp() );
-    mBox->bbSignalOutputModification();
+    mBox->bbSetOutputMeshNames( GetMeshNames() );
+    if(signalBox==true){
+               mBox->bbSignalOutputModification();
+    }
 }
 
 
@@ -47,8 +50,12 @@ void MeshManager::Process()
     if (meshManagerModel_Box==NULL)
     {
         meshManagerModel_Box = new MeshManagerModel_Box(this);
-        meshManagerModel_Box->SetMeshBase( bbGetInputMesh() );
-        meshManagerModel_Box->RefreshOutputs();
+
+        meshManagerModel_Box->AddMeshes_( bbGetInputMeshVector() );
+
+               meshManagerModel_Box->AddMesh_( bbGetInputMesh() );
+        //meshManagerModel_Box->SetMeshBase( bbGetInputMesh() );
+        meshManagerModel_Box->RefreshOutputs(false);
         bbSetOutputMeshManagerModel( meshManagerModel_Box );
     } // if meshManagerModel_Box
 }
index e4e389ae0c0131f618eaa1e179bb03c8fc7ecc90..3b544e3b2a4f853991c5a58717aa68ebf270c5c0 100644 (file)
@@ -24,8 +24,10 @@ class bbcreaVtk_EXPORT MeshManager
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
   BBTK_DECLARE_INPUT(Mesh,vtkPolyData*);
+  BBTK_DECLARE_INPUT(MeshVector, std::vector<vtkPolyData*>);
   BBTK_DECLARE_OUTPUT(MeshBase,vtkPolyData*);
   BBTK_DECLARE_OUTPUT(MeshTemp,vtkPolyData*);
+  BBTK_DECLARE_OUTPUT(MeshNames,std::vector<std::string>);
   BBTK_DECLARE_OUTPUT(MeshManagerModel,MeshManagerModel*);
   BBTK_PROCESS(Process);
   void Process();
@@ -41,7 +43,7 @@ class MeshManagerModel_Box : public MeshManagerModel
 public :
     MeshManagerModel_Box(MeshManager *box);
     ~MeshManagerModel_Box();
-    virtual void RefreshOutputs();
+    virtual void RefreshOutputs(bool signalBox);
 protected:
 private:
     MeshManager *mBox;
@@ -56,8 +58,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(MeshManager,bbtk::AtomicBlackBox);
   BBTK_CATEGORY("empty");
 
   BBTK_INPUT(MeshManager,Mesh,"Mesh",vtkPolyData*,"");
+  BBTK_INPUT(MeshManager,MeshVector,"Vector of Meshes",std::vector<vtkPolyData*>,"");
   BBTK_OUTPUT(MeshManager,MeshBase,"Mesh Base",vtkPolyData*,"");
   BBTK_OUTPUT(MeshManager,MeshTemp,"Mesh Temp",vtkPolyData*,"");
+  BBTK_OUTPUT(MeshManager,MeshNames,"Mesh Names",std::vector<std::string>,"");
   BBTK_OUTPUT(MeshManager,MeshManagerModel,"Mesh manager model",MeshManagerModel*,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(MeshManager);
index d0f63ed3017600b637bf926fb586e9f7e1f0f40c..e39e25fd66ef4e531c2a0d259875f32b3b1d3871 100644 (file)
@@ -66,6 +66,31 @@ void MeshManager_tool::Process()
             bbGetInputMeshManagerModel()->ResetMeshTemp();
         } // if Tool 40 Reset
         
+        if(bbGetInputTool() == 50) // Set Array of Meshes
+        {
+               if(bbGetInputMeshes().size() > 1)
+               {
+                       if(bbGetInputMeshManagerModel()->GetNumberOfMeshes() == 1){
+                                       bbGetInputMeshManagerModel()->DeleteAll();
+                       }
+                       if(bbGetInputMeshManagerModel()->GetNumberOfMeshes() > 1)
+                       {
+                               bbGetInputMeshManagerModel()->DeleteCurrentMesh();
+                       }
+                               bbGetInputMeshManagerModel()->InsertMeshesAtCurrent(bbGetInputMeshes());
+                   }
+        }
+        if(bbGetInputTool() == 60) // Select Mesh by Name
+        {
+               if(!bbGetInputStringParam().empty())
+               {
+                       bbGetInputMeshManagerModel()->SelectMeshByName(bbGetInputStringParam());
+                   }
+        }
+        if(bbGetInputTool() == 70) // Delete Current Mesh
+        {
+                   bbGetInputMeshManagerModel()->DeleteCurrentMesh();
+        }
     } else {
         printf("EED Warning! MeshManager_tool : MeshManagerModel not defined. \n");
     }// if MeshManagerModel != NULL
index 3cf9b798b46dc31b3dc3d2572a44204a7a465461..76ba719e2999fcfa98dac4f41064d16033f40883 100644 (file)
@@ -24,6 +24,8 @@ class bbcreaVtk_EXPORT MeshManager_tool
     BBTK_DECLARE_INPUT(Tool,int);
     BBTK_DECLARE_INPUT(Mesh,vtkPolyData*);
     BBTK_DECLARE_INPUT(MeshManagerModel,MeshManagerModel*);
+    BBTK_DECLARE_INPUT(Meshes,std::vector<vtkPolyData*>);
+    BBTK_DECLARE_INPUT(StringParam, std::string);
 //  BBTK_DECLARE_OUTPUT(Out,double);
   BBTK_PROCESS(Process);
   void Process();
@@ -38,8 +40,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(MeshManager_tool,bbtk::AtomicBlackBox);
   BBTK_DESCRIPTION("No Description.");
   BBTK_CATEGORY("empty");
 
-  BBTK_INPUT(MeshManager_tool,Tool,"(default 0) 0:Nothing  10:Undo  20:ReDo  30:Set  32:Copy and Set  35:Set memory mode  40:ResetMeshTemp",int,"");
+  BBTK_INPUT(MeshManager_tool,Tool,"(default 0) 0:Nothing  10:Undo  20:ReDo  30:Set  32:Copy and Set  35:Set memory mode  40:ResetMeshTemp     50: Set Array of meshes  60:Select mesh by name  70:Delete current mesh",int,"");
   BBTK_INPUT(MeshManager_tool,Mesh,"Mesh",vtkPolyData*,"");
+  BBTK_INPUT(MeshManager_tool,Meshes,"Input meshes, required for tool 50",std::vector<vtkPolyData*>,"");
+  BBTK_INPUT(MeshManager_tool,StringParam,"String input",std::string,"");
   BBTK_INPUT(MeshManager_tool,MeshManagerModel,"Mesh Manager Model",MeshManagerModel*,"");
 
 //  BBTK_OUTPUT(MeshManager_tool,Out,"First output",double,"");
index cf0b3dd2384da5f2e7b1b01847a5fbcc3a840e4e..677727c6057a054b06ecb097298ba36977c1f78a 100644 (file)
 
 #include "MeshManagerModel.h"
 
-MeshManagerModel::MeshManagerModel()
+////////////////////
+/////////////////////// MESH MODEL
+////////////////////
+
+MeshModel::MeshModel(int id)
 {
-    _meshBase = NULL;
+       _meshBase = NULL;
     _meshTemp = NULL;
+    _meshId = id;
+    _name = "mesh-" + std::to_string(id);
 }
 
-MeshManagerModel::~MeshManagerModel()
+MeshModel::MeshModel(vtkPolyData* mesh, int id)
 {
+       if(mesh != NULL){       
+               _meshBase = mesh;
+               _meshTemp = vtkPolyData::New();
+               _meshTemp->DeepCopy(_meshBase);
+               _meshId = id;
+       _name = "mesh-" + std::to_string(id);
+       }
 }
 
-void MeshManagerModel::ResetMeshTemp_()
+MeshModel::~MeshModel(){
+       if(_meshBase != NULL){
+               _meshBase->Delete();
+       }
+       if(_meshTemp != NULL){
+               _meshTemp->Delete();
+       }
+}
+
+void MeshModel::ResetMeshTemp_()
 {
     if (_meshBase!=NULL)
     {
@@ -52,29 +74,26 @@ void MeshManagerModel::ResetMeshTemp_()
     }
 }
 
-void MeshManagerModel::SetMeshBase(vtkPolyData* mesh)
+void MeshModel::SetMeshBase(vtkPolyData* mesh)
 {
     if (mesh!=NULL)
     {
         _meshBase = mesh;
         ResetMeshTemp_();
-        RefreshOutputs();
     } // if mesh
 }
 
-void MeshManagerModel::SetMeshMemoryMode(vtkPolyData* mesh)
+void MeshModel::SetMeshMemoryMode(vtkPolyData* mesh)
 {
     _meshBase = mesh;
-    RefreshOutputs();
 }
 
-void MeshManagerModel::ResetMeshTemp()
+void MeshModel::ResetMeshTemp()
 {
     ResetMeshTemp_();
-    RefreshOutputs();
 }
 
-void MeshManagerModel::CopySetMeshBase(vtkPolyData* mesh)
+void MeshModel::CopySetMeshBase(vtkPolyData* mesh)
 {
     if (mesh!=NULL)
     {
@@ -85,16 +104,291 @@ void MeshManagerModel::CopySetMeshBase(vtkPolyData* mesh)
 }
 
 
-vtkPolyData*  MeshManagerModel::GetMeshBase()
+vtkPolyData*  MeshModel::GetMeshBase()
 {
    return _meshBase;
 }
 
-vtkPolyData*  MeshManagerModel::GetMeshTemp()
+vtkPolyData*  MeshModel::GetMeshTemp()
 {
    return _meshTemp;
 }
 
-void MeshManagerModel::RefreshOutputs() // virtula
+int MeshModel::GetId()
+{
+       return _meshId;
+}
+
+std::string MeshModel::GetName()
+{
+       return _name;
+}
+
+////////////////////
+/////////////////////// MESH MANAGER
+////////////////////
+
+MeshManagerModel::MeshManagerModel()
+{
+       //MeshModel* firstMesh = new MeshModel();
+       //_meshes.push_back(firstMesh);
+       currentMesh = 0;
+       meshId = 0;
+}
+
+MeshManagerModel::~MeshManagerModel()
+{
+       DeleteAll();
+}
+
+void MeshManagerModel::RefreshOutputs(bool signalBox) // virtual
+{
+}
+
+int MeshManagerModel::GetNumberOfMeshes(){
+       return _meshes.size();
+}
+
+void MeshManagerModel::AddMesh_(vtkPolyData* mesh){
+       if(mesh != NULL){
+               MeshModel *meshModel = new MeshModel(mesh, meshId);
+               _meshes.push_back(meshModel);
+               meshId++;
+       }
+       else{
+               printf("PG MeshManagerModel::AddMesh Mesh is null \n");
+       }
+}
+
+void MeshManagerModel::AddMesh(vtkPolyData* mesh){
+       AddMesh_(mesh);
+       RefreshOutputs(true);
+}
+
+void MeshManagerModel::AddMeshes_(std::vector<vtkPolyData*> meshList){
+       if(!meshList.empty())
+       {
+               MeshModel *meshModel;
+               for(int i = 0; i < meshList.size(); i++){
+                       meshModel = new MeshModel(meshList[i], meshId);
+                       _meshes.push_back(meshModel);
+                       meshId++;
+               }
+       }else{
+               printf("PG MeshManagerModel::AddMeshes Empty list of meshes \n");
+       }
+}
+
+void MeshManagerModel::AddMeshes(std::vector<vtkPolyData*> meshList){
+       AddMeshes_(meshList);
+       RefreshOutputs(true);
+}
+
+void MeshManagerModel::AddEmptyMesh_(){
+       MeshModel *meshModel = new MeshModel(meshId);
+       _meshes.push_back(meshModel);
+       meshId++;
+}
+
+void MeshManagerModel::AddEmptyMesh(){
+       AddEmptyMesh_();
+       RefreshOutputs(true);
+}
+
+void MeshManagerModel::InsertMeshesAtCurrent_(std::vector<vtkPolyData*> meshList)
+{
+       if(!meshList.empty())
+       {
+               std::vector<MeshModel*> tmpVect;
+               MeshModel *meshModel;
+               for(int i = 0; i < meshList.size(); i++){
+                       meshModel = new MeshModel(meshList[i], meshId);
+                       tmpVect.push_back(meshModel);
+                       meshId++;
+               }
+               _meshes.insert(_meshes.begin() + currentMesh, tmpVect.begin(), tmpVect.end());
+       }else{
+               printf("PG MeshManagerModel::AddMeshes Empty list of meshes \n");
+       }
+}
+
+void MeshManagerModel::InsertMeshesAtCurrent(std::vector<vtkPolyData*> meshList)
+{
+       InsertMeshesAtCurrent_(meshList);
+       RefreshOutputs(true);
+}
+
+void MeshManagerModel::SelectMesh(int i) {
+       if(i >= 0 && i < _meshes.size()){
+               int prevCurrent = currentMesh;
+               currentMesh = i;
+               if(prevCurrent != i){
+                       RefreshOutputs(true);           
+               }
+       }
+       else{
+               printf("PG MeshManagerModel::SelectMesh index out of bounds \n");
+       }
+}
+
+void MeshManagerModel::SelectMeshByName(std::string meshName) {
+       if(!_meshes.empty()){
+               bool found = false;
+               for(int i = 0; i < _meshes.size() && !found; i++){
+                       if(_meshes.at(i)->GetName() == meshName){
+                               found = true;
+                               SelectMesh(i);
+                       }
+               }
+       }
+}
+
+void MeshManagerModel::DeleteMesh(int position){
+       if(position >= 0 && position < _meshes.size()){
+               delete _meshes.at(position);
+               _meshes.erase(_meshes.begin() + position);
+               currentMesh = currentMesh + (position <= currentMesh?-1:0);
+               if(currentMesh < 0){
+                       currentMesh = 0;
+               }
+               RefreshOutputs(true);
+       }
+}
+
+void MeshManagerModel::DeleteMeshByName(std::string meshName){
+       if(!_meshes.empty()){
+               bool found = false;
+               for(int i = 0; i < _meshes.size() && !found; i++){
+                       if(_meshes.at(i)->GetName() == meshName){
+                               found = true;
+                               delete _meshes.at(i);
+                               _meshes.erase(_meshes.begin() + i);
+                               currentMesh = currentMesh + (i <= currentMesh?-1:0);
+                               if(currentMesh < 0){
+                                       currentMesh = 0;
+                               }
+                               RefreshOutputs(true);
+                       }
+               }
+       }
+}
+
+void MeshManagerModel::DeleteCurrentMesh(){
+       if(!_meshes.empty()){   
+               delete _meshes.at(currentMesh);
+               _meshes.erase(_meshes.begin() + currentMesh);
+               currentMesh--;
+               if(currentMesh < 0){
+                       currentMesh = 0;
+               }
+               RefreshOutputs(true);
+       }
+}
+
+void MeshManagerModel::DeleteAll(){
+       if(!_meshes.empty()){   
+               for (MeshModel* element : _meshes)
+               {
+                       delete element;
+               } 
+               _meshes.clear();
+               RefreshOutputs(true);
+       }
+}
+
+void MeshManagerModel::NextMesh(){
+       currentMesh++;
+       if(currentMesh >= _meshes.size()){
+               currentMesh = _meshes.size()-1;
+       }
+       RefreshOutputs(true);
+}
+
+void MeshManagerModel::PreviousMesh(){
+       currentMesh--;
+       if(currentMesh < 0){
+               currentMesh = 0;
+       }
+       RefreshOutputs(true);
+}
+
+MeshModel* MeshManagerModel::GetMeshModel(){
+       return _meshes.at(currentMesh);
+}
+
+vtkPolyData*  MeshManagerModel::GetMeshBase()
+{
+       if(!_meshes.empty()){
+               return _meshes.at(currentMesh)->GetMeshBase();
+       }
+       else{
+               return NULL;
+       }
+}
+
+vtkPolyData*  MeshManagerModel::GetMeshTemp()
+{
+       if(!_meshes.empty()){
+               return _meshes.at(currentMesh)->GetMeshTemp();
+       }
+       else{
+               return NULL;
+       }
+}
+
+void MeshManagerModel::SetMeshBase(vtkPolyData* mesh)
+{
+    if(!_meshes.empty()){
+        _meshes.at(currentMesh)->SetMeshBase(mesh);
+        RefreshOutputs(true);
+    }else{
+       printf("PG MeshManagerModel::SetMeshMemoryMode Mesh vector is empty \n");
+    }
+}
+
+void MeshManagerModel::SetMeshMemoryMode(vtkPolyData* mesh)
+{
+       //if(!_meshes.empty()){
+       if(_meshes.size() > 1){
+               DeleteAll();
+       }
+       if(_meshes.size() == 0){
+               AddEmptyMesh_();
+       }
+       _meshes.at(currentMesh)->SetMeshMemoryMode(mesh);
+       RefreshOutputs(true);
+    //}else{
+    // printf("PG MeshManagerModel::SetMeshMemoryMode Mesh vector is empty \n");
+    //}
+}
+
+void MeshManagerModel::ResetMeshTemp()
+{
+       if(!_meshes.empty()){
+       _meshes.at(currentMesh)->ResetMeshTemp();
+       RefreshOutputs(true);
+    }else{
+       printf("PG MeshManagerModel::ResetMeshTemp Mesh vector is empty \n");
+    }
+    
+}
+
+void MeshManagerModel::CopySetMeshBase(vtkPolyData* mesh)
+{
+       if(!_meshes.empty()){
+               _meshes.at(currentMesh)->CopySetMeshBase(mesh);
+               RefreshOutputs(true);
+       }
+       else{
+               printf("PG MeshManagerModel::CopySetMeshBase Mesh vector is empty \n");
+       }
+}
+
+std::vector<std::string> MeshManagerModel::GetMeshNames()
 {
+       std::vector<std::string> names;
+       for(int i = 0; i < _meshes.size(); i++){
+               names.push_back(_meshes.at(i)->GetName());
+       }
+       return names;
 }
index b2f5dc9051b13963e1383c8cf511ce6f54140d12..b679255a55e1686afbf39b4ad59a030752c4aedf 100644 (file)
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------
 */
+#include <vtkPolyData.h>
+
+class MeshModel{
+
+public:
+       MeshModel(int id);
+       MeshModel(vtkPolyData* mesh, int id);
+       ~MeshModel();
+       
+       void                    SetMeshBase(vtkPolyData* mesh);
+    void                       SetMeshMemoryMode(vtkPolyData* mesh);
+    void                       CopySetMeshBase(vtkPolyData* mesh);
+    void                       ResetMeshTemp();
+    void                       ResetMeshTemp_();
+    vtkPolyData*       GetMeshBase();
+    vtkPolyData*       GetMeshTemp();
+    int                        GetId();
+    std::string        GetName();
+    
+protected:
+
+private:
+       vtkPolyData                             *_meshBase;
+    vtkPolyData                                *_meshTemp;
+    int                                                        _meshId;
+    std::string                                        _name;
+};
 
 #ifndef _MESHMANAGERMODEL_H_
 #define _MESHMANAGERMODEL_H_
@@ -33,8 +60,6 @@
 // [classdescription]
 //---------------------------------------------
 
-#include <vtkPolyData.h>
-
 class MeshManagerModel
 {
 
@@ -49,10 +74,36 @@ public :
     void SetMeshMemoryMode(vtkPolyData* mesh);
     void CopySetMeshBase(vtkPolyData* mesh);
     void ResetMeshTemp();
-    void ResetMeshTemp_();
+    //void ResetMeshTemp_();
     vtkPolyData* GetMeshBase();
     vtkPolyData* GetMeshTemp();
-    virtual void RefreshOutputs();
+    
+    virtual void RefreshOutputs(bool signalBox);
+    
+    MeshModel* GetMeshModel();
+    int GetNumberOfMeshes();
+    
+    void AddMesh_(vtkPolyData* mesh);
+    void AddMesh(vtkPolyData* mesh);
+    
+    void AddEmptyMesh_();
+    void AddEmptyMesh();
+    
+    void AddMeshes(std::vector<vtkPolyData*> meshList);
+    void AddMeshes_(std::vector<vtkPolyData*> meshList);
+    
+    void InsertMeshesAtCurrent_(std::vector<vtkPolyData*> meshList);
+    void InsertMeshesAtCurrent(std::vector<vtkPolyData*> meshList);
+    
+    void SelectMesh(int i);
+    void SelectMeshByName(std::string meshName);
+    void DeleteMesh(int position);
+    void DeleteMeshByName(std::string meshName);
+    void DeleteCurrentMesh();
+    void DeleteAll();
+    void NextMesh();
+    void PreviousMesh();
+    std::vector<std::string> GetMeshNames();
 
 //--Method template----------------------------
 //  void FunctionName(int& parameterA);
@@ -67,8 +118,10 @@ protected:
 //Methods and attributes only visible by this class
 //---------------------------------------------
 private:
-    vtkPolyData *_meshBase;
-    vtkPolyData *_meshTemp;
+    
+    std::vector<MeshModel*>    _meshes;
+    int                                                currentMesh;
+    int                                                        meshId;
 };
 
 //-end of _MESHMANAGERMODEL_H_------------------------------------------------------