0024181: Text to BRep functionality
[occt.git] / src / ViewerTest / ViewerTest_ObjectCommands.cxx
index 846bb7b..af6b112 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
-//===============================================
-//    AIS Objects Creation : Datums (axis,trihedrons,lines,planes)
-//===============================================
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include <Draw_Appli.hxx>
 #include <DBRep.hxx>
 
+#include <Font_BRepFont.hxx>
 #include <OSD_Chronometer.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <Visual3d_View.hxx>
 #include <V3d_Viewer.hxx>
 #include <V3d_View.hxx>
-#include <V3d_Plane.hxx>
 #include <V3d.hxx>
 
 #include <AIS_Shape.hxx>
 #include <Graphic3d_ArrayOfQuadrangles.hxx>
 #include <Graphic3d_ArrayOfQuadrangleStrips.hxx>
 #include <Graphic3d_ArrayOfPolygons.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Standard_Real.hxx>
 
 #include <TopoDS_Wire.hxx>
 
 #include <AIS_ConnectedShape.hxx>
+#include <AIS_MultipleConnectedInteractive.hxx>
+#include <AIS_MultipleConnectedShape.hxx>
 #include <TopLoc_Location.hxx>
 #include <TColStd_ListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 
 #include <Select3D_SensitiveTriangle.hxx>
 #include <Select3D_SensitiveCurve.hxx>
+#include <Select3D_SensitivePoint.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <StdPrs_Curve.hxx>
 
 #include <BRepExtrema_ExtPF.hxx>
 
 #include <Prs3d_LineAspect.hxx>
+#include <Prs3d_PointAspect.hxx>
+
+#include <Image_AlienPixMap.hxx>
+#include <TColStd_HArray1OfAsciiString.hxx>
 
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
@@ -153,7 +155,7 @@ extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
 extern Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName,
                                            const Handle(AIS_InteractiveObject)& theAISObj,
                                            Standard_Boolean theReplaceIfExists = Standard_True);
-Standard_IMPORT int ViewerMainLoop(Standard_Integer argc, const char** argv);
+extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
 extern Handle(AIS_InteractiveContext)& TheAISContext();
 
 
