]> Creatis software - creaVtk.git/commitdiff
MeshManager
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 31 Aug 2022 15:23:37 +0000 (17:23 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 31 Aug 2022 15:23:37 +0000 (17:23 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkActor.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager_tool.cxx
lib/creaVtk/MeshManagerModel.cpp
lib/creaVtk/MeshManagerModel.h

index 2d52f394429bb1d012155eada8377f2c9cafab45..84e89e6d127aecee69fcbee59a8c9979d3a21169 100644 (file)
@@ -48,19 +48,16 @@ void Actor::Process()
                        double b = bbGetInputColor()[2];
                        vtkactor->GetProperty()->SetColor( r,g,b );
                }
-                
                 if ( bbGetInputTransform()!=NULL )
                 {
                    vtkprop3D->SetUserTransform( bbGetInputTransform() );
                 }
 
-       //     bbSetOutputOut( vtkactor );
-
-                // Interface Update
+        // bbSetOutputOut( vtkactor );
+        // Interface Update
 
                if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() ))
                {
-               
                        if (bbGetInputActive()==true )
                        {
                                bbGetInputRenderer()->AddActor( vtkprop3D );
index 4c444dd8fb467c9c9139eb7b60350973b668046c..7b9cf258dae4c0b196038a147fd86cb334ce452a 100644 (file)
@@ -36,11 +36,6 @@ void CreateMeshFromPoints::Process()
                std::vector<double> lstZ                = bbGetInputLstZ();
                std::vector<int> lstIndexs              = bbGetInputLstIndexs();
     
-    printf("CreateMeshFromPoints::Process: sizeX %d \n", lstX.size() );
-    printf("CreateMeshFromPoints::Process: sizeY %d \n", lstY.size() );
-    printf("CreateMeshFromPoints::Process: sizeZ %d \n", lstZ.size() );
-    printf("CreateMeshFromPoints::Process: lstIndexs %d \n", lstIndexs.size() );
-
                if ( (lstIndexs.size()<=1) || (lstX.size()==0) || (lstX.size()!=lstY.size()) || (lstY.size()!=lstZ.size()) )
                {
                        printf("Warnning! CreateMeshFromPoints::Process: List of points X Y Z  and LstIndexes is not correct\n");
index 826d759336ef5e5f24c2d7d21f95299f8ce9b0c5..742a700036b835569ae09c414d51850e95a37ea0 100644 (file)
@@ -33,7 +33,7 @@ void Cutter::Process()
   //  See example in:
   //  https://kitware.github.io/vtk-examples/site/Cxx/VisualizationAlgorithms/Cutter/
   
-    printf("EED Cutter::Process start this=%p   ImFu=%p \n ", this, bbGetInputImplicitFunction() );
+    printf("EED Cutter::Process start this=%p   ImFu=%p In=%p\n", this, bbGetInputImplicitFunction() , bbGetInputIn() );
     if ( (bbGetInputActive()==true) && (bbGetInputIn()!=NULL) )
     {
         vtkCutter *cutter;
@@ -45,9 +45,8 @@ void Cutter::Process()
     } else {
         bbSetOutputOut( NULL );
     }
-    
-    printf("EED Cutter::Process end\n ");
 }
+
 //===== 
 // 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)
 //===== 
index bda31e1b44a90818c75af3cb1514f33a543bbc5e..b175bd4d25b3754d3af712d8f72d62127f0455a5 100644 (file)
@@ -26,7 +26,9 @@ void MeshManager_tool::Process()
 //      (the one provided in the attribute 'type' of the tag 'input')
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
+    
+    printf("EED MeshManager_tool::Process start this=%p\n", this);
+    
     if (bbGetInputMeshManagerModel()!=NULL)
     {
         if (bbGetInputTool()==10) // Undo
@@ -51,10 +53,26 @@ void MeshManager_tool::Process()
             } // Mesh!=NULL
         } // if Tool 30 Set
 
+        if (bbGetInputTool()==35)  // Set memory mode
+        {
+            printf("EED    MeshManager_tool::Process Set memory mode\n");
+//            if (bbGetInputMesh()!=NULL){
+//                vtkPoints   *points = bbGetInputMesh()->GetPoints();
+//                if (points!=NULL)
+//                {
+                    bbGetInputMeshManagerModel()->SetMeshMemoryMode( bbGetInputMesh() );
+//                } // if points!=NULL
+//            } // Mesh!=NULL
+        } // if Tool 35 Set memory mode
+
+        
         if (bbGetInputTool()==40) // Reset
         {
             printf("EED Warning!   MeshManager_tool Reset   Not implemented.\n");
         } // if Tool 40 Reset
+        
+
+        
     } else {
         printf("EED Warning! MeshManager_tool : MeshManagerModel not defined. \n");
     }// if MeshManagerModel != NULL
index 01f33987c6399fb0763949edcd9bc7d9b334673d..f87f714e34d69de8cfe8893f507999e182612c2c 100644 (file)
@@ -52,6 +52,12 @@ void MeshManagerModel::SetMeshBase(vtkPolyData* mesh)
     } // if mesh
 }
 
+void MeshManagerModel::SetMeshMemoryMode(vtkPolyData* mesh)
+{
+    _meshBase = mesh;
+    RefreshOutputs();
+}
+
 vtkPolyData*  MeshManagerModel::GetMeshBase()
 {
    return _meshBase;
index 7677cc7641d712e6b8aca96423299b3269c4e839..4373ff1614705eb3d7f7749e29269213c2627b8e 100644 (file)
@@ -46,6 +46,7 @@ public :
   ~MeshManagerModel();
 
     void SetMeshBase(vtkPolyData* mesh);
+    void SetMeshMemoryMode(vtkPolyData* mesh);
     vtkPolyData* GetMeshBase();
     vtkPolyData* GetMeshTemp();
     virtual void RefreshOutputs();