wxWidgetMesure2D_Plane_in_MPR Class Reference

#include <wxWidgetMesure2D_Plane_in_MPR.h>

Inheritance diagram for wxWidgetMesure2D_Plane_in_MPR:
Inheritance graph
[legend]
Collaboration diagram for wxWidgetMesure2D_Plane_in_MPR:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxWidgetMesure2D_Plane_in_MPR (wxWindow *parent)
 ~wxWidgetMesure2D_Plane_in_MPR ()
void OnActiveLink (wxCommandEvent &event)
void SetVtkPlane2DView (vtkPlane2DView *vtkplane2Dview)
void SetActiveLink (bool ok)
void OnActiveLine (wxCommandEvent &event)
void OnActiveCirlcle (wxCommandEvent &event)
virtual void ConfigureA (wxVtk2DBaseView *wxvtk2Dbaseview)
void ConfigureCircleLine ()
void CircleLine ()
void OnActiveMessureTool (wxCommandEvent &event)
void OnVisibleMessureTool (wxCommandEvent &event)
void OnCloseContour (wxCommandEvent &event)
void OnVisibleInformation (wxCommandEvent &event)
void SetMesureScale (double mesureScale)
manualContourModelGetManualContourModel ()

Protected Member Functions

virtual wxWindow * CreateWin1a (wxWindow *parent)

Protected Attributes

wxVtk2DBaseView_wxvtk2Dbaseview

Private Attributes

wxCheckBox * _cb_link
vtkPlane2DView_vtkplane2Dview

Detailed Description

Definition at line 7 of file wxWidgetMesure2D_Plane_in_MPR.h.


Constructor & Destructor Documentation

wxWidgetMesure2D_Plane_in_MPR::wxWidgetMesure2D_Plane_in_MPR ( wxWindow *  parent  ) 

Definition at line 3 of file wxWidgetMesure2D_Plane_in_MPR.cxx.

References _vtkplane2Dview.

00004 :wxWidgetMesure2D_Plane(parent)
00005 {
00006         _vtkplane2Dview=NULL;
00007 }

wxWidgetMesure2D_Plane_in_MPR::~wxWidgetMesure2D_Plane_in_MPR (  ) 

Definition at line 11 of file wxWidgetMesure2D_Plane_in_MPR.cxx.

00012 {
00013 }


Member Function Documentation

void wxWidgetMesure2D_Plane::CircleLine (  )  [inherited]

Definition at line 176 of file wxWidgetMesure2D_Plane.cxx.

References wxWidgetMesure2D_Plane::_circle1Actor, wxWidgetMesure2D_Plane::_circle1Mapper, wxWidgetMesure2D_Plane::_circle2Actor, wxWidgetMesure2D_Plane::_circle2Mapper, wxVtk2DBaseView::_imageViewer2XYZ, wxWidgetMesure2D_Plane::_lineRef1Actor, wxWidgetMesure2D_Plane::_lineRef1Mapper, wxWidgetMesure2D_Plane::_lineRef2Actor, wxWidgetMesure2D_Plane::_lineRef2Mapper, wxWidgetMesure2D_Plane::_pdCircle1, wxWidgetMesure2D_Plane::_pdCircle2, wxWidgetMesure2D_Plane::_pdLineRef1, wxWidgetMesure2D_Plane::_pdLineRef2, wxWidgetMesure2D_Plane::_ptsCircle1, wxWidgetMesure2D_Plane::_ptsCircle2, wxWidgetMesure2D_Plane::_ptsLineRef1, wxWidgetMesure2D_Plane::_ptsLineRef2, wxWidgetMesure2D::_wxvtk2Dbaseview, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by wxWidgetMesure2D_Plane::ConfigureA().