@@ -243,57 +245,56 @@ static int VTrihedron2D (Draw_Interpretor& di, Standard_Integer argc, const char
 
 //==============================================================================
 //function : VTriherdron
-//author   : ege
 //purpose  : Create a trihedron. If no arguments are set, the default
 //           trihedron (Oxyz) is created.
 //Draw arg : vtrihedron  name  [Xo] [Yo] [Zo] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
 //==============================================================================
 
-static int VTrihedron (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-
+static int VTrihedron (Draw_Interpretor& theDi,
+                       Standard_Integer  theArgsNb,
+                       const char**      theArgVec)
 {
-  // Verification des arguments
-  if ( argc<2 || argc>11) {di<<argv[0]<<" Syntaxe error"<<"\n"; return 1;}
-
-  // Declarations et creation des objets par default
-  TCollection_AsciiString     name=argv[1];
-
-  if(argc > 5 && argc!=11)
-  {di<<argv[0]<<" Syntaxe error"<<"\n"; return 1;}
+  if (theArgsNb != 2 && theArgsNb != 5 && theArgsNb != 11)
+  {
+    theDi << theArgVec[0] << " Syntax error\n";
+    return 1;
+  }
 
-  // Cas ou il y a des arguments
-  Standard_Real coord[9]={0.,0.,0.,0.,0.,1.,1.,0.,0.};
-  if (argc>2){
-    Standard_Integer i ;
-    for( i=0;i<=2;i++)
-      coord[i]= atof(argv[2+i]);
-
-    if(argc>5){
-      for(i=0;i<=2;i++){
-        coord[3+i] = atof(argv[6+i]);
-        coord[6+i] = atof(argv[8+i]);
-      }
+  gp_Pnt anOrigin (0.0, 0.0, 0.0);
+  gp_Dir aDirZ = gp::DZ();
+  gp_Dir aDirX = gp::DX();
+  Standard_Integer anArgIter = 2; // 1st is an IO name
+  if (anArgIter < theArgsNb)
+  {
+    anOrigin.SetX (Draw::Atof (theArgVec[anArgIter++]));
+    anOrigin.SetY (Draw::Atof (theArgVec[anArgIter++]));
+    anOrigin.SetZ (Draw::Atof (theArgVec[anArgIter++]));
+    if (anArgIter < theArgsNb)
+    {
+      Standard_Real aX = Draw::Atof (theArgVec[anArgIter++]);
+      Standard_Real aY = Draw::Atof (theArgVec[anArgIter++]);
+      Standard_Real aZ = Draw::Atof (theArgVec[anArgIter++]);
+      aDirZ.SetCoord (aX, aY, aZ);
+
+      aX = Draw::Atof (theArgVec[anArgIter++]);
+      aY = Draw::Atof (theArgVec[anArgIter++]);
+      aZ = Draw::Atof (theArgVec[anArgIter++]);
+      aDirX.SetCoord (aX, aY, aZ);
     }
   }
-  gp_Pnt ThePoint(coord[0],coord[1],coord[2]);
-  gp_Dir TheZVector(coord[3],coord[4],coord[5]);
-  gp_Dir TheXVector(coord[6],coord[7],coord[8]);
 
-  if ( !TheZVector.IsNormal(TheXVector,M_PI/180)) {di<<argv[0]<<" VectorX is not normal to VectorZ"<<"\n"; return 1;}
-
-  Handle(Geom_Axis2Placement) OrigineAndAxii=new Geom_Axis2Placement(ThePoint,TheZVector,TheXVector);
-
-  // Creation du triedre
-  Handle(AIS_Trihedron) aShape= new AIS_Trihedron(OrigineAndAxii);
-  GetMapOfAIS().Bind(aShape,name);
-  TheAISContext()->Display(aShape);
+  if (!aDirZ.IsNormal (aDirX, M_PI / 180.0))
+  {
+    theDi << theArgVec[0] << " - VectorX is not normal to VectorZ\n";
+    return 1;
+  }
 
+  Handle(Geom_Axis2Placement) aPlacement = new Geom_Axis2Placement (anOrigin, aDirZ, aDirX);
+  Handle(AIS_Trihedron) aShape = new AIS_Trihedron (aPlacement);
+  VDisplayAISObject (theArgVec[1], aShape);
   return 0;
 }
 
-
-
-
 //==============================================================================
 //function : VSize
 //author   : ege
@@ -311,19 +312,16 @@ static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv
   Standard_Boolean             ThereIsCurrent;
   Standard_Real                value;
   Standard_Boolean             hascol;
-#ifdef DEB
-  Quantity_NameOfColor         col;
-#else
+
   Quantity_NameOfColor         col = Quantity_NOC_BLACK ;
-#endif
 
   // Verification des arguments
   if ( argc>3 ) {di<<argv[0]<<" Syntaxe error"<<"\n"; return 1;}
 
   // Verification du nombre d'arguments
   if (argc==1)      {ThereIsName=Standard_False;value=100;}
-  else if (argc==2) {ThereIsName=Standard_False;value=atof(argv[1]);}
-  else              {ThereIsName=Standard_True;value=atof(argv[2]);}
+  else if (argc==2) {ThereIsName=Standard_False;value=Draw::Atof(argv[1]);}
+  else              {ThereIsName=Standard_True;value=Draw::Atof(argv[2]);}
 
   // On ferme le contexte local pour travailler dans le contexte global
   if(TheAISContext()->HasOpenedContext())
@@ -563,7 +561,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
   if (HasArg) {
     Standard_Real coord[6];
     for(Standard_Integer i=0;i<=5;i++){
-      coord[i]=atof(argv[2+i]);
+      coord[i]=Draw::Atof(argv[2+i]);
     }
     gp_Pnt p1(coord[0],coord[1],coord[2]), p2(coord[3],coord[4],coord[5]) ;
 
@@ -815,7 +813,7 @@ static int VPointBuilder(Draw_Interpretor& di, Standard_Integer argc, const char
   if (HasArg) {
     Standard_Real thecoord[3];
     for(Standard_Integer i=0;i<=2;i++)
-      thecoord[i]=atof(argv[2+i]);
+      thecoord[i]=Draw::Atof(argv[2+i]);
     Handle(Geom_CartesianPoint )  myGeomPoint= new Geom_CartesianPoint (thecoord[0],thecoord[1],thecoord[2]);
     Handle(AIS_Point)  myAISPoint=new AIS_Point(myGeomPoint );
     GetMapOfAIS().Bind (myAISPoint,name);
@@ -899,7 +897,7 @@ static int VPointBuilder(Draw_Interpretor& di, Standard_Integer argc, const char
 //                            [PlaneName] [PointName]
 //==============================================================================
 
-static Standard_Integer VPlaneBuilder (Draw_Interpretor& di,
+static Standard_Integer VPlaneBuilder (Draw_Interpretor& /*di*/,
                                        Standard_Integer argc,
                                        const char** argv)
 {
@@ -989,23 +987,23 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& di,
           Handle(Geom_CartesianPoint)::DownCast( anAISPointC->Component());
 
         // Verification that the three points are different
-        if(abs(aCartPointB->X()-aCartPointA->X())<=Precision::Confusion() &&
-           abs(aCartPointB->Y()-aCartPointA->Y())<=Precision::Confusion() &&
-           abs(aCartPointB->Z()-aCartPointA->Z())<=Precision::Confusion())
+        if(Abs(aCartPointB->X()-aCartPointA->X())<=Precision::Confusion() &&
+           Abs(aCartPointB->Y()-aCartPointA->Y())<=Precision::Confusion() &&
+           Abs(aCartPointB->Z()-aCartPointA->Z())<=Precision::Confusion())
         {
           // B=A
           std::cout<<"vplane error: same points"<<"\n";return 1;
         }
-        if(abs(aCartPointC->X()-aCartPointA->X())<=Precision::Confusion() &&
-           abs(aCartPointC->Y()-aCartPointA->Y())<=Precision::Confusion() &&
-           abs(aCartPointC->Z()-aCartPointA->Z())<=Precision::Confusion())
+        if(Abs(aCartPointC->X()-aCartPointA->X())<=Precision::Confusion() &&
+           Abs(aCartPointC->Y()-aCartPointA->Y())<=Precision::Confusion() &&
+           Abs(aCartPointC->Z()-aCartPointA->Z())<=Precision::Confusion())
         {
           // C=A
           std::cout<<"vplane error: same points"<<"\n";return 1;
         }
-        if(abs(aCartPointC->X()-aCartPointB->X())<=Precision::Confusion() &&
-           abs(aCartPointC->Y()-aCartPointB->Y())<=Precision::Confusion() &&
-           abs(aCartPointC->Z()-aCartPointB->Z())<=Precision::Confusion())
+        if(Abs(aCartPointC->X()-aCartPointB->X())<=Precision::Confusion() &&
+           Abs(aCartPointC->Y()-aCartPointB->Y())<=Precision::Confusion() &&
+           Abs(aCartPointC->Z()-aCartPointB->Z())<=Precision::Confusion())
         {
           // C=B
           std::cout<<"vplane error: same points"<<"\n";return 1;
@@ -1681,8 +1679,8 @@ static int VLineBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
 
     Standard_Real coord[6];
     for(Standard_Integer i=0;i<=2;i++){
-      coord[i]=atof(argv[2+i]);
-      coord[i+3]=atof(argv[5+i]);
+      coord[i]=Draw::Atof(argv[2+i]);
+      coord[i+3]=Draw::Atof(argv[5+i]);
     }
 
     Handle(Geom_CartesianPoint ) myCartPointA=new Geom_CartesianPoint (coord[0],coord[1],coord[2] );
@@ -1842,7 +1840,7 @@ TopoDS_Face FilledCircle::ComputeFace()
   return aFace;
 }
 
-void FilledCircle::Compute(const Handle_PrsMgr_PresentationManager3d &thePresentationManager
+void FilledCircle::Compute(const Handle_PrsMgr_PresentationManager3d &/*thePresentationManager*/
                            const Handle_Prs3d_Presentation &thePresentation, 
                            const Standard_Integer theMode) 
 {
@@ -1857,7 +1855,7 @@ void FilledCircle::Compute(const Handle_PrsMgr_PresentationManager3d &thePresent
 }
 
 void FilledCircle::ComputeSelection(const Handle_SelectMgr_Selection &theSelection, 
-                                    const Standard_Integer theMode)
+                                    const Standard_Integer /*theMode*/)
 {
   Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner(this);
   Handle(Select3D_SensitiveCircle) aSensitiveCircle = new Select3D_SensitiveCircle(anEntityOwner, 
@@ -1910,7 +1908,7 @@ void DisplayCircle (Handle (Geom_Circle) theGeomCircle,
   
 }
 
-static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
+static int VCircleBuilder(Draw_Interpretor& /*di*/, Standard_Integer argc, const char** argv)
 {
   Standard_Integer myCurrentIndex;
   // Verification of the arguments
@@ -1926,7 +1924,7 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
   {
     // Get arguments
     TCollection_AsciiString aName(argv[1]);
-    Standard_Boolean isFilled = (Standard_Boolean)atoi(argv[5]);
+    Standard_Boolean isFilled = (Standard_Boolean)Draw::Atoi(argv[5]);
 
     Handle(AIS_InteractiveObject) theShapeA;
     Handle(AIS_InteractiveObject) theShapeB;
@@ -1975,25 +1973,25 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
           Handle(Geom_CartesianPoint)::DownCast(myGeomPointC);
 
         // Test A=B
-        if (abs(myCartPointA->X()-myCartPointB->X()) <= Precision::Confusion() && 
-          abs(myCartPointA->Y()-myCartPointB->Y()) <= Precision::Confusion() && 
-          abs(myCartPointA->Z()-myCartPointB->Z()) <= Precision::Confusion() ) 
+        if (Abs(myCartPointA->X()-myCartPointB->X()) <= Precision::Confusion() && 
+            Abs(myCartPointA->Y()-myCartPointB->Y()) <= Precision::Confusion() && 
+            Abs(myCartPointA->Z()-myCartPointB->Z()) <= Precision::Confusion() ) 
         {
           std::cout << "vcircle error: Same points.\n"; 
           return 1; // TCL_ERROR 
         }
         // Test A=C
-        if (abs(myCartPointA->X()-myCartPointC->X()) <= Precision::Confusion() &&
-          abs(myCartPointA->Y()-myCartPointC->Y()) <= Precision::Confusion() && 
-          abs(myCartPointA->Z()-myCartPointC->Z()) <= Precision::Confusion() ) 
+        if (Abs(myCartPointA->X()-myCartPointC->X()) <= Precision::Confusion() &&
+            Abs(myCartPointA->Y()-myCartPointC->Y()) <= Precision::Confusion() && 
+            Abs(myCartPointA->Z()-myCartPointC->Z()) <= Precision::Confusion() ) 
         {
           std::cout << "vcircle error: Same points.\n"; 
           return 1; // TCL_ERROR 
         }
         // Test B=C
-        if (abs(myCartPointB->X()-myCartPointC->X()) <= Precision::Confusion() && 
-          abs(myCartPointB->Y()-myCartPointC->Y()) <= Precision::Confusion() && 
-          abs(myCartPointB->Z()-myCartPointC->Z()) <= Precision::Confusion() ) 
+        if (Abs(myCartPointB->X()-myCartPointC->X()) <= Precision::Confusion() && 
+            Abs(myCartPointB->Y()-myCartPointC->Y()) <= Precision::Confusion() && 
+            Abs(myCartPointB->Z()-myCartPointC->Z()) <= Precision::Confusion() ) 
         {
           std::cout << "vcircle error: Same points.\n"; 
           return 1;// TCL_ERROR 
@@ -2027,7 +2025,7 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
         return 1; // TCL_ERROR 
       }
       // Ã‘heck that the radius is >= 0
-      if (atof(argv[4]) <= 0 ) 
+      if (Draw::Atof(argv[4]) <= 0 ) 
       {
         std::cout << "vcircle error: the radius must be >=0.\n"; 
         return 1; // TCL_ERROR 
@@ -2046,7 +2044,7 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
       gp_Ax1 thegpAxe = mygpPlane.Axis();
       gp_Dir theDir = thegpAxe.Direction();
       gp_Pnt theCenter = myCartPointB->Pnt();
-      Standard_Real TheR = atof(argv[4]);
+      Standard_Real TheR = Draw::Atof(argv[4]);
       GC_MakeCircle Cir = GC_MakeCircle (theCenter, theDir ,TheR);
       Handle (Geom_Circle) theGeomCircle;
       try 
@@ -2254,15 +2252,14 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
 //===============================================================================================
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_Structure.hxx>
-#include <Graphic3d_NameOfFont.hxx>
 #include <Graphic3d_AspectText3d.hxx>
-#include <Graphic2d_GraphicObject.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_StructureManager.hxx>
 #include <Graphic3d_VerticalTextAlignment.hxx>
 #include <Graphic3d_HorizontalTextAlignment.hxx>
 
+#include <Font_NameOfFont.hxx>
+
 #include <Visual3d_ViewManager.hxx>
 #include <ViewerTest_Tool.ixx>
 
@@ -2301,7 +2298,7 @@ public:
       Standard_Real Angle ,
       Standard_Boolean Zoom ,
       Standard_Real  Height,
-      OSD_FontAspect FontAspect,
+      Font_FontAspect FontAspect,
       Standard_CString Font
     );
 
@@ -2311,8 +2308,8 @@ private:
                   const Handle(Prs3d_Presentation)& aPresentation,
                   const Standard_Integer aMode);
 
-  void ComputeSelection (  const Handle(SelectMgr_Selection)& aSelection,
-                           const Standard_Integer aMode){} ;
+  void ComputeSelection (  const Handle(SelectMgr_Selection)& /*aSelection*/,
+                           const Standard_Integer /*aMode*/){} ;
 
 protected:
   TCollection_ExtendedString          aText;
@@ -2324,8 +2321,8 @@ protected:
   Standard_Real                       aHeight;
   Standard_Boolean                    aZoomable;
   Quantity_Color                      aColor;
-  Standard_CString                    aFont;
-  OSD_FontAspect                      aFontAspect;
+  TCollection_AsciiString             aFont;
+  Font_FontAspect                     aFontAspect;
   Graphic3d_HorizontalTextAlignment   aHJustification;
   Graphic3d_VerticalTextAlignment     aVJustification;
 };
@@ -2343,7 +2340,7 @@ MyTextClass::MyTextClass( const TCollection_ExtendedString& text, const gp_Pnt&
                           Standard_Real     angle       = 0.0 ,
                           Standard_Boolean  zoomable    = Standard_True,
                           Standard_Real     height      = 12.,
-                          OSD_FontAspect    fontAspect  = OSD_FA_Regular,
+                          Font_FontAspect   fontAspect  = Font_FA_Regular,
                           Standard_CString  font        = "Courier")
 {
   aText           = text;
@@ -2361,16 +2358,16 @@ MyTextClass::MyTextClass( const TCollection_ExtendedString& text, const gp_Pnt&
 
 
 //////////////////////////////////////////////////////////////////////////////
-void MyTextClass::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+void MyTextClass::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
                           const Handle(Prs3d_Presentation)& aPresentation,
-                          const Standard_Integer aMode)
+                          const Standard_Integer /*aMode*/)
 {
 
   aPresentation->Clear();
 
   Handle_Prs3d_TextAspect asp = myDrawer->TextAspect();
 
-  asp->SetFont(aFont);
+  asp->SetFont(aFont.ToCString());
   asp->SetColor(aColor);
   asp->SetHeight(aHeight); // I am changing the myHeight value
 
@@ -2387,9 +2384,7 @@ void MyTextClass::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentat
   Graphic3d_Vertex vertices_text;
   vertices_text.SetCoord(aPosition.X(),aPosition.Y(),aPosition.Y());
   TheGroup->SetPrimitivesAspect(aspect);
-  TheGroup->BeginPrimitives();
   TheGroup->Text(aText,vertices_text,aHeight,Standard_True);
-  TheGroup->EndPrimitives();
   */
 };
 
@@ -2418,32 +2413,32 @@ static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char**
   }
 
   // Text position
-  const Standard_Real X = atof(argv[2]);
-  const Standard_Real Y = atof(argv[3]);
-  const Standard_Real Z = atof(argv[4]);
+  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);
 
   // Text color
-  const Quantity_Parameter R = atof(argv[5])/255.;
-  const Quantity_Parameter G = atof(argv[6])/255.;
-  const Quantity_Parameter B = atof(argv[7])/255.;
+  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 );
 
   // Text alignment
-  const int hor_align = atoi(argv[8]);
-  const int ver_align = atoi(argv[9]);
+  const int hor_align = Draw::Atoi(argv[8]);
+  const int ver_align = Draw::Atoi(argv[9]);
 
   // Text angle
-  const Standard_Real angle = atof(argv[10]);
+  const Standard_Real angle = Draw::Atof(argv[10]);
 
   // Text zooming
-  const Standard_Boolean zoom = atoi(argv[11]);
+  const Standard_Boolean zoom = Draw::Atoi(argv[11]);
 
   // Text height
-  const Standard_Real height = atof(argv[12]);
+  const Standard_Real height = Draw::Atof(argv[12]);
 
   // Text aspect
-  const OSD_FontAspect aspect = OSD_FontAspect(atoi(argv[13]));
+  const Font_FontAspect aspect = Font_FontAspect(Draw::Atoi(argv[13]));
 
   // Text font
   TCollection_AsciiString font;
@@ -2453,7 +2448,7 @@ static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char**
     font.AssignCat(argv[14]);
 
   // Text is multibyte
-  const Standard_Boolean isMultibyte = (argc < 16)? Standard_False : (atoi(argv[15]) != 0);
+  const Standard_Boolean isMultibyte = (argc < 16)? Standard_False : (Draw::Atoi(argv[15]) != 0);
 
   // Read text string
   TCollection_ExtendedString name;
@@ -2487,7 +2482,6 @@ static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char**
 #include <gp_Pnt.hxx>
 #include <Graphic3d_ArrayOfPoints.hxx>
 #include <Graphic3d_ArrayOfPrimitives.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
 #include <Graphic3d_ArrayOfTriangles.hxx>
 #include <Poly_Array1OfTriangle.hxx>
 #include <Poly_Triangle.hxx>
@@ -2497,7 +2491,6 @@ static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char**
 #include <TShort_HArray1OfShortReal.hxx>
 
 #include <AIS_Triangulation.hxx>
-#include <Aspect_GraphicDevice.hxx>
 #include <StdPrs_ToolShadedShape.hxx>
 #include <Poly_Connect.hxx>
 #include <TColgp_Array1OfDir.hxx>
@@ -2754,7 +2747,7 @@ Handle( Poly_Triangulation ) CalculationOfSphere( double X , double Y , double Z
 //author   : psn
 //purpose  : Create an AIS shape.
 //===============================================================================================
-static int VDrawSphere (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
+static int VDrawSphere (Draw_Interpretor& /*di*/, Standard_Integer argc, const char** argv)
 {
   // check for errors
   Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
@@ -2766,18 +2759,18 @@ static int VDrawSphere (Draw_Interpretor& di, Standard_Integer argc, const char*
   else if (argc < 3)
   {
     std::cout << "Use: " << argv[0]
-              << " shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0]\n";
+              << " shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToShowEdges=0]\n";
     return 1;
   }
 
   // read the arguments
   TCollection_AsciiString aShapeName (argv[1]);
-  Standard_Integer aResolution = atoi (argv[2]);
-  Standard_Real aCenterX = (argc > 5) ? atof (argv[3]) : 0.0;
-  Standard_Real aCenterY = (argc > 5) ? atof (argv[4]) : 0.0;
-  Standard_Real aCenterZ = (argc > 5) ? atof (argv[5]) : 0.0;
-  Standard_Real aRadius =  (argc > 6) ? atof (argv[6]) : 100.0;
-  Standard_Boolean toShowEdges =  (argc > 7) ? atoi (argv[7]) : Standard_False;
+  Standard_Integer aResolution = Draw::Atoi (argv[2]);
+  Standard_Real aCenterX = (argc > 5) ? Draw::Atof (argv[3]) : 0.0;
+  Standard_Real aCenterY = (argc > 5) ? Draw::Atof (argv[4]) : 0.0;
+  Standard_Real aCenterZ = (argc > 5) ? Draw::Atof (argv[5]) : 0.0;
+  Standard_Real aRadius =  (argc > 6) ? Draw::Atof (argv[6]) : 100.0;
+  Standard_Boolean toShowEdges =  (argc > 7) ? Draw::Atoi (argv[7]) : Standard_False;
 
   // remove AIS object with given name from map
   VDisplayAISObject (aShapeName, Handle(AIS_InteractiveObject)());
@@ -2856,181 +2849,6 @@ static int VDrawSphere (Draw_Interpretor& di, Standard_Integer argc, const char*
   return 0;
 }
 
-//===============================================================================================
-//function : VClipPlane
-//purpose  :
-//===============================================================================================
-static int VClipPlane (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-{
-  Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
-  Handle(V3d_View) aView = ViewerTest::CurrentView();
-  Standard_Real coeffA, coeffB, coeffC, coeffD;
-  if (aViewer.IsNull() || aView.IsNull())
-  {
-    std::cout << "Viewer not initialized!\n";
-    return 1;
-  }
-
-  // count an active planes count
-  Standard_Integer aNewPlaneId = 1;
-  Standard_Integer anActivePlanes = 0;
-  for (aViewer->InitDefinedPlanes(); aViewer->MoreDefinedPlanes(); aViewer->NextDefinedPlanes(), ++aNewPlaneId)
-  {
-    Handle(V3d_Plane) aPlaneV3d = aViewer->DefinedPlane();
-    if (aView->IsActivePlane (aPlaneV3d))
-    {
-      ++anActivePlanes;
-    }
-  }
-
-  if (argc == 1)
-  {
-    // just show info about existing planes
-    Standard_Integer aPlaneId = 1;
-    std::cout << "Active planes: " << anActivePlanes << " from maximal " << aView->View()->PlaneLimit() << "\n";
-    for (aViewer->InitDefinedPlanes(); aViewer->MoreDefinedPlanes(); aViewer->NextDefinedPlanes(), ++aPlaneId)
-    {
-      Handle(V3d_Plane) aPlaneV3d = aViewer->DefinedPlane();
-      aPlaneV3d->Plane (coeffA, coeffB, coeffC, coeffD);
-      gp_Pln aPlane (coeffA, coeffB, coeffC, coeffD);
-      const gp_Pnt& aLoc = aPlane.Location();
-      const gp_Dir& aNor = aPlane.Axis().Direction();
-      Standard_Boolean isActive = aView->IsActivePlane (aPlaneV3d);
-      std::cout << "Plane #" << aPlaneId
-        << " " << aLoc.X() << " " << aLoc.Y() << " " << aLoc.Z()
-        << " " << aNor.X() << " " << aNor.Y() << " " << aNor.Z()
-        << (isActive ? " on" : " off")
-        << (aPlaneV3d->IsDisplayed() ? ", displayed" : ", hidden")
-        << "\n";
-    }
-    if (aPlaneId == 1)
-    {
-      std::cout << "No defined clipping planes\n";
-    }
-    return 0;
-  }
-  else if (argc == 2 || argc == 3)
-  {
-    Standard_Integer aPlaneIdToOff = (argc == 3) ? atoi (argv[1]) : 1;
-    Standard_Boolean toIterateAll = (argc == 2);
-    TCollection_AsciiString isOnOffStr ((argc == 3) ? argv[2] : argv[1]);
-    isOnOffStr.LowerCase();
-    Standard_Integer aPlaneId = 1;
-    for (aViewer->InitDefinedPlanes(); aViewer->MoreDefinedPlanes(); aViewer->NextDefinedPlanes(), ++aPlaneId)
-    {
-      if (aPlaneIdToOff == aPlaneId || toIterateAll)
-      {
-        Handle(V3d_Plane) aPlaneV3d = aViewer->DefinedPlane();
-        if (isOnOffStr.Search ("off") >= 0)
-        {
-          aView->SetPlaneOff (aPlaneV3d);
-          std::cout << "Clipping plane #" << aPlaneId << " was disabled\n";
-        }
-        else if (isOnOffStr.Search ("on") >= 0)
-        {
-          // avoid z-fighting glitches
-          aPlaneV3d->Erase();
-          if (!aView->IsActivePlane (aPlaneV3d))
-          {
-            if (anActivePlanes < aView->View()->PlaneLimit())
-            {
-              aView->SetPlaneOn (aPlaneV3d);
-              std::cout << "Clipping plane #" << aPlaneId << " was enabled\n";
-            }
-            else
-            {
-              std::cout << "Maximal active planes limit exceeded (" << anActivePlanes << ")\n"
-                        << "You should disable or remove some existing plane to activate this one\n";
-            }
-          }
-          else
-          {
-            std::cout << "Clipping plane #" << aPlaneId << " was already enabled\n";
-          }
-        }
-        else if (isOnOffStr.Search ("del") >= 0 || isOnOffStr.Search ("rem") >= 0)
-        {
-          aPlaneV3d->Erase(); // not performed on destructor!!!
-          aView->SetPlaneOff (aPlaneV3d);
-          aViewer->DelPlane (aPlaneV3d);
-          std::cout << "Clipping plane #" << aPlaneId << " was removed\n";
-          if (toIterateAll)
-          {
-            for (aViewer->InitDefinedPlanes(); aViewer->MoreDefinedPlanes(); aViewer->InitDefinedPlanes(), ++aPlaneId)
-            {
-              aPlaneV3d = aViewer->DefinedPlane();
-              aPlaneV3d->Erase(); // not performed on destructor!!!
-              aView->SetPlaneOff (aPlaneV3d);
-              aViewer->DelPlane (aPlaneV3d);
-              std::cout << "Clipping plane #" << aPlaneId << " was removed\n";
-            }
-            break;
-          }
-          else
-          {
-            break;
-          }
-        }
-        else if (isOnOffStr.Search ("disp") >= 0 || isOnOffStr.Search ("show") >= 0)
-        {
-          // avoid z-fighting glitches
-          aView->SetPlaneOff (aPlaneV3d);
-          aPlaneV3d->Display (aView);
-          std::cout << "Clipping plane #" << aPlaneId << " was shown and disabled\n";
-        }
-        else if (isOnOffStr.Search ("hide") >= 0)
-        {
-          aPlaneV3d->Erase();
-          std::cout << "Clipping plane #" << aPlaneId << " was hidden\n";
-        }
-        else
-        {
-          std::cout << "Usage: " << argv[0] << " [x y z dx dy dz] [planeId {on/off/del/display/hide}]\n";
-          return 1;
-        }
-      }
-    }
-    if (aPlaneIdToOff >= aPlaneId && !toIterateAll)
-    {
-      std::cout << "Clipping plane with id " << aPlaneIdToOff << " not found!\n";
-      return 1;
-    }
-    aView->Update();
-    return 0;
-  }
-  else if (argc != 7)
-  {
-    std::cout << "Usage: " << argv[0] << " [x y z dx dy dz] [planeId {on/off/del/display/hide}]\n";
-    return 1;
-  }
-
-  Standard_Real aLocX = atof (argv[1]);
-  Standard_Real aLocY = atof (argv[2]);
-  Standard_Real aLocZ = atof (argv[3]);
-  Standard_Real aNormDX = atof (argv[4]);
-  Standard_Real aNormDY = atof (argv[5]);
-  Standard_Real aNormDZ = atof (argv[6]);
-
-  Handle(V3d_Plane) aPlaneV3d = new V3d_Plane();
-  gp_Pln aPlane (gp_Pnt (aLocX, aLocY, aLocZ), gp_Dir (aNormDX, aNormDY, aNormDZ));
-  aPlane.Coefficients (coeffA, coeffB, coeffC, coeffD);
-  aPlaneV3d->SetPlane(coeffA, coeffB, coeffC, coeffD);
-
-  aViewer->AddPlane (aPlaneV3d); // add to defined planes list
-  std::cout << "Added clipping plane #" << aNewPlaneId << "\n";
-  if (anActivePlanes < aView->View()->PlaneLimit())
-  {
-    aView->SetPlaneOn (aPlaneV3d); // add to enabled planes list
-    aView->Update();
-  }
-  else
-  {
-    std::cout << "Maximal active planes limit exceeded (" << anActivePlanes << ")\n"
-              << "You should disable or remove some existing plane to activate the new one\n";
-  }
-  return 0;
-}
-
 //=============================================================================
 //function : VComputeHLR
 //purpose  :
@@ -3096,9 +2914,9 @@ static int VComputeHLR (Draw_Interpretor& di,
   {
     gp_Dir anUp;
 
-    anEye.SetCoord (atof (argv[3]), atof (argv[4]), atof (argv[5]));
-    aDir.SetCoord (atof (argv[6]), atof (argv[7]), atof (argv[8]));
-    anUp.SetCoord (atof (argv[9]), atof (argv[10]), atof (argv[11]));
+    anEye.SetCoord (Draw::Atof (argv[3]), Draw::Atof (argv[4]), Draw::Atof (argv[5]));
+    aDir.SetCoord (Draw::Atof (argv[6]), Draw::Atof (argv[7]), Draw::Atof (argv[8]));
+    anUp.SetCoord (Draw::Atof (argv[9]), Draw::Atof (argv[10]), Draw::Atof (argv[11]));
     aProjAx.SetLocation (anEye);
     aProjAx.SetDirection (aDir);
     aProjAx.SetYDirection (anUp);
@@ -3173,9 +2991,11 @@ class MyPArrayObject : public AIS_InteractiveObject
 
 public:
 
-  MyPArrayObject (const Handle(Graphic3d_ArrayOfPrimitives) theArray)
+  MyPArrayObject (Handle(TColStd_HArray1OfAsciiString) theArrayDescription,
+                  Handle(Graphic3d_AspectMarker3d) theMarkerAspect = NULL)
   {
-    myArray = theArray;
+    myArrayDescription = theArrayDescription;
+    myMarkerAspect = theMarkerAspect;
   }
 
   DEFINE_STANDARD_RTTI(MyPArrayObject);
@@ -3186,158 +3006,90 @@ private:
                 const Handle(Prs3d_Presentation)& aPresentation,
                 const Standard_Integer aMode);
 
-  void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
-                         const Standard_Integer aMode) {};
+  void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+                         const Standard_Integer /*theMode*/);
+
+  bool CheckInputCommand (const TCollection_AsciiString theCommand,
+                          const Handle(TColStd_HArray1OfAsciiString) theArgsArray,
+                          Standard_Integer &theArgIndex,
+                          Standard_Integer theArgCount,
+                          Standard_Integer theMaxArgs);
 
 protected:
 
-  Handle(Graphic3d_ArrayOfPrimitives) myArray;
+  Handle(TColStd_HArray1OfAsciiString) myArrayDescription;
+  Handle(Graphic3d_AspectMarker3d) myMarkerAspect;
 
 };
 
 IMPLEMENT_STANDARD_HANDLE(MyPArrayObject, AIS_InteractiveObject)
 IMPLEMENT_STANDARD_RTTIEXT(MyPArrayObject, AIS_InteractiveObject)
 
-void MyPArrayObject::Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+void MyPArrayObject::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
                               const Handle(Prs3d_Presentation)& aPresentation,
-                              const Standard_Integer aMode)
-{
-  aPresentation->Clear();
-
-  Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation);
-  aGroup->BeginPrimitives ();
-  aGroup->AddPrimitiveArray (myArray);
-  aGroup->EndPrimitives ();
-}
-
-static bool CheckInputCommand (const TCollection_AsciiString theCommand,
-                               const char **theArgStr, int &theArgIndex,
-                               int theArgCount, int theMaxArgs)
-{
-  // check if there is more elements than expected
-  if (theArgIndex >= theMaxArgs)
-    return false;
-
-  TCollection_AsciiString aStrCommand(theArgStr[theArgIndex]);
-  aStrCommand.LowerCase();
-  if (aStrCommand.Search(theCommand) != 1 ||
-      theArgIndex + (theArgCount - 1) >= theMaxArgs)
-    return false;
-
-  // go to the first data element
-  theArgIndex++;
-
-  // check data if it can be converted to numeric
-  for (int aElement = 0; aElement < theArgCount; aElement++, theArgIndex++)
-  {
-    aStrCommand = theArgStr[theArgIndex];
-    if (!aStrCommand.IsRealValue())
-      return false;
-  }
-
-  return true;
-}
-
-//=============================================================================
-//function : VDrawPArray
-//purpose  : Draws primitives array from list of vertexes, bounds, edges
-//=============================================================================
-
-static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
+                              const Standard_Integer /*aMode*/)
 {
-  Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
-  if (aContextAIS.IsNull())
-  {
-    di << "Call vinit before!\n";
-    return 1;
-  }
-  else if (argc < 3)
-  {
-    di << "Use: " << argv[0] << " Name TypeOfArray"
-       << " [vertex] ... [bounds] ... [edges]\n"
-       << "  TypeOfArray={ points | segments | polylines | triangles |\n"
-       << "                trianglefans | trianglestrips | quads |\n"
-       << "                quadstrips | polygons }\n"
-       << "  vertex={ 'v' x y z [normal={ 'n' nx ny nz }] [color={ 'c' r g b }]"
-       << " [texel={ 't' tx ty }] } \n"
-       << "  bounds={ 'b' verticies_count [color={ 'c' r g b }] }\n"
-       << "  edges={ 'e' vertex_id [hidden_edge={'h'}] }\n";
-    return 1;
-  }
-
-  // read the arguments
-  Standard_Integer aArgIndex = 1;
-  TCollection_AsciiString aName (argv[aArgIndex++]);
-  TCollection_AsciiString anArrayType (argv[aArgIndex++]);
-  const Standard_Integer anArgsFrom = aArgIndex;
 
-  // parse number of verticies, bounds, edges
+  // Parsing array description
   Standard_Integer aVertexNum = 0, aBoundNum = 0, aEdgeNum = 0;
   Standard_Boolean hasVColors, hasBColors, hasNormals, hasInfos, hasTexels;
   hasVColors = hasNormals = hasBColors = hasInfos = hasTexels = Standard_False;
 
+  Standard_Integer anArgIndex = 0;
+  Standard_Integer anArgsCount = myArrayDescription->Length();
+  TCollection_AsciiString anArrayType = myArrayDescription->Value (anArgIndex++);
+
   TCollection_AsciiString aCommand;
-  while (aArgIndex < argc)
+  while (anArgIndex < anArgsCount)
   {
-    aCommand = argv[aArgIndex];
+    aCommand = myArrayDescription->Value (anArgIndex);
     aCommand.LowerCase();
-    if (!aCommand.IsAscii())
-    {
-      di << "Unexpected argument: #" << aArgIndex - 1 << " , "
-         << "should be an array element: 'v', 'b', 'e' \n";
-      break;
-    }
 
     // vertex command
-    if (CheckInputCommand ("v", argv, aArgIndex, 3, argc))
+    if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, anArgsCount))
     {
       // vertex has a normal or normal with color or texel
-      if (CheckInputCommand ("n", argv, aArgIndex, 3, argc))
+      if (CheckInputCommand ("n", myArrayDescription, anArgIndex, 3, anArgsCount))
         hasNormals = Standard_True;
 
       // vertex has a color
-      if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+      if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
         hasVColors = Standard_True;
 
       // vertex has a texel
-      if (CheckInputCommand ("t", argv, aArgIndex, 2, argc))
+      if (CheckInputCommand ("t", myArrayDescription, anArgIndex, 2, anArgsCount))
         hasTexels = Standard_True;
 
       aVertexNum++;
     }
     // bound command
-    else if (CheckInputCommand ("b", argv, aArgIndex, 1, argc))
+    else if (CheckInputCommand ("b", myArrayDescription, anArgIndex, 1, anArgsCount))
     {
       // bound has color
-      if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+      if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
         hasBColors = Standard_True;
 
       aBoundNum++;
     }
     // edge command
-    else if (CheckInputCommand ("e", argv, aArgIndex, 1, argc))
+    else if (CheckInputCommand ("e", myArrayDescription, anArgIndex, 1, anArgsCount))
     {
       // edge has a hide flag
-      if (CheckInputCommand ("h", argv, aArgIndex, 0, argc))
+      if (CheckInputCommand ("h", myArrayDescription, anArgIndex, 0, anArgsCount))
         hasInfos = Standard_True;
 
       aEdgeNum++;
     }
     // unknown command
     else
-      aArgIndex++;
-  }
-
-  if (aVertexNum == 0)
-  {
-    di << "You should pass any verticies in the list of array elements\n";
-    return 1;
+      anArgIndex++;
   }
 
-  // create an array of primitives by types
   Handle(Graphic3d_ArrayOfPrimitives) anArray;
   if (anArrayType == "points")
+  {
     anArray = new Graphic3d_ArrayOfPoints (aVertexNum);
+  }
   else if (anArrayType == "segments")
     anArray = new Graphic3d_ArrayOfSegments (aVertexNum, aEdgeNum, hasVColors);
   else if (anArrayType == "polylines")
@@ -3366,122 +3118,260 @@ static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char*
     anArray = new Graphic3d_ArrayOfPolygons (aVertexNum, aBoundNum, aEdgeNum,
                                              hasNormals, hasVColors, hasBColors,
                                              hasTexels, hasInfos);
-  else
-  {
-    di << "Unexpected type of primitiives array\n";
-    return 1;
-  }
 
-  // parse an array of primitives
-  aArgIndex = anArgsFrom;
-  while (aArgIndex < argc)
+  anArgIndex = 1;
+  while (anArgIndex < anArgsCount)
   {
-    aCommand = argv[aArgIndex];
+    aCommand = myArrayDescription->Value (anArgIndex);
     aCommand.LowerCase();
     if (!aCommand.IsAscii())
       break;
 
     // vertex command
-    if (CheckInputCommand ("v", argv, aArgIndex, 3, argc))
+    if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, anArgsCount))
     {
-      anArray->AddVertex (atof (argv[aArgIndex - 3]),
-                          atof (argv[aArgIndex - 2]),
-                          atof (argv[aArgIndex - 1]));
+      anArray->AddVertex (myArrayDescription->Value (anArgIndex - 3).RealValue(),
+                          myArrayDescription->Value (anArgIndex - 2).RealValue(),
+                          myArrayDescription->Value (anArgIndex - 1).RealValue());
 
       // vertex has a normal or normal with color or texel
-      if (CheckInputCommand ("n", argv, aArgIndex, 3, argc))
+      if (CheckInputCommand ("n", myArrayDescription, anArgIndex, 3, anArgsCount))
         anArray->SetVertexNormal (anArray->VertexNumber (),
-                                  atof (argv[aArgIndex - 3]),
-                                  atof (argv[aArgIndex - 2]),
-                                  atof (argv[aArgIndex - 1]));
+                                  myArrayDescription->Value (anArgIndex - 3).RealValue(),
+                                  myArrayDescription->Value (anArgIndex - 2).RealValue(),
+                                  myArrayDescription->Value (anArgIndex - 1).RealValue());
       
-      if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+      if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
         anArray->SetVertexColor (anArray->VertexNumber (),
-                                 atof (argv[aArgIndex - 3]),
-                                 atof (argv[aArgIndex - 2]),
-                                 atof (argv[aArgIndex - 1]));
+                                 myArrayDescription->Value (anArgIndex - 3).RealValue(),
+                                 myArrayDescription->Value (anArgIndex - 2).RealValue(),
+                                 myArrayDescription->Value (anArgIndex - 1).RealValue());
       
-      if (CheckInputCommand ("t", argv, aArgIndex, 2, argc))
+      if (CheckInputCommand ("t", myArrayDescription, anArgIndex, 2, anArgsCount))
         anArray->SetVertexTexel (anArray->VertexNumber (),
-                                 atof (argv[aArgIndex - 2]),
-                                 atof (argv[aArgIndex - 1]));
+                                 myArrayDescription->Value (anArgIndex - 2).RealValue(),
+                                 myArrayDescription->Value (anArgIndex - 1).RealValue());
     }
     // bounds command
-    else if (CheckInputCommand ("b", argv, aArgIndex, 1, argc))
+    else if (CheckInputCommand ("b", myArrayDescription, anArgIndex, 1, anArgsCount))
     {
-      Standard_Integer aVertCount = atoi (argv[aArgIndex - 1]);
+      Standard_Integer aVertCount = myArrayDescription->Value (anArgIndex - 1).IntegerValue();
 
-      if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+      if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
         anArray->AddBound (aVertCount,
-                           atof (argv[aArgIndex - 3]),
-                           atof (argv[aArgIndex - 2]),
-                           atof (argv[aArgIndex - 1]));
+                           myArrayDescription->Value (anArgIndex - 3).RealValue(),
+                           myArrayDescription->Value (anArgIndex - 2).RealValue(),
+                           myArrayDescription->Value (anArgIndex - 1).RealValue());
 
       else
         anArray->AddBound (aVertCount);
     }
     // edge command
-    else if (CheckInputCommand ("e", argv, aArgIndex, 1, argc))
+    else if (CheckInputCommand ("e", myArrayDescription, anArgIndex, 1, anArgsCount))
     {
-      Standard_Integer aVertIndex = atoi (argv[aArgIndex - 1]);
+      Standard_Integer aVertIndex = myArrayDescription->Value (anArgIndex - 1).IntegerValue();
 
       // edge has/hasn't hide flag
-      if (CheckInputCommand ("h", argv, aArgIndex, 0, argc))
+      if (CheckInputCommand ("h", myArrayDescription, anArgIndex, 0, anArgsCount))
         anArray->AddEdge (aVertIndex, Standard_False);
       else
         anArray->AddEdge (aVertIndex, Standard_True);
     }
     // unknown command
     else
-      aArgIndex++;
+      anArgIndex++;
   }
 
-  // create primitives array object
-  Handle (MyPArrayObject) aPObject = new MyPArrayObject (anArray);
+  aPresentation->Clear();
+  if (!myMarkerAspect.IsNull())
+  {
+    Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
+  }
+  Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (anArray);
+}
 
-  // register the object in map
-  VDisplayAISObject (aName, aPObject);
+void MyPArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+                                       const Standard_Integer /*theMode*/)
+{
+  Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this);
 
-  return 0;
+  Standard_Integer anArgIndex = 1;
+  while (anArgIndex < myArrayDescription->Length())
+  {
+    if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, myArrayDescription->Length()))
+    {
+      gp_Pnt aPoint (myArrayDescription->Value (anArgIndex - 3).RealValue(),
+                     myArrayDescription->Value (anArgIndex - 2).RealValue(),
+                     myArrayDescription->Value (anArgIndex - 1).RealValue());
+      Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, aPoint);
+      theSelection->Add (aSensetivePoint);
+    }
+    else
+    {
+      anArgIndex++;
+    }
+  }
 }
 
