1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0028088: Visualization, AIS_InteractiveContext - drop default value for Update Viewer parameter

This commit is contained in:
isk
2016-12-27 13:24:08 +03:00
committed by kgv
parent 9bcfd6f649
commit 0577ae8ca4
65 changed files with 884 additions and 715 deletions

View File

@@ -81,7 +81,7 @@ void CModelClippingDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBa
if (m_ModelClippingONOFF)
{
myDoc->GetAISContext()->SetLocation (myShape, TopLoc_Location (myTrsf));
myDoc->GetAISContext()->Redisplay (myShape);
myDoc->GetAISContext()->Redisplay (myShape, Standard_True);
myView->Update();
}
else
@@ -141,7 +141,7 @@ BOOL CModelClippingDlg::OnInitDialog()
myClippingPlane->SetOn (Standard_True);
myDoc->GetAISContext()->Display (myShape);
myDoc->GetAISContext()->Display (myShape, Standard_True);
}
UpdateData (FALSE);
@@ -172,7 +172,7 @@ void CModelClippingDlg::OnChangeEditModelclippingZ()
if (m_ModelClippingONOFF)
{
myDoc->GetAISContext()->SetLocation (myShape, TopLoc_Location (myTrsf));
myDoc->GetAISContext()->Redisplay (myShape);
myDoc->GetAISContext()->Redisplay (myShape, Standard_False);
myView->Update();
}
else
@@ -223,14 +223,14 @@ void CModelClippingDlg::OnCheckModelclippingonoff()
myClippingPlane->SetOn (Standard_True);
myDoc->GetAISContext()->Display (myShape);
myDoc->GetAISContext()->Display (myShape, Standard_False);
}
else
{
// deactivate clipping plane
myClippingPlane->SetOn (Standard_False);
myDoc->GetAISContext()->Remove (myShape);
myDoc->GetAISContext()->Remove (myShape, Standard_False);
}
myView->Update();
@@ -275,7 +275,7 @@ void CModelClippingDlg::OnCancel()
if (!myShape.IsNull())
{
myDoc->GetAISContext()->Remove (myShape);
myDoc->GetAISContext()->Remove (myShape, Standard_False);
}
myView->Update();
@@ -291,7 +291,7 @@ void CModelClippingDlg::OnOK()
{
if (!myShape.IsNull())
{
myDoc->GetAISContext()->Remove (myShape);
myDoc->GetAISContext()->Remove (myShape, Standard_True);
}
CDialog::OnOK();

View File

@@ -100,7 +100,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicSurface);
getAISContext()->Display (aGraphicSurface, Standard_True);
}
return aGraphicSurface;
@@ -125,7 +125,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve);
getAISContext()->Display (aGraphicCurve, Standard_True);
}
return aGraphicCurve;
@@ -172,7 +172,7 @@ Handle(AIS_Point) OCCDemo_Presentation::drawPoint
getAISContext()->SetColor (aGraphicPoint, theColor, toDisplay);
if (toDisplay) {
getAISContext()->Display (aGraphicPoint);
getAISContext()->Display (aGraphicPoint, Standard_True);
//COCCDemoDoc::Fit();
}
@@ -210,7 +210,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve);
getAISContext()->Display (aGraphicCurve, Standard_True);
}
return aGraphicCurve;
@@ -231,7 +231,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape);
getAISContext()->Display (aGraphicShape, Standard_True);
}
return aGraphicShape;
@@ -251,7 +251,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape);
getAISContext()->Display (aGraphicShape, Standard_True);
}
return aGraphicShape;

View File

