wxWidgetMesure2D_Plane Class Reference

#include <wxWidgetMesure2D_Plane.h>

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

List of all members.

Public Member Functions

 wxWidgetMesure2D_Plane (wxWindow *parent)
 ~wxWidgetMesure2D_Plane ()
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 Member Functions

void SetVisibleCircle (bool ok)

Private Attributes

wxCheckBox * _cb_line
wxCheckBox * _cb_circle
vtkPoints * _ptsCircle1
vtkActor * _circle1Actor
vtkPolyDataMapper * _circle1Mapper
vtkPolyData * _pdCircle1
vtkPoints * _ptsCircle2
vtkActor * _circle2Actor
vtkPolyDataMapper * _circle2Mapper
vtkPolyData * _pdCircle2
vtkPoints * _ptsLineRef1
vtkActor * _lineRef1Actor
vtkPolyDataMapper * _lineRef1Mapper
vtkPolyData * _pdLineRef1
vtkPoints * _ptsLineRef2
vtkActor * _lineRef2Actor
vtkPolyDataMapper * _lineRef2Mapper
vtkPolyData * _pdLineRef2

Detailed Description

Definition at line 7 of file wxWidgetMesure2D_Plane.h.


Constructor & Destructor Documentation

wxWidgetMesure2D_Plane::wxWidgetMesure2D_Plane ( wxWindow *  parent  ) 

Definition at line 5 of file wxWidgetMesure2D_Plane.cxx.

References _circle1Actor, _circle1Mapper, _circle2Actor, _circle2Mapper, _lineRef1Actor, _lineRef1Mapper, _lineRef2Actor, _lineRef2Mapper, _pdCircle1, _pdCircle2, _pdLineRef1, _pdLineRef2, _ptsCircle1, _ptsCircle2, _ptsLineRef1, and _ptsLineRef2.

00006 : wxWidgetMesure2D(parent)
00007 {
00008         // Circle 1
00009         _ptsCircle1             = NULL;
00010         _circle1Actor   = NULL;
00011         _circle1Mapper  = NULL;
00012     _pdCircle1          = NULL;
00013         // Circle 2
00014         _ptsCircle2             = NULL;
00015         _circle2Actor   = NULL;
00016         _circle2Mapper  = NULL;
00017     _pdCircle2          = NULL;
00018         // line reference 1
00019         _ptsLineRef1    = NULL;
00020         _lineRef1Actor  = NULL;
00021         _lineRef1Mapper = NULL;
00022     _pdLineRef1         = NULL;
00023         // line reference 2
00024         _ptsLineRef2    = NULL;
00025         _lineRef2Actor  = NULL;
00026         _lineRef2Mapper = NULL;
00027     _pdLineRef2         = NULL;
00028 
00029 }

wxWidgetMesure2D_Plane::~wxWidgetMesure2D_Plane (  ) 

Definition at line 33 of file wxWidgetMesure2D_Plane.cxx.

References _circle1Actor, _circle1Mapper, _circle2Actor, _circle2Mapper, _lineRef1Actor, _lineRef1Mapper, _lineRef2Actor, _lineRef2Mapper, _pdCircle1, _pdCircle2, _pdLineRef1, _pdLineRef2, _ptsCircle1, _ptsCircle2, _ptsLineRef1, and _ptsLineRef2.

00034 {
00035         // Circle 1
00036     if (        _ptsCircle1             != NULL){       _ptsCircle1                     -> Delete(); }
00037     if (        _circle1Actor   != NULL){       _circle1Actor           -> Delete(); }
00038     if (        _circle1Mapper  != NULL){       _circle1Mapper          -> Delete(); }
00039     if (    _pdCircle1          != NULL){       _pdCircle1                      -> Delete(); }
00040         // Circle 2
00041     if (        _ptsCircle2             != NULL){       _ptsCircle2                     -> Delete(); }
00042     if (        _circle2Actor   != NULL){       _circle2Actor           -> Delete(); }
00043     if (        _circle2Mapper  != NULL){       _circle2Mapper          -> Delete(); }
00044     if (    _pdCircle2          != NULL){       _pdCircle2                      -> Delete(); }
00045         // line reference 1
00046     if (        _ptsLineRef1    != NULL){       _ptsLineRef1            -> Delete(); }
00047     if (        _lineRef1Actor  != NULL){       _lineRef1Actor          -> Delete(); }
00048     if (        _lineRef1Mapper != NULL){       _lineRef1Mapper         -> Delete(); }
00049      if (   _pdLineRef1         != NULL){       _pdLineRef1                     -> Delete(); }
00050         // line reference 2
00051     if (        _ptsLineRef2    != NULL){       _ptsLineRef2            -> Delete(); }
00052     if (        _lineRef2Actor  != NULL){       _lineRef2Actor          -> Delete(); }
00053     if (        _lineRef2Mapper != NULL){       _lineRef2Mapper         -> Delete(); }
00054     if (    _pdLineRef2         != NULL){       _pdLineRef2                     -> Delete(); }
00055 }