-//=======================================================================
-//function : VSetLocation
-//purpose  : Change location of AIS interactive object
-//=======================================================================
+bool MyPArrayObject::CheckInputCommand (const TCollection_AsciiString theCommand,
+                                       const Handle(TColStd_HArray1OfAsciiString) theArgsArray,
+                                       Standard_Integer &theArgIndex,
+                                       Standard_Integer theArgCount,
+                                       Standard_Integer theMaxArgs)
+{
+  // check if there is more elements than expected
+  if (theArgIndex >= theMaxArgs)
+    return false;
 
-static Standard_Integer VSetLocation (Draw_Interpretor& di,
-                                      Standard_Integer argc,
-                                      const char ** argv)
+  TCollection_AsciiString aStrCommand = theArgsArray->Value (theArgIndex);
+  aStrCommand.LowerCase();
+  if (aStrCommand.Search(theCommand) != 1 ||
+      theArgIndex + (theArgCount - 1) >= theMaxArgs)
+    return false;
+
+  // go to the first data element
+  theArgIndex++;
+
+  // check data if it can be converted to numeric
+  for (int aElement = 0; aElement < theArgCount; aElement++, theArgIndex++)
+  {
+    aStrCommand = theArgsArray->Value (theArgIndex);
+    if (!aStrCommand.IsRealValue())
+      return false;
+  }
+
+  return true;
+}
+
+//=============================================================================
+//function : VDrawPArray
+//purpose  : Draws primitives array from list of vertexes, bounds, edges
+//=============================================================================
+
+static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
 {
-  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
-  if (aContext.IsNull())
+  Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
+  if (aContextAIS.IsNull())
   {
-    di << argv[0] << "ERROR : use 'vinit' command before " << "\n";
+    di << "Call vinit before!\n";
     return 1;
   }
-
-  if (argc != 5)
+  else if (argc < 3)
   {
-    di << "ERROR : Usage : " << argv[0] << " name x y z; new location" << "\n";
+    di << "Use: " << argv[0] << " Name TypeOfArray"
+       << " [vertex] ... [bounds] ... [edges]\n"
+       << "  TypeOfArray={ points | segments | polylines | triangles |\n"
+       << "                trianglefans | trianglestrips | quads |\n"
+       << "                quadstrips | polygons }\n"
+       << "  vertex={ 'v' x y z [normal={ 'n' nx ny nz }] [color={ 'c' r g b }]"
+       << " [texel={ 't' tx ty }] } \n"
+       << "  bounds={ 'b' verticies_count [color={ 'c' r g b }] }\n"
+       << "  edges={ 'e' vertex_id [hidden_edge={'h'}] }\n";
     return 1;
   }
 
-  TCollection_AsciiString aName (argv[1]);
-  Standard_Real aX = atof (argv[2]);
-  Standard_Real aY = atof (argv[3]);
-  Standard_Real aZ = atof (argv[4]);
+  // read the arguments
+  Standard_Integer aArgIndex = 1;
+  TCollection_AsciiString aName (argv[aArgIndex++]);
+  TCollection_AsciiString anArrayType (argv[aArgIndex++]);
 
-  // find object
-  ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
-  Handle(AIS_InteractiveObject) anIObj;
-  if (!aMap.IsBound2 (aName))
+  Standard_Boolean hasVertex = Standard_False;
+
+  Handle(TColStd_HArray1OfAsciiString) anArgsArray = new TColStd_HArray1OfAsciiString (0, argc - 2);
+  anArgsArray->SetValue (0, anArrayType);
+
+  if (anArrayType != "points"         &&
+      anArrayType != "segments"       &&
+      anArrayType != "polylines"      &&
+      anArrayType != "triangles"      &&
+      anArrayType != "trianglefans"   &&
+      anArrayType != "trianglestrips" &&
+      anArrayType != "quads"          &&
+      anArrayType != "quadstrips"     &&
+      anArrayType != "polygons")
   {
-    di << "Use 'vdisplay' before" << "\n";
+    di << "Unexpected type of primitives array\n";
     return 1;
   }
-  else
-  {
+
+  TCollection_AsciiString aCommand;
+  for (Standard_Integer anArgIndex = 3; anArgIndex < argc; anArgIndex++)
+  {
+    aCommand = argv[anArgIndex];
+    aCommand.LowerCase();
+    if (!aCommand.IsAscii())
+    {
+      di << "Unexpected argument: #" << aArgIndex - 1 << " , "
+         << "should be an array element: 'v', 'b', 'e' \n";
+      break;
+    }
+
+    if (aCommand == "v")
+    {
+      hasVertex = Standard_True;
+    }
+
+    anArgsArray->SetValue (anArgIndex - 2, aCommand);
+  }
+
+  if (!hasVertex)
+  {
+    di << "You should pass any verticies in the list of array elements\n";
+    return 1;
+  }
+
+  Handle(Graphic3d_AspectMarker3d)    anAspPoints;
+  if (anArrayType == "points")
+  {
+    anAspPoints = new Graphic3d_AspectMarker3d (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0f);
+  }
+
+  // create primitives array object
+  Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArgsArray, anAspPoints);
+
+  // register the object in map
+  VDisplayAISObject (aName, aPObject);
+
+  return 0;
+}
+
+//=======================================================================
+//function : VSetLocation
+//purpose  : Change location of AIS interactive object
+//=======================================================================
+
+static Standard_Integer VSetLocation (Draw_Interpretor& di,
+                                      Standard_Integer argc,
+                                      const char ** argv)
+{
+  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+  if (aContext.IsNull())
+  {
+    di << argv[0] << "ERROR : use 'vinit' command before " << "\n";
+    return 1;
+  }
+
+  if (argc != 5)
+  {
+    di << "ERROR : Usage : " << argv[0] << " name x y z; new location" << "\n";
+    return 1;
+  }
+
+  TCollection_AsciiString aName (argv[1]);
+  Standard_Real aX = Draw::Atof (argv[2]);
+  Standard_Real aY = Draw::Atof (argv[3]);
+  Standard_Real aZ = Draw::Atof (argv[4]);
+
+  // find object
+  ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
+  Handle(AIS_InteractiveObject) anIObj;
+  if (!aMap.IsBound2 (aName))
+  {
+    di << "Use 'vdisplay' before" << "\n";
+    return 1;
+  }
+  else
+  {
     anIObj = Handle(AIS_InteractiveObject)::DownCast (aMap.Find2 (aName));
 
     // not an AIS_InteractiveObject
@@ -3504,50 +3394,138 @@ static Standard_Integer VSetLocation (Draw_Interpretor& di,
 //===============================================================================================
 //function : VConnect
 //purpose  : Creates and displays AIS_ConnectedInteractive object from input object and location 
-//Draw arg : vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
+//Draw arg : vconnect name Xo Yo Zo Xu Xv Xw Zu Zv Zw object1 object2 ... [color=NAME]
 //===============================================================================================
 
-static Standard_Integer VConnect(Draw_Interpretor& di
+static Standard_Integer VConnect(Draw_Interpretor& /*di*/
                                  Standard_Integer argc, 
                                  const char ** argv) 
 {
-  // Check argumnets 
-  if(argc != 12)
+  // Check the viewer
+  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+  if (aContext.IsNull())
   {
-    std::cout << "vconnect error: expect 11 argumnets\n"; 
+    std::cout << "vconnect error : call vinit before\n";
     return 1; // TCL_ERROR
   }
-  // Get values 
-  TCollection_AsciiString aName(argv[1]); 
-  TCollection_AsciiString anOriginObjectName(argv[2]); 
-  if(aName.IsEqual(anOriginObjectName))
+  // Check argumnets 
+  if (argc < 12)
   {
-    std::cout << "vconnect error: equal names for connected objects\n"; 
+    std::cout << "vconnect error: expect at least 11 arguments\n";
     return 1; // TCL_ERROR
   }
-  // Check if the origin shape is not null
+
+  // Get values
+  Standard_Integer anArgIter = 1;
+  TCollection_AsciiString aName (argv[anArgIter++]);
   Handle(AIS_InteractiveObject) anOriginObject;
-  if(GetMapOfAIS().IsBound2(anOriginObjectName))
+  TCollection_AsciiString aColorString (argv[argc-1]);
+  Standard_CString aColorName = "";
+  Standard_Boolean hasColor = Standard_False;
+  if (aColorString.Search ("color=") != -1)
+  {
+    hasColor = Standard_True;
+    aColorString.Remove (1, 6);
+    aColorName = aColorString.ToCString();
+  }
+  Handle(AIS_InteractiveObject) anObject;
+
+  // AIS_ConnectedInteractive
+  if (argc == 12 || (argc == 13 && hasColor))
+  {
+    TCollection_AsciiString anOriginObjectName(argv[11]);
+    if (aName.IsEqual (anOriginObjectName))
+    {
+      std::cout << "vconnect error: equal names for connected objects\n"; 
+      return 1; // TCL_ERROR
+    }
+    if (GetMapOfAIS().IsBound2 (anOriginObjectName))
+    {
+      Handle(Standard_Transient) anObj = GetMapOfAIS().Find2 (anOriginObjectName);
+      anOriginObject = Handle(AIS_InteractiveObject)::DownCast(anObj);
+      if (anOriginObject.IsNull())
+      {
+        std::cout << "Object " << anOriginObjectName << " is used for non AIS viewer\n";
+        return 1; // TCL_ERROR
+      }
+    }
+    else
+    {
+      Standard_CString aName = anOriginObjectName.ToCString();
+      TopoDS_Shape aTDShape = DBRep::Get (aName);
+      if (aTDShape.IsNull())
+      {
+        std::cout << "vconnect error: object " << anOriginObjectName << " doesn't exist\n";
+        return 1; // TCL_ERROR
+      }
+      anOriginObject = new AIS_Shape (aTDShape);
+      if (hasColor)
+      {
+        anOriginObject->SetColor (ViewerTest::GetColorFromName (aColorName));
+      }
+    }
+  }
+  // AIS_MultipleConnectedInteractive
+  else
   {
-    Handle(Standard_Transient) anObj = GetMapOfAIS().Find2(anOriginObjectName);
-    anOriginObject = Handle(AIS_InteractiveObject)::DownCast(anObj);
-    if(anOriginObject.IsNull())
+    const Standard_Integer aNbShapes = hasColor ? (argc - 1) : argc;
+    for (Standard_Integer i = 11; i < aNbShapes; ++i)
     {
-      std::cout << "Object " << anOriginObjectName << " is used for non AIS viewer\n!";
+      TCollection_AsciiString anOriginObjectName (argv[i]);
+      if (aName.IsEqual (anOriginObjectName))
+      {
+        std::cout << "vconnect error: equal names for connected objects\n";
+        continue;
+      }
+      if (GetMapOfAIS().IsBound2 (anOriginObjectName))
+      {
+        Handle(Standard_Transient) anObj = GetMapOfAIS().Find2 (anOriginObjectName);
+        anObject = Handle(AIS_InteractiveObject)::DownCast(anObj);
+        if (anObject.IsNull())
+        {
+          std::cout << "Object " << anOriginObjectName << " is used for non AIS viewer\n";
+          continue;
+        }
+      }
+      else
+      {
+        Standard_CString aName = anOriginObjectName.ToCString();
+        TopoDS_Shape aTDShape = DBRep::Get (aName);
+        if (aTDShape.IsNull())
+        {
+          std::cout << "vconnect error: object " << anOriginObjectName << " doesn't exist\n";
+          continue;
+        }
+        anObject = new AIS_Shape (aTDShape);
+        anObject->SetColor (ViewerTest::GetColorFromName (aColorName));
+      }
+      if (anOriginObject.IsNull())
+      {
+        anOriginObject = new AIS_MultipleConnectedInteractive();
+        Handle(AIS_MultipleConnectedInteractive)::DownCast(anOriginObject)->Connect (anObject);
+      }
+      else
+      {
+        Handle(AIS_MultipleConnectedInteractive)::DownCast(anOriginObject)->Connect (anObject);
+      }
+    }
+    if (anOriginObject.IsNull())
+    {
+      std::cout << "vconect error : can't connect input objects\n";
       return 1; // TCL_ERROR
     }
   }
-  
+
   // Get location data
-  Standard_Real aXo = atof(argv[3]);
-  Standard_Real aYo = atof(argv[4]);
-  Standard_Real aZo = atof(argv[5]);
-  Standard_Real aXu = atof(argv[6]);
-  Standard_Real aXv = atof(argv[7]);
-  Standard_Real aXw = atof(argv[8]);
-  Standard_Real aZu = atof(argv[9]);
-  Standard_Real aZv = atof(argv[10]);
-  Standard_Real aZw = atof(argv[11]);
+  Standard_Real aXo = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aYo = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZo = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aXu = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aXv = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aXw = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZu = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZv = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZw = Draw::Atof (argv[anArgIter++]);
 
   // Create transformation
   gp_Pnt aPoint(aXo, aYo, aZo);
@@ -3563,8 +3541,16 @@ static Standard_Integer VConnect(Draw_Interpretor& di,
   TopLoc_Location aLocation(aTrsf);
 
   // Create connected object
-  Handle(AIS_ConnectedInteractive) aConnectedObject = new AIS_ConnectedInteractive();
-  aConnectedObject->Connect(anOriginObject, aLocation);
+  Handle(AIS_ConnectedInteractive) aConnected = new AIS_ConnectedInteractive();
+  Handle(AIS_MultipleConnectedInteractive) anOrigin = Handle(AIS_MultipleConnectedInteractive)::DownCast(anOriginObject);
+  if (anOrigin.IsNull())
+  {
+    aConnected->Connect (anOriginObject, aLocation);
+  }
+  else
+  {
+    aConnected->Connect (anOrigin, aLocation);
+  }
 
   // Check if there is another object with given name
   // and remove it from context
@@ -3576,11 +3562,11 @@ static Standard_Integer VConnect(Draw_Interpretor& di,
     GetMapOfAIS().UnBind2(aName);
   }
 
-  // Bind connected object to its name 
-  GetMapOfAIS().Bind(aConnectedObject, aName); 
+  // Bind connected object to its name
+  GetMapOfAIS().Bind (aConnected, aName);
 
   // Display connected object
-  TheAISContext()->Display(aConnectedObject);
+  TheAISContext()->Display (aConnected);
 
   return 0;
 }
@@ -3588,50 +3574,141 @@ static Standard_Integer VConnect(Draw_Interpretor& di,
 //===============================================================================================
 //function : VConnectShape
 //purpose  : Creates and displays AIS_ConnectedShape from input shape and location 
-//Draw arg : vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
+//Draw arg : vconnectsh name Xo Yo Zo Xu Xv Xw Zu Zv Zw shape1 shape2 ... [color=NAME]
 //===============================================================================================
 
-static Standard_Integer VConnectShape(Draw_Interpretor& di
+static Standard_Integer VConnectShape(Draw_Interpretor& /*di*/
                                       Standard_Integer argc, 
                                       const char ** argv) 
 {
-  // Check argumnets 
-  if(argc != 12)
+  // Check the viewer
+  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+  if (aContext.IsNull())
   {
-    std::cout << "vconnectsh error: expect 11 argumnets\n"; 
+    std::cout << "vconnectsh error : call vinit before\n";
     return 1; // TCL_ERROR
   }
-  // Get values 
-  TCollection_AsciiString aName(argv[1]); 
-  TCollection_AsciiString anOriginShapeName(argv[2]); 
-  if(aName.IsEqual(anOriginShapeName))
+  // Check argumnets
+  if (argc < 12)
   {
-    std::cout << "vconnectsh error: equal names for connected shapes\n"; 
+    std::cout << "vconnectsh error: expect at least 11 arguments\n";
     return 1; // TCL_ERROR
   }
-  // Check if the origin shape is not null
+
+  // Get values
+  Standard_Integer anArgIter = 1;
+  TCollection_AsciiString aName (argv[anArgIter++]);
   Handle(AIS_InteractiveObject) anOriginShape;
-  if(GetMapOfAIS().IsBound2(anOriginShapeName))
+  TCollection_AsciiString aColorString(argv[argc-1]);
+  Standard_CString aColorName = "";
+  Standard_Boolean hasColor = Standard_False;
+  if (aColorString.Search ("color=") != -1)
+  {
+    hasColor = Standard_True;
+    aColorString.Remove (1, 6);
+    aColorName = aColorString.ToCString();
+  }
+  Handle(AIS_Shape) aShape;
+
+  // AIS_ConnectedShape
+  if (argc == 12 || (argc == 13 && hasColor))
+  {
+    TCollection_AsciiString anOriginShapeName (argv[11]);
+    if (aName.IsEqual (anOriginShapeName))
+    {
+      std::cout << "vconnectsh error: equal names for connected shapes\n";
+      return 1; // TCL_ERROR
+    }
+    if (GetMapOfAIS().IsBound2 (anOriginShapeName))
+    {
+      Handle(Standard_Transient) anObj = GetMapOfAIS().Find2 (anOriginShapeName);
+      anOriginShape = Handle(AIS_Shape)::DownCast(anObj);
+      if (anOriginShape.IsNull())
+      {
+        std::cout << "Shape " << anOriginShapeName << " is used for non AIS viewer\n!";
+        return 1; // TCL_ERROR
+      }
+    }
+    else
+    {
+      Standard_CString aName = anOriginShapeName.ToCString();
+      TopoDS_Shape aTDShape = DBRep::Get (aName);
+      if (aTDShape.IsNull())
+      {
+        std::cout << "vconnectsh error: object " << anOriginShapeName << " doesn't exist\n";
+        return 1; // TCL_ERROR
+      }
+      anOriginShape = new AIS_Shape (aTDShape);
+      if (hasColor)
+      {
+        anOriginShape->SetColor (ViewerTest::GetColorFromName (aColorName));
+      }
+    }
+  }
+  // AIS_MultipleConnectedShape
+  else
   {
-    Handle(Standard_Transient) anObj = GetMapOfAIS().Find2(anOriginShapeName);
-    anOriginShape = Handle(AIS_InteractiveObject)::DownCast(anObj);
-    if(anOriginShape.IsNull())
+    const Standard_Integer aNbShapes = hasColor ? (argc - 1) : argc;
+    for (Standard_Integer i = 11; i < aNbShapes; ++i)
+    {
+      TCollection_AsciiString anOriginShapeName (argv[i]);
+      if (aName.IsEqual (anOriginShapeName))
+      {
+        std::cout << "vconnectsh error: equal names for connected shapes\n";
+        continue;
+      }
+      if (GetMapOfAIS().IsBound2 (anOriginShapeName))
+      {
+        Handle(Standard_Transient) anObj = GetMapOfAIS().Find2 (anOriginShapeName);
+        aShape = Handle(AIS_Shape)::DownCast(anObj);
+        if (aShape.IsNull())
+        {
+          std::cout << "Shape " << anOriginShapeName << " is used for non AIS viewer\n";
+          continue;
+        }
+      }
+      else
+      {
+        Standard_CString aName = anOriginShapeName.ToCString();
+        TopoDS_Shape aTDShape = DBRep::Get (aName);
+        if (aTDShape.IsNull())
+        {
+          std::cout << "vconnectsh error: object " << anOriginShapeName << " doesn't exist\n";
+          continue;
+        }
+        aShape = new AIS_Shape (aTDShape);
+        if (hasColor)
+        {
+          aShape->SetColor (ViewerTest::GetColorFromName (aColorName));
+        }
+      }
+      if (anOriginShape.IsNull())
+      {
+        anOriginShape = new AIS_MultipleConnectedShape (aShape->Shape());
+        Handle(AIS_MultipleConnectedShape)::DownCast(anOriginShape)->Connect (aShape);
+      }
+      else
+      {
+        Handle(AIS_MultipleConnectedShape)::DownCast(anOriginShape)->Connect (aShape);
+      }
+    }
+    if (anOriginShape.IsNull())
     {
-      std::cout << "Shape " << anOriginShapeName << " is used for non AIS viewer\n!";
+      std::cout << "vconectsh error : can't connect input objects\n";
       return 1; // TCL_ERROR
     }
   }
 
   // Get location data  
-  Standard_Real aXo = atof(argv[3]);
-  Standard_Real aYo = atof(argv[4]);
-  Standard_Real aZo = atof(argv[5]);
-  Standard_Real aXu = atof(argv[6]);
-  Standard_Real aXv = atof(argv[7]);
-  Standard_Real aXw = atof(argv[8]);
-  Standard_Real aZu = atof(argv[9]);
-  Standard_Real aZv = atof(argv[10]);
-  Standard_Real aZw = atof(argv[11]);
+  Standard_Real aXo = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aYo = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZo = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aXu = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aXv = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aXw = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZu = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZv = Draw::Atof (argv[anArgIter++]);
+  Standard_Real aZw = Draw::Atof (argv[anArgIter++]);
 
   // Create transformation
   gp_Pnt aPoint(aXo, aYo, aZo);
@@ -3647,9 +3724,18 @@ static Standard_Integer VConnectShape(Draw_Interpretor& di,
   TopLoc_Location aLocation(aTrsf);
 
   // Create connected shape
-  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(anOriginShape);
-  Handle(AIS_ConnectedShape) aConnectedShape = new AIS_ConnectedShape(aShape);
-  aConnectedShape->Connect(anOriginShape, aLocation);
+  Handle(AIS_ConnectedInteractive) aConnected;
+  Handle(AIS_Shape) anOrigin = Handle(AIS_Shape)::DownCast(anOriginShape);
+  if (!anOrigin.IsNull())
+  {
+    aConnected = new AIS_ConnectedShape (anOrigin);
+    aConnected->Connect (anOrigin, aLocation);
+  }
+  else
+  {
+    aConnected = new AIS_ConnectedInteractive();
+    aConnected->Connect (anOriginShape, aLocation);
+  }
 
   // Check if there is another object with given name
   // and remove it from context
@@ -3661,11 +3747,11 @@ static Standard_Integer VConnectShape(Draw_Interpretor& di,
     GetMapOfAIS().UnBind2(aName);
   }
 
-  // Bind connected shape to its name 
-  GetMapOfAIS().Bind(aConnectedShape, aName); 
+  // Bind connected shape to its name
+  GetMapOfAIS().Bind (aConnected, aName);
 
   // Display connected shape
-  TheAISContext()->Display(aConnectedShape);
+  TheAISContext()->Display (aConnected);
 
   return 0;
 }
@@ -3693,7 +3779,7 @@ Standard_Boolean InList(Handle(AIS_InteractiveContext) theAISContext,
   return Standard_False;
 }
 
-static Standard_Integer VSetSelectionMode(Draw_Interpretor& di
+static Standard_Integer VSetSelectionMode(Draw_Interpretor& /*di*/
                                           Standard_Integer argc, 
                                           const char ** argv)
 {
@@ -3708,7 +3794,8 @@ static Standard_Integer VSetSelectionMode(Draw_Interpretor& di,
   // Check the arguments 
   if(argc != 3 && argc != 4)
   {
-    std::cout << "vselmode error : expects at least 2 arguments\n"; 
+    std::cout << "vselmode error : expects at least 2 arguments.\n"
+      << "Type help "<< argv[0] <<" for more information."; 
     return 1; // TCL_ERROR
   }
 
@@ -3718,8 +3805,8 @@ static Standard_Integer VSetSelectionMode(Draw_Interpretor& di,
   if(argc == 3)
   {
     // Get arguments 
-    Standard_Integer aMode = atoi(argv[1]);
-    Standard_Boolean isTurnOn = atoi(argv[2]); 
+    Standard_Integer aMode = Draw::Atoi(argv[1]);
+    Standard_Boolean isTurnOn = Draw::Atoi(argv[2]); 
 
     // Get all displayed objects
     AIS_ListOfInteractive anObjList;
@@ -3773,8 +3860,8 @@ static Standard_Integer VSetSelectionMode(Draw_Interpretor& di,
   else
   {
     // Get argumnets 
-    Standard_Integer aMode = atoi(argv[2]);
-    Standard_Boolean isTurnOn = atoi(argv[3]);
+    Standard_Integer aMode = Draw::Atoi(argv[2]);
+    Standard_Boolean isTurnOn = Draw::Atoi(argv[3]);
     TCollection_AsciiString aName(argv[1]); 
 
     // Check if there is an object with given name in context
@@ -3860,9 +3947,9 @@ Triangle::Triangle (const gp_Pnt& theP1,
   myPoint3 = theP3;
 }
 
-void Triangle::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+void Triangle::Compute(const Handle(PrsMgr_PresentationManager3d)& /*thePresentationManager*/,
                        const Handle(Prs3d_Presentation)& thePresentation,
-                       const Standard_Integer theMode)
+                       const Standard_Integer /*theMode*/)
 {
   thePresentation->Clear();
 
@@ -3888,7 +3975,7 @@ void Triangle::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentati
 }
 
 void Triangle::ComputeSelection(const Handle(SelectMgr_Selection)& theSelection, 
-                                const Standard_Integer theMode)
+                                const Standard_Integer /*theMode*/)
 {
   Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner(this);
   Handle(Select3D_SensitiveTriangle) aSensTriangle = 
@@ -3927,16 +4014,16 @@ Standard_Boolean IsPoint (const TCollection_AsciiString& theName,
 Standard_Boolean IsMatch (const Handle(Geom_CartesianPoint)& thePoint1,
                           const Handle(Geom_CartesianPoint)& thePoint2)
 {
-  if(abs(thePoint1->X()-thePoint2->X()) <= Precision::Confusion() &&
-     abs(thePoint1->Y()-thePoint2->Y()) <= Precision::Confusion() &&
-     abs(thePoint1->Z()-thePoint2->Z()) <= Precision::Confusion())
+  if(Abs(thePoint1->X()-thePoint2->X()) <= Precision::Confusion() &&
+     Abs(thePoint1->Y()-thePoint2->Y()) <= Precision::Confusion() &&
+     Abs(thePoint1->Z()-thePoint2->Z()) <= Precision::Confusion())
   {
     return Standard_True;
   }
   return Standard_False;
 }
 
-static Standard_Integer VTriangle (Draw_Interpretor& di,
+static Standard_Integer VTriangle (Draw_Interpretor& /*di*/,
                                    Standard_Integer argc,
                                    const char ** argv)
 {
@@ -4049,9 +4136,9 @@ SegmentObject::SegmentObject (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2)
   myPoint2 = thePnt2;
 }
 
-void SegmentObject::Compute (const Handle_PrsMgr_PresentationManager3d &thePresentationManager,
+void SegmentObject::Compute (const Handle_PrsMgr_PresentationManager3d &/*thePresentationManager*/,
                              const Handle_Prs3d_Presentation &thePresentation,
-                             const Standard_Integer theMode)
+                             const Standard_Integer /*theMode*/)
 {
   thePresentation->Clear();
   BRepBuilderAPI_MakeEdge anEdgeMaker(myPoint1, myPoint2);
@@ -4063,7 +4150,7 @@ void SegmentObject::Compute (const Handle_PrsMgr_PresentationManager3d &thePrese
 }
 
 void SegmentObject::ComputeSelection (const Handle_SelectMgr_Selection &theSelection,
-                                      const Standard_Integer theMode)
+                                      const Standard_Integer /*theMode*/)
 {
   Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner(this);
   Handle(TColgp_HArray1OfPnt) anArray = new TColgp_HArray1OfPnt(1, 2);
@@ -4079,7 +4166,7 @@ void SegmentObject::ComputeSelection (const Handle_SelectMgr_Selection &theSelec
 //Draw args : vsegment Name PointName PointName
 //purpose   : creates and displays Segment
 //=======================================================================
-static Standard_Integer VSegment (Draw_Interpretor& di,
+static Standard_Integer VSegment (Draw_Interpretor& /*di*/,
                                   Standard_Integer argc,
                                   const char ** argv)
 {
@@ -4191,7 +4278,7 @@ static Standard_Integer VObjZLayer (Draw_Interpretor& di,
   // process operation
   if (aOperation.IsEqual ("set"))
   {
-    Standard_Integer aLayerId = atoi (argv [3]);
+    Standard_Integer aLayerId = Draw::Atoi (argv [3]);
     aContext->SetZLayer (anInterObj, aLayerId);
   }
   else if (aOperation.IsEqual ("get"))
@@ -4206,7 +4293,7 @@ static Standard_Integer VObjZLayer (Draw_Interpretor& di,
 //function : VPolygonOffset
 //purpose  : Set or get polygon offset parameters
 //=======================================================================
-static Standard_Integer VPolygonOffset(Draw_Interpretor& di,
+static Standard_Integer VPolygonOffset(Draw_Interpretor& /*di*/,
                                        Standard_Integer argc,
                                        const char ** argv)
 {
@@ -4250,9 +4337,9 @@ static Standard_Integer VPolygonOffset(Draw_Interpretor& di,
   Standard_ShortReal    aFactor, aUnits;
   if (argc == 5)
   {
-    aMode   = atoi(argv[2]);
-    aFactor = (Standard_ShortReal) atof(argv[3]);
-    aUnits  = (Standard_ShortReal) atof(argv[4]);
+    aMode   = Draw::Atoi(argv[2]);
+    aFactor = (Standard_ShortReal) Draw::Atof(argv[3]);
+    aUnits  = (Standard_ShortReal) Draw::Atof(argv[4]);
 
     anInterObj->SetPolygonOffsets(aMode, aFactor, aUnits);
     aContext->UpdateCurrentViewer();
@@ -4288,7 +4375,7 @@ static Standard_Integer VPolygonOffset(Draw_Interpretor& di,
 //function : VShowFaceBoundaries
 //purpose  : Set face boundaries drawing on/off for ais object
 //=======================================================================
-static Standard_Integer VShowFaceBoundary (Draw_Interpretor& di,
+static Standard_Integer VShowFaceBoundary (Draw_Interpretor& /*di*/,
                                            Standard_Integer argc,
                                            const char ** argv)
 {
@@ -4358,28 +4445,28 @@ static Standard_Integer VShowFaceBoundary (Draw_Interpretor& di,
     TheAISContext ()->DefaultDrawer () : anInterObj->Attributes ();
 
   // turn boundaries on/off
-  Standard_Boolean isBoundaryDraw = (atoi (argv[2]) == 1);
+  Standard_Boolean isBoundaryDraw = (Draw::Atoi (argv[2]) == 1);
   aDrawer->SetFaceBoundaryDraw (isBoundaryDraw);
   
   // set boundary line color
   if (argc >= 6)
   {
     // Text color
-    aRed   = atof (argv[3])/255.;
-    aGreen = atof (argv[4])/255.;
-    aBlue  = atof (argv[5])/255.;
+    aRed   = Draw::Atof (argv[3])/255.;
+    aGreen = Draw::Atof (argv[4])/255.;
+    aBlue  = Draw::Atof (argv[5])/255.;
   }
 
   // set line width
   if (argc >= 7)
   {
-    aWidth = (Standard_Real)atof (argv[6]);
+    aWidth = (Standard_Real)Draw::Atof (argv[6]);
   }
 
   // select appropriate line type
   if (argc == 8)
   {
-    switch (atoi (argv[7]))
+    switch (Draw::Atoi (argv[7]))
     {
       case 1: aLineType = Aspect_TOL_DASH;    break;
       case 2: aLineType = Aspect_TOL_DOT;     break;
@@ -4401,6 +4488,270 @@ static Standard_Integer VShowFaceBoundary (Draw_Interpretor& di,
   return 0;
 }
 
+// This class is used for testing markers.
+DEFINE_STANDARD_HANDLE(ViewerTest_MarkersArrayObject, AIS_InteractiveObject)
+class ViewerTest_MarkersArrayObject : public AIS_InteractiveObject
+{
+
+public:
+
+  ViewerTest_MarkersArrayObject (const gp_XYZ& theStartPoint,
+                                 const Standard_Integer& thePointsOnSide,
+                                 Handle(Graphic3d_AspectMarker3d) theMarkerAspect = NULL)
+  {
+    myStartPoint = theStartPoint;
+    myPointsOnSide = thePointsOnSide;
+    myMarkerAspect = theMarkerAspect;
+  }
+
+  DEFINE_STANDARD_RTTI(MyPArrayObject);
+
+private:
+
+  void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+                const Handle(Prs3d_Presentation)& aPresentation,
+                const Standard_Integer aMode);
+
+  void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+                         const Standard_Integer /*theMode*/);
+
+protected:
+
+  gp_XYZ myStartPoint;
+  Standard_Integer myPointsOnSide;
+  Handle(Graphic3d_AspectMarker3d) myMarkerAspect;
+};
+
+IMPLEMENT_STANDARD_HANDLE(ViewerTest_MarkersArrayObject, AIS_InteractiveObject)
+IMPLEMENT_STANDARD_RTTIEXT(ViewerTest_MarkersArrayObject, AIS_InteractiveObject)
+
+void ViewerTest_MarkersArrayObject::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
+                              const Handle(Prs3d_Presentation)& aPresentation,
+                              const Standard_Integer /*aMode*/)
+{
+  Handle(Graphic3d_ArrayOfPrimitives) anArray = new Graphic3d_ArrayOfPoints ((Standard_Integer )Pow (myPointsOnSide, 3), myPointsOnSide != 1);
+  if (myPointsOnSide == 1)
+  {
+    anArray->AddVertex (myStartPoint);
+  }
+  else
+  {
+    for (Standard_Real i = 1; i <= myPointsOnSide; i++)
+    {
+      for (Standard_Real j = 1; j <= myPointsOnSide; j++)
+      {
+        for (Standard_Real k = 1; k <= myPointsOnSide; k++)
+        {
+          anArray->AddVertex (myStartPoint.X() + i, myStartPoint.Y() + j, myStartPoint.Z() + k);
+          anArray->SetVertexColor (anArray->VertexNumber(),
+                                   i / myPointsOnSide,
+                                   j / myPointsOnSide,
+                                   k / myPointsOnSide);
+        }
+      }
+    }
+  }
+
+  aPresentation->Clear();
+  if (!myMarkerAspect.IsNull())
+  {
+    Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
+  }
+  Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (anArray);
+}
+
+void ViewerTest_MarkersArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+                                       const Standard_Integer /*theMode*/)
+{
+  Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this);
+
+  if (myPointsOnSide == 1)
+  {
+    gp_Pnt aPoint (myStartPoint);
+    Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, aPoint);
+    theSelection->Add (aSensetivePoint);
+  }
+  else
+  {
+    for (Standard_Real i = 1; i <= myPointsOnSide; i++)
+    {
+      for (Standard_Real j = 1; j <= myPointsOnSide; j++)
+      {
+        for (Standard_Real k = 1; k <= myPointsOnSide; k++)
+        {
+          gp_Pnt aPoint (myStartPoint.X() + i, myStartPoint.Y() + j, myStartPoint.Z() + k);
+          Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, aPoint);
+          theSelection->Add (aSensetivePoint);
+        }
+      }
+    }
+  }
+}
+//=======================================================================
+//function : VMarkersTest
+//purpose  : Draws an array of markers for testing purposes.
+//=======================================================================
+static Standard_Integer VMarkersTest (Draw_Interpretor&,
+                                      Standard_Integer  theArgNb,
+                                      const char**      theArgVec)
+{
+  Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+  if (aContext.IsNull())
+  {
+    std::cerr << "Call 'vinit' before!\n";
+    return 1;
+  }
+
+  if (theArgNb < 5)
+  {
+    std::cerr << "Usage :\n " << theArgVec[0]
+              << "name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n";
+    return 1;
+  }
+
+  Standard_Integer anArgIter = 1;
+
+  TCollection_AsciiString aName (theArgVec[anArgIter++]);
+  TCollection_AsciiString aFileName;
+  gp_XYZ aPnt (Atof (theArgVec[anArgIter]),
+               Atof (theArgVec[anArgIter + 1]),
+               Atof (theArgVec[anArgIter + 2]));
+  anArgIter += 3;
+
+  Standard_Integer aPointsOnSide = 10;
+  Standard_Integer aMarkerType   = -1;
+  Standard_Real    aScale        = 1.0;
+  for (; anArgIter < theArgNb; ++anArgIter)
+  {
+    const TCollection_AsciiString anArg (theArgVec[anArgIter]);
+    if (anArg.Search ("PointsOnSide=") > -1)
+    {
+      aPointsOnSide = anArg.Token ("=", 2).IntegerValue();
+    }
+    else if (anArg.Search ("MarkerType=") > -1)
+    {
+      aMarkerType = anArg.Token ("=", 2).IntegerValue();
+    }
+    else if (anArg.Search ("Scale=") > -1)
+    {
+      aScale = anArg.Token ("=", 2).RealValue();
+    }
+    else if (anArg.Search ("FileName=") > -1)
+    {
+      aFileName = anArg.Token ("=", 2);
+    }
+    else
+    {
+      std::cerr << "Wrong argument: " << anArg << "\n";
+      return 1;
+    }
+  }
+
+  Handle(Graphic3d_AspectMarker3d) anAspect;
+  Handle(Image_AlienPixMap) anImage;
+  Quantity_Color aColor (Quantity_NOC_GREEN1);
+  if ((aMarkerType == Aspect_TOM_USERDEFINED || aMarkerType < 0)
+   && !aFileName.IsEmpty())
+  {
+    anImage = new Image_AlienPixMap();
+    if (!anImage->Load (aFileName))
+    {
+      std::cerr << "Could not load image from file '" << aFileName << "'!\n";
+      return 1;
+    }
+    anAspect = new Graphic3d_AspectMarker3d (anImage);
+  }
+  else
+  {
+    anAspect = new Graphic3d_AspectMarker3d (aMarkerType >= 0 ? (Aspect_TypeOfMarker )aMarkerType : Aspect_TOM_POINT, aColor, aScale);
+  }
+
+  Handle(ViewerTest_MarkersArrayObject) aMarkersArray = new ViewerTest_MarkersArrayObject (aPnt, aPointsOnSide, anAspect);
+  VDisplayAISObject (aName, aMarkersArray);
+
+  return 0;
+}
+
+//=======================================================================
+//function : TextToBrep
+//purpose  : Tool for conversion text to occt-shapes
+//=======================================================================
+
+static int TextToBRep (Draw_Interpretor& /*theDI*/,
+                       Standard_Integer  theArgNb,
+                       const char**      theArgVec)
+{
+  // Check arguments
+  if (theArgNb < 5)
+  {
+    std::cerr << "Error: " << theArgVec[0] << " - invalid syntax\n";
+    return 1;
+  }
+
+  Standard_Integer    anArgIter = 1;
+  Standard_CString    aResName  = theArgVec[anArgIter++];
+  Standard_CString    aText     = theArgVec[anArgIter++];
+  Standard_CString    aFontName = theArgVec[anArgIter++];
+  const Standard_Real aSize     = Atof (theArgVec[anArgIter++]);
+
+  Font_BRepFont    aFont;
+  Font_FontAspect  aFontAspect      = Font_FA_Regular;
+  Standard_Boolean isCompositeCurve = Standard_False;
+  gp_Ax3           aPenAx3 (gp::XOY());
+  gp_Pnt           aPenLoc;
+  while (anArgIter < theArgNb)
+  {
+    const TCollection_AsciiString anArg (theArgVec[anArgIter++]);
+    if (anArg.Search ("x=") > -1)
+    {
+      aPenLoc.SetX (anArg.Token ("=", 2).RealValue());
+    }
+    else if (anArg.Search ("y=") > -1)
+    {
+      aPenLoc.SetY (anArg.Token ("=", 2).RealValue());
+    }
+    else if (anArg.Search ("z=") > -1)
+    {
+      aPenLoc.SetZ (anArg.Token ("=", 2).RealValue());
+    }
+    else if (anArg.Search ("composite=") > -1)
+    {
+      isCompositeCurve = (anArg.Token ("=", 2).IntegerValue() == 1);
+    }
+    else if (anArg.Search ("regular") > -1)
+    {
+      aFontAspect = Font_FA_Regular;
+    }
+    else if (anArg.Search ("bolditalic") > -1)
+    {
+      aFontAspect = Font_FA_BoldItalic;
+    }
+    else if (anArg.Search ("bold") > -1)
+    {
+      aFontAspect = Font_FA_Bold;
+    }
+    else if (anArg.Search ("italic") > -1)
+    {
+      aFontAspect = Font_FA_Italic;
+    }
+    else
+    {
+      std::cerr << "Warning! Unknown argument '" << anArg.ToCString() << "'\n";
+    }
+  }
+
+  aFont.SetCompositeCurveMode (isCompositeCurve);
+  if (!aFont.Init (aFontName, aFontAspect, aSize))
+  {
+    std::cerr << "Font initialization error\n";
+    return 1;
+  }
+
+  aPenAx3.SetLocation (aPenLoc);
+  DBRep::Set (aResName, aFont.RenderText (aText, aPenAx3));
+  return 0;
+}
+
 //=======================================================================
 //function : ObjectsCommands
 //purpose  :
@@ -4469,10 +4820,6 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
     "vdrawsphere: vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToShowEdges=0]\n",
     __FILE__,VDrawSphere,group);
 
-  theCommands.Add("vclipplane",
-    "vclipplane : vclipplane [x y z dx dy dz] [planeId {on/off/del/display/hide}]",
-    __FILE__,VClipPlane,group);
-
   theCommands.Add ("vsetlocation",
         "vsetlocation : name x y z; set new location for an interactive object",
         __FILE__, VSetLocation, group);
@@ -4487,15 +4834,32 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
     __FILE__,VDrawPArray,group);
 
   theCommands.Add("vconnect", 
-    "vconnect : name object Xo Yo Zo Xu Xv Xw Zu Zv Zw", 
+    "vconnect : name Xo Yo Zo Xu Xv Xw Zu Zv Zw object1 object2 ... [color=NAME]", 
     __FILE__, VConnect, group);
 
   theCommands.Add("vconnectsh", 
-    "vconnectsh : name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw", 
+    "vconnectsh : name Xo Yo Zo Xu Xv Xw Zu Zv Zw shape1 shape2 ... [color=NAME]", 
     __FILE__, VConnectShape, group);
 
   theCommands.Add("vselmode", 
-    "vselmode : [object] mode On/Off (1/0)", 
+    "vselmode : [object] mode_number is_turned_on=(1|0)\n"
+    "  switches selection mode for the determined object or\n"
+    "  for all objects in context.\n"
+    "  mode_number is non-negative integer that has different\n"
+    "    meaning for different interactive object classes.\n"
+    "    For shapes the following mode_number values are allowed:\n"
+    "      0 - shape\n"
+    "      1 - vertex\n"
+    "      2 - edge\n"
+    "      3 - wire\n"
+    "      4 - face\n"
+    "      5 - shell\n"
+    "      6 - solid\n"
+    "      7 - compsolid\n"
+    "      8 - compound\n"
+    "  is_turned_on is:\n"
+    "    1 if mode is to be switched on\n"
+    "    0 if mode is to be switched off\n", 
     __FILE__, VSetSelectionMode, group);
 
   theCommands.Add("vtriangle",
@@ -4519,4 +4883,12 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
     "- turns on/off drawing of face boundaries for ais object "
     "and defines boundary line style.",
     __FILE__, VShowFaceBoundary, group);
+
+  theCommands.Add ("vmarkerstest",
+                   "vmarkerstest: name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n",
+                   __FILE__, VMarkersTest, group);
+
+  theCommands.Add ("text2brep",
+                   "text2brep: res text fontName fontSize [x=0.0 y=0.0 z=0.0 composite=1 {regular,bold,italic,bolditalic=regular}]\n",
+                   __FILE__, TextToBRep, group);
 }