@@ -56,7 +56,7 @@ void TexturesExt_Presentation::DoSample()
{
((CViewer3dApp*) AfxGetApp())->SetSampleName (L"Viewer3d");
((CViewer3dApp*) AfxGetApp())->SetSamplePath (L"..\\..\\04_Viewer3d");
getAISContext()->EraseAll();
getAISContext()->EraseAll (Standard_True);
if (myIndex >=0 && myIndex < myNbSamples)
{
// turn lights on for terrain sample
@@ -299,7 +299,7 @@ void TexturesExt_Presentation::sampleTerrain()
aTransform.Perform(aFaces(1));
aShape = aTransform;
getAISContext()->Display(Texturize(aShape, "terrain.gif"));
getAISContext()->Display (Texturize (aShape, "terrain.gif"), Standard_True);
}

View File

@@ -153,10 +153,10 @@ void CViewer3dDoc::OnBox()
myBox = new AIS_Shape(B.Shape());
myAISContext->SetMaterial(myBox,Graphic3d_NOM_PEWTER);
myAISContext->SetDisplayMode(myBox,1);
myAISContext->SetMaterial (myBox, Graphic3d_NOM_PEWTER, Standard_False);
myAISContext->SetDisplayMode (myBox, 1, Standard_False);
myAISContext->Display(myBox);
myAISContext->Display (myBox, Standard_True);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeBox Box1(gp_Pnt(0,-400,-100), 200.,150.,100.);\n\
");
@@ -172,9 +172,9 @@ void CViewer3dDoc::OnCylinder()
gp_Ax2 CylAx2(gp_Pnt(0,0,-100), gp_Dir(gp_Vec(gp_Pnt(0,0,-100),gp_Pnt(0,0,100))));
myCylinder = new User_Cylinder(CylAx2, 80.,200.);
myAISContext->SetDisplayMode(myCylinder,1);
myAISContext->SetDisplayMode (myCylinder, 1, Standard_False);
myAISContext->Display(myCylinder);
myAISContext->Display (myCylinder, Standard_True);
TCollection_AsciiString Message("\
gp_Ax2 CylAx2(gp_Pnt(0,0,-100), gp_Dir(gp_Vec(gp_Pnt(0,0,-100),gp_Pnt(0,0,100))));\n\
@@ -193,10 +193,10 @@ void CViewer3dDoc::OnSphere()
mySphere = new AIS_Shape(S.Shape());
myAISContext->SetMaterial(mySphere,Graphic3d_NOM_BRONZE);
myAISContext->SetDisplayMode(mySphere,1);
myAISContext->SetMaterial (mySphere, Graphic3d_NOM_BRONZE, Standard_False);
myAISContext->SetDisplayMode (mySphere, 1, Standard_False);
myAISContext->Display(mySphere);
myAISContext->Display (mySphere, Standard_False);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeSphere S(gp_Pnt(0,300,0), 100.);\n\
");
@@ -212,10 +212,10 @@ void CViewer3dDoc::OnRemoveAll()
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aListOfObjects);aListIterator.More();aListIterator.Next()){
myAISContext->Remove(aListIterator.Value());
myAISContext->Remove (aListIterator.Value(), Standard_False);
}
myAISContext->Remove(myCylinder);
myAISContext->Remove (myCylinder, Standard_True);
myCylinder.Nullify();
@@ -240,10 +240,10 @@ void CViewer3dDoc::OnOverlappedBox()
myOverlappedBox = new AIS_Shape(aBoxShape2);
myAISContext->SetMaterial(myOverlappedBox,Graphic3d_NOM_GOLD);
myAISContext->SetDisplayMode(myOverlappedBox,1);
myAISContext->SetMaterial (myOverlappedBox, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetDisplayMode (myOverlappedBox, 1, Standard_False);
myAISContext->Display(myOverlappedBox);
myAISContext->Display (myOverlappedBox, Standard_True);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeBox Box1(gp_Pnt(0,-400,-100), 200.,150.,100.);\n\
\n\
@@ -270,10 +270,10 @@ void CViewer3dDoc::OnOverlappedCylinder()
myOverlappedCylinder = new AIS_Shape(aCylShape2);
myAISContext->SetMaterial(myOverlappedCylinder,Graphic3d_NOM_GOLD);
myAISContext->SetDisplayMode(myOverlappedCylinder,1);
myAISContext->SetMaterial (myOverlappedCylinder, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetDisplayMode (myOverlappedCylinder, 1, Standard_False);
myAISContext->Display(myOverlappedCylinder);
myAISContext->Display (myOverlappedCylinder, Standard_True);
TCollection_AsciiString Message("\
gp_Ax2 CylAx2(gp_Pnt(0,0,-100), gp_Dir(gp_Vec(gp_Pnt(0,0,-100),gp_Pnt(0,0,100))));\n\
@@ -301,11 +301,11 @@ void CViewer3dDoc::OnOverlappedSphere()
myOverlappedSphere = new AIS_Shape(aSphereShape2);
myAISContext->SetMaterial(myOverlappedSphere,Graphic3d_NOM_GOLD);
myAISContext->SetMaterial (myOverlappedSphere, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetDisplayMode(myOverlappedSphere,1);
myAISContext->SetDisplayMode (myOverlappedSphere, 1, Standard_False);
myAISContext->Display(myOverlappedSphere);
myAISContext->Display (myOverlappedSphere, Standard_True);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeSphere Sphere1(gp_Pnt(0,300,0), 100.);\n\
@@ -506,7 +506,7 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
Quantity_Color CSFColor;
COLORREF MSColor;
myAISContext->Select();
myAISContext->Select (Standard_True);
// Change the color of a selected face in a user cylinder
if (myState == FACE_COLOR)
@@ -537,7 +537,7 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
Handle(AIS_InteractiveObject) aSelectedObject = myAISContext->SelectedInteractive();
Handle(User_Cylinder)::DownCast (aSelectedObject)->SetColor (CSFColor.Name());
myAISContext->Redisplay (aSelectedObject);
myAISContext->Redisplay (aSelectedObject, Standard_True);
myState = -1;
}
}
@@ -599,8 +599,10 @@ void CViewer3dDoc::OnObjectColoredMesh()
{
myAISContext->ClearPrs(myAISContext->SelectedInteractive(),6,Standard_False);
myAISContext->RecomputePrsOnly(myAISContext->SelectedInteractive(), Standard_False);
myAISContext->SetDisplayMode(myAISContext->SelectedInteractive(), 6);
myAISContext->SetDisplayMode(myAISContext->SelectedInteractive(), 6, Standard_False);
}
myAISContext->UpdateCurrentViewer();
}
void CViewer3dDoc::OnUpdateObjectColoredMesh(CCmdUI* pCmdUI)
@@ -635,14 +637,14 @@ void CViewer3dDoc::OnOptionsTrihedronDynamicTrihedron()
{
if (myAISContext -> IsDisplayed(myTrihedron))
{
myAISContext->Remove(myTrihedron);
myAISContext->Remove(myTrihedron, Standard_True);
}
else
{
Handle(Geom_Axis2Placement) myTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
myTrihedron=new AIS_Trihedron(myTrihedronAxis);
myAISContext->SetTrihedronSize(200, Standard_True);
myAISContext->Display(myTrihedron);
myAISContext->SetTrihedronSize(200, Standard_False);
myAISContext->Display(myTrihedron, Standard_True);
}
}
@@ -800,7 +802,7 @@ void CViewer3dDoc::OnFillet3d()
}
aSelInteractive ->Set (aNewShape);
myAISContext->Redisplay (aSelInteractive);
myAISContext->Redisplay (aSelInteractive, Standard_True);
}
myCResultDialog.SetTitle("Make a fillet");
@@ -832,7 +834,7 @@ void CViewer3dDoc::OnCircle()
// Handle(AIS_Circle) anAISCirc = new AIS_Circle(C.Value());
Handle(AIS_Circle) anAISCirc = new AIS_Circle(aGeomCircle);
myAISContext->Display (anAISCirc);
myAISContext->Display (anAISCirc, Standard_True);
myCResultDialog.SetTitle("Create a circle");
myCResultDialog.SetText(" GC_MakeCircle C(gp_Pnt(-100.,-300.,0.),gp_Pnt(-50.,-200.,0.),gp_Pnt(-10.,-250.,0.)); \n"
@@ -850,7 +852,7 @@ void CViewer3dDoc::OnLine()
gp_Lin aGpLin (gp_Pnt (0., 0., 0.), gp_Dir(1., 0., 0.));
Handle(Geom_Line) aGeomLin = new Geom_Line (aGpLin);
Handle(AIS_Line) anAISLine = new AIS_Line (aGeomLin);
myAISContext->Display (anAISLine);
myAISContext->Display (anAISLine, Standard_True);
myCResultDialog.SetTitle("Create a line");
myCResultDialog.SetText(" gp_Lin L(gp_Pnt(0.,0.,0.),gp_Dir(1.,0.,0.)); \n"
@@ -894,8 +896,8 @@ BOOL CViewer3dDoc::OnNewDocument()
// (SDI documents will reuse this document)
SetTitle(myPresentation->GetName());
myAISContext->EraseAll();
myAISContext->SetDisplayMode(AIS_Shaded);
myAISContext->EraseAll (Standard_False);
myAISContext->SetDisplayMode(AIS_Shaded, Standard_True);
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
@@ -954,14 +956,14 @@ void CViewer3dDoc::DoSample()
void CViewer3dDoc::OnBUTTONStart()
{
myAISContext->EraseAll();
myAISContext->EraseAll (Standard_True);
myPresentation->FirstSample();
DoSample();
}
void CViewer3dDoc::OnBUTTONEnd()
{
myAISContext->EraseAll();
myAISContext->EraseAll (Standard_True);
myPresentation->LastSample();
DoSample();
}

View File

@@ -422,7 +422,7 @@ GetDocument()->UpdateResultMessageDlg("SetPosition",Message);
BRepPrimAPI_MakeCone MakeCone(gp_Ax2(p1, gp_Dir(gp_Vec(p1, p2))),
0, (p1.Distance(p2))/tan(1.04), coneHeigth);
spotConeShape->Set(MakeCone.Solid());
GetDocument()->GetAISContext()->Display(spotConeShape,0,-1);
GetDocument()->GetAISContext()->Display (spotConeShape, 0, -1, Standard_True);
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Pick the target point");
myCurrentMode = CurAction3d_TargetSpotLight;
@@ -447,7 +447,7 @@ GetDocument()->UpdateResultMessageDlg("SetAngle",Message);
}
break;
case CurAction3d_EndSpotLight :
GetDocument()->GetAISContext()->Erase(spotConeShape);
GetDocument()->GetAISContext()->Erase (spotConeShape, Standard_True);
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Ready");
myCurrentMode = CurAction3d_Nothing;
break;
@@ -457,7 +457,7 @@ GetDocument()->UpdateResultMessageDlg("SetAngle",Message);
p2 = gp_Pnt(p1.X(),p1.Y(),p1.Z()+1.);
BRepBuilderAPI_MakeEdge MakeEdge(p1, p2);
directionalEdgeShape->Set(MakeEdge.Edge());
GetDocument()->GetAISContext()->Display(directionalEdgeShape,0,-1);
GetDocument()->GetAISContext()->Display (directionalEdgeShape, 0, -1, Standard_True);
// Create a directional light
myCurrent_DirectionalLight = new V3d_DirectionalLight(myView->Viewer(), p1.X(),p1.Y(),p1.Z(),0.,0.,1.);
myView->SetLightOn(myCurrent_DirectionalLight);
@@ -474,7 +474,7 @@ GetDocument()->UpdateResultMessageDlg("SetDirection",Message);
}
break;
case CurAction3d_EndDirectionalLight:
GetDocument()->GetAISContext()->Erase(directionalEdgeShape);
GetDocument()->GetAISContext()->Erase (directionalEdgeShape, Standard_True);
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Ready");
myCurrentMode = CurAction3d_Nothing;
break;
@@ -1175,18 +1175,18 @@ void CViewer3dView::RedrawVisMode()
switch (myVisMode)
{
case VIS_WIREFRAME:
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
GetDocument()->GetAISContext()->SetDisplayMode (AIS_WireFrame, Standard_True);
myView->SetComputedMode (Standard_False);
break;
case VIS_SHADE:
GetDocument()->GetAISContext()->SetDisplayMode(AIS_Shaded);
GetDocument()->GetAISContext()->SetDisplayMode (AIS_Shaded, Standard_True);
myView->SetComputedMode (Standard_False);
break;
case VIS_HLR:
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode (Standard_True);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
GetDocument()->GetAISContext()->SetDisplayMode (AIS_WireFrame, Standard_True);
break;
}
}