Member Function Documentation

void wxWidgetMesure2D_Plane::CircleLine (  ) 

Definition at line 176 of file wxWidgetMesure2D_Plane.cxx.

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

Referenced by 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]

Reimplemented from wxWidgetMesure2D.

Definition at line 122 of file wxWidgetMesure2D_Plane.cxx.

References CircleLine(), ConfigureCircleLine(), and 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 (  ) 

Definition at line 132 of file wxWidgetMesure2D_Plane.cxx.

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

Referenced by 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::CreateWin1a ( wxWindow *  parent  )  [protected, virtual]

Reimplemented from wxWidgetMesure2D.

Reimplemented in wxWidgetMesure2D_Plane_in_MPR.

Definition at line 59 of file wxWidgetMesure2D_Plane.cxx.

References _cb_circle, _cb_line, wxWidgetMesure2D::CreateWin1a(), OnActiveCirlcle(), and OnActiveLine().

Referenced by wxWidgetMesure2D_Plane_in_MPR::CreateWin1a().

00060 {
00061         wxPanel *panel = new wxPanel(parent,-1);
00062 
00063         _cb_circle              = new wxCheckBox(panel,-1,_T("Circle        ")); 
00064         _cb_line                = new wxCheckBox(panel,-1,_T("Rotation Axe ")); 
00065 
00066 
00067         wxBoxSizer *sizerA = new wxBoxSizer(wxHORIZONTAL);
00068         sizerA->Add(_cb_circle);
00069         sizerA->Add(_cb_line);
00070 
00071 
00072         wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
00073         sizer->Add( sizerA );
00074         sizer->Add( wxWidgetMesure2D::CreateWin1a(panel) );
00075 
00076         panel->SetAutoLayout(true);
00077         panel->SetSizer(sizer);
00078         panel->SetSize(400,30);
00079         panel->Layout();
00080 //EEDxx2.4
00081 //      panel->FitInside();
00082 
00083         Connect(_cb_line->GetId()        , wxEVT_COMMAND_CHECKBOX_CLICKED         , (wxObjectEventFunction) &wxWidgetMesure2D_Plane::OnActiveLine                       );
00084         Connect(_cb_circle->GetId()      , wxEVT_COMMAND_CHECKBOX_CLICKED         , (wxObjectEventFunction) &wxWidgetMesure2D_Plane::OnActiveCirlcle            );
00085 
00086         return panel;
00087 }

Here is the call graph for this function:

Here is the caller 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  ) 

Definition at line 91 of file wxWidgetMesure2D_Plane.cxx.

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

Referenced by 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  ) 

Definition at line 113 of file wxWidgetMesure2D_Plane.cxx.

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

Referenced by 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::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::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::SetVisibleCircle ( bool  ok  )  [private]

Definition at line 98 of file wxWidgetMesure2D_Plane.cxx.

References _circle1Actor, _circle2Actor, _lineRef1Actor, and _lineRef2Actor.

Referenced by ConfigureA(), and OnActiveCirlcle().

00099 {
00100         double opacity;
00101         if (ok==true)
00102         {
00103                 opacity=1;
00104         } else {
00105                 opacity=0;
00106         } 
00107         _lineRef1Actor->GetProperty()->SetOpacity( opacity );
00108         _lineRef2Actor->GetProperty()->SetOpacity( opacity );
00109         _circle1Actor->GetProperty()->SetOpacity( opacity );
00110         _circle2Actor->GetProperty()->SetOpacity( opacity );
00111 }

Here is the caller graph for this function:


Member Data Documentation

wxCheckBox* wxWidgetMesure2D_Plane::_cb_circle [private]

Definition at line 22 of file wxWidgetMesure2D_Plane.h.

Referenced by CreateWin1a(), and OnActiveCirlcle().

wxCheckBox* wxWidgetMesure2D_Plane::_cb_line [private]

Definition at line 21 of file wxWidgetMesure2D_Plane.h.

Referenced by CreateWin1a(), and OnActiveLine().

vtkPolyDataMapper* wxWidgetMesure2D_Plane::_circle1Mapper [private]
vtkPolyDataMapper* wxWidgetMesure2D_Plane::_circle2Mapper [private]
vtkPolyDataMapper* wxWidgetMesure2D_Plane::_lineRef1Mapper [private]
vtkPolyDataMapper* wxWidgetMesure2D_Plane::_lineRef2Mapper [private]
vtkPolyData* wxWidgetMesure2D_Plane::_pdCircle1 [private]
vtkPolyData* wxWidgetMesure2D_Plane::_pdCircle2 [private]
vtkPolyData* wxWidgetMesure2D_Plane::_pdLineRef1 [private]
vtkPolyData* wxWidgetMesure2D_Plane::_pdLineRef2 [private]

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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1