#include "manualView3DContour.h" // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- manualView3DContour::manualView3DContour() { } // ---------------------------------------------------------------------------- manualView3DContour::~manualView3DContour() { } // ---------------------------------------------------------------------------- manualView3DContour * manualView3DContour :: Clone() { manualView3DContour * clone = new manualView3DContour(); CopyAttributesTo(clone); return clone; } // --------------------------------------------------------------------------- void manualView3DContour::CopyAttributesTo( manualView3DContour * cloneObject) { // Fathers object manualViewContour::CopyAttributesTo(cloneObject); cloneObject->SetDimensions ( _w , _h , _d ); } // ---------------------------------------------------------------------------- void manualView3DContour::SetDimensions(int w, int h, int d) { _w = w; _h = h; _d = d; } // ---------------------------------------------------------------------------- void manualView3DContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) { X = _vtkmprbasedata->GetX(); Y = _vtkmprbasedata->GetY(); Z = _vtkmprbasedata->GetZ(); } // ---------------------------------------------------------------------------- void manualView3DContour::SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata) { _vtkmprbasedata = vtkmprbasedata; } // ---------------------------------------------------------------------------- int manualView3DContour::GetIdPoint2(int x, int y) { int id = -1; double p[3],pA[3],pB[3]; double pickPoint[ 3 ], cameraPos[ 3 ]; vtkPointPicker* picker = vtkPointPicker::New( ); vtkRenderer *pRenderer = this->GetWxVtkBaseView()->GetRenderer(); picker->Pick( x, y, 0.0, pRenderer ); pRenderer->GetActiveCamera( )->GetPosition( cameraPos ); picker->GetPickPosition( pickPoint ); picker->Delete( ); UtilVtk3DGeometriSelection utilVtk3Dgeometriselection; utilVtk3Dgeometriselection.SetDimentions(_w,_h,_d); if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos ) ) { double dist,distMin=999999999; int i,size=this->_manContModel->GetSizeLstPoints(); for (i=0;i_manContModel->GetManualPoint(i); p[0] = mp->GetX(); p[1] = mp->GetY(); p[2] = mp->GetZ(); dist=utilVtk3Dgeometriselection.DistanceMinPointToLine(p,pA,pB); if ( (dist<=2*GetRange()) && (dist