]> Creatis software - creaMaracasVisu.git/commitdiff
open dialog y ya funciona el NV
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Wed, 2 Dec 2009 16:27:37 +0000 (16:27 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Wed, 2 Dec 2009 16:27:37 +0000 (16:27 +0000)
lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenLoadImageDialog.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/LogicalColorBar.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx

index 23d080f8a816af0ac0edb849a1d9227a24e979d5..f2a09305c5c651fea2cfaaff638f9f0524c2c6c6 100644 (file)
@@ -20,6 +20,7 @@ OpenLoadImageDialog::OpenLoadImageDialog()
 
                getImageDataDialog = (GETIMAGEDATADIALOG)GetProcAddress(gimmickhandle, "getImageDataDialog");
 
+               std::cout<<"imagehandle "<<gimmickhandle<<std::endl;
                std::cout<<"imagedatadialog "<<getImageDataDialog<<std::endl;
 
                if(getImageDataDialog!=NULL){
@@ -27,10 +28,8 @@ OpenLoadImageDialog::OpenLoadImageDialog()
                        gimmicknotfound = false;
                }
        }       
-#else
-       //GNU part
-#endif
 
+#endif
 
        if(gimmicknotfound){
 
@@ -46,6 +45,9 @@ OpenLoadImageDialog::OpenLoadImageDialog()
                        img = reader->GetOutput();              
                }               
        }       
+
+
+       
 }
 
 //-------------------------------------------------------------------
index d94b7560abb78d3b44b0bb4d4ffc648d8d3219d2..feaf8f776dda817359931a00d4aa963b474f13af 100644 (file)
                        {
                                logicColorPoints.push_back(newColorPoint);
                                addedPoint = true;
-                       }
-                       for ( iter = logicColorPoints.begin(); i<=maxIndex && !addedPoint; iter++ )
-                       {
-                               nextIter = iter;
-                               int before = (*iter)->getRealX() ;
-                               if(before>xRealValue && i==0)
-                               {
-                                       //Is the first point
-                                       logicColorPoints.insert( iter, newColorPoint );
-                                       addedPoint =true;
-                                       lastAddedPoint = newColorPoint;
-                               }
-                               else if(before<xRealValue && i==maxIndex)
+                       }else{                          
+                               iter = logicColorPoints.begin();
+                               for (i=0; i<=maxIndex && !addedPoint; i++)
                                {
-                                       //Is the last point 
-                                       logicColorPoints.insert( iter+1, newColorPoint );       
-                                       addedPoint =true;
-                                       lastAddedPoint = newColorPoint;
-                               }
-                               else if(i<maxIndex)
-                               {
-                                       //
-                                       nextIter++;                     
-                                       int after = (*nextIter)->getRealX();                            
-                                       if( before < xRealValue && after> xRealValue)
+                                       nextIter = iter;
+                                       int before = (*iter)->getRealX() ;
+                                       if(before>xRealValue && i==0)
+                                       {
+                                               //Is the first point
+                                               logicColorPoints.insert( iter, newColorPoint );
+                                               addedPoint =true;
+                                               lastAddedPoint = newColorPoint;
+                                       }
+                                       else if(before<xRealValue && i==maxIndex)
                                        {
-                                               logicColorPoints.insert( nextIter, newColorPoint );     
+                                               //Is the last point 
+                                               logicColorPoints.push_back(newColorPoint );     
                                                addedPoint =true;
                                                lastAddedPoint = newColorPoint;
                                        }
-                               }                               
-                               i++;
-                       }               
+                                       else if(i<maxIndex)
+                                       {
+                                               //
+                                               nextIter++;                     
+                                               int after = (*nextIter)->getRealX();                            
+                                               if( before < xRealValue && after> xRealValue)
+                                               {
+                                                       logicColorPoints.insert( nextIter, newColorPoint );     
+                                                       addedPoint =true;
+                                                       lastAddedPoint = newColorPoint;
+                                               }
+                                       }               
+                                       //std::cout<<"JCPaddColorPoint iterator "<<*iter<<std::endl;
+                                       if(!addedPoint)
+                                               ++iter;
+                               }               
+                       }                       
                }
                return addedPoint;              
        }
index dd262f4b379abfa61a0c21c1423d5e3d09bad149..055a12f743c926fd1c5e0f34e248b79dc7fe518f 100644 (file)
@@ -246,7 +246,7 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event)
        HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Color table"),imagedata,2);
        
                
-       hDlg->erasePointsTransferenceFunction();        
+       hDlg->erasePointsTransferenceFunction();                
        int ctfSize=ctfunVectorRed->size();
        if(ctfSize>0)
        {
@@ -257,9 +257,10 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event)
                                double gr       = (*ctfunVectorPoint)[i];
                                double r        = (*ctfunVectorRed)[i];
                                double g        = (*ctfunVectorGreen)[i];
-                               double b        = (*ctfunVectorBlue)[i];
-                       
+                               double b        = (*ctfunVectorBlue)[i];                        
+
                                hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255));
+
                                i++;
                        }
        }