00177 {
00178         int i,maxPts=20;
00179         vtkCellArray *lines;
00180 
00181         vtkImageViewer2_XYZ *imageViewer2XYZ = _wxvtk2Dbaseview->_imageViewer2XYZ;
00182         
00183 
00184 // Circle 1 Horizontal
00185         _ptsCircle1 = vtkPoints::New();
00186         _ptsCircle1->SetNumberOfPoints(maxPts);
00187         lines = vtkCellArray::New();
00188         lines->InsertNextCell(maxPts);
00189         for (i=0;i<maxPts;i++)
00190         {
00191                 lines->InsertCellPoint(i);
00192                 _ptsCircle1->SetPoint(i, 0      , 0     , 0 );
00193         }
00194         lines->InsertCellPoint(0);
00195         _ptsCircle1->SetPoint(0, -1000  , -1000 , -1000 );
00196         _ptsCircle1->SetPoint(1,  1000  ,  1000 ,  1000 );
00197 
00198         _pdCircle1 = vtkPolyData::New();
00199     _pdCircle1->SetPoints( _ptsCircle1 );
00200     _pdCircle1->SetLines( lines );
00201         lines->Delete();  //do not delete lines ??
00202         _circle1Actor                                   =       vtkActor::New();
00203     _circle1Mapper                                      =       vtkPolyDataMapper::New();
00204         _circle1Mapper->SetInput(_pdCircle1);
00205         _circle1Mapper->ImmediateModeRenderingOn();
00206         _circle1Actor->SetMapper(_circle1Mapper);
00207         _circle1Actor->GetProperty()->BackfaceCullingOn();
00208         _circle1Actor->GetProperty()->SetDiffuseColor(0,0,1);
00209         _circle1Actor->GetProperty()->SetLineWidth(2);
00210     imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _circle1Actor );
00211 
00212 // Circle 2 Horizontal
00213         _ptsCircle2 = vtkPoints::New();
00214         _ptsCircle2->SetNumberOfPoints(maxPts);
00215         lines = vtkCellArray::New();
00216         lines->InsertNextCell(maxPts);
00217         for (i=0;i<maxPts;i++)
00218         {
00219                 lines->InsertCellPoint(i);
00220                 _ptsCircle2->SetPoint(i, 0      , 0     , 0 );
00221         }
00222         _ptsCircle2->SetPoint(0, -1000  , -1000 , -1000 );
00223         _ptsCircle2->SetPoint(1,  1000  ,  1000 ,  1000 );
00224 
00225         _pdCircle2 = vtkPolyData::New();
00226     _pdCircle2->SetPoints( _ptsCircle2 );
00227     _pdCircle2->SetLines( lines );
00228         lines->Delete();  //do not delete lines ??
00229         _circle2Actor                                   =       vtkActor::New();
00230     _circle2Mapper                                      =       vtkPolyDataMapper::New();
00231         _circle2Mapper->SetInput(_pdCircle2);
00232         _circle2Mapper->ImmediateModeRenderingOn();
00233         _circle2Actor->SetMapper(_circle2Mapper);
00234         _circle2Actor->GetProperty()->BackfaceCullingOn();
00235         _circle2Actor->GetProperty()->SetDiffuseColor(0,0,1);
00236         _circle2Actor->GetProperty()->SetLineWidth(2);
00237     imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _circle2Actor );
00238 
00239 // Line Referance 1
00240         _ptsLineRef1 = vtkPoints::New();
00241         _ptsLineRef1->SetNumberOfPoints(2);
00242         _ptsLineRef1->SetPoint(0, -1000 , -1000 , -1000 );
00243         _ptsLineRef1->SetPoint(1,  1000 ,  1000 ,  1000 );
00244         lines = vtkCellArray::New();
00245         lines->InsertNextCell(2);
00246         lines->InsertCellPoint(0);
00247         lines->InsertCellPoint(1);
00248 
00249         _pdLineRef1 = vtkPolyData::New();
00250     _pdLineRef1->SetPoints( _ptsLineRef1 );
00251     _pdLineRef1->SetLines( lines );
00252         lines->Delete();  //do not delete lines ??
00253         _lineRef1Actor                                  =       vtkActor::New();
00254     _lineRef1Mapper                                     =       vtkPolyDataMapper::New();
00255         _lineRef1Mapper->SetInput(_pdLineRef1);
00256         _lineRef1Mapper->ImmediateModeRenderingOn();
00257         _lineRef1Actor->SetMapper(_lineRef1Mapper);
00258         _lineRef1Actor->GetProperty()->BackfaceCullingOn();
00259         _lineRef1Actor->GetProperty()->SetDiffuseColor(0,0,1);
00260         _lineRef1Actor->GetProperty()->SetLineWidth(2);
00261     imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineRef1Actor );
00262 
00263 // Line Referance 2
00264         _ptsLineRef2 = vtkPoints::New();
00265         _ptsLineRef2->SetNumberOfPoints(2);
00266         _ptsLineRef2->SetPoint(0, -1000 , -1000 , -1000 );
00267         _ptsLineRef2->SetPoint(1,  1000 ,  1000 ,  1000 );
00268         lines = vtkCellArray::New();
00269         lines->InsertNextCell(2);
00270         lines->InsertCellPoint(0);
00271         lines->InsertCellPoint(1);
00272 
00273         _pdLineRef2 = vtkPolyData::New();
00274     _pdLineRef2->SetPoints( _ptsLineRef2 );
00275     _pdLineRef2->SetLines( lines );
00276         lines->Delete();  //do not delete lines ??
00277         _lineRef2Actor                                  =       vtkActor::New();
00278     _lineRef2Mapper                                     =       vtkPolyDataMapper::New();
00279         _lineRef2Mapper->SetInput(_pdLineRef2);
00280         _lineRef2Mapper->ImmediateModeRenderingOn();
00281         _lineRef2Actor->SetMapper(_lineRef2Mapper);
00282         _lineRef2Actor->GetProperty()->BackfaceCullingOn();
00283         _lineRef2Actor->GetProperty()->SetDiffuseColor(0,0,1);
00284         _lineRef2Actor->GetProperty()->SetLineWidth(2);
00285     imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineRef2Actor );
00286 
00287 
00288 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxWidgetMesure2D_Plane::ConfigureA ( wxVtk2DBaseView wxvtk2Dbaseview  )  [virtual, inherited]

