From 29e2c6d2473cdfccd3581c0bbb5addfc3eb22c1a Mon Sep 17 00:00:00 2001 From: isk Date: Tue, 5 May 2015 11:06:29 +0300 Subject: [PATCH] 0022785: Draw Harness - add possibility to remove a text drawn by the command vdrawtext AIS_TextLabel - new public class to display simple text labels (based on MyTextClass private class from Draw Harness). ViewerTest::Display() - add more reliable replacement for VDisplayAISObject() with no viewer update flag. vdrawtext command redesign: - Use new AIS_TextLabel class instead of private MyTextClass. - Take object name and allow to clear labels from the Viewer. - Use parameter name + parameter value syntax instead of strict list of mandatory arguments. - Use [0; 1] range for colors and accept names. - Drop redundant argument "isMultiByte". - Support argument -noupdate to skip Viewer update. Update test cases to new syntax of vdrawtext. --- samples/tcl/Penrose.tcl | 2 +- samples/tcl/materials.tcl | 26 +- src/AIS/AIS_TextLabel.cxx | 182 ++++++++ src/AIS/AIS_TextLabel.hxx | 94 +++++ src/AIS/FILES | 2 + src/ViewerTest/ViewerTest.cxx | 60 +-- src/ViewerTest/ViewerTest.hxx | 11 + src/ViewerTest/ViewerTest_ObjectCommands.cxx | 423 ++++++++++--------- tests/3rdparty/export/A2 | 22 +- tests/3rdparty/export/A3 | 22 +- tests/3rdparty/export/A4 | 22 +- tests/3rdparty/export/A5 | 22 +- tests/3rdparty/export/A6 | 22 +- tests/3rdparty/export/A7 | 22 +- tests/3rdparty/fonts/A2 | 61 +-- tests/3rdparty/fonts/A3 | 2 +- tests/3rdparty/fonts/A4 | 2 +- tests/3rdparty/fonts/A5 | 18 +- tests/3rdparty/fonts/A6 | 19 +- tests/3rdparty/fonts/B1 | 4 +- tests/3rdparty/fonts/B2 | 4 +- tests/bugs/vis/bug21091_4 | 24 +- tests/bugs/vis/bug21091_5 | 24 +- tests/bugs/vis/bug21091_6 | 25 +- tests/bugs/vis/bug21091_7 | 22 +- tests/bugs/vis/bug21091_8 | 24 +- tests/bugs/vis/bug21091_9 | 24 +- tests/bugs/vis/bug22149 | 4 +- tests/bugs/vis/bug22796_1 | 3 +- tests/bugs/vis/bug22796_2 | 3 +- tests/bugs/vis/bug22796_3 | 3 +- tests/bugs/vis/bug23652 | 4 +- tests/bugs/vis/bug23654_MarkersRecompute | 2 +- tests/bugs/vis/bug24131_markers | 2 +- tests/bugs/vis/bug24555 | 4 +- tests/bugs/vis/bug24837_2 | 16 +- tests/bugs/vis/bug25121 | 8 +- tests/bugs/vis/bug25369 | 2 +- tests/bugs/vis/bug25732_1 | 2 +- tests/bugs/vis/bug25732_2 | 2 +- tests/demo/draw/bug23745 | 2 +- tests/v3d/raytrace/bug24819 | 2 +- 42 files changed, 817 insertions(+), 427 deletions(-) create mode 100644 src/AIS/AIS_TextLabel.cxx create mode 100644 src/AIS/AIS_TextLabel.hxx diff --git a/samples/tcl/Penrose.tcl b/samples/tcl/Penrose.tcl index a9499fa704..64b79b6ac2 100644 --- a/samples/tcl/Penrose.tcl +++ b/samples/tcl/Penrose.tcl @@ -82,4 +82,4 @@ vsetcolor b10 0 0.48046875 0.73828125 # set material to plastic for better look for {set i 1} {$i <= 10} {incr i} {vsetmaterial b$i plastic} -vdrawtext "Which\nbox\nis\ncloser\nto\nyou?" 0 -6 -2 0 0 0 left top 0 0 40 Bold +vdrawtext label "Which\nbox\nis\ncloser\nto\nyou?" -pos 0 -6 -2 -color 0 0 0 -halign left -valign bottom -angle 0 -zoom 0 -height 40 diff --git a/samples/tcl/materials.tcl b/samples/tcl/materials.tcl index c43f4dc55b..4683cbf359 100644 --- a/samples/tcl/materials.tcl +++ b/samples/tcl/materials.tcl @@ -10,30 +10,30 @@ set THE_ROW_DIST 35 proc drawLabels {} { set x 20 set y 15 - set r 25 - set g 25 - set b 25 + set r 0.098 + set g 0.098 + set b 0.098 foreach aMatIter $::THE_MATERIALS { - vdrawtext "$aMatIter" $x $y 0 $r $g $b 2 1 000 0 14 1 Arial + vdrawtext "$aMatIter" "$aMatIter" -pos $x $y 0 -color $r $g $b -halign right -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial incr y 10 } set x 40 set y 5 foreach aColIter $::THE_COLORS { if { $aColIter == "red" } { - set r 255 - set g 0 + set r 1.0 + set g 0.0 set b 0 } elseif { $aColIter == "green" } { - set r 0 - set g 255 - set b 0 + set r 0.0 + set g 1.0 + set b 0.0 } elseif { $aColIter == "blue1" } { - set r 0 - set g 0 - set b 255 + set r 0.0 + set g 0.0 + set b 1.0 } - vdrawtext "$aColIter" $x $y 0 $r $g $b 1 1 000 0 14 1 Arial + vdrawtext "$aColIter" "$aColIter" -pos $x $y 0 -color $r $g $b -halign center -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial incr x $::THE_ROW_DIST } } diff --git a/src/AIS/AIS_TextLabel.cxx b/src/AIS/AIS_TextLabel.cxx new file mode 100644 index 0000000000..511f66103e --- /dev/null +++ b/src/AIS/AIS_TextLabel.cxx @@ -0,0 +1,182 @@ +// Created on: 2014-11-10 +// Copyright (c) 2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include + +#include + +#include +#include + +#include +#include +#include + +IMPLEMENT_STANDARD_HANDLE (AIS_TextLabel, AIS_InteractiveObject) +IMPLEMENT_STANDARD_RTTIEXT(AIS_TextLabel, AIS_InteractiveObject) + +//======================================================================= +//function : AIS_TextLabel +//purpose : +//======================================================================= +AIS_TextLabel::AIS_TextLabel() +: myText ("?"), + myPosition (0.0, 0.0, 0.0), + myFont ("Courier"), + myFontAspect (Font_FA_Regular) +{ + myDrawer->SetTextAspect (new Prs3d_TextAspect()); + + SetDisplayMode (0); +} + +//======================================================================= +//function : SetColor +//purpose : +//======================================================================= +void AIS_TextLabel::SetColor (const Quantity_Color& theColor) +{ + hasOwnColor = Standard_True; + myOwnColor = theColor; + myDrawer->TextAspect()->SetColor (theColor); +} + +//======================================================================= +//function : SetColor +//purpose : +//======================================================================= +void AIS_TextLabel::SetColor (const Quantity_NameOfColor theColor) +{ + SetColor (Quantity_Color (theColor)); +} + +//======================================================================= +//function : SetText +//purpose : +//======================================================================= +void AIS_TextLabel::SetText (const TCollection_ExtendedString& theText) +{ + myText = theText; +} + +//======================================================================= +//function : SetPosition +//purpose : +//======================================================================= +void AIS_TextLabel::SetPosition (const gp_Pnt& thePosition) +{ + myPosition = thePosition; +} + +//======================================================================= +//function : SetHJustification +//purpose : +//======================================================================= +void AIS_TextLabel::SetHJustification (const Graphic3d_HorizontalTextAlignment theHJust) +{ + myDrawer->TextAspect()->SetHorizontalJustification (theHJust); +} + +//======================================================================= +//function : SetVJustification +//purpose : Setup vertical justification. +//======================================================================= +void AIS_TextLabel::SetVJustification (const Graphic3d_VerticalTextAlignment theVJust) +{ + myDrawer->TextAspect()->SetVerticalJustification (theVJust); +} + +//======================================================================= +//function : SetAngle +//purpose : +//======================================================================= +void AIS_TextLabel::SetAngle (const Standard_Real theAngle) +{ + myDrawer->TextAspect()->Aspect()->SetTextAngle (theAngle * 180.0 / M_PI); +} + +//======================================================================= +//function : SetZoom +//purpose : +//======================================================================= +void AIS_TextLabel::SetZoomable (const Standard_Boolean theIsZoomable) +{ + myDrawer->TextAspect()->Aspect()->SetTextZoomable (theIsZoomable); +} + +//======================================================================= +//function : SetHeight +//purpose : +//======================================================================= +void AIS_TextLabel::SetHeight (const Standard_Real theHeight) +{ + myDrawer->TextAspect()->SetHeight (theHeight); +} + +//======================================================================= +//function : SetAngle +//purpose : +//======================================================================= +void AIS_TextLabel::SetFontAspect (const Font_FontAspect theFontAspect) +{ + myDrawer->TextAspect()->Aspect()->SetTextFontAspect (theFontAspect); +} + +//======================================================================= +//function : SetFont +//purpose : +//======================================================================= +void AIS_TextLabel::SetFont (Standard_CString theFont) +{ + myFont = theFont; + myDrawer->TextAspect()->SetFont (myFont.ToCString()); +} + +//======================================================================= +//function : Compute +//purpose : +//======================================================================= +void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePrsMgr*/, + const Handle(Prs3d_Presentation)& thePrs, + const Standard_Integer theMode) +{ + switch (theMode) + { + case 0: + { + Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect(); + Prs3d_Text::Draw (thePrs, anAsp, myText, myPosition); + break; + } + } +} + +//======================================================================= +//function : ComputeSelection +//purpose : +//======================================================================= +void AIS_TextLabel::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, + const Standard_Integer theMode) +{ + switch (theMode) + { + case 0: + { + Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this, 10); + Handle(Select3D_SensitivePoint) aSensitivePoint = new Select3D_SensitivePoint (anEntityOwner, myPosition); + theSelection->Add (aSensitivePoint); + break; + } + } +} diff --git a/src/AIS/AIS_TextLabel.hxx b/src/AIS/AIS_TextLabel.hxx new file mode 100644 index 0000000000..813bf01ee1 --- /dev/null +++ b/src/AIS/AIS_TextLabel.hxx @@ -0,0 +1,94 @@ +// Created on: 2014-11-10 +// Copyright (c) 2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _AIS_TextLabel_HeaderFile +#define _AIS_TextLabel_HeaderFile + +#include + +#include +#include +#include +#include +#include + +//! Presentation of the text. +class AIS_TextLabel : public AIS_InteractiveObject +{ +public: + + //! Default constructor + Standard_EXPORT AIS_TextLabel(); + + //! Setup color of entire text. + Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE; + + //! Setup color of entire text. + Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor theColor) Standard_OVERRIDE; + + //! Setup text. + Standard_EXPORT void SetText (const TCollection_ExtendedString& theText); + + //! Setup position. + Standard_EXPORT void SetPosition (const gp_Pnt& thePosition); + + //! Setup horizontal justification. + Standard_EXPORT void SetHJustification (const Graphic3d_HorizontalTextAlignment theHJust); + + //! Setup vertical justification. + Standard_EXPORT void SetVJustification (const Graphic3d_VerticalTextAlignment theVJust); + + //! Setup angle. + Standard_EXPORT void SetAngle (const Standard_Real theAngle); + + //! Setup zoomable property. + Standard_EXPORT void SetZoomable (const Standard_Boolean theIsZoomable); + + //! Setup height. + Standard_EXPORT void SetHeight (const Standard_Real theHeight); + + //! Setup font aspect. + Standard_EXPORT void SetFontAspect (const Font_FontAspect theFontAspect); + + //! Setup font. + Standard_EXPORT void SetFont (Standard_CString theFont); + +private: + + //! Compute + Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode) Standard_OVERRIDE; + + //! Compute selection + Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, + const Standard_Integer theMode) Standard_OVERRIDE; + +protected: + + TCollection_ExtendedString myText; + gp_Pnt myPosition; + TCollection_AsciiString myFont; + Font_FontAspect myFontAspect; + +public: + + //! CASCADE RTTI + DEFINE_STANDARD_RTTI(AIS_TextLabel); + +}; + +DEFINE_STANDARD_HANDLE(AIS_TextLabel, AIS_InteractiveObject) + +#endif // _AIS_TextLabel_HeaderFile diff --git a/src/AIS/FILES b/src/AIS/FILES index 2f3c30c8e9..2b4917fe71 100755 --- a/src/AIS/FILES +++ b/src/AIS/FILES @@ -23,3 +23,5 @@ AIS_RadiusDimension.hxx AIS_RadiusDimension.cxx AIS_PointCloud.hxx AIS_PointCloud.cxx +AIS_TextLabel.hxx +AIS_TextLabel.cxx diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index 5f046013b9..98635194a3 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -257,24 +257,20 @@ Standard_EXPORT ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS(){ return TheMap; } - -//============================================================================== -//function : VDisplayAISObject -//purpose : register interactive object in the map of AIS objects; -// if other object with such name already registered, it will be kept -// or replaced depending on value of , -// if "true" - the old object will be cleared from AIS context; -// returns Standard_True if registered in map; -//============================================================================== -Standard_EXPORT Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName, - const Handle(AIS_InteractiveObject)& theAISObj, - Standard_Boolean theReplaceIfExists = Standard_True) +//======================================================================= +//function : Display +//purpose : +//======================================================================= +Standard_Boolean ViewerTest::Display (const TCollection_AsciiString& theName, + const Handle(AIS_InteractiveObject)& theObject, + const Standard_Boolean theToUpdate, + const Standard_Boolean theReplaceIfExists) { ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS(); - Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext(); - if (aContextAIS.IsNull()) + Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext(); + if (aCtx.IsNull()) { - std::cout << "AIS context is not available.\n"; + std::cout << "Error: AIS context is not available.\n"; return Standard_False; } @@ -282,38 +278,42 @@ Standard_EXPORT Standard_Boolean VDisplayAISObject (const TCollection_AsciiStrin { if (!theReplaceIfExists) { - std::cout << "Other interactive object has been already " - << "registered with name: " << theName << ".\n" + std::cout << "Error: other interactive object has been already registered with name: " << theName << ".\n" << "Please use another name.\n"; return Standard_False; } - // stop displaying object - Handle(AIS_InteractiveObject) anOldObj = - Handle(AIS_InteractiveObject)::DownCast (aMap.Find2 (theName)); - + Handle(AIS_InteractiveObject) anOldObj = Handle(AIS_InteractiveObject)::DownCast (aMap.Find2 (theName)); if (!anOldObj.IsNull()) - aContextAIS->Remove (anOldObj, Standard_True); - - // remove name and old object from map + { + aCtx->Remove (anOldObj, Standard_True); + } aMap.UnBind2 (theName); } - if (theAISObj.IsNull()) + if (theObject.IsNull()) { - // object with specified name already unbound + // object with specified name has been already unbound return Standard_True; } - // unbind AIS object if was bound with another name - aMap.UnBind1 (theAISObj); + // unbind AIS object if it was bound with another name + aMap.UnBind1 (theObject); // can be registered without rebinding - aMap.Bind (theAISObj, theName); - aContextAIS->Display (theAISObj, Standard_True); + aMap.Bind (theObject, theName); + aCtx->Display (theObject, theToUpdate); return Standard_True; } +//! Alias for ViewerTest::Display(), compatibility with old code. +Standard_EXPORT Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName, + const Handle(AIS_InteractiveObject)& theObject, + Standard_Boolean theReplaceIfExists = Standard_True) +{ + return ViewerTest::Display (theName, theObject, Standard_True, theReplaceIfExists); +} + static TColStd_MapOfInteger theactivatedmodes(8); static TColStd_ListOfTransient theEventMgrs; diff --git a/src/ViewerTest/ViewerTest.hxx b/src/ViewerTest/ViewerTest.hxx index 562cc8ea6c..8e77511019 100644 --- a/src/ViewerTest/ViewerTest.hxx +++ b/src/ViewerTest/ViewerTest.hxx @@ -88,6 +88,17 @@ public: Standard_EXPORT static void RemoveView (const Handle(V3d_View)& theView, const Standard_Boolean theToRemoveContext = Standard_True); + //! Display AIS object in active Viewer and register it in the map of Interactive Objects with specified name. + //! @param theName key to be associated to displayed interactive object + //! @param theObject object to display + //! @param theToUpdate redraw viewer after displaying object + //! @param theReplaceIfExists replace the object assigned to specified key + //! @return true if new object has been displayed + Standard_EXPORT static Standard_Boolean Display (const TCollection_AsciiString& theName, + const Handle(AIS_InteractiveObject)& theObject, + const Standard_Boolean theToUpdate = Standard_True, + const Standard_Boolean theReplaceIfExists = Standard_True); + //! waits until a shape of type is picked in the AIS Viewer and returns it. //! if == TopAbs_Shape, any shape can be picked... //! MaxPick is the Max number before exiting, if no pick is successful diff --git a/src/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/ViewerTest/ViewerTest_ObjectCommands.cxx index dc578081d1..e68451557e 100644 --- a/src/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -114,6 +114,7 @@ #include #include +#include #include #include #include @@ -2390,230 +2391,239 @@ static int VCircleBuilder(Draw_Interpretor& /*di*/, Standard_Integer argc, const return 0; } - -//=============================================================================================== +//======================================================================= //function : VDrawText -//author : psn -//purpose : Create a text. -//Draw arg : vdrawtext name [X] [Y] [Z] [R] [G] [B] [hor_align] [ver_align] [angle] [zoomable] -//=============================================================================================== -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - - -DEFINE_STANDARD_HANDLE(MyTextClass, AIS_InteractiveObject) - -class MyTextClass:public AIS_InteractiveObject -{ -public: - // CASCADE RTTI - DEFINE_STANDARD_RTTI(MyTextClass ); - - MyTextClass(){}; - - MyTextClass - ( - const TCollection_ExtendedString& , const gp_Pnt& , - Quantity_Color color, - Standard_Integer aHJust, - Standard_Integer aVJust , - Standard_Real Angle , - Standard_Boolean Zoom , - Standard_Real Height, - Font_FontAspect FontAspect, - Standard_CString Font - ); - -private: - - void Compute ( const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer aMode); - - void ComputeSelection ( const Handle(SelectMgr_Selection)& /*aSelection*/, - const Standard_Integer /*aMode*/){} ; - -protected: - TCollection_ExtendedString aText; - gp_Pnt aPosition; - Standard_Real Red; - Standard_Real Green; - Standard_Real Blue; - Standard_Real aAngle; - Standard_Real aHeight; - Standard_Boolean aZoomable; - Quantity_Color aColor; - TCollection_AsciiString aFont; - Font_FontAspect aFontAspect; - Graphic3d_HorizontalTextAlignment aHJustification; - Graphic3d_VerticalTextAlignment aVJustification; -}; - - - -IMPLEMENT_STANDARD_HANDLE(MyTextClass, AIS_InteractiveObject) -IMPLEMENT_STANDARD_RTTIEXT(MyTextClass, AIS_InteractiveObject) - - -MyTextClass::MyTextClass( const TCollection_ExtendedString& text, const gp_Pnt& position, - Quantity_Color color = Quantity_NOC_YELLOW, - Standard_Integer aHJust = Graphic3d_HTA_LEFT, - Standard_Integer aVJust = Graphic3d_VTA_BOTTOM, - Standard_Real angle = 0.0 , - Standard_Boolean zoomable = Standard_True, - Standard_Real height = 12., - Font_FontAspect fontAspect = Font_FA_Regular, - Standard_CString font = "Courier") -{ - aText = text; - aPosition = position; - aHJustification = Graphic3d_HorizontalTextAlignment(aHJust); - aVJustification = Graphic3d_VerticalTextAlignment(aVJust); - aAngle = angle; - aZoomable = zoomable; - aHeight = height; - aColor = color; - aFontAspect = fontAspect; - aFont = font; -}; - - - -////////////////////////////////////////////////////////////////////////////// -void MyTextClass::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/, - const Handle(Prs3d_Presentation)& aPresentation, - const Standard_Integer /*aMode*/) +//purpose : +//======================================================================= +static int VDrawText (Draw_Interpretor& theDI, + Standard_Integer theArgsNb, + const char** theArgVec) { - - aPresentation->Clear(); - - if (!myDrawer->HasOwnTextAspect()) + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if (theArgsNb < 3) { - myDrawer->SetTextAspect (new Prs3d_TextAspect()); - if(myDrawer->HasLink()) - { - *myDrawer->TextAspect()->Aspect() = *myDrawer->Link()->TextAspect()->Aspect(); - } + std::cout << "Error: wrong number of arguments! See usage:\n"; + theDI.PrintHelp (theArgVec[0]); + return 1; + } + else if (aContext.IsNull()) + { + std::cout << "Error: no active view!\n"; + return 1; } - Handle(Prs3d_TextAspect) asp = myDrawer->TextAspect(); - - asp->SetFont(aFont.ToCString()); - asp->SetColor(aColor); - asp->SetHeight(aHeight); // I am changing the myHeight value - - asp->SetHorizontalJustification(aHJustification); - asp->SetVerticalJustification(aVJustification); - asp->Aspect()->SetTextZoomable(aZoomable); - asp->Aspect()->SetTextAngle(aAngle); - asp->Aspect()->SetTextFontAspect(aFontAspect); - Prs3d_Text::Draw(aPresentation, asp, aText, aPosition); - - /* This comment code is worked - Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation); - Handle(Graphic3d_AspectFillArea3d) aspect = myDrawer->ShadingAspect()->Aspect(); - Graphic3d_Vertex vertices_text; - vertices_text.SetCoord(aPosition.X(),aPosition.Y(),aPosition.Y()); - TheGroup->SetPrimitivesAspect(aspect); - TheGroup->Text(aText,vertices_text,aHeight,Standard_True); - */ -}; + Standard_Integer anArgIt = 1; + TCollection_ExtendedString aName (theArgVec[anArgIt++], Standard_True); + TCollection_ExtendedString aText (theArgVec[anArgIt++], Standard_True); + Handle(AIS_TextLabel) aTextPrs; + ViewerTest_AutoUpdater anAutoUpdater (aContext, ViewerTest::CurrentView()); -static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char** argv) -{ - // Check arguments - if (argc < 14) + if (GetMapOfAIS().IsBound2 (aName)) { - di<<"Error: "<SetFont ("Courier"); } - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + aTextPrs->SetText (aText); - // Create 3D view if it doesn't exist - if ( aContext.IsNull() ) + for (; anArgIt < theArgsNb; ++anArgIt) { - ViewerTest::ViewerInit(); - aContext = ViewerTest::GetAISContext(); - if( aContext.IsNull() ) + TCollection_AsciiString aParam (theArgVec[anArgIt]); + aParam.LowerCase(); + + if (anAutoUpdater.parseRedrawMode (aParam)) { - di << "Error: Cannot create a 3D view\n"; - return 1; //TCL_ERROR + continue; } - } + else if (aParam == "-pos" + || aParam == "-position") + { + if (anArgIt + 3 >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text position - const Standard_Real X = Draw::Atof(argv[2]); - const Standard_Real Y = Draw::Atof(argv[3]); - const Standard_Real Z = Draw::Atof(argv[4]); - const gp_Pnt pnt(X,Y,Z); + gp_Pnt aPos; + aPos.SetX (Draw::Atof (theArgVec[++anArgIt])); + aPos.SetY (Draw::Atof (theArgVec[++anArgIt])); + aPos.SetZ (Draw::Atof (theArgVec[++anArgIt])); + aTextPrs->SetPosition (aPos); + } + else if (aParam == "-color") + { + if (anArgIt + 1 >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text color - const Quantity_Parameter R = Draw::Atof(argv[5])/255.; - const Quantity_Parameter G = Draw::Atof(argv[6])/255.; - const Quantity_Parameter B = Draw::Atof(argv[7])/255.; - const Quantity_Color aColor( R, G, B, Quantity_TOC_RGB ); + TCollection_AsciiString aColor (theArgVec[anArgIt + 1]); + Quantity_NameOfColor aNameOfColor = Quantity_NOC_BLACK; + if (Quantity_Color::ColorFromName (aColor.ToCString(), aNameOfColor)) + { + anArgIt += 1; + aTextPrs->SetColor (aNameOfColor); + continue; + } + else if (anArgIt + 3 >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text alignment - const int hor_align = Draw::Atoi(argv[8]); - const int ver_align = Draw::Atoi(argv[9]); + TCollection_AsciiString aGreen (theArgVec[anArgIt + 2]); + TCollection_AsciiString aBlue (theArgVec[anArgIt + 3]); + if (!aColor.IsRealValue() + || !aGreen.IsRealValue() + || !aBlue.IsRealValue()) + { + std::cout << "Error: wrong syntax at '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text angle - const Standard_Real angle = Draw::Atof(argv[10]); + const Graphic3d_Vec3d anRGB (aColor.RealValue(), + aGreen.RealValue(), + aBlue.RealValue()); - // Text zooming - const Standard_Boolean zoom = Draw::Atoi(argv[11]); + aTextPrs->SetColor (Quantity_Color (anRGB.r(), anRGB.g(), anRGB.b(), Quantity_TOC_RGB)); + anArgIt += 3; + } + else if (aParam == "-halign") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text height - const Standard_Real height = Draw::Atof(argv[12]); + TCollection_AsciiString aType (theArgVec[anArgIt]); + aType.LowerCase(); + if (aType == "left") + { + aTextPrs->SetHJustification (Graphic3d_HTA_LEFT); + } + else if (aType == "center") + { + aTextPrs->SetHJustification (Graphic3d_HTA_CENTER); + } + else if (aType == "right") + { + aTextPrs->SetHJustification (Graphic3d_HTA_RIGHT); + } + else + { + std::cout << "Error: wrong syntax at '" << aParam.ToCString() << "'.\n"; + return 1; + } + } + else if (aParam == "-valign") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } + + TCollection_AsciiString aType (theArgVec[anArgIt]); + aType.LowerCase(); + if (aType == "top") + { + aTextPrs->SetVJustification (Graphic3d_VTA_TOP); + } + else if (aType == "center") + { + aTextPrs->SetVJustification (Graphic3d_VTA_CENTER); + } + else if (aType == "bottom") + { + aTextPrs->SetVJustification (Graphic3d_VTA_BOTTOM); + } + else + { + std::cout << "Error: wrong syntax at '" << aParam.ToCString() << "'.\n"; + return 1; + } + } + else if (aParam == "-angle") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text aspect - const Font_FontAspect aspect = Font_FontAspect(Draw::Atoi(argv[13])); + aTextPrs->SetAngle (Draw::Atof (theArgVec[anArgIt]) * (M_PI / 180.0)); + } + else if (aParam == "-zoom") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text font - TCollection_AsciiString font; - if(argc < 15) - font.AssignCat("Courier"); - else - font.AssignCat(argv[14]); + aTextPrs->SetZoomable (Draw::Atoi (theArgVec[anArgIt]) == 1); + } + else if (aParam == "-height") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Text is multibyte - const Standard_Boolean isMultibyte = (argc < 16)? Standard_False : (Draw::Atoi(argv[15]) != 0); + aTextPrs->SetHeight (Draw::Atof(theArgVec[anArgIt])); + } + else if (aParam == "-aspect") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - // Read text string - TCollection_ExtendedString name(argv[1],isMultibyte); + TCollection_AsciiString anOption (theArgVec[anArgIt]); + anOption.LowerCase(); + if (anOption.IsEqual ("regular")) + { + aTextPrs->SetFontAspect (Font_FA_Regular); + } + else if (anOption.IsEqual ("bold")) + { + aTextPrs->SetFontAspect (Font_FA_Bold); + } + else if (anOption.IsEqual ("italic")) + { + aTextPrs->SetFontAspect (Font_FA_Italic); + } + else if (anOption.IsEqual ("bolditalic")) + { + aTextPrs->SetFontAspect (Font_FA_BoldItalic); + } + } + else if (aParam == "-font") + { + if (++anArgIt >= theArgsNb) + { + std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n"; + return 1; + } - if (name.Length()) - { - Handle(MyTextClass) myT = new MyTextClass(name,pnt,aColor,hor_align,ver_align,angle,zoom,height,aspect,font.ToCString()); - aContext->Display(myT,Standard_True); + aTextPrs->SetFont (theArgVec[anArgIt]); + } + else + { + std::cout << "Error: unknown argument '" << aParam << "'\n"; + return 1; + } } + ViewerTest::Display (aName, aTextPrs, Standard_False); return 0; } @@ -5977,9 +5987,20 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands) "vcircle CircleName [PointName PointName PointName IsFilled]\n\t\t\t\t\t[PlaneName PointName Radius IsFilled]", __FILE__,VCircleBuilder,group); - theCommands.Add("vdrawtext", - "vdrawtext : vdrawtext name X Y Z R G B hor_align ver_align angle zoomable height Aspect [Font [isMultiByte]]", - __FILE__,VDrawText,group); + theCommands.Add ("vdrawtext", + "vdrawtext name text" + "\n\t\t: [-pos X=0 Y=0 Z=0]" + "\n\t\t: [-color {R G B|name}=yellow]" + "\n\t\t: [-halign {left|center|right}=left]" + "\n\t\t: [-valign {top|center|bottom}=bottom}]" + "\n\t\t: [-angle angle=0]" + "\n\t\t: [-zoom {0|1}=0]" + "\n\t\t: [-height height=16]" + "\n\t\t: [-aspect {regular|bold|italic|bolditalic}=regular]" + "\n\t\t: [-font font=Times]" + "\n\t\t: [-noupdate]" + "\n\t\t: Display text label at specified position.", + __FILE__, VDrawText, group); theCommands.Add("vdrawsphere", "vdrawsphere: vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToShowEdges=0] [ToPrintInfo=1]\n", diff --git a/tests/3rdparty/export/A2 b/tests/3rdparty/export/A2 index 58a3f71f8a..dd9b730b74 100755 --- a/tests/3rdparty/export/A2 +++ b/tests/3rdparty/export/A2 @@ -7,23 +7,29 @@ puts "" vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/3rdparty/export/A3 b/tests/3rdparty/export/A3 index 39bef0f8bc..b4ebcc72ab 100644 --- a/tests/3rdparty/export/A3 +++ b/tests/3rdparty/export/A3 @@ -7,23 +7,29 @@ puts "" vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/3rdparty/export/A4 b/tests/3rdparty/export/A4 index a54a8134c2..c2f4127893 100644 --- a/tests/3rdparty/export/A4 +++ b/tests/3rdparty/export/A4 @@ -7,23 +7,29 @@ puts "" vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/3rdparty/export/A5 b/tests/3rdparty/export/A5 index b171205a88..bbe906a859 100644 --- a/tests/3rdparty/export/A5 +++ b/tests/3rdparty/export/A5 @@ -7,23 +7,29 @@ puts "" vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/3rdparty/export/A6 b/tests/3rdparty/export/A6 index a5715ab2ba..11b8f15126 100644 --- a/tests/3rdparty/export/A6 +++ b/tests/3rdparty/export/A6 @@ -7,23 +7,29 @@ puts "" vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/3rdparty/export/A7 b/tests/3rdparty/export/A7 index c31233fd87..ba4e59f6b0 100644 --- a/tests/3rdparty/export/A7 +++ b/tests/3rdparty/export/A7 @@ -7,23 +7,29 @@ puts "" vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/3rdparty/fonts/A2 b/tests/3rdparty/fonts/A2 index b9021bf022..16dbbb7e34 100755 --- a/tests/3rdparty/fonts/A2 +++ b/tests/3rdparty/fonts/A2 @@ -3,7 +3,8 @@ puts "OCC21091" puts "OCC21450" puts "============" puts "" -#vdrawtext: vdrawtext name X Y Z R G B hor_align ver_align angle zoomable height Aspect FONT +#vdrawtext: vdrawtext name text [-pos X Y Z] [-color R G B] [-align hor_align ver_align] [-angle angle] [-zoom zoomable] +# [-height height] [-aspect aspect] [-font font] [-mb isMultiByte] #------------------------------------------------------ # X\Y\Z - Position Of Text #------------------------------------------------------ @@ -40,51 +41,51 @@ vtrihedron trihedr vpoint p1 100 100 -400 vpoint p2 000 000 -400 vpoint p3 -100 -100 -400 -vdrawtext OpenCascade 100 100 -400 000 255 255 0 0 000 1 50 1 Times-Roman -vdrawtext OpenCascade 000 000 -400 000 255 255 1 0 000 1 50 1 Times-Roman -vdrawtext OpenCascade -100 -100 -400 000 255 255 2 0 000 1 50 1 Times-Roman +vdrawtext OC0 OpenCascade -pos 100 100 -400 -color 0.0 1.0 1.0 -halign left -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext OC1 OpenCascade -pos 000 000 -400 -color 0.0 1.0 1.0 -halign center -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext OC2 OpenCascade -pos -100 -100 -400 -color 0.0 1.0 1.0 -halign right -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint p4 100 100 -500 vpoint p5 000 000 -500 vpoint p6 -100 -100 -500 -vdrawtext OpenCascade 100 100 -500 255 000 000 0 2 000 1 50 1 Times-Roman -vdrawtext OpenCascade 000 000 -500 255 000 000 1 2 000 1 50 1 Times-Roman -vdrawtext OpenCascade -100 -100 -500 255 000 000 2 2 000 1 50 1 Times-Roman +vdrawtext OC3 OpenCascade -pos 100 100 -500 -color 1.0 0.0 0.0 -halign left -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext OC4 OpenCascade -pos 000 000 -500 -color 1.0 0.0 0.0 -halign center -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext OC5 OpenCascade -pos -100 -100 -500 -color 1.0 0.0 0.0 -halign right -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint p7 100 100 -450 vpoint p8 000 000 -450 vpoint p9 -100 -100 -450 -vdrawtext OpenCascade 100 100 -450 005 255 000 0 1 000 1 50 1 Times-Roman -vdrawtext OpenCascade 000 000 -450 005 255 000 1 1 000 1 50 1 Times-Roman -vdrawtext OpenCascade -100 -100 -450 005 255 000 2 1 000 1 50 1 Times-Roman +vdrawtext OC6 OpenCascade -pos 100 100 -450 -color 0.02 1.0 0.0 -halign left -valign center -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext OC7 OpenCascade -pos 000 000 -450 -color 0.02 1.0 0.0 -halign center -valign center -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext OC8 OpenCascade -pos -100 -100 -450 -color 0.02 1.0 0.0 -halign right -valign center -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman -vdrawtext _.Left._ 200 200 200 255 255 255 0 0 000 1 50 1 Times-Roman -vdrawtext _.Left._ 200 200 200 255 255 000 0 0 090 1 50 1 Times-Roman +vdrawtext L0 _.Left._ -pos 200 200 200 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext L1 _.Left._ -pos 200 200 200 -color 1.0 1.0 0.0 -halign left -valign bottom -angle 090 -zoom 1 -height 50 -aspect regular -font Times-Roman -vdrawtext _.Right._ 200 200 200 255 000 255 2 2 000 1 50 1 Times-Roman -vdrawtext _.Right._ 200 200 200 255 155 150 2 2 090 1 50 1 Times-Roman +vdrawtext R0 _.Right._ -pos 200 200 200 -color 1.0 0.0 1.0 -halign right -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext R1 _.Right._ -pos 200 200 200 -color 1.0 0.6078 0.5882 -halign right -valign top -angle 090 -zoom 1 -height 50 -aspect regular -font Times-Roman -vdrawtext _.0123456789._ 200 200 200 000 000 255 1 1 045 1 50 1 Times-Roman -vdrawtext _.0123456789._ 200 200 200 255 000 000 1 1 -45 1 50 1 Times-Roman +vdrawtext N0 _.0123456789._ -pos 200 200 200 -color 0.0 0.0 1.0 -halign center -valign center -angle 045 -zoom 1 -height 50 -aspect regular -font Times-Roman +vdrawtext N1 _.0123456789._ -pos 200 200 200 -color 1.0 0.0 0.0 -halign center -valign center -angle -45 -zoom 1 -height 50 -aspect regular -font Times-Roman -vdrawtext _.~!@#$%^&*:?|+-._ -200 000 400 255 000 000 0 0 0 1 50 1 Times-Roman +vdrawtext SS _.~!@#$%^&*:?|+-._ -pos -200 000 400 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 1 -height 50 -aspect regular -font Times-Roman box atextbox -100 -100 -100 -200 -200 -200 vdisplay atextbox -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC9 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vdrawtext OC10 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vdrawtext OC11 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vdrawtext OC12 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC13 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vdrawtext OC14 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vdrawtext OC15 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vdrawtext OC16 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier -vdrawtext OpenCascade -200 -200 100 255 000 255 0 0 010 0 15 1 Times-Roman -vdrawtext OpenCascade -200 -200 150 000 255 255 0 0 010 0 15 1 Arbat -vdrawtext OpenCascade -200 -200 200 255 255 000 0 0 010 0 15 3 Elephant -vdrawtext OpenCascade -200 -200 250 000 255 005 0 0 010 0 15 4 RockWell -vdrawtext OpenCascade -200 -200 300 255 000 005 0 0 010 0 15 1 Arial +vdrawtext OC17 OpenCascade -pos -200 -200 100 -color 1.0 0.0 1.0 -halign left -valign bottom -angle 010 -zoom 0 -height 15 -aspect regular -font Times-Roman +vdrawtext OC18 OpenCascade -pos -200 -200 150 -color 0.0 1.0 1.0 -halign left -valign bottom -angle 010 -zoom 0 -height 15 -aspect regular -font Arbat +vdrawtext OC19 OpenCascade -pos -200 -200 200 -color 1.0 1.0 0.0 -halign left -valign bottom -angle 010 -zoom 0 -height 15 -aspect italic -font Elephant +vdrawtext OC20 OpenCascade -pos -200 -200 250 -color 0.0 1.0 0.02 -halign left -valign bottom -angle 010 -zoom 0 -height 15 -aspect bolditalic -font RockWell +vdrawtext OC21 OpenCascade -pos -200 -200 300 -color 1.0 0.0 0.02 -halign left -valign bottom -angle 010 -zoom 0 -height 15 -aspect regular -font Arial diff --git a/tests/3rdparty/fonts/A3 b/tests/3rdparty/fonts/A3 index 61b922f707..f5edea08c4 100644 --- a/tests/3rdparty/fonts/A3 +++ b/tests/3rdparty/fonts/A3 @@ -15,6 +15,6 @@ vpoint p1 0 10000 -400 vpoint p2 1000 0 -400 vfit -vdrawtext "$aText" 100 100 -400 000 255 255 0 0 000 1 50 1 Times-Roman +vdrawtext text "$aText" -pos 100 100 -400 -color 0.0 1.0 1.0 -halign left -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vfps diff --git a/tests/3rdparty/fonts/A4 b/tests/3rdparty/fonts/A4 index ac7b213cea..ccca866956 100644 --- a/tests/3rdparty/fonts/A4 +++ b/tests/3rdparty/fonts/A4 @@ -18,7 +18,7 @@ set data [split $aFileData "\n"] set aLineId 0 foreach aLine $data { set aLineY [expr $aLineId * 400] - vdrawtext "$aLine" 100 $aLineY -400 000 255 255 0 0 000 0 20 1 Times-Roman + vdrawtext "Line_$aLineId" "$aLine" -noupdate -pos 100 $aLineY -400 -color 0.0 1.0 1.0 -halign left -valign bottom -angle 000 -zoom 0 -height 20 -aspect regular -font Times-Roman set aLineId [expr $aLineId + 1] } diff --git a/tests/3rdparty/fonts/A5 b/tests/3rdparty/fonts/A5 index c399f0666e..d6c0e740b8 100644 --- a/tests/3rdparty/fonts/A5 +++ b/tests/3rdparty/fonts/A5 @@ -7,31 +7,31 @@ puts "" vtrihedron trihedr vpoint pTL -700 100 600 -vdrawtext "Top-Left\nFirst line\nLion The Second\n3rd" -700 100 600 000 255 255 0 2 000 1 50 1 Times-Roman +vdrawtext Text0 "Top-Left\nFirst line\nLion The Second\n3rd" -pos -700 100 600 -color 0.0 1.0 1.0 -halign left -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pTC 0 100 600 -vdrawtext "Top-Center\nFirst line\nLion The Second\n3rd" 0 100 600 000 255 255 1 2 000 1 50 1 Times-Roman +vdrawtext Text1 "Top-Center\nFirst line\nLion The Second\n3rd" -pos 0 100 600 -color 0.0 1.0 1.0 -halign center -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pTR 700 100 600 -vdrawtext "Top-Right\nFirst line\nLion The Second\n3rd" 700 100 600 000 255 255 2 2 000 1 50 1 Times-Roman +vdrawtext Text2 "Top-Right\nFirst line\nLion The Second\n3rd" -pos 700 100 600 -color 0.0 1.0 1.0 -halign right -valign top -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pCL -700 100 -100 -vdrawtext "Center-Left\nFirst line\nLion The Second\n3rd" -700 100 -100 255 255 255 0 1 000 1 50 1 Times-Roman +vdrawtext Text3 "Center-Left\nFirst line\nLion The Second\n3rd" -pos -700 100 -100 -color 1.0 1.0 1.0 -halign left -valign center -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pCC 0 100 -100 -vdrawtext "Center-Center\nFirst line\nLion The Second\n3rd" 0 100 -100 255 255 255 1 1 000 1 50 1 Times-Roman +vdrawtext Text4 "Center-Center\nFirst line\nLion The Second\n3rd" -pos 0 100 -100 -color 1.0 1.0 1.0 -halign center -valign center -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pCR 700 100 -100 -vdrawtext "Center-Right\nFirst line\nLion The Second\n3rd" 700 100 -100 255 255 255 2 1 000 1 50 1 Times-Roman +vdrawtext Text5 "Center-Right\nFirst line\nLion The Second\n3rd" -pos 700 100 -100 -color 1.0 1.0 1.0 -halign right -valign center -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pBL -700 100 -700 -vdrawtext "Bottom-Left\nFirst line\nLion The Second\n3rd" -700 100 -700 255 255 0 0 0 000 1 50 1 Times-Roman +vdrawtext Text6 "Bottom-Left\nFirst line\nLion The Second\n3rd" -pos -700 100 -700 -color 1.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pBC 0 100 -700 -vdrawtext "Bottom-Center\nFirst line\nLion The Second\n3rd" 0 100 -700 255 255 0 1 0 000 1 50 1 Times-Roman +vdrawtext Text7 "Bottom-Center\nFirst line\nLion The Second\n3rd" -pos 0 100 -700 -color 1.0 1.0 0.0 -halign center -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vpoint pBR 700 100 -700 -vdrawtext "Bottom-Right\nFirst line\nLion The Second\n3rd" 700 100 -700 255 255 0 2 0 000 1 50 1 Times-Roman +vdrawtext Text8 "Bottom-Right\nFirst line\nLion The Second\n3rd" -pos 700 100 -700 -color 1.0 1.0 0.0 -halign right -valign bottom -angle 000 -zoom 1 -height 50 -aspect regular -font Times-Roman vfit diff --git a/tests/3rdparty/fonts/A6 b/tests/3rdparty/fonts/A6 index 1e46142dac..a58130a122 100644 --- a/tests/3rdparty/fonts/A6 +++ b/tests/3rdparty/fonts/A6 @@ -7,31 +7,32 @@ puts "" vtrihedron trihedr vpoint pTL -700 100 600 -vdrawtext " Top-Left\nFirst line \nLion The Second\n 3rd " -700 100 600 000 255 255 0 2 000 0 14 2 Arial +vdrawtext Text0 " Top-Left\nFirst line \nLion The Second\n 3rd " -pos -700 100 600 -color 0.0 1.0 1.0 -halign left -valign top -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pTC 0 100 600 -vdrawtext " Top-Center\nFirst line \nLion The Second\n 3rd " 0 100 600 000 255 255 1 2 000 0 14 2 Arial +vdrawtext Text1 " Top-Center\nFirst line \nLion The Second\n 3rd " -pos 0 100 600 -color 0.0 1.0 1.0 -halign center -valign top -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pTR 700 100 600 -vdrawtext " Top-Right\nFirst line \nLion The Second\n 3rd " 700 100 600 000 255 255 2 2 000 0 14 2 Arial +vdrawtext Text2 " Top-Right\nFirst line \nLion The Second\n 3rd " -pos 700 100 600 -color 0.0 1.0 1.0 -halign right -valign top -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pCL -700 100 -100 -vdrawtext " Center-Left\nFirst line \nLion The Second\n 3rd " -700 100 -100 255 255 255 0 1 000 0 14 2 Arial +vdrawtext Text3 " Center-Left\nFirst line \nLion The Second\n 3rd " -pos -700 100 -100 -color 1.0 1.0 1.0 -halign left -valign center -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pCC 0 100 -100 -vdrawtext " Center-Center\nFirst line \nLion The Second\n 3rd " 0 100 -100 255 255 255 1 1 000 0 14 2 Arial +vdrawtext Text4 " Center-Center\nFirst line \nLion The Second\n 3rd " -pos 0 100 -100 -color 1.0 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pCR 700 100 -100 -vdrawtext " Center-Right\nFirst line \nLion The Second\n 3rd " 700 100 -100 255 255 255 2 1 000 0 14 2 Arial +vdrawtext Text5 " Center-Right\nFirst line \nLion The Second\n 3rd " -pos 700 100 -100 -color 1.0 1.0 1.0 -halign right -valign center -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pBL -700 100 -700 -vdrawtext " Bottom-Left\nFirst line \nLion The Second\n 3rd " -700 100 -700 255 255 0 0 0 000 0 14 2 Arial +vdrawtext Text6 " Bottom-Left\nFirst line \nLion The Second\n 3rd " -pos -700 100 -700 -color 1.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pBC 0 100 -700 -vdrawtext " Bottom-Center\nFirst line \nLion The Second\n 3rd " 0 100 -700 255 255 0 1 0 000 0 14 2 Arial +vdrawtext Text7 " Bottom-Center\nFirst line \nLion The Second\n 3rd " -pos 0 100 -700 -color 1.0 1.0 0.0 -halign center -valign bottom -angle 000 -zoom 0 -height 14 -aspect bold -font Arial vpoint pBR 700 100 -700 -vdrawtext " Bottom-Right\nFirst line \nLion The Second\n 3rd " 700 100 -700 255 255 0 2 0 000 0 14 2 Arial +vdrawtext Text8 " Bottom-Right\nFirst line \nLion The Second\n 3rd " -pos 700 100 -700 -color 1.0 1.0 0.0 -halign right -valign bottom -angle 000 -zoom 0 -height 14 -aspect bold -font Arial + vfit diff --git a/tests/3rdparty/fonts/B1 b/tests/3rdparty/fonts/B1 index f30ae58203..5fe3428139 100644 --- a/tests/3rdparty/fonts/B1 +++ b/tests/3rdparty/fonts/B1 @@ -13,16 +13,18 @@ vsetdispmode 1 vtop set aLine 0 +set aLineId 0 foreach aSize $THE_FONT_SIZES { set aText "\[$aSize\] $THE_TEXT" vpoint aPnt_$aSize 0.0 $aLine 0.0 - vdrawtext $aText 0.0 $aLine 0.0 000 255 255 0 2 000 1 $aSize 4 $THE_FONT_NAME + vdrawtext "Line_$aLineId" $aText -pos 0.0 $aLine 0.0 -color 0.0 1.0 1.0 -halign left -valign top -angle 000 -zoom 1 -height $aSize -aspect bolditalic -font $THE_FONT_NAME text2brep aBText_$aSize $aText $THE_FONT_NAME $aSize bolditalic composite=0 ttranslate aBText_$aSize 0.0 $aLine 0.0 vdisplay aBText_$aSize set aLine [expr $aLine - 4.0 * $aSize] + set aLineId [expr $aLineId + 1] } vfit diff --git a/tests/3rdparty/fonts/B2 b/tests/3rdparty/fonts/B2 index 00ec5f4fc2..7e2bb4ebc9 100644 --- a/tests/3rdparty/fonts/B2 +++ b/tests/3rdparty/fonts/B2 @@ -13,16 +13,18 @@ vsetdispmode 1 vtop set aLine 0 +set aLineId 0 foreach aSize $THE_FONT_SIZES { set aText "\[$aSize\] $THE_TEXT" vpoint aPnt_$aSize 0.0 $aLine 0.0 - vdrawtext $aText 0.0 $aLine 0.0 000 255 255 0 2 000 1 $aSize 4 $THE_FONT_NAME + vdrawtext "Line_$aLineId" $aText -pos 0.0 $aLine 0.0 -color 0.0 1.0 1.0 -halign left -valign top -angle 000 -zoom 1 -height $aSize -aspect bolditalic -font $THE_FONT_NAME text2brep aBText_$aSize $aText $THE_FONT_NAME $aSize bolditalic composite=1 ttranslate aBText_$aSize 0.0 $aLine 0.0 vdisplay aBText_$aSize set aLine [expr $aLine - 4.0 * $aSize] + set aLineId [expr $aLineId + 1] } vfit diff --git a/tests/bugs/vis/bug21091_4 b/tests/bugs/vis/bug21091_4 index afc202bc89..1c5fb2525d 100755 --- a/tests/bugs/vis/bug21091_4 +++ b/tests/bugs/vis/bug21091_4 @@ -11,23 +11,29 @@ vinit vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 @@ -57,4 +63,4 @@ if { [file exists ${aFile}] } { puts "Faulty : Export to PDF file was not done" } -set only_screen 1 \ No newline at end of file +set only_screen 1 diff --git a/tests/bugs/vis/bug21091_5 b/tests/bugs/vis/bug21091_5 index 1e5e0165a4..c58b2cef03 100755 --- a/tests/bugs/vis/bug21091_5 +++ b/tests/bugs/vis/bug21091_5 @@ -11,23 +11,29 @@ vinit vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 @@ -57,4 +63,4 @@ if { [file exists ${aFile}] } { puts "Faulty : Export to PS format was not done" } -set only_screen 1 \ No newline at end of file +set only_screen 1 diff --git a/tests/bugs/vis/bug21091_6 b/tests/bugs/vis/bug21091_6 index 4852b39157..5ae77c9914 100755 --- a/tests/bugs/vis/bug21091_6 +++ b/tests/bugs/vis/bug21091_6 @@ -11,24 +11,29 @@ vinit vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier -vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier +vpoint p8 -100 -300 -100 +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 box a 110 110 110 200 200 200 @@ -57,4 +62,4 @@ if { [file exists ${aFile}] } { puts "Faulty : Export to EPS file was not done" } -set only_screen 1 \ No newline at end of file +set only_screen 1 diff --git a/tests/bugs/vis/bug21091_7 b/tests/bugs/vis/bug21091_7 index 8cbb694942..8c6f0d427d 100755 --- a/tests/bugs/vis/bug21091_7 +++ b/tests/bugs/vis/bug21091_7 @@ -13,23 +13,29 @@ set only_screen 1 vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 diff --git a/tests/bugs/vis/bug21091_8 b/tests/bugs/vis/bug21091_8 index 99549cfdb8..58051f2df0 100755 --- a/tests/bugs/vis/bug21091_8 +++ b/tests/bugs/vis/bug21091_8 @@ -11,23 +11,29 @@ vinit vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 @@ -57,4 +63,4 @@ if { [file exists ${aFile}] } { puts "Faulty : Export to SVG file was not done" } -set only_screen 1 \ No newline at end of file +set only_screen 1 diff --git a/tests/bugs/vis/bug21091_9 b/tests/bugs/vis/bug21091_9 index 7fbaeab5ad..27b7dd45e6 100755 --- a/tests/bugs/vis/bug21091_9 +++ b/tests/bugs/vis/bug21091_9 @@ -11,23 +11,29 @@ vinit vtrihedron trihedron vpoint p1 -300 -300 -300 -vdrawtext OpenCascade -300 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC0 OpenCascade -pos -300 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p2 -300 -300 -100 -vdrawtext OpenCascade -300 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC1 OpenCascade -pos -300 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p3 -100 -100 -300 -vdrawtext OpenCascade -100 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC2 OpenCascade -pos -100 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p4 -100 -100 -100 -vdrawtext OpenCascade -100 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC3 OpenCascade -pos -100 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vpoint p5 -300 -100 -300 -vdrawtext OpenCascade -300 -100 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC4 OpenCascade -pos -300 -100 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p6 -100 -300 -300 -vdrawtext OpenCascade -100 -300 -300 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC5 OpenCascade -pos -100 -300 -300 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p7 -300 -100 -100 -vdrawtext OpenCascade -300 -100 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC6 OpenCascade -pos -300 -100 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier + vpoint p8 -100 -300 -100 -vdrawtext OpenCascade -100 -300 -100 000 255 000 0 0 000 0 15 1 Courier +vdrawtext OC7 OpenCascade -pos -100 -300 -100 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 000 -zoom 0 -height 15 -aspect regular -font Courier vaxis ax1 100 100 100 100 100 0 @@ -57,4 +63,4 @@ if { [file exists ${aFile}] } { puts "Faulty : Export to PGF file was not done" } -set only_screen 1 \ No newline at end of file +set only_screen 1 diff --git a/tests/bugs/vis/bug22149 b/tests/bugs/vis/bug22149 index 9fe6c33a25..a1c04c76ee 100755 --- a/tests/bugs/vis/bug22149 +++ b/tests/bugs/vis/bug22149 @@ -10,7 +10,7 @@ set BugNumber OCC22149 vfont add [locate_data_file bug22149_mona.ttf] Mona vinit -vdrawtext HELLO 0 0 0 0 255 0 0 0 0 0 50 1 -vdrawtext [encoding convertfrom unicode \x42\x30] 0 0 200 255 0 0 0 0 0 0 50 0 Mona 1 +vdrawtext text0 HELLO -pos 0 0 0 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 50 -aspect regular +vdrawtext text1 [encoding convertfrom unicode \x42\x30] -pos 0 0 200 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 50 -aspect regular -font Mona set only_screen 1 diff --git a/tests/bugs/vis/bug22796_1 b/tests/bugs/vis/bug22796_1 index f3c4ff8c61..48a0a7a365 100755 --- a/tests/bugs/vis/bug22796_1 +++ b/tests/bugs/vis/bug22796_1 @@ -8,7 +8,8 @@ puts "" set BugNumber OCC22796 -vdrawtext "MyTest1\rHello,\tWor\vld!\nMyTest2\t\a\bMyTest3" 0 0 0 255 255 255 0 0 0 1 50 0 +vinit +vdrawtext text0 "MyTest1\rHello,\tWor\vld!\nMyTest2\t\a\bMyTest3" -pos 0 0 0 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 0 -zoom 1 -height 50 -aspect regular set only_screen 1 diff --git a/tests/bugs/vis/bug22796_2 b/tests/bugs/vis/bug22796_2 index d74ee72756..c37ba4ee47 100755 --- a/tests/bugs/vis/bug22796_2 +++ b/tests/bugs/vis/bug22796_2 @@ -8,10 +8,11 @@ puts "" set BugNumber OCC22796 +vinit vfont add [locate_data_file bug22149_mona.ttf] Mona set s [encoding convertfrom unicode "\x42\x30\x09\x00\x79\x30\x0A\x00\x6F\x30\x42\x26"] #vdrawtext "\x30\x42\x00\x09\x30\x79\x00\x0A\x30\x6F" 0 0 0 255 255 255 0 0 0 1 50 0 Mona 1 -vdrawtext $s 0 0 0 255 255 255 0 0 0 1 50 0 Mona 1 +vdrawtext text0 $s -pos 0 0 0 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 0 -zoom 1 -height 50 -aspect regular -font Mona set only_screen 1 diff --git a/tests/bugs/vis/bug22796_3 b/tests/bugs/vis/bug22796_3 index 0dc4b39bc0..c3a91c573b 100755 --- a/tests/bugs/vis/bug22796_3 +++ b/tests/bugs/vis/bug22796_3 @@ -8,7 +8,8 @@ puts "" set BugNumber OCC22796 -vdrawtext "TestString\nHello,\tWorld!" 0 0 0 255 255 255 0 0 0 1 50 0 +vinit +vdrawtext text0 "TestString\nHello,\tWorld!" -pos 0 0 0 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 0 -zoom 1 -height 50 -aspect regular vexport $imagedir/${test_image}.pdf PDF set only_screen 1 diff --git a/tests/bugs/vis/bug23652 b/tests/bugs/vis/bug23652 index 591e289f79..90334fe7f5 100755 --- a/tests/bugs/vis/bug23652 +++ b/tests/bugs/vis/bug23652 @@ -8,8 +8,8 @@ puts "========" vinit vtrihedron tri -vdrawtext Default 0.0 0.0 0.0 255 255 255 0 0 0 1 20 0 -vdrawtext Right_Align 0.0 0.0 0.0 255 255 255 2 0 0 1 20 0 +vdrawtext text0 Default -pos 0.0 0.0 0.0 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 0 -zoom 1 -height 20 -aspect regular +vdrawtext text1 Right_Align -pos 0.0 0.0 0.0 -color 1.0 1.0 1.0 -halign right -valign bottom -angle 0 -zoom 1 -height 20 -aspect regular set scale 3.1783114563761763 set proj_X 0.57735025882720947 diff --git a/tests/bugs/vis/bug23654_MarkersRecompute b/tests/bugs/vis/bug23654_MarkersRecompute index e51a1419b0..911328a27e 100644 --- a/tests/bugs/vis/bug23654_MarkersRecompute +++ b/tests/bugs/vis/bug23654_MarkersRecompute @@ -43,7 +43,7 @@ for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } { set aRow [expr $aMarkerType - 7] set aCol 5 set aName [lindex $aMarkerTypeNames $aMarkerType] - vdrawtext "$aName" 0 [expr $aRow + 0.5] 0 128 255 255 1 1 000 0 12 2 Arial + vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 0.5 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font Arial if { $aMarkerType == 13 } { vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1 set aCol [expr $aCol - 1] diff --git a/tests/bugs/vis/bug24131_markers b/tests/bugs/vis/bug24131_markers index 0bd9691995..5de3465242 100644 --- a/tests/bugs/vis/bug24131_markers +++ b/tests/bugs/vis/bug24131_markers @@ -47,7 +47,7 @@ for { set aMode 0 } { $aMode <= 1 } { incr aMode } { set aRow [expr $aMarkerType - 7] set aCol 5 set aName [lindex $aMarkerTypeNames $aMarkerType] - vdrawtext "$aName" 0 [expr $aRow + 0.5] 0 128 255 255 1 1 000 0 12 2 Arial + vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 0.5 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font Arial if { $aMarkerType == 13 } { vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1 set aCol [expr $aCol - 1] diff --git a/tests/bugs/vis/bug24555 b/tests/bugs/vis/bug24555 index e1eb6cd3fe..a9e9ee1843 100755 --- a/tests/bugs/vis/bug24555 +++ b/tests/bugs/vis/bug24555 @@ -9,9 +9,9 @@ puts "" vinit vclear vaxo -vdrawtext "This program" 0 0 0 0 255 0 0 0 0 0 50 1 Arial +vdrawtext text0 "This program" -pos 0 0 0 -color 0.0 1.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 50 -aspect regular -font Arial -vdrawtext "This program" 0 0 0 255 0 0 0 0 0 0 50 1 Arial +vdrawtext text1 "This program" -pos 0 0 0 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 50 -aspect regular -font Arial set x 346 set y 190 diff --git a/tests/bugs/vis/bug24837_2 b/tests/bugs/vis/bug24837_2 index d3b99f8e96..37de7ea9a7 100644 --- a/tests/bugs/vis/bug24837_2 +++ b/tests/bugs/vis/bug24837_2 @@ -18,21 +18,21 @@ vsetdispmode 0 vdisplay o1 o2 vdisplay b1 b2 vfit -vdrawtext "b1" 0 -3 3 255 25 25 2 0 000 0 14 1 Arial -vdrawtext "b2" 3 0 3 25 255 25 2 0 000 0 14 1 Arial -vdrawtext "bc_1" 0 -9 3 255 225 225 2 0 000 0 14 1 Arial -vdrawtext "bc_2" 3 -6 3 255 225 225 2 0 000 0 14 1 Arial +vdrawtext tb1 "b1" -pos 0 -3 3 -color 1.0 0.098 0.098 -halign right -valign bottom -angle 000 -zoom 0 -height 14 -aspect regular -font Arial +vdrawtext tb2 "b2" -pos 3 0 3 -color 0.098 1.0 0.098 -halign right -valign bottom -angle 000 -zoom 0 -height 14 -aspect regular -font Arial +vdrawtext bc_1 "bc_1" -pos 0 -9 3 -color 1.0 0.8823 0.8823 -halign right -valign bottom -angle 000 -zoom 0 -height 14 -aspect regular -font Arial +vdrawtext bc_2 "bc_2" -pos 3 -6 3 -color 1.0 0.8823 0.8823 -halign right -valign bottom -angle 000 -zoom 0 -height 14 -aspect regular -font Arial vsetdispmode 1 set anImage ${imagedir}/${casename}_2_1.png vdump ${anImage} -vsetmaterial b1 b2 plastic -vsetcolor b1 RED -vsetcolor b2 GREEN +vsetmaterial b1 b2 tb1 tb2 plastic +vsetcolor b1 tb1 RED +vsetcolor b2 tb2 GREEN set anImage ${imagedir}/${casename}_2_2.png vdump ${anImage} vsetlocation b1 0 -3 0 -vconnect bc 0 -6 0 b1 b2 +vconnect bc 0 -6 0 b1 b2 tb1 tb2 set anImage ${imagedir}/${casename}_2_3.png vdump ${anImage} diff --git a/tests/bugs/vis/bug25121 b/tests/bugs/vis/bug25121 index 5b660f2005..566b2ff7fd 100644 --- a/tests/bugs/vis/bug25121 +++ b/tests/bugs/vis/bug25121 @@ -13,10 +13,10 @@ vdisplay -noupdate b vtop vfit -vdrawtext "000 3D" 0.0 0.0 0.0 255 255 255 1 1 000 0 16 1 Courier -vdrawtext "001 3D" 0.0 1.0 0.0 255 255 255 1 1 000 0 16 1 Courier -vdrawtext "101 3D" 0.0 2.0 0.0 255 255 255 1 1 000 0 16 1 Courier -vdrawtext "110 3D" 0.0 3.0 0.0 255 255 255 1 1 000 0 16 1 Courier +vdrawtext 000_3D "000 3D" -pos 0.0 0.0 0.0 -color 1.0 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 16 -aspect regular -font Courier +vdrawtext 001_3D "001 3D" -pos 0.0 1.0 0.0 -color 1.0 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 16 -aspect regular -font Courier +vdrawtext 101_3D "101 3D" -pos 0.0 2.0 0.0 -color 1.0 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 16 -aspect regular -font Courier +vdrawtext 110_3D "110 3D" -pos 0.0 3.0 0.0 -color 1.0 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 16 -aspect regular -font Courier voverlaytext "000 2D" 100 200 16 Courier 255 255 255 normal 0 0 255 voverlaytext "001 2D" 100 250 16 Courier 255 255 255 normal 0 0 255 voverlaytext "101 2D" 100 300 16 Courier 255 255 255 normal 0 0 255 diff --git a/tests/bugs/vis/bug25369 b/tests/bugs/vis/bug25369 index bb92a1b13f..05652652b7 100644 --- a/tests/bugs/vis/bug25369 +++ b/tests/bugs/vis/bug25369 @@ -14,7 +14,7 @@ vdisplay b vfit set s [encoding convertfrom unicode "\x3A\x04\x30\x04\x40\x04\x2E\x00\x70\x00\x6E\x00\x67\x00"] -vdrawtext $s 0 0 0 255 255 255 0 0 0 0 50 0 Times 1 +vdrawtext text0 $s -pos 0 0 0 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 0 -zoom 0 -height 50 -aspect regular -font Times vdump $::imagedir/$s vtexture b $::imagedir/$s diff --git a/tests/bugs/vis/bug25732_1 b/tests/bugs/vis/bug25732_1 index e12048f012..e924db4912 100644 --- a/tests/bugs/vis/bug25732_1 +++ b/tests/bugs/vis/bug25732_1 @@ -16,7 +16,7 @@ vdisplay b vfit vsetdispmode b 1 -vdrawtext "Open\nCASCADE" 0 0 0 255 0 0 1 1 -45 1 50 1 Arial +vdrawtext text "Open\nCASCADE" -pos 0 0 0 -color 1.0 0.0 0.0 -halign center -valign center -angle -45 -zoom 1 -height 50 -aspect regular -font Arial set bug_info [vreadpixel 255 283 rgb name] if {$bug_info != "RED"} { diff --git a/tests/bugs/vis/bug25732_2 b/tests/bugs/vis/bug25732_2 index bad868521d..ad577cea89 100644 --- a/tests/bugs/vis/bug25732_2 +++ b/tests/bugs/vis/bug25732_2 @@ -15,7 +15,7 @@ vsetdispmode 1 vdisplay b_1 b_2 vfit -vdrawtext "SAMPLE TEXT" 1 0 3 255 0 0 0 0 0 0 30 1 +vdrawtext text "SAMPLE TEXT" -pos 1 0 3 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 30 -aspect regular set bug_info [vreadpixel 260 137 rgb name] if {$bug_info != "RED"} { diff --git a/tests/demo/draw/bug23745 b/tests/demo/draw/bug23745 index eb37d8fb0f..985c980d98 100644 --- a/tests/demo/draw/bug23745 +++ b/tests/demo/draw/bug23745 @@ -10,7 +10,7 @@ pload QAcommands pload VISUALIZATION vinit -vdrawtext "ANOTHERBUG" 100 100 100 255 0 0 0 0 0 1 50 0 +vdrawtext text0 "ANOTHERBUG" -pos 100 100 100 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 1 -height 50 -aspect regular vtrihedron trihedron set x 239 diff --git a/tests/v3d/raytrace/bug24819 b/tests/v3d/raytrace/bug24819 index a945ca89fa..7b1d30c9c6 100644 --- a/tests/v3d/raytrace/bug24819 +++ b/tests/v3d/raytrace/bug24819 @@ -33,7 +33,7 @@ vdisplay p vmarkerstest mTest 7 -3 0 PointsOnSide=5 MarkerType=5 # 3d text -vdrawtext 3D_Text 1 2 2 255 0 0 0 0 0 0 20 0 +vdrawtext text0 3D_Text -pos 1 2 2 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 20 -aspect regular vlight change 0 pos -1 1 1 -- 2.20.1