myMeasDlg = new HYDROGUI_MeasurementToolDlg( module()->getApp()->desktop() );
myMeasDlg->setModal( false );
myMeasDlg->setWindowTitle(getName());
- myMeasDlg->show();
+ myMeasDlg->show();
//Tool: draw a distance line
LightApp_Application* anApp = module()->getApp();
OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer();
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
//polyline names
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( aCtx.IsNull() )
- return;
+ return;
gp_Pnt aPnt = CurveCreator_Utils::ConvertClickToPoint( theEvent->x(), theEvent->y(), aView );
{
myLineMaker = new BRepLib_MakePolygon();
myLineMaker->Add(aPnt);
- aRes = myLineMaker->FirstVertex();
+ aRes = myLineMaker->FirstVertex();
}
else
- {
+ {
myLineMaker->Add(aPnt);
aRes = myLineMaker->Shape();
const TopoDS_Edge& aLE = myLineMaker->Edge();
if ( !myAISLineM.IsNull() )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
aCtx->Erase( myAISLineM, Standard_False );
}
}
continue;
TopExp_Explorer expW(W, TopAbs_EDGE);
if (!expW.More())
- continue;
+ continue;
TopoDS_Edge E = TopoDS::Edge(expW.Current());
expW.Next();
if (expW.More())
params.push_back(aKnots(i));
}
}
- //in some cases, extrema gives inaccurate result ->
+ //in some cases, extrema gives inaccurate result ->
//split bspline by knot params and try to find minimum distance
//on each interval
std::sort(params.begin(), params.end());
double WinDiagDist = sqrt ((double)aWinSX*(double)aWinSX + (double)aWinSY*(double)aWinSY);
if (fdist <= prec || pd / WinDiagDist < 0.08)
{
- if (fdist < fdist_min)
+ if (fdist < fdist_min)
{
- fdist_min = fdist;
+ fdist_min = fdist;
minWire = W;
minU = aProj.LowerDistanceParameter();
minC.Initialize(E);
{
if (myFW.IsSame(minWire))
{
- //calc distance on current curve
- double LenAlongCurv = GCPnts_AbscissaPoint::Length(minC, myFu, minU);
+ //calc distance on current curve
+ double LenAlongCurv = GCPnts_AbscissaPoint::Length(minC, myFu, minU);
myFW = TopoDS_Wire();
if (!BRep_Tool::IsClosed(minWire))
{
//anAspect->SetTypeOfMarker(Aspect_TOM_RING1);
//anAspect->SetColor(Quantity_NOC_BLACK);
//mySplitPointPreview->Attributes()->SetPointAspect( anAspect );
-
+
aCtx->SetZLayer(myAISLineM, Graphic3d_ZLayerId_Topmost);
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
- aCtx->Display( myAISLineM, Standard_False );
+ aCtx->Display( myAISLineM, Standard_False );
aCtx->UpdateCurrentViewer();
}
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( !aCtx.IsNull() )
{
- if ( aCtx->HasOpenedContext() )
- aCtx->CloseLocalContext();
aCtx->Erase( myAISLineM, Standard_False );
}
myAISLineM.Nullify();
aCtx->UpdateCurrentViewer();
- }
+ }
}
}
}
if (aViewManager && aViewer)
{
- disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
- connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
aViewManager->getOCCViewer(), SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
}