Reimplemented from wxWidgetMesure2D.

Definition at line 122 of file wxWidgetMesure2D_Plane.cxx.

References wxWidgetMesure2D_Plane::CircleLine(), wxWidgetMesure2D_Plane::ConfigureCircleLine(), and wxWidgetMesure2D_Plane::SetVisibleCircle().

00123 {
00124         wxWidgetMesure2D::ConfigureA(wxvtk2Dbaseview);
00125         CircleLine();
00126         ConfigureCircleLine();
00127         SetVisibleCircle(false);        
00128 }

Here is the call graph for this function:

void wxWidgetMesure2D_Plane::ConfigureCircleLine (  )  [inherited]

Definition at line 132 of file wxWidgetMesure2D_Plane.cxx.

References wxWidgetMesure2D_Plane::_ptsCircle1, wxWidgetMesure2D_Plane::_ptsCircle2, wxWidgetMesure2D_Plane::_ptsLineRef1, wxWidgetMesure2D_Plane::_ptsLineRef2, wxWidgetMesure2D::_wxvtk2Dbaseview, and vtkPlane2DView::GetImgSize().

Referenced by wxWidgetMesure2D_Plane::ConfigureA().

00133 {
00134         double ang;
00135 
00136         vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)_wxvtk2Dbaseview;
00137         int sizeIma = vtkplane2Dview->GetImgSize();
00138 
00139         double i,maxPts=20;
00140         double k=(360/(maxPts-1)) * (3.1416/180);
00141         double x,y,r1=5,r2=10,r3=15;
00142         for (i=0;i<maxPts;i++)
00143         {
00144                 x=cos( k*i ) ;
00145                 y=sin( k*i ) ;
00146                 _ptsCircle1->SetPoint( (int)i , (sizeIma/2) + x*r1      , (sizeIma/2) + y*r1    , 1 );
00147                 _ptsCircle2->SetPoint( (int)i , (sizeIma/2) + x*r2      , (sizeIma/2) + y*r2    , 1 );
00148         }
00149 
00150         //
00151         ang=(45) * (3.1416/180);
00152         x=cos( ang ) ;
00153         y=sin( ang ) ;
00154         _ptsLineRef1->SetPoint( 0 , (sizeIma/2) + x*r3  , (sizeIma/2) + y*r3    , 1 );
00155         
00156         ang=(45+180) * (3.1416/180);
00157         x=cos( ang ) ;
00158         y=sin( ang ) ;
00159         _ptsLineRef1->SetPoint( 1 , (sizeIma/2) + x*r3  , (sizeIma/2) + y*r3    , 1 );
00160 
00161         //
00162         ang=(135) * (3.1416/180);
00163         x=cos( ang ) ;
00164         y=sin( ang ) ;
00165         _ptsLineRef2->SetPoint( 0 , (sizeIma/2) + x*r3  , (sizeIma/2) + y*r3    , 1 );
00166         
00167         ang=(135+180) * (3.1416/180);
00168         x=cos( ang ) ;
00169         y=sin( ang ) ;
00170         _ptsLineRef2->SetPoint( 1 , (sizeIma/2) + x*r3  , (sizeIma/2) + y*r3    , 1 );
00171 }

