mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0028162: Draw Harness - eliminate usage of deprecated Local Context
Create a general draw command 'VRelation' and drop the old 'relation' commands. Add test cases for new draw command "vrelation". Add two new methods: Activate and Deactivate which activate/deactivate the given selection mode for all displayed objects. Eliminate deprecated local context methods in ObjectCommands, QABugs. Eliminate deprecated local context methods in mfc standard sample and qt samples.
This commit is contained in:
@@ -58,20 +58,12 @@ END_MESSAGE_MAP()
|
||||
|
||||
void CLengthParamsEdgesPage::OnBnClickedEdge1Btn()
|
||||
{
|
||||
// Open local context and choose the edge for length dimensions
|
||||
if (!myAISContext->HasOpenedContext())
|
||||
{
|
||||
myAISContext->OpenLocalContext();
|
||||
myAISContext->ActivateStandardMode (TopAbs_EDGE);
|
||||
AfxMessageBox (_T("Local context was not opened. Choose the edge and press the button again"),
|
||||
MB_ICONINFORMATION | MB_OK);
|
||||
return;
|
||||
}
|
||||
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
|
||||
|
||||
// Now it's ok, local context is opened and edge selection mode is activated
|
||||
// Now it's ok, edge selection mode is activated
|
||||
// Check if some edge is selected
|
||||
myAISContext->LocalContext()->InitSelected();
|
||||
if (!myAISContext->LocalContext()->MoreSelected() ||
|
||||
myAISContext->InitSelected();
|
||||
if (!myAISContext->MoreSelected() ||
|
||||
myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE)
|
||||
{
|
||||
AfxMessageBox(_T("Choose the edge and press the button again"),
|
||||
@@ -81,7 +73,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge1Btn()
|
||||
|
||||
myFirstEdge = TopoDS::Edge (myAISContext->SelectedShape());
|
||||
|
||||
myAISContext->LocalContext()->ClearSelected();
|
||||
myAISContext->ClearSelected();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -91,8 +83,8 @@ void CLengthParamsEdgesPage::OnBnClickedEdge1Btn()
|
||||
|
||||
void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
|
||||
{
|
||||
myAISContext->LocalContext()->InitSelected();
|
||||
if (!myAISContext->LocalContext()->MoreSelected() ||
|
||||
myAISContext->InitSelected();
|
||||
if (!myAISContext->MoreSelected() ||
|
||||
myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE)
|
||||
{
|
||||
AfxMessageBox (_T("Choose the edge and press the button again"),
|
||||
@@ -102,7 +94,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
|
||||
|
||||
mySecondEdge = TopoDS::Edge (myAISContext->SelectedShape());
|
||||
|
||||
myAISContext->LocalContext()->ClearSelected();
|
||||
myAISContext->ClearSelected();
|
||||
|
||||
// Build plane through three points
|
||||
BRepAdaptor_Curve aCurve1 (myFirstEdge);
|
||||
@@ -118,8 +110,6 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
|
||||
|
||||
CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner());
|
||||
|
||||
myAISContext->CloseAllContexts();
|
||||
|
||||
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
|
||||
anAspect->MakeArrows3d (Standard_False);
|
||||
anAspect->MakeText3d (aDimDlg->GetTextType());
|
||||
@@ -162,6 +152,5 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
|
||||
myAISContext->Display (aLenDim);
|
||||
}
|
||||
|
||||
myAISContext->OpenLocalContext();
|
||||
myAISContext->ActivateStandardMode (TopAbs_EDGE);
|
||||
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
|
||||
}
|
||||
|
Reference in New Issue
Block a user