1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027900: Coding rules - drop redundant Name parameter from V3d_Viewer constructor

Removed unused methods AIS_InteractiveContext::DomainOfMainViewer(),
V3d_Viewer::NextName(), V3d_Viewer::Domain().

NCollection_List - added methods Contains() and Remove() taking item value.
V3d_Viewer now uses V3d_ListOfLight, V3d_ListOfView instead of V3d_ListOfTransient.

Removed obsolete ZFit workaround from command XShow.
This commit is contained in:
kgv
2016-09-25 19:09:23 +03:00
parent 1f7f5a900f
commit 6a24c6ded9
37 changed files with 666 additions and 995 deletions

View File

@@ -3786,9 +3786,9 @@ static int VDisplay2 (Draw_Interpretor& theDI,
aDispStatus);
if (toDisplayInView)
{
for (aCtx->CurrentViewer()->InitDefinedViews(); aCtx->CurrentViewer()->MoreDefinedViews(); aCtx->CurrentViewer()->NextDefinedViews())
for (V3d_ListOfViewIterator aViewIter (aCtx->CurrentViewer()->DefinedViewIterator()); aViewIter.More(); aViewIter.Next())
{
aCtx->SetViewAffinity (aShape, aCtx->CurrentViewer()->DefinedView(), Standard_False);
aCtx->SetViewAffinity (aShape, aViewIter.Value(), Standard_False);
}
aCtx->SetViewAffinity (aShape, ViewerTest::CurrentView(), Standard_True);
}

View File

@@ -656,8 +656,7 @@ TCollection_AsciiString ViewerTest::ViewerInit (const Standard_Integer thePxLeft
else if (a3DViewer.IsNull())
{
toCreateViewer = Standard_True;
TCollection_ExtendedString NameOfWindow("Viewer3D");
a3DViewer = new V3d_Viewer(aGraphicDriver, NameOfWindow.ToExtString());
a3DViewer = new V3d_Viewer(aGraphicDriver);
a3DViewer->SetDefaultBackgroundColor (ViewerTest_DefaultBackground.FlatColor);
a3DViewer->SetDefaultBgGradientColors (ViewerTest_DefaultBackground.GradientColor1,
ViewerTest_DefaultBackground.GradientColor2,
@@ -7631,9 +7630,9 @@ static int VLight (Draw_Interpretor& theDi,
{
// print lights info
Standard_Integer aLightId = 0;
for (aView->InitActiveLights(); aView->MoreActiveLights(); aView->NextActiveLights(), ++aLightId)
for (V3d_ListOfLightIterator aLightIter (aView->ActiveLightIterator()); aLightIter.More(); aLightIter.Next(), ++aLightId)
{
Handle(V3d_Light) aLight = aView->ActiveLight();
Handle(V3d_Light) aLight = aLightIter.Value();
const Quantity_Color aColor = aLight->Color();
theDi << "Light" << aLightId << "\n";
switch (aLight->Type())
@@ -7747,11 +7746,11 @@ static int VLight (Draw_Interpretor& theDi,
|| anArgCase.IsEqual ("CLEAR"))
{
toCreate = Standard_False;
aView->InitActiveLights();
while (aView->MoreActiveLights())
for (V3d_ListOfLightIterator aLightIter (aView->ActiveLightIterator()); aLightIter.More();)
{
aViewer->DelLight (aView->ActiveLight());
aView->InitActiveLights();
Handle(V3d_Light) aLight = aLightIter.Value();
aViewer->DelLight (aLight);
aLightIter = aView->ActiveLightIterator();
}
}
else if (anArgCase.IsEqual ("AMB")
@@ -7815,11 +7814,11 @@ static int VLight (Draw_Interpretor& theDi,
const Standard_Integer aLightId = getLightId (theArgVec[anArgIt]);
Standard_Integer aLightIt = 0;
for (aView->InitActiveLights(); aView->MoreActiveLights(); aView->NextActiveLights(), ++aLightIt)
for (V3d_ListOfLightIterator aLightIter (aView->ActiveLightIterator()); aLightIter.More(); aLightIter.Next(), ++aLightIt)
{
if (aLightIt == aLightId)
{
aLightOld = aView->ActiveLight();
aLightOld = aLightIter.Value();
break;
}
}
@@ -7843,9 +7842,9 @@ static int VLight (Draw_Interpretor& theDi,
const TCollection_AsciiString anArgNext (theArgVec[anArgIt]);
const Standard_Integer aLightDelId = getLightId (theArgVec[anArgIt]);
Standard_Integer aLightIt = 0;
for (aView->InitActiveLights(); aView->MoreActiveLights(); aView->NextActiveLights(), ++aLightIt)
for (V3d_ListOfLightIterator aLightIter (aView->ActiveLightIterator()); aLightIter.More(); aLightIter.Next(), ++aLightIt)
{
aLightDel = aView->ActiveLight();
aLightDel = aLightIter.Value();
if (aLightIt == aLightDelId)
{
break;