Here is the call graph for this function:

Here is the caller graph for this function:

wxWindow * wxWidgetMesure2D_Plane_in_MPR::CreateWin1a ( wxWindow *  parent  )  [protected, virtual]

Reimplemented from wxWidgetMesure2D_Plane.

Definition at line 44 of file wxWidgetMesure2D_Plane_in_MPR.cxx.

References _cb_link, wxWidgetMesure2D_Plane::CreateWin1a(), and OnActiveLink().

00045 {
00046         wxPanel *panel = new wxPanel(parent,-1);
00047 
00048         _cb_link                = new wxCheckBox(panel,-1,_T("LINK                    ")); 
00049         _cb_link->SetValue(true);
00050 
00051         wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
00052 
00053         sizer->Add(_cb_link);
00054 
00055         sizer->Add( wxWidgetMesure2D_Plane::CreateWin1a(panel) );
00056 
00057         panel->SetAutoLayout(true);
00058         panel->SetSizer(sizer);
00059         panel->SetSize(400,30);
00060         panel->Layout();
00061 
00062 //EEDxx2.4
00063 //      panel->FitInside();
00064 
00065         Connect(_cb_link->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxWidgetMesure2D_Plane_in_MPR::OnActiveLink );
00066 
00067         return panel;
00068 }

Here is the call graph for this function:

manualContourModel * wxWidgetMesure2D::GetManualContourModel (  )  [inherited]

Definition at line 176 of file wxWidgetMesure2D.cxx.

References wxWidgetMesure2D::_mContourModel_1.

00177 {
00178         return _mContourModel_1;
00179 }

void wxWidgetMesure2D_Plane::OnActiveCirlcle ( wxCommandEvent &  event  )  [inherited]

Definition at line 91 of file wxWidgetMesure2D_Plane.cxx.

References wxWidgetMesure2D_Plane::_cb_circle, wxWidgetMesure2D::_wxvtk2Dbaseview, wxVtkBaseView::RefreshView(), and wxWidgetMesure2D_Plane::SetVisibleCircle().

Referenced by wxWidgetMesure2D_Plane::CreateWin1a().

