BBTK_BLACK_BOX_IMPLEMENTATION(DrawAxe3D,bbtk::AtomicBlackBox);
void DrawAxe3D::Process()
{
- printf("EED DrawAxe3D::Process start \n");
-
std::vector< double > vectx = bbGetInputlstPointX();
std::vector< double > vecty = bbGetInputlstPointY();
std::vector< double > vectz = bbGetInputlstPointZ();
firsttime=false;
bbGetInputRenderer()->AddActor( mvtkactor );
}
-
- printf("EED DrawAxe3D::Process end \n");
-
}
void DrawAxe3D::bbUserSetDefaultValues()
void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
{
//printf("CPR: bbwxMaracas_N_ViewersWidget::OnRefreshView -> actualiza X, Y y Z\n");
- mbbViewerNV->point.clear();
+ mbbViewerNV->_point.clear();
- mbbViewerNV->point.push_back( (int)GetX() );
- mbbViewerNV->point.push_back( (int)GetY() );
- mbbViewerNV->point.push_back( (int)GetZ() );
- mbbViewerNV->bbSetOutputPoint( mbbViewerNV->point );
+ mbbViewerNV->_point.push_back( (int)GetX() );
+ mbbViewerNV->_point.push_back( (int)GetY() );
+ mbbViewerNV->_point.push_back( (int)GetZ() );
+ mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
mbbViewerNV->bbSignalOutputModification(std::string("Point"));
wxMaracas_N_ViewersWidget::OnRefreshView(event);
//-------------------------------------------------------------
void ViewerNV::Process()
{
-
- printf("EED ViewerNV::Process start \n");
-
vtkImageData* img = bbGetInputIn();
/*
double spc[3];
std::vector<int> type = bbGetInputnTypeView();
- if(img != NULL && mwxwidget != NULL){
- if(!compareVectors(type, currenttype)){
- mwxwidget->SetType(&type);
- mwxwidget->UpdateLayout(img);
- }else if (img != currentimg){
- mwxwidget->SetImage(img);
- //mwxwidget->UpdateLayout(img);
+ if(img != NULL && _mwxwidget != NULL){
+ if(!compareVectors(type, _currenttype)){
+ _mwxwidget->SetType(&type);
+ _mwxwidget->UpdateLayout(img);
+ }else if (img != _currentimg){
+ _mwxwidget->SetImage(img);
}
-// if (firsttime==true) // EED 21 aout 2010
-// {
-// firsttime=false;
-// mwxwidget->ConfigureVTK();
-// }
+ _mwxwidget->RefreshView();
- mwxwidget->RefreshView();
+ _currenttype = type;
+ _currentimg = img;
- currenttype = type;
- currentimg = img;
-
- point.clear();
- point.push_back((int)mwxwidget->GetX());
- point.push_back((int)mwxwidget->GetY());
- point.push_back((int)mwxwidget->GetZ());
- bbSetOutputPoint(point);
+ _point.clear();
+ _point.push_back((int)_mwxwidget->GetX());
+ _point.push_back((int)_mwxwidget->GetY());
+ _point.push_back((int)_mwxwidget->GetZ());
+ bbSetOutputPoint(_point);
// WxBlackBox::Process();
// mwxwidget->SetImage(img );
- wxVtkBaseView *wvbv1 = mwxwidget->GetwxVtkBaseView(1);
- wxVtkBaseView *wvbv2 = mwxwidget->GetwxVtkBaseView(2);
- wxVtkBaseView *wvbv3 = mwxwidget->GetwxVtkBaseView(3);
- wxVtkBaseView *wvbv4 = mwxwidget->GetwxVtkBaseView(4);
+ wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView(1);
+ wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView(2);
+ wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView(3);
+ wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView(4);
//wxwidget->RefreshView();
if(bbGetInputColorFunction()!=NULL)
{
- mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
+ _mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
}
if(bbGetInputWindowLevel()!=-1)
{
- mwxwidget->setWindowLevel(bbGetInputWindowLevel());
+ _mwxwidget->setWindowLevel(bbGetInputWindowLevel());
}
if(bbGetInputColorLevel()!=-1)
if(bbGetInputColorLevel() == 0)
{
std::cout<<"colorlevel "<<bbGetInputColorLevel()<<std::endl;
- mwxwidget->setColorLevel(0.1);
+ _mwxwidget->setColorLevel(0.1);
}else{
- mwxwidget->setColorLevel(bbGetInputColorLevel());
+ _mwxwidget->setColorLevel(bbGetInputColorLevel());
}
}
}// mwxwidget != NULL
-
- printf("EED ViewerNV::Process end\n");
}
//-------------------------------------------------------------
void ViewerNV::CreateWidget(wxWindow* parent)
{
- printf("EED ViewerNV::CreateWidget start\n");
-
bbtkDebugMessageInc("Core",9,"ViewerNV::CreateWidget()"<<std::endl);
- mwxwidget = new bbwxMaracas_N_ViewersWidget( this, parent );
+ _mwxwidget = new bbwxMaracas_N_ViewersWidget( this, parent );
bbtkDebugDecTab("Core",9);
- bbSetOutputWidget( mwxwidget );
-
- printf("EED ViewerNV::CreateWidget end\n");
-
+ bbSetOutputWidget( _mwxwidget );
//this->bbSignalOutputModification();
//Process();
}
//-------------------------------------------------------------
void ViewerNV::bbUserSetDefaultValues()
{
-// firsttime=true;
- mwxwidget = NULL;
+ _currentimg = NULL;
+ _mwxwidget = NULL;
bbSetInputIn(NULL);
bbSetInputObs1(NULL);
BBTK_CREATE_WIDGET(CreateWidget);
void CreateWidget(wxWindow* parent);
- std::vector<int> point;
+ std::vector<int> _point;
private:
-// bool firsttime;
-
- vtkImageData* currentimg;
- std::vector<int> currenttype;
- wxMaracas_N_ViewersWidget *mwxwidget;
+ vtkImageData *_currentimg;
+ std::vector<int> _currenttype;
+ wxMaracas_N_ViewersWidget *_mwxwidget;
+
bool compareVectors(std::vector<int> type,std::vector<int> currenttype);
void updateObservers();
};
nps_t = nps-1;
} // if close
- printf("EED manualViewContour::ifTouchContour \n");
+printf("EED Warning manualViewContour::ifTouchContour \n");
for( i = 0; i < nps_t; i++ )
{
-printf("%d ", i);
_pts->GetPoint(i%nps, ppA);
_pts->GetPoint((i+1)%nps, ppB);
d1 = sqrt( (ppA[0]-xx)*(ppA[0]-xx) + (ppA[1]-yy)*(ppA[1]-yy) + (ppA[2]-zz)*(ppA[2]-zz));
Program: wxMaracas
Module: $RCSfile: wxMaracas_N_ViewersWidget.cxx,v $
Language: C++
- Date: $Date: 2012/05/30 17:23:12 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2012/10/11 10:45:16 $
+ Version: $Revision: 1.22 $
Copyright: (c) 2002, 2003
License:
if (wxwindow2!=NULL) { wxwindow2->SetImage(image); }
if (wxwindow3!=NULL) { wxwindow3->SetImage(image); }
if (wxwindow4!=NULL) { wxwindow4->SetImage(image); }
- ConfigureVTK();
-
+
+// ConfigureVTK();
}
+
//-----------------------------------------------------------------------------------
void wxMaracas_N_ViewersWidget::ConfigureVTK()
{
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $
Language: C++
- Date: $Date: 2012/05/30 17:23:12 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2012/10/11 10:45:16 $
+ Version: $Revision: 1.36 $
Copyright: (c) 2002, 2003
License:
if (mwxvtkmpr3Dview !=NULL)
{
mwxvtkmpr3Dview->Configure();
-printf("EED wxMaracas_ViewerWidget::ConfigureVTK \n");
//EED??? mwxvtkmpr3Dview->ResetCamera(ext,org,spc);
}
//-------------------------------------------------------------------------
void wxMaracas_ViewerWidget::RefreshView()
{
- if (mvtk2Dbaseview !=NULL ){ mvtk2Dbaseview->Refresh(); }
- if (mvtkmpr2Dview_X !=NULL ){ mvtkmpr2Dview_X->Refresh(); }
- if (mvtkmpr2Dview_Y !=NULL ){ mvtkmpr2Dview_Y->Refresh(); }
- if (mvtkmpr2Dview_Z !=NULL ){ mvtkmpr2Dview_Z->Refresh(); }
- if (mvtkplane2Dview !=NULL ){ mvtkplane2Dview->Refresh(); }
- if (mwxsphereview !=NULL ){ mwxsphereview ->Refresh(); }
-
- if (mwxvtkmpr3Dview !=NULL ){ mwxvtkmpr3Dview->RefreshView(); }
- if (mwxvtkclipping3Dview !=NULL ){ mwxvtkclipping3Dview->Refresh(); }
- if (mwxvtk3Dbaseview_Clipping3D !=NULL ){ mwxvtk3Dbaseview_Clipping3D->Refresh();}
+ if (mvtk2Dbaseview !=NULL ){ mvtk2Dbaseview->Refresh(); }
+ if (mvtkmpr2Dview_X !=NULL ){ mvtkmpr2Dview_X->Refresh(); }
+ if (mvtkmpr2Dview_Y !=NULL ){ mvtkmpr2Dview_Y->Refresh(); }
+ if (mvtkmpr2Dview_Z !=NULL ){ mvtkmpr2Dview_Z->Refresh(); }
+ if (mvtkplane2Dview !=NULL ){ mvtkplane2Dview->Refresh(); }
+ if (mwxsphereview !=NULL ){ mwxsphereview ->Refresh(); }
+ if (mwxvtkmpr3Dview !=NULL ){ mwxvtkmpr3Dview->RefreshView(); }
+ if (mwxvtkclipping3Dview !=NULL ){ mwxvtkclipping3Dview->Refresh(); }
+ if (mwxvtk3Dbaseview_Clipping3D !=NULL ){ mwxvtk3Dbaseview_Clipping3D->Refresh(); }
}
//-------------------------------------------------------------------------
mar->AddImageData(image);
}
+
+ if (mvtk2Dbaseview!=NULL)
+ {
+ mvtk2Dbaseview->SetImageToVtkViewer(image);
+ }
+
+ if (mvtkmpr2Dview_X!=NULL){
+ mvtkmpr2Dview_X->SetImageToVtkViewer(image);
+ }
+ if (mvtkmpr2Dview_Y!=NULL){
+ mvtkmpr2Dview_Y->SetImageToVtkViewer(image);
+ }
+ if (mvtkmpr2Dview_Z!=NULL){
+ mvtkmpr2Dview_Z->SetImageToVtkViewer(image);
+ }
+
+ if (mvtkplane2Dview!=NULL){
+ // ??? EED 10 oct 2012
+ }
+ if (mwxsphereview!=NULL){
+ // ??? EED 10 oct 2012
+ }
+ if (mwxvtk3Dbaseview_Clipping3D!=NULL){
+ // ??? EED 10 oct 2012
+ }
+
+
+
//EED 26/11/2009
// ConfigureVTK();
// RefreshView();
//-------------------------------------------------------------------
void wxVtk2DBaseView::ResetView()
{
+ printf("EED wxVtk2DBaseView::ResetView");
double spx = 0,spy = 0,spz = 0;
int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1;
wxVtkBaseView::Configure();
}
+
+//-------------------------------------------------------------------
+void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData)
+{
+ if (_imageViewer2XYZ!=NULL)
+ {
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData );
+ } // if _imageViewer2XYZ
+}
+
+
//-------------------------------------------------------------------
void wxVtk2DBaseView::Configure(bool okimage)
{
vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData();
- if (imageData!=NULL){
-
+ if (imageData!=NULL)
+ {
imageData->UpdateInformation();
imageData->SetUpdateExtent( imageData->GetWholeExtent());
imageData->Update();
if (okimage==true){
imageData->GetSpacing (spx,spy,spz);
imageData->GetExtent (x1,x2,y1,y2,z1,z2);
- _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
+ SetImageToVtkViewer(imageData);
_imageViewer2XYZ->SetExtentDimension(x1,x2,y1,y2,z1,z2);
double range[2];
imageData->GetScalarRange(range);
// SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
- vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2();
- vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
+ vtkImageViewer2 *IV2 = _imageViewer2XYZ->GetVtkImageViewer2();
+ vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
//EED 17Avril2009
//EED 21 mars 2012 FLIP problem ..PLOP..
void setColorLevel(double level);
virtual int GetDirection();
+ void SetImageToVtkViewer(vtkImageData *imageData);
private:
//-------------------------------------------------------------------
void wxVtkBaseView::Refresh() // virtual
{
+
// EED 10 Oct 2007
-
#if defined(WIN32)
_iren->Refresh(false);
#else
//-------------------------------------------------------------------
void wxVtkBaseView::RefreshView() // virtual
{
+ printf("EED wxVtkBaseView::RefreshView() \n");
// EED 10 Oct 2007
#if defined(WIN32)
return (vtkMPRBaseData*)GetVtkBaseData();
}
//-------------------------------------------------------------------
-void wxVtkMPR2DView::Configure(){
+void wxVtkMPR2DView::Configure()
+{
+ printf("EED wxVtkMPR2DView::Configure");
+
wxVtk2DBaseView::Configure();
void wxVtkMPR2DView::Refresh()
{
+ printf("wxVtkMPR2DView::Refresh start\n");
//wxVtk2DBaseView::Refresh();
_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified();
wxVtkBaseView::Refresh();
+
+ printf("wxVtkMPR2DView::Refresh end\n");
+
}
}
//-------------------------------------------------------------------