mchange->Modified(); //important
mchange->Update(); //important
bbSetOutputOut( mchange->GetOutput() );
- } // if img
+ } else {
+ printf("EED ImageChangeInformation::Process NULL\n");
+ bbSetOutputOut( NULL );
+
+ } // if img
}
mwxwidget->SetOpacity( bbGetInputOpacity() );
mwxwidget->SetRadio( bbGetInputRadio() );
- if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
+ if (firsttime==true)
{
- mwxwidget->DetectCollectionActive();
- }
- if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
- {
- mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
- mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() );
- }
-
+ firsttime=false;
+ if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
+ {
+ mwxwidget->DetectCollectionActive();
+ }
+ if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
+ {
+ mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
+ mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() , bbGetInputInitLstIndexs() );
+ }
+ } // firsttime OJO machete Eduardo pour Adreas a verificar
+
mwxwidget->AutoAddPoints();
mwxwidget->TrackingPoint();
bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() );
//-----------------------------------------------------------------
void ShowNPoints::bbUserSetDefaultValues()
{
+ firsttime=true;
mwxwidget = NULL;
bbSetInputRadio(10);
bbSetInputOpacity(1);
void CreateWidget(wxWindow*);
private:
+ bool firsttime;
WidgetShowNPointsBox *mwxwidget;
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerNV,bbtk::WxBlackBox);
BBTK_NAME("ViewerNV");
BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
-BBTK_DESCRIPTION("Viewer : N view configuration 2D and 3D");
+BBTK_DESCRIPTION("Viewer : N view configuration 2D and 3D (C++,Python)");
BBTK_CATEGORY("viewer");
BBTK_INPUT(ViewerNV,Title,"Title prepended to the text",std::string,"");
BBTK_INPUT(ViewerNV,In,"Input image",vtkImageData*,"");
}
//------------------------------------------------------------------------
-void WidgetShowNPoints::SetInitLstPoints( std::vector<double> initLstPointsX, std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels )
+void WidgetShowNPoints::SetInitLstPoints( std::vector<double> initLstPointsX, std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels, std::vector<int> initLstIndexs )
{
+
+ printf("EED WidgetShowNPoints::SetInitLstPoints flag 1\n");
+
+ if (GetViewShowNPoints()->renderer==NULL)
+ {
+ return;
+ }
+ double x,y,z;
+ std::string label;
+ int i,sizeX,sizeY,sizeZ,sizeTmp,sizeLabels;
+ int ii,iIndexs,sizeIndexs;
+
+ sizeX = (int)initLstPointsX.size();
+ sizeY = (int)initLstPointsY.size();
+ sizeZ = (int)initLstPointsZ.size();
+ sizeLabels = (int)initLstLabels.size();
+ sizeIndexs = (int)initLstIndexs.size();
+
+ if (sizeIndexs==0)
+ {
+ initLstIndexs.push_back(sizeX);
+ sizeIndexs = (int)initLstIndexs.size();
+ }
+
+ if ( (sizeX==sizeY) && (sizeX==sizeZ) )
+ {
+ i=0;
+ for (iIndexs=0;iIndexs<sizeIndexs;iIndexs++ )
+ {
+ if (iIndexs!=0)
+ {
+ InsertCollectionAfter_();
+ }// if last iIndexs
+ sizeTmp = initLstIndexs[iIndexs];
+ for (ii=0;ii<sizeTmp;ii++)
+ {
+ x = initLstPointsX[i];
+ y = initLstPointsY[i];
+ z = initLstPointsZ[i];
+ if (i<sizeLabels)
+ {
+ label = initLstLabels[i];
+ } else {
+ label="";
+ }
+ AddPoint( x,y,z,label );
+ i++;
+ } // for i
+
+
+ }// for ii
+ // SetOutputBox();
+ // renderer->GetRenderWindow()->Render();
+ } // if size
+
+
+
+
+ /*
+
// EED 2022-05-19
//if (this->renderer==NULL)
if (GetViewShowNPoints()->renderer==NULL)
// SetOutputBox();
// renderer->GetRenderWindow()->Render();
} // if size
+
+ */
}
//------------------------------------------------------------------------
int GetLstModelShowNPointsSize();
ModelShowNPoints* GetModelShowNPoints();
ViewShowNPoints* GetViewShowNPoints();
- void SetInitLstPoints( std::vector<double> initLstPointsX, std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels );
+ void SetInitLstPoints( std::vector<double> initLstPointsX, std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels, std::vector<int> initLstIndexs );
void SetType(int type);
int GetType();