00092 {
00093         SetVisibleCircle( _cb_circle->GetValue() );
00094         _wxvtk2Dbaseview->RefreshView();
00095 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxWidgetMesure2D_Plane::OnActiveLine ( wxCommandEvent &  event  )  [inherited]

Definition at line 113 of file wxWidgetMesure2D_Plane.cxx.

References wxWidgetMesure2D_Plane::_cb_line, wxWidgetMesure2D::_wxvtk2Dbaseview, wxVtkBaseView::RefreshView(), and vtkPlane2DView::SetVisibleLine().

Referenced by wxWidgetMesure2D_Plane::CreateWin1a().

00114 {
00115         vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)_wxvtk2Dbaseview;
00116         vtkplane2Dview->SetVisibleLine( _cb_line->GetValue() );
00117         _wxvtk2Dbaseview->RefreshView();
00118 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxWidgetMesure2D_Plane_in_MPR::OnActiveLink ( wxCommandEvent &  event  ) 

Definition at line 15 of file wxWidgetMesure2D_Plane_in_MPR.cxx.

References _cb_link, _vtkplane2Dview, vtkPlane2DView::Refresh(), wxVtkBaseView::RefreshView(), and vtkPlane2DView::SetActive().

Referenced by CreateWin1a().

00016 {
00017         if (_vtkplane2Dview!=NULL)
00018         {
00019                 _vtkplane2Dview->SetActive( _cb_link->GetValue() );
00020                 _vtkplane2Dview->Refresh();
00021                 _vtkplane2Dview->RefreshView();
00022         }
00023 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxWidgetMesure2D::OnActiveMessureTool ( wxCommandEvent &  event  )  [inherited]

Definition at line 120 of file wxWidgetMesure2D.cxx.

References wxWidgetMesure2D::_cb_closeContour, wxWidgetMesure2D::_cb_messuretool, wxWidgetMesure2D::_cb_mt_visible, wxWidgetMesure2D::_cb_visibleText, wxWidgetMesure2D::_mViewContour_1, wxWidgetMesure2D::_wxvtk2Dbaseview, wxWidgetMesure2D::ActiveMessureTool(), wxVtk2DBaseView::Refresh(), wxVtkBaseView::RefreshView(), and manualViewBaseContour::SetVisible().

Referenced by wxWidgetMesure2D::CreateWin1a().

00121 {
00122         ActiveMessureTool( _cb_messuretool->GetValue() );
00123         if ( _cb_messuretool->GetValue() == true )
00124         {
00125                 _cb_mt_visible->SetValue(true);
00126                 _mViewContour_1->SetVisible( _cb_mt_visible->GetValue() );
00127                 _cb_closeContour->Enable(true);
00128                 _cb_visibleText->Enable(true);
00129         } else{
00130                 _cb_closeContour->Enable(false);
00131                 _cb_visibleText->Enable(false);
00132         }
00133         _wxvtk2Dbaseview->Refresh();
00134         _wxvtk2Dbaseview->RefreshView();
00135 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxWidgetMesure2D::OnCloseContour ( wxCommandEvent &  event  )  [inherited]
void wxWidgetMesure2D::OnVisibleInformation ( wxCommandEvent &  event  )  [inherited]
void wxWidgetMesure2D::OnVisibleMessureTool ( wxCommandEvent &  event  )  [inherited]
void wxWidgetMesure2D_Plane_in_MPR::SetActiveLink ( bool  ok  ) 

Definition at line 27 of file wxWidgetMesure2D_Plane_in_MPR.cxx.

References _cb_link, _vtkplane2Dview, and vtkPlane2DView::SetActive().

00028 {
00029         _cb_link->SetValue(ok);
00030         if (_vtkplane2Dview!=NULL)
00031         {
00032                 _vtkplane2Dview->SetActive( _cb_link->GetValue() );
00033         }
00034 }

Here is the call graph for this function:

void wxWidgetMesure2D::SetMesureScale ( double  mesureScale  )  [inherited]

Definition at line 171 of file wxWidgetMesure2D.cxx.

References wxWidgetMesure2D::_mViewContour_1, and manualViewContour::SetMesureScale().

Referenced by wxMPRWidget::ConfigureVTK().

00172 {
00173         _mViewContour_1->SetMesureScale(mesureScale);
00174 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxWidgetMesure2D_Plane_in_MPR::SetVtkPlane2DView ( vtkPlane2DView vtkplane2Dview  ) 

Definition at line 37 of file wxWidgetMesure2D_Plane_in_MPR.cxx.

References _vtkplane2Dview.

Referenced by wxMPRWidget::CreateMPRPanel4View(), and wxMPRWidget::CreateView().

00038 {
00039         _vtkplane2Dview = vtkplane2Dview;
00040 }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 19 of file wxWidgetMesure2D_Plane_in_MPR.h.

Referenced by CreateWin1a(), OnActiveLink(), and SetActiveLink().


The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1