//---------------------------------------------------
void PlotterView::Process()
{
-
- if (bbGetInputInX().size()==bbGetInputInY().size() ) {
-
+ if (bbGetInputInX().size()==bbGetInputInY().size() )
+ {
pGraphicalFunction *pGF = mwxwidget->getFunction(0);
pGraphicalFunction *pGF2 = mwxwidget->getFunction(1);
-
-
// EED 2020-01-22
if (pGF!=NULL)
{
mwxwidget->deleteFunction(pGF2);
pGF2=NULL;
}
-
-
-
+
if ( (bbGetInputInY().size()!=0) && (pGF==NULL) )
{
// avoid 'taking address of temporary '
//pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx
-
std::vector<double> inX;
if (bbGetInputInX().size()==0)
{
inX = bbGetInputInX();
} // if bbGetInputInX
std::vector<double> inY = bbGetInputInY();
-
- pGF = mwxwidget->getFunctionForVectors( &inX, &inY );
- mwxwidget->addFunction(pGF);
+
+ bool ok=false;
+ int i, size = inY.size();
+ for ( i=0 ; i<size ; i++ )
+ {
+ if (inY[i]!=0) {ok=true;}
+ }// for
+ if (ok==true)
+ {
+ pGF = mwxwidget->getFunctionForVectors( &inX, &inY );
+ mwxwidget->addFunction(pGF);
+ } // if ok
+
} // if bbGetInputInY
- if ((bbGetInputInY2().size()!=0)&& (pGF2==NULL) )
+ if ((bbGetInputInY2().size()!=0)&& (pGF2==NULL) )
{
// avoid 'taking address of temporary '
//pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx
-
std::vector<double> inX2;
if (bbGetInputInX().size()==0)
{
} else {
inX2 = bbGetInputInX();
} // if bbGetInputInX
- std::vector<double> inY2 = bbGetInputInY();
- pGF2 = mwxwidget->getFunctionForVectors( &inX2, &inY2 );
- mwxwidget->addFunction(pGF2);
+ std::vector<double> inY2 = bbGetInputInY2();
+
+ bool ok2=false;
+ int i, size = inY2.size();
+ for ( i=0 ; i<size ; i++ )
+ {
+ if (inY2[i]!=0) {ok2=true;}
+ }// for
+ if (ok2==true)
+ {
+ pGF2 = mwxwidget->getFunctionForVectors( &inX2, &inY2 );
+ mwxwidget->addFunction(pGF2);
+ } // if ok
+
+
} // if bbGetInputInY
-
/* EED 2020-01-22
} // for
}// if pGF
*/
-
mwxwidget->UpdateAll();
-
} else {
printf("EED Warnning... PlotterView::Process() Size of vecto X and Y is not coherent.\n");
} // InX.size InY.size
wxwindow=panelClipping3D;
} else if (type==6) {
- panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
- mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
- vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
- wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
- wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
- wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
+ panelClipping3D = new wxSplitterWindow( panel , -1);
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
+ mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
+ vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
+ wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
+ wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
+ wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
+ wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
panelControl->SetAutoLayout(true);
//-------------------------------------------------------------------------
void wxMaracas_ViewerWidget::RefreshView()
{
- if (mwxvtk3Dbaseview_Clipping3D !=NULL ){ mwxvtk3Dbaseview_Clipping3D->Refresh(); }
- if (mwxvtkclipping3Dview !=NULL ){ mwxvtkclipping3Dview->Refresh(); }
- if (mwxvtkmpr3Dview !=NULL ){ mwxvtkmpr3Dview->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 ->RefreshView(); }
+//printf("EED wxMaracas_ViewerWidget::RefreshView %p\n", this);
+ 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 ->RefreshView(); }
}
//-------------------------------------------------------------------------
{
mvtkmprbasedata->SetColorWindow(colorWindow);
mvtkmprbasedata->SetColorLevel(colorLevel);
-//EED Borrame
-/*
- RefreshView();
- if(mvtk2Dbaseview!=NULL)
- {
- mvtk2Dbaseview->SetColorWindow(level);
- }
-
- if(mvtkmpr2Dview_X!=NULL)
- {
- mvtkmpr2Dview_X->SetColorWindow(level);
- }
-
- if(mvtkmpr2Dview_Y!=NULL)
- {
- mvtkmpr2Dview_Y->SetColorWindow(level);
- }
-
- if(mvtkmpr2Dview_Z!=NULL)
- {
- mvtkmpr2Dview_Z->SetColorWindow(level);
- }
-
- if(mwxvtkmpr3Dview!=NULL)
- {
- mwxvtkmpr3Dview->SetColorWindow(level);
- }
- */
}
//------------------------------------------------------------------------------------------------------------
void setColorTransferFunction(vtkColorTransferFunction* colortable);
-
- void SetColorWindowLevel(double colorWindow, double colorLevel);
-
+ void SetColorWindowLevel(double colorWindow, double colorLevel);
private:
int mType;
-
bool minternalVtkmprbasedata;
vtkMPRBaseData *mvtkmprbasedata;
-
-
wxVtk2DBaseView *mvtk2Dbaseview;
wxVtkMPR2DView *mvtkmpr2Dview_X;
wxVtkMPR2DView *mvtkmpr2Dview_Y;
wxWidgetMesure2D_Plane_in_MPR *mwidgetMesure;
vtkPlane2DView *mvtkplane2Dview;
wxSphereView *mwxsphereview;
-
wxVtkClipping3DView *mwxvtkclipping3Dview;
wxVtk3DBaseView *mwxvtk3Dbaseview_Clipping3D;
wxVtkMPR3DView *mwxvtkmpr3Dview;
-
-
vtkMPR3DDataViewer *vtkmpr3Ddataviewer;
-
};
#endif // __WX__MARACAS__VIEWERWIDGET__H__
//-------------------------------------------------------------------
wxVtk3DBaseView::~wxVtk3DBaseView()
{
-
if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;}
if (_renWin!=NULL)
// EED 27/05/2013
void wxVtk3DBaseView::ResetCamera(int* ext, double* spc)
{
-
- GetRenderer()->ResetCameraClippingRange();
-
+ GetRenderer()->ResetCameraClippingRange();
if(ext == NULL)
{
-
GetRenderer()->ResetCamera ();
GetCamera()->Dolly(1.2);
- }else{
-
+ }else{
/*double x = (spc[0])*(origin[0]+(((double)ext[1]-(double)ext[0])/2.0));
double y = (spc[1])*(origin[1]+(double)ext[3]);
double z = (spc[2])*(origin[2]+(((double)ext[5]-(double)ext[4])/2.0));*/
double y1=(spc[1])*((double)ext[3]+origin[1]);
double z0=(spc[2])*((double)ext[4]+origin[2]);
double z1=(spc[2])*((double)ext[5]+origin[2]);*/
-
double x0=(spc[0])*((double)ext[0]);
double x1=(spc[0])*((double)ext[1]);
double y0=(spc[1])*((double)ext[2]);
double y1=(spc[1])*((double)ext[3]);
double z0=(spc[2])*((double)ext[4]);
double z1=(spc[2])*((double)ext[5]);
-
GetRenderer()->ResetCamera(x0,x1,y0,y1,z0,z1);
//_wxvtk3Dbaseview->GetCamera()->SetPosition(x,y,z);
GetCamera()->Dolly(1.5);
- }
+ }// if ext
}
//-------------------------------------------------------------------
void wxVtk3DBaseView::SetStereo(int type)
{
//EED 02/06/2012
-
if (_renWin!=NULL)
{
if (type==0)
// VTK_STEREO_ANAGLYPH 7
// VTK_STEREO_CHECKERBOARD 8
_renWin->SetStereoType(type);
-
} // if type
} // _renWin
}
//double nx=1,ny=0,nz=0; // JPRx
Refresh();
- double x=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
- double y=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
- double z=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
+ double x = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
+ double y = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
+ double z = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
SetColorWindow( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() );
SetColorLevel( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );