1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

@@ -714,7 +714,7 @@ static int visos (Draw_Interpretor& di, Standard_Integer argc, const char** argv
CurDrawer->SetVIsoAspect(CopyIsoAspect(aVIso, aNbVIsos));
TheAISContext()->SetLocalAttributes
(aShape, CurDrawer, Standard_False);
TheAISContext()->Redisplay(aShape);
TheAISContext()->Redisplay (aShape, Standard_False);
} else {
di << "Number of isos for " << argv[i] << " : "
<< aUIso->Number() << " " << aVIso->Number() << "\n";
@@ -1225,9 +1225,9 @@ static int VSubInt(Draw_Interpretor& di, Standard_Integer argc, const char** arg
IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
if (!IO.IsNull()) {
if(On==1)
Ctx->SubIntensityOn(IO);
Ctx->SubIntensityOn(IO, Standard_True);
else
Ctx->SubIntensityOff(IO);
Ctx->SubIntensityOff(IO, Standard_True);
}
}
else return 1;
@@ -3373,7 +3373,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
anAISContext->SetDisplayMode (aTexturedIO, AIS_Shaded, Standard_False);
if (aPreviousMode == 3)
{
anAISContext->RecomputePrsOnly (aTexturedIO);
anAISContext->RecomputePrsOnly (aTexturedIO, Standard_False);
}
anAISContext->Display (aTexturedIO, Standard_True);
@@ -3468,7 +3468,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
if (aTexturedIO->DisplayMode() == 3 || aPreviousMode == 3)
{
anAISContext->RecomputePrsOnly (aTexturedIO);
anAISContext->RecomputePrsOnly (aTexturedIO, Standard_True);
}
else
{
@@ -3957,7 +3957,7 @@ static int VDisplay2 (Draw_Interpretor& theDI,
if (aSelMode == -1)
{
aCtx->Erase (aShape);
aCtx->Erase (aShape, Standard_False);
}
aCtx->Display (aShape, aDispMode, aSelMode,
Standard_False, aShape->AcceptShapeDecomposition(),
@@ -4054,7 +4054,7 @@ static int VShading(Draw_Interpretor& ,Standard_Integer argc, const char** argv)
else
TheAISContext()->SetDeviationCoefficient(TheAisIO,0.0008,Standard_True);
TheAISContext()->Redisplay(TheAisIO);
TheAISContext()->Redisplay (TheAisIO, Standard_True);
return 0;
}
//==============================================================================
@@ -4891,7 +4891,7 @@ static int VPickShape( Draw_Interpretor& di, Standard_Integer argc, const char**
Handle(AIS_Shape) newsh = new AIS_Shape(PickSh);
GetMapOfAIS().Bind(newsh, name);
TheAISContext()->Display(newsh);
TheAISContext()->Display (newsh, Standard_True);
di<<"Nom de la shape pickee : "<<name.ToCString()<<"\n";
}
@@ -4921,9 +4921,10 @@ static int VPickShape( Draw_Interpretor& di, Standard_Integer argc, const char**
Handle(AIS_Shape) newsh = new AIS_Shape(PickSh);
GetMapOfAIS().Bind(newsh, name);
di<<"display of picke shape #"<<i<<" - nom : "<<name.ToCString()<<"\n";
TheAISContext()->Display(newsh);
TheAISContext()->Display (newsh, Standard_False);
}
TheAISContext()->UpdateCurrentViewer();
}
}
return 0;
@@ -4971,9 +4972,11 @@ static int VPickSelected (Draw_Interpretor& , Standard_Integer theArgNb, const c
Handle(AIS_Shape) aNewShape = new AIS_Shape (aShape);
GetMapOfAIS().Bind (aNewShape, aCurrentName);
TheAISContext()->Display (aNewShape);
TheAISContext()->Display (aNewShape, Standard_False);
}
TheAISContext()->UpdateCurrentViewer();
return 0;
}
@@ -5163,7 +5166,7 @@ static Standard_Integer vr(Draw_Interpretor& , Standard_Integer , const char** a
DBRep::Set(a[1], shape);
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
Handle(AIS_Shape) ais = new AIS_Shape(shape);
Ctx->Display(ais);
Ctx->Display (ais, Standard_True);
return 0;
}

View File

@@ -135,9 +135,9 @@ static Standard_Integer VBLEND(Draw_Interpretor& di, Standard_Integer narg, cons
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
Ctx->Erase(Start,Standard_False);
if(Ctx->IsDisplayed(AS))
Ctx->Redisplay(AS);
Ctx->Redisplay (AS, Standard_True);
else
Ctx->Display(AS);
Ctx->Display (AS, Standard_True);
return 0;
}

View File

@@ -575,7 +575,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(Geom_Line) myLine=new Geom_Line (p1 ,myVect );
Handle(AIS_Axis) TheAxis=new AIS_Axis (myLine );
GetMapOfAIS().Bind (TheAxis,name);
TheAISContext()->Display(TheAxis);
TheAISContext()->Display(TheAxis, Standard_True);
}
// Pas d'arguments
@@ -613,7 +613,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(Geom_Axis1Placement) OrigineAndVect=new Geom_Axis1Placement (A,D);
Handle(AIS_Axis) TheAxis=new AIS_Axis (OrigineAndVect);
GetMapOfAIS().Bind (TheAxis,name);
TheAISContext()->Display(TheAxis);
TheAISContext()->Display (TheAxis, Standard_True);
}
else
{
@@ -627,7 +627,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(Geom_Axis1Placement) OrigineAndVect=new Geom_Axis1Placement (A,D);
Handle(AIS_Axis) TheAxis=new AIS_Axis (OrigineAndVect);
GetMapOfAIS().Bind (TheAxis,name);
TheAISContext()->Display(TheAxis);
TheAISContext()->Display (TheAxis, Standard_True);
}
}
@@ -662,7 +662,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(Geom_Axis1Placement) OrigineAndVect=new Geom_Axis1Placement (B,D);
Handle(AIS_Axis) TheAxis=new AIS_Axis (OrigineAndVect);
GetMapOfAIS().Bind (TheAxis,name);
TheAISContext()->Display(TheAxis);
TheAISContext()->Display (TheAxis, Standard_True);
}
@@ -697,7 +697,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(Geom_Axis1Placement) OrigineAndVect=new Geom_Axis1Placement (B,D);
Handle(AIS_Axis) TheAxis=new AIS_Axis (OrigineAndVect);
GetMapOfAIS().Bind (TheAxis,name);
TheAISContext()->Display(TheAxis);
TheAISContext()->Display (TheAxis, Standard_True);
}
@@ -745,7 +745,7 @@ static int VPointBuilder(Draw_Interpretor& di, Standard_Integer argc, const char
Handle(Geom_CartesianPoint ) myGeomPoint= new Geom_CartesianPoint (thecoord[0],thecoord[1],thecoord[2]);
Handle(AIS_Point) myAISPoint=new AIS_Point(myGeomPoint );
GetMapOfAIS().Bind (myAISPoint,name);
TheAISContext()->Display(myAISPoint);
TheAISContext()->Display (myAISPoint, Standard_True);
}
// Il n'a pas d'arguments
@@ -769,7 +769,7 @@ static int VPointBuilder(Draw_Interpretor& di, Standard_Integer argc, const char
Handle(Geom_CartesianPoint) myGeomPoint= new Geom_CartesianPoint (A );
Handle(AIS_Point) myAISPoint = new AIS_Point (myGeomPoint );
GetMapOfAIS().Bind(myAISPoint,name);
TheAISContext()->Display(myAISPoint);
TheAISContext()->Display (myAISPoint, Standard_True);
}
else
{
@@ -782,7 +782,7 @@ static int VPointBuilder(Draw_Interpretor& di, Standard_Integer argc, const char
Handle(Geom_CartesianPoint) myGeomPointM= new Geom_CartesianPoint ( (A.X()+B.X())/2 , (A.Y()+B.Y())/2 , (A.Z()+B.Z())/2 );
Handle(AIS_Point) myAISPointM = new AIS_Point (myGeomPointM );
GetMapOfAIS().Bind(myAISPointM,name);
TheAISContext()->Display(myAISPointM);
TheAISContext()->Display (myAISPointM, Standard_True);
}
}
@@ -945,7 +945,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
anAISPlane->SetTypeOfSensitivity (Select3D_TypeOfSensitivity (aType));
}
}
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
// The first argument is an AIS_Axis
@@ -1003,7 +1003,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
anAISPlane->SetTypeOfSensitivity (Select3D_TypeOfSensitivity (aType));
}
}
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
// The first argumnet is an AIS_Plane
@@ -1058,7 +1058,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
anAISPlane->SetTypeOfSensitivity (Select3D_TypeOfSensitivity (aType));
}
}
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
// Error
else
@@ -1118,7 +1118,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
Handle(Geom_Plane) aGeomPlane = MkPlane.Value();
Handle(AIS_Plane) anAISPlane = new AIS_Plane (aGeomPlane);
GetMapOfAIS().Bind (anAISPlane, aName);
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
}
else if (aShapes.Extent() == 3)
@@ -1145,7 +1145,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
Handle(Geom_Plane) aGeomPlane = MkPlane.Value();
Handle(AIS_Plane) anAISPlane = new AIS_Plane (aGeomPlane);
GetMapOfAIS().Bind (anAISPlane, aName);
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
else
{
@@ -1189,7 +1189,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
Handle(Geom_Plane) aGeomPlane = MkPlane.Value();
Handle(AIS_Plane) anAISPlane = new AIS_Plane (aGeomPlane);
GetMapOfAIS().Bind (anAISPlane ,aName);
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
else if (aShapeA.ShapeType() == TopAbs_FACE)
{
@@ -1201,7 +1201,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
Handle(Geom_Plane) aGeomPlane = new Geom_Plane(aPlane);
Handle(AIS_Plane) anAISPlane = new AIS_Plane(aGeomPlane);
GetMapOfAIS().Bind (anAISPlane, aName);
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
else
{
@@ -1253,7 +1253,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
Handle(Geom_Plane) aGeomPlane = new Geom_Plane (aPlane);
Handle(AIS_Plane) aAISPlane = new AIS_Plane (aGeomPlane, A);
GetMapOfAIS().Bind (aAISPlane ,aName);
TheAISContext()->Display(aAISPlane);
TheAISContext()->Display (aAISPlane, Standard_True);
}
else
{
@@ -1325,7 +1325,7 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
gp_Pnt aMiddle ((Aa.X()+Ab.X() )/2 ,(Aa.Y()+Ab.Y() )/2 ,(Aa.Z()+Ab.Z() )/2 );
Handle(AIS_Plane) anAISPlane = new AIS_Plane (aGeomPlane, aMiddle);
GetMapOfAIS().Bind (anAISPlane, aName);
TheAISContext()->Display(anAISPlane);
TheAISContext()->Display (anAISPlane, Standard_True);
}
else
{
@@ -1506,7 +1506,7 @@ static int VLineBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
// Les deux points sont OK...Construction de l'AIS_Line (en faite, le segment AB)
Handle(AIS_Line) theAISLine= new AIS_Line(myCartPointA,myCartPointB );
GetMapOfAIS().Bind(theAISLine,argv[1] );
TheAISContext()->Display(theAISLine );
TheAISContext()->Display (theAISLine, Standard_True);
}
@@ -1527,7 +1527,7 @@ static int VLineBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(AIS_Line) theAISLine= new AIS_Line(myCartPointA,myCartPointB );
GetMapOfAIS().Bind(theAISLine,argv[1] );
TheAISContext()->Display(theAISLine );
TheAISContext()->Display (theAISLine, Standard_True);
}
@@ -1563,7 +1563,7 @@ static int VLineBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
Handle(AIS_Line) theAISLine= new AIS_Line(myCartPointA,myCartPointB );
GetMapOfAIS().Bind(theAISLine,argv[1] );
TheAISContext()->Display(theAISLine );
TheAISContext()->Display (theAISLine, Standard_True);
}
return 0;
@@ -1709,7 +1709,7 @@ void DisplayCircle (Handle (Geom_Circle) theGeomCircle,
GetMapOfAIS().Bind(aCircle, theName);
// Display the circle
TheAISContext()->Display(aCircle);
TheAISContext()->Display (aCircle, Standard_True);
}
@@ -2874,7 +2874,7 @@ static int VComputeHLR (Draw_Interpretor& di,
// create an AIS shape and display it
Handle(AIS_Shape) anObject = new AIS_Shape (aHlrShape);
GetMapOfAIS().Bind (anObject, aHlrName);
aContextAIS->Display (anObject);
aContextAIS->Display (anObject, Standard_False);
aContextAIS->UpdateCurrentViewer ();
@@ -3718,7 +3718,7 @@ static Standard_Integer VConnect (Draw_Interpretor& /*di*/,
GetMapOfAIS().Bind (anOriginObject, aName);
// Display connected object
TheAISContext()->Display (anOriginObject);
TheAISContext()->Display (anOriginObject, Standard_True);
return 0;
}
@@ -3964,7 +3964,7 @@ static Standard_Integer VAddConnected (Draw_Interpretor& di,
aTrsf.SetTranslation (gp_Vec (aX, aY, aZ));
anAssembly->Connect (anIObj, aTrsf);
TheAISContext()->Display (anAssembly);
TheAISContext()->Display (anAssembly, Standard_False);
TheAISContext()->RecomputeSelectionOnly (anAssembly);
aContext->UpdateCurrentViewer();
@@ -4413,7 +4413,7 @@ static Standard_Integer VTriangle (Draw_Interpretor& /*di*/,
GetMapOfAIS().Bind(aTriangle, aName);
// Display triangle
TheAISContext()->Display(aTriangle);
TheAISContext()->Display (aTriangle, Standard_True);
return 0;
}
@@ -4528,7 +4528,7 @@ static Standard_Integer VSegment (Draw_Interpretor& /*di*/,
GetMapOfAIS().Bind(aSegment, aName);
// Display segment
TheAISContext()->Display(aSegment);
TheAISContext()->Display (aSegment, Standard_True);
return 0;
}
@@ -4788,7 +4788,7 @@ static Standard_Integer VShowFaceBoundary (Draw_Interpretor& /*di*/,
aDrawer->SetFaceBoundaryAspect (aBoundaryAspect);
TheAISContext()->Redisplay (anInterObj);
TheAISContext()->Redisplay (anInterObj, Standard_True);
return 0;
}
@@ -5464,7 +5464,7 @@ static int VSetEdgeType (Draw_Interpretor& theDI,
// Update shape presentation as aspect parameters were changed
if (isForceRedisplay)
{
ViewerTest::GetAISContext()->Redisplay (anObject);
ViewerTest::GetAISContext()->Redisplay (anObject, Standard_False);
}
else
{
@@ -5528,7 +5528,7 @@ static int VUnsetEdgeType (Draw_Interpretor& theDI,
// Update shape presentation as aspect parameters were changed
if (isForceRedisplay)
{
ViewerTest::GetAISContext()->Redisplay (anObject);
ViewerTest::GetAISContext()->Redisplay (anObject, Standard_False);
}
else
{

View File

@@ -1758,7 +1758,7 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const
Handle(AIS_Relation) aRelation = Handle(AIS_Relation)::DownCast (aPickedObj);
aPoint = Get3DPointAtMousePosition();
aRelation->SetPosition (aPoint);
TheAISContext()->Redisplay (aRelation);
TheAISContext()->Redisplay (aRelation, Standard_True);
}
else
{
@@ -1795,7 +1795,7 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const
}
aDim->SetTextPosition (aPoint);
TheAISContext()->Redisplay (aDim);
TheAISContext()->Redisplay (aDim, Standard_True);
}
}
@@ -1805,13 +1805,13 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const
{
Handle(AIS_Relation) aRelation = Handle(AIS_Relation)::DownCast (aPickedObj);
aRelation->SetPosition (aPoint);
TheAISContext()->Redisplay (aRelation);
TheAISContext()->Redisplay (aRelation, Standard_True);
}
else
{
Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast (aPickedObj);
aDim->SetTextPosition (aPoint);
TheAISContext()->Redisplay (aDim);
TheAISContext()->Redisplay (aDim, Standard_True);
}
return 0;

View File

@@ -1437,7 +1437,7 @@ void VT_ProcessKeyPress (const char* buf_ret)
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
if(Ctx->NbSelected()==0)
Ctx->SetDisplayMode(AIS_Shaded);
Ctx->SetDisplayMode (AIS_Shaded, Standard_True);
else{
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
Ctx->SetDisplayMode(Ctx->SelectedInteractive(),1,Standard_False);
@@ -1451,7 +1451,7 @@ void VT_ProcessKeyPress (const char* buf_ret)
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
if(Ctx->NbSelected()==0)
Ctx->SetDisplayMode(AIS_WireFrame);
Ctx->SetDisplayMode (AIS_WireFrame, Standard_True);
else{
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
Ctx->UnsetDisplayMode(Ctx->SelectedInteractive(),Standard_False);
@@ -1484,7 +1484,7 @@ void VT_ProcessKeyPress (const char* buf_ret)
std::cout << "setup WireFrame display mode" << std::endl;
Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
if(Ctx->NbSelected()==0)
Ctx->SetDisplayMode(AIS_WireFrame);
Ctx->SetDisplayMode (AIS_WireFrame, Standard_True);
else{
for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
Ctx->SetDisplayMode(Ctx->SelectedInteractive(),0,Standard_False);
@@ -1899,7 +1899,7 @@ static LRESULT WINAPI AdvViewerWindowProc( HWND hwnd,
if (!GetActiveAISManipulator().IsNull())
{
GetActiveAISManipulator()->StopTransform();
ViewerTest::GetAISContext()->ClearSelected();
ViewerTest::GetAISContext()->ClearSelected (Standard_True);
}
if (ViewerTest::GetAISContext()->IsDisplayed (GetRubberBand()))
@@ -1919,7 +1919,7 @@ static LRESULT WINAPI AdvViewerWindowProc( HWND hwnd,
if (!GetActiveAISManipulator().IsNull())
{
GetActiveAISManipulator()->StopTransform (Standard_False);
ViewerTest::GetAISContext()->ClearSelected();
ViewerTest::GetAISContext()->ClearSelected (Standard_True);
}
IsDragged = Standard_False;
}
@@ -2340,24 +2340,24 @@ int ViewerMainLoop(Standard_Integer argc, const char** argv)
if( DragFirst )
if( ShiftPressed )
{
aContext->ShiftSelect();
aContext->ShiftSelect (Standard_True);
}
else
{
aContext->Select();
aContext->Select (Standard_True);
}
else
if( ShiftPressed )
{
aContext->ShiftSelect( min( X_ButtonPress, X_Motion ), min( Y_ButtonPress, Y_Motion ),
max( X_ButtonPress, X_Motion ), max( Y_ButtonPress, Y_Motion ),
ViewerTest::CurrentView());
aContext->ShiftSelect(Min(X_ButtonPress, X_Motion), Min(Y_ButtonPress, Y_Motion),
Max(X_ButtonPress, X_Motion), Max(Y_ButtonPress, Y_Motion),
ViewerTest::CurrentView(), Standard_True);
}
else
{
aContext->Select( min( X_ButtonPress, X_Motion ), min( Y_ButtonPress, Y_Motion ),
max( X_ButtonPress, X_Motion ), max( Y_ButtonPress, Y_Motion ),
ViewerTest::CurrentView() );
aContext->Select(Min(X_ButtonPress, X_Motion), Min(Y_ButtonPress, Y_Motion),
Max(X_ButtonPress, X_Motion), Max(Y_ButtonPress, Y_Motion),
ViewerTest::CurrentView(), Standard_True);
}
else
VT_ProcessButton3Release();
@@ -4916,7 +4916,7 @@ static int VLayerLine(Draw_Interpretor& di, Standard_Integer argc, const char**
static Handle (V3d_LineItem) aLine;
if (!aLine.IsNull())
{
aContext->Erase (aLine);
aContext->Erase (aLine, Standard_False);
}
aLine = new V3d_LineItem (X1, Y1, X2, Y2,
aLineType, aWidth,
@@ -6940,7 +6940,7 @@ static Standard_Integer VChangeSelected (Draw_Interpretor& di,
return 1;
}
aContext->AddOrRemoveSelected(anAISObject);
aContext->AddOrRemoveSelected(anAISObject, Standard_True);
}
return 0;
}
@@ -9781,7 +9781,7 @@ static int VManipulator (Draw_Interpretor& theDi,
aManipulator->Detach();
aMapAIS.UnBind2 (aName);
ViewerTest::GetAISContext()->Remove (aManipulator);
ViewerTest::GetAISContext()->Remove (aManipulator, Standard_True);
return 0;
}
@@ -9950,7 +9950,7 @@ static int VManipulator (Draw_Interpretor& theDi,
aManipulator->Transform (aT);
}
ViewerTest::GetAISContext()->Redisplay (aManipulator);
ViewerTest::GetAISContext()->Redisplay (aManipulator, Standard_True);
return 0;
}