diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index 9f663ef974..df43089f30 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -2124,7 +2124,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, { TCollection_AsciiString aCommandName (theArgv[0]); - NCollection_DataMap aMapOfArgs; + NCollection_DataMap aMapOfArgs; if (aCommandName == "vtexture") { if (theArgsNb < 2) @@ -2146,7 +2146,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, aParseKey = anArg; aParseKey.Remove (1); aParseKey.UpperCase(); - aMapOfArgs.Bind (aParseKey, TColStd_SequenceOfAsciiString()); + aMapOfArgs.Bind (aParseKey, new TColStd_HSequenceOfAsciiString); continue; } @@ -2155,7 +2155,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, continue; } - aMapOfArgs.ChangeFind (aParseKey).Append (anArg); + aMapOfArgs(aParseKey)->Append (anArg); } } else if (aCommandName == "vtexscale" @@ -2171,15 +2171,15 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, return 1; } - TColStd_SequenceOfAsciiString anArgs; + Handle(TColStd_HSequenceOfAsciiString) anArgs = new TColStd_HSequenceOfAsciiString; if (theArgsNb == 2) { - anArgs.Append ("OFF"); + anArgs->Append ("OFF"); } else if (theArgsNb == 4) { - anArgs.Append (TCollection_AsciiString (theArgv[2])); - anArgs.Append (TCollection_AsciiString (theArgv[3])); + anArgs->Append (TCollection_AsciiString (theArgv[2])); + anArgs->Append (TCollection_AsciiString (theArgv[3])); } TCollection_AsciiString anArgKey; @@ -2202,32 +2202,32 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, { // scan for parameters of vtexdefault command // equal to -default option of vtexture command - aMapOfArgs.Bind ("DEFAULT", TColStd_SequenceOfAsciiString()); + aMapOfArgs.Bind ("DEFAULT", new TColStd_HSequenceOfAsciiString); } // Check arguments for validity - NCollection_DataMap::Iterator aMapIt (aMapOfArgs); + NCollection_DataMap::Iterator aMapIt (aMapOfArgs); for (; aMapIt.More(); aMapIt.Next()) { const TCollection_AsciiString& aKey = aMapIt.Key(); - const TColStd_SequenceOfAsciiString& anArgs = aMapIt.Value(); + const Handle(TColStd_HSequenceOfAsciiString)& anArgs = aMapIt.Value(); // -scale, -origin, -repeat: one argument "off", or two real values if ((aKey.IsEqual ("SCALE") || aKey.IsEqual ("ORIGIN") || aKey.IsEqual ("REPEAT")) - && ((anArgs.Length() == 1 && anArgs (1) == "OFF") - || (anArgs.Length() == 2 && anArgs (1).IsRealValue() && anArgs (2).IsRealValue()))) + && ((anArgs->Length() == 1 && anArgs->Value(1) == "OFF") + || (anArgs->Length() == 2 && anArgs->Value(1).IsRealValue() && anArgs->Value(2).IsRealValue()))) { continue; } // -modulate: single argument "on" / "off" - if (aKey.IsEqual ("MODULATE") && anArgs.Length() == 1 && (anArgs (1) == "OFF" || anArgs (1) == "ON")) + if (aKey.IsEqual ("MODULATE") && anArgs->Length() == 1 && (anArgs->Value(1) == "OFF" || anArgs->Value(1) == "ON")) { continue; } // -default: no arguments - if (aKey.IsEqual ("DEFAULT") && anArgs.IsEmpty()) + if (aKey.IsEqual ("DEFAULT") && anArgs->IsEmpty()) { continue; } @@ -2332,7 +2332,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, // Process other options and commands // ------------------------------------ - TColStd_SequenceOfAsciiString aValues; + Handle(TColStd_HSequenceOfAsciiString) aValues; if (aMapOfArgs.Find ("DEFAULT", aValues)) { aTexturedIO->SetTextureRepeat (Standard_False); @@ -2344,9 +2344,9 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, { if (aMapOfArgs.Find ("SCALE", aValues)) { - if (aValues (1) != "OFF") + if (aValues->Value(1) != "OFF") { - aTexturedIO->SetTextureScale (Standard_True, aValues (1).RealValue(), aValues (2).RealValue()); + aTexturedIO->SetTextureScale (Standard_True, aValues->Value(1).RealValue(), aValues->Value(2).RealValue()); } else { @@ -2356,9 +2356,9 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, if (aMapOfArgs.Find ("ORIGIN", aValues)) { - if (aValues (1) != "OFF") + if (aValues->Value(1) != "OFF") { - aTexturedIO->SetTextureOrigin (Standard_True, aValues (1).RealValue(), aValues (2).RealValue()); + aTexturedIO->SetTextureOrigin (Standard_True, aValues->Value(1).RealValue(), aValues->Value(2).RealValue()); } else { @@ -2368,9 +2368,9 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, if (aMapOfArgs.Find ("REPEAT", aValues)) { - if (aValues (1) != "OFF") + if (aValues->Value(1) != "OFF") { - aTexturedIO->SetTextureRepeat (Standard_True, aValues (1).RealValue(), aValues (2).RealValue()); + aTexturedIO->SetTextureRepeat (Standard_True, aValues->Value(1).RealValue(), aValues->Value(2).RealValue()); } else { @@ -2380,7 +2380,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb, if (aMapOfArgs.Find ("MODULATE", aValues)) { - if (aValues (1) == "ON") + if (aValues->Value(1) == "ON") { aTexturedIO->EnableTextureModulate(); } diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index 8a1db20e7e..9e3d762a01 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include #include @@ -1658,6 +1658,7 @@ void ProcessZClipMotion() //purpose : Zoom //============================================================================== +#if defined(_WIN32) || ! defined(__APPLE__) || defined(MACOSX_USE_GLX) static void ProcessControlButton1Motion() { ViewerTest::CurrentView()->Zoom( X_ButtonPress, Y_ButtonPress, X_Motion, Y_Motion); @@ -1665,6 +1666,7 @@ static void ProcessControlButton1Motion() X_ButtonPress = X_Motion; Y_ButtonPress = Y_Motion; } +#endif //============================================================================== //function : VT_ProcessControlButton2Motion @@ -4420,7 +4422,7 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con // Parse options and values // ------------------------- - NCollection_DataMap aMapOfKeysByValues; + NCollection_DataMap aMapOfKeysByValues; TCollection_AsciiString aParseKey; for (Standard_Integer anArgIt = 1; anArgIt < theArgsNb; ++anArgIt) { @@ -4431,7 +4433,7 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con aParseKey = anArg; aParseKey.Remove (1); aParseKey.UpperCase(); - aMapOfKeysByValues.Bind (aParseKey, TColStd_SequenceOfAsciiString()); + aMapOfKeysByValues.Bind (aParseKey, new TColStd_HSequenceOfAsciiString); continue; } @@ -4442,7 +4444,7 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con return 1; } - aMapOfKeysByValues.ChangeFind (aParseKey).Append (anArg); + aMapOfKeysByValues(aParseKey)->Append (anArg); } // --------------------------------------------- @@ -4450,19 +4452,19 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con // --------------------------------------------- // Check arguments for validity - NCollection_DataMap::Iterator aMapIt (aMapOfKeysByValues); + NCollection_DataMap::Iterator aMapIt (aMapOfKeysByValues); for (; aMapIt.More(); aMapIt.Next()) { const TCollection_AsciiString& aKey = aMapIt.Key(); - const TColStd_SequenceOfAsciiString& aValues = aMapIt.Value(); + const Handle(TColStd_HSequenceOfAsciiString)& aValues = aMapIt.Value(); - if (!(aKey.IsEqual ("SCALE") && (aValues.Length() == 1 || aValues.IsEmpty())) - && !(aKey.IsEqual ("SIZE") && (aValues.Length() == 1 || aValues.IsEmpty())) - && !(aKey.IsEqual ("EYE") && (aValues.Length() == 3 || aValues.IsEmpty())) - && !(aKey.IsEqual ("AT") && (aValues.Length() == 3 || aValues.IsEmpty())) - && !(aKey.IsEqual ("UP") && (aValues.Length() == 3 || aValues.IsEmpty())) - && !(aKey.IsEqual ("PROJ") && (aValues.Length() == 3 || aValues.IsEmpty())) - && !(aKey.IsEqual ("CENTER") && aValues.Length() == 2)) + if (!(aKey.IsEqual ("SCALE") && (aValues->Length() == 1 || aValues->IsEmpty())) + && !(aKey.IsEqual ("SIZE") && (aValues->Length() == 1 || aValues->IsEmpty())) + && !(aKey.IsEqual ("EYE") && (aValues->Length() == 3 || aValues->IsEmpty())) + && !(aKey.IsEqual ("AT") && (aValues->Length() == 3 || aValues->IsEmpty())) + && !(aKey.IsEqual ("UP") && (aValues->Length() == 3 || aValues->IsEmpty())) + && !(aKey.IsEqual ("PROJ") && (aValues->Length() == 3 || aValues->IsEmpty())) + && !(aKey.IsEqual ("CENTER") && aValues->Length() == 2)) { TCollection_AsciiString aLowerKey; aLowerKey = "-"; @@ -4474,23 +4476,23 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con } } - TColStd_SequenceOfAsciiString aValues; + Handle(TColStd_HSequenceOfAsciiString) aValues; // Change view parameters in proper order if (aMapOfKeysByValues.Find ("SCALE", aValues)) { - if (aValues.IsEmpty()) + if (aValues->IsEmpty()) { theDi << "Scale: " << anAISView->Scale() << "\n"; } else { - anAISView->SetScale (aValues (1).RealValue()); + anAISView->SetScale (aValues->Value(1).RealValue()); } } if (aMapOfKeysByValues.Find ("SIZE", aValues)) { - if (aValues.IsEmpty()) + if (aValues->IsEmpty()) { Standard_Real aSizeX = 0.0; Standard_Real aSizeY = 0.0; @@ -4499,12 +4501,12 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con } else { - anAISView->SetSize (aValues (1).RealValue()); + anAISView->SetSize (aValues->Value(1).RealValue()); } } if (aMapOfKeysByValues.Find ("EYE", aValues)) { - if (aValues.IsEmpty()) + if (aValues->IsEmpty()) { Standard_Real anEyeX = 0.0; Standard_Real anEyeY = 0.0; @@ -4514,12 +4516,12 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con } else { - anAISView->SetEye (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue()); + anAISView->SetEye (aValues->Value(1).RealValue(), aValues->Value(2).RealValue(), aValues->Value(3).RealValue()); } } if (aMapOfKeysByValues.Find ("AT", aValues)) { - if (aValues.IsEmpty()) + if (aValues->IsEmpty()) { Standard_Real anAtX = 0.0; Standard_Real anAtY = 0.0; @@ -4529,12 +4531,12 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con } else { - anAISView->SetAt (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue()); + anAISView->SetAt (aValues->Value(1).RealValue(), aValues->Value(2).RealValue(), aValues->Value(3).RealValue()); } } if (aMapOfKeysByValues.Find ("PROJ", aValues)) { - if (aValues.IsEmpty()) + if (aValues->IsEmpty()) { Standard_Real aProjX = 0.0; Standard_Real aProjY = 0.0; @@ -4544,12 +4546,12 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con } else { - anAISView->SetProj (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue()); + anAISView->SetProj (aValues->Value(1).RealValue(), aValues->Value(2).RealValue(), aValues->Value(3).RealValue()); } } if (aMapOfKeysByValues.Find ("UP", aValues)) { - if (aValues.IsEmpty()) + if (aValues->IsEmpty()) { Standard_Real anUpX = 0.0; Standard_Real anUpY = 0.0; @@ -4559,12 +4561,12 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con } else { - anAISView->SetUp (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue()); + anAISView->SetUp (aValues->Value(1).RealValue(), aValues->Value(2).RealValue(), aValues->Value(3).RealValue()); } } if (aMapOfKeysByValues.Find ("CENTER", aValues)) { - anAISView->SetCenter (aValues (1).IntegerValue(), aValues (2).IntegerValue()); + anAISView->SetCenter (aValues->Value(1).IntegerValue(), aValues->Value(2).IntegerValue()); } return 0;