0023634: Eliminate Polyline and Polygon usage in drawers
authorkgv <kgv@opencascade.com>
Fri, 18 Jan 2013 09:36:18 +0000 (13:36 +0400)
committerkgv <kgv@opencascade.com>
Fri, 18 Jan 2013 09:36:18 +0000 (13:36 +0400)
Polylines and polygons removed, now everything is based on PrimitiveArrays.
Added use of Graphic3d_ArrayOfSegments, some additional clean up in Graphic3d_Group.
Dead code elimination in AIS and V3d
Corrected compilation errors
Fixed grid presentation
Adding test case correction

134 files changed:
src/AIS/AIS_AngleDimension.cxx
src/AIS/AIS_Axis.cxx
src/AIS/AIS_Circle.cxx
src/AIS/AIS_GraphicTool.cxx
src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveObject.lxx
src/AIS/AIS_Line.cxx
src/AIS/AIS_LocalContext_1.cxx
src/AIS/AIS_Plane.cxx
src/AIS/AIS_PlaneTrihedron.cxx
src/AIS/AIS_Relation.cxx
src/AIS/AIS_Shape.cxx
src/AIS/AIS_Triangulation.cxx
src/AIS/AIS_Trihedron.cxx
src/DsgPrs/DsgPrs_AnglePresentation.cxx
src/DsgPrs/DsgPrs_Chamf2dPresentation.cxx
src/DsgPrs/DsgPrs_ConcentricPresentation.cxx
src/DsgPrs/DsgPrs_DiameterPresentation.cxx
src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx
src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx
src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx
src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx
src/DsgPrs/DsgPrs_FixPresentation.cxx
src/DsgPrs/DsgPrs_IdenticPresentation.cxx
src/DsgPrs/DsgPrs_LengthPresentation.cxx
src/DsgPrs/DsgPrs_MidPointPresentation.cxx
src/DsgPrs/DsgPrs_OffsetPresentation.cxx
src/DsgPrs/DsgPrs_ParalPresentation.cxx
src/DsgPrs/DsgPrs_PerpenPresentation.cxx
src/DsgPrs/DsgPrs_RadiusPresentation.cxx
src/DsgPrs/DsgPrs_ShadedPlanePresentation.cxx
src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx
src/DsgPrs/DsgPrs_SymmetricPresentation.cxx
src/DsgPrs/DsgPrs_TangentPresentation.cxx
src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx
src/DsgPrs/DsgPrs_XYZPlanePresentation.cxx
src/Graphic3d/FILES
src/Graphic3d/Graphic3d.cdl
src/Graphic3d/Graphic3d_ArrayOfPrimitives.cdl
src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx
src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx
src/Graphic3d/Graphic3d_CGroup.hxx
src/Graphic3d/Graphic3d_CStructure.hxx
src/Graphic3d/Graphic3d_GraphicDriver.cdl
src/Graphic3d/Graphic3d_GraphicDriver.cxx
src/Graphic3d/Graphic3d_Group.cdl
src/Graphic3d/Graphic3d_Group.cxx
src/Graphic3d/Graphic3d_Group_1.cxx
src/Graphic3d/Graphic3d_Group_10.cxx
src/Graphic3d/Graphic3d_Group_13.cxx
src/Graphic3d/Graphic3d_Group_2.cxx
src/Graphic3d/Graphic3d_Group_3.cxx
src/Graphic3d/Graphic3d_Group_5.cxx [deleted file]
src/Graphic3d/Graphic3d_Group_7.cxx [deleted file]
src/Graphic3d/Graphic3d_Group_8.cxx
src/Graphic3d/Graphic3d_Structure.cdl
src/Graphic3d/Graphic3d_Structure.cxx
src/Graphic3d/Graphic3d_Structure.pxx
src/Graphic3d/Graphic3d_Vector.cxx
src/Graphic3d/Graphic3d_Vertex.cdl [deleted file]
src/Graphic3d/Graphic3d_Vertex.cxx
src/Graphic3d/Graphic3d_Vertex.hxx [new file with mode: 0644]
src/Graphic3d/Graphic3d_VertexC.cdl [deleted file]
src/Graphic3d/Graphic3d_VertexC.cxx [deleted file]
src/Graphic3d/Graphic3d_VertexN.cdl [deleted file]
src/Graphic3d/Graphic3d_VertexN.cxx [deleted file]
src/Graphic3d/Graphic3d_VertexNC.cdl [deleted file]
src/Graphic3d/Graphic3d_VertexNC.cxx [deleted file]
src/Graphic3d/Graphic3d_VertexNT.cdl [deleted file]
src/Graphic3d/Graphic3d_VertexNT.cxx [deleted file]
src/InterfaceGraphic/FILES
src/InterfaceGraphic/InterfaceGraphic_Cextern.hxx [deleted file]
src/InterfaceGraphic/InterfaceGraphic_telem.hxx
src/MeshVS/MeshVS_ElementalColorPrsBuilder.cxx
src/MeshVS/MeshVS_MeshEntityOwner.cxx
src/MeshVS/MeshVS_MeshPrsBuilder.cxx
src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx
src/MeshVS/MeshVS_TextPrsBuilder.cxx
src/MeshVS/MeshVS_VectorPrsBuilder.cxx
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_GraphicDriver_3.cxx
src/OpenGl/OpenGl_GraphicDriver_703.cxx
src/OpenGl/OpenGl_GraphicDriver_705.cxx
src/OpenGl/OpenGl_GraphicDriver_713.cxx
src/OpenGl/OpenGl_Group.cxx
src/OpenGl/OpenGl_Group.hxx
src/OpenGl/OpenGl_Polyline.hxx
src/OpenGl/OpenGl_Text.cxx
src/OpenGl/OpenGl_tsm.hxx
src/Prs3d/Prs3d_AnglePresentation.cxx
src/Prs3d/Prs3d_Arrow.cxx
src/Prs3d/Prs3d_Datum.gxx
src/Prs3d/Prs3d_HLRShape.gxx
src/Prs3d/Prs3d_LengthPresentation.cxx
src/Prs3d/Prs3d_Line.gxx
src/Prs3d/Prs3d_Point.gxx
src/Prs3d/Prs3d_Vector.gxx
src/Prs3d/Prs3d_WFDeflectionRestrictedFace.gxx
src/Prs3d/Prs3d_WFRestrictedFace.gxx
src/Prs3d/Prs3d_WFShape.gxx
src/QABugs/QABugs_PresentableObject.cxx
src/StdPrs/StdPrs_Curve.cxx
src/StdPrs/StdPrs_DeflectionCurve.cdl
src/StdPrs/StdPrs_DeflectionCurve.cxx
src/StdPrs/StdPrs_HLRPolyShape.cxx
src/StdPrs/StdPrs_Plane.cxx
src/StdPrs/StdPrs_PoleCurve.cxx
src/StdPrs/StdPrs_ShadedShape.cxx
src/StdPrs/StdPrs_ShadedSurface.cxx
src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx
src/StdPrs/StdPrs_WFPoleSurface.cxx
src/StdPrs/StdPrs_WFSurface.cxx
src/StdSelect/StdSelect.cxx
src/StdSelect/StdSelect_ViewerSelector3d.cxx
src/V3d/V3d.cxx
src/V3d/V3d_CircularGrid.cdl
src/V3d/V3d_CircularGrid.cxx
src/V3d/V3d_DirectionalLight.cxx
src/V3d/V3d_Plane.cxx
src/V3d/V3d_PositionLight.cxx
src/V3d/V3d_PositionalLight.cxx
src/V3d/V3d_RectangularGrid.cdl
src/V3d/V3d_RectangularGrid.cxx
src/V3d/V3d_SpotLight.cxx
src/V3d/V3d_View.cxx
src/V3d/V3d_View_4.cxx
src/V3d/V3d_View_5.cxx
src/V3d/V3d_Viewer.cxx
src/V3d/V3d_Viewer_3.cxx
src/V3d/V3d_Viewer_4.cxx
src/ViewerTest/ViewerTest_ObjectCommands.cxx
src/Visual3d/Visual3d_View.cxx
src/XCAFPrs/XCAFPrs_AISObject.cxx
tests/3rdparty/export/A7

index 76e8157..85590f7 100755 (executable)
 #include <GC_MakeConicalSurface.hxx>
 #include <gce_MakePln.hxx>
 #include <gce_MakeCone.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>  
+
 
 //=======================================================================
 //function : Constructor
@@ -1975,19 +1975,17 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
 
   gp_Pnt AttachmentPnt;
   gp_Pnt OppositePnt;
-  gp_Pnt aPnt, tmpPnt;
-  Quantity_Length X,Y,Z;
 
   Standard_Real param = ElCLib::Parameter(myCircle, myPosition);
 
-  aPnt = Apex;
+  gp_Pnt aPnt = Apex;
   gp_Pnt P1 = ElCLib::Value(0., myCircle);
   gp_Pnt P2 = ElCLib::Value(M_PI, myCircle);
 
-  gce_MakePln mkPln(P1, P2,  aPnt);   // create a plane whitch defines plane for projection aPosition on it
+  gce_MakePln mkPln(P1, P2, aPnt);   // create a plane whitch defines plane for projection aPosition on it
 
-  aPnt =  AIS::ProjectPointOnPlane(myPosition, mkPln.Value()); 
-  tmpPnt = aPnt;
+  aPnt = AIS::ProjectPointOnPlane(myPosition, mkPln.Value()); 
+  gp_Pnt tmpPnt = aPnt;
 
   if( aPnt.Distance(P1) <  aPnt.Distance(P2) ){
     AttachmentPnt = P1; 
@@ -2015,49 +2013,30 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
 
   if( myPosition.Distance( myCircle.Location() ) <= myCircle.Radius() )
     if( 2 * myCircle.Radius() > aCircle2.Radius() * 0.4 ) IsArrowOut = Standard_False;  //four times more than an arrow size
-  Graphic3d_Array1OfVertex V(1, 12);
-  
-  Standard_Real angle;
-  param = ElCLib::Parameter(aCircle2, tmpPnt);
 
-  if(IsArrowOut) {
-    angle = OppParam - AttParam + M_PI / 6; //An angle between AttParam and OppParam + 30 degrees
-    param = AttParam - M_PI / 12;      //out parts of dimension line are 15 degrees
-    
-    while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
-    for( i = 0; i <= 11; i++ ) {       //calculating of arc             
-      aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
-      aPnt.Coord(X, Y, Z);
-      V(i+1).SetCoord(X, Y, Z);    
-    }
-      
-  }
-  else {
-    angle = OppParam - AttParam;
-    param = AttParam;
-    while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
-    for( i = 0; i <= 11; i++ ) {       //calculating of arc             
-      aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
-      aPnt.Coord(X, Y, Z);
-      V(i+1).SetCoord(X, Y, Z);
-    }
+  param = AttParam;
+  Standard_Real angle = OppParam - AttParam;
+
+  if(IsArrowOut)
+  {
+    angle += M_PI / 6; //An angle between AttParam and OppParam + 30 degrees
+    param -= M_PI / 12;      //out parts of dimension line are 15 degrees
   }
-  
-  for(i = 1; i<=11; i++) {
 
-    V(i).Coord(X, Y, Z);
-    P1.SetCoord(X, Y, Z);
-    V(i+1).Coord(X, Y, Z);
-    P1.SetCoord(X, Y, Z);
+  while ( angle > 2. * M_PI ) angle -= 2. * M_PI;
 
-    seg = new Select3D_SensitiveSegment(owner, P1, P2);
-    aSelection->Add(seg);   
+  gp_Pnt Vprev = ElCLib::Value(param, aCircle2);
+  for( i = 1; i <= 11; i++ ) //calculating of arc
+  {
+    gp_Pnt Vcur = ElCLib::Value(param + angle/11 * i, aCircle2);
+    seg = new Select3D_SensitiveSegment(owner, Vprev, Vcur);
+    aSelection->Add(seg);
+    Vprev = Vcur;
   }
 
-  tmpPnt =  tmpPnt.Translated(gp_Vec(0, 0, -1)*2);
+  tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -2));
 
-  Standard_Real size(Min(myVal/100.+1.e-6,myArrowSize+1.e-6));
+  const Standard_Real size(Min(myVal/100.+1.e-6,myArrowSize+1.e-6));
   Handle( Select3D_SensitiveBox ) box = new Select3D_SensitiveBox( owner,
                                                                   tmpPnt.X(),
                                                                   tmpPnt.Y(),
@@ -2067,6 +2046,3 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
                                                                   tmpPnt.Z() + size);
   aSelection->Add(box);
 }
-
-
-
index debb688..d6a98f3 100755 (executable)
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351               //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
+//GER61351             //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #include <AIS_Axis.ixx>
 #include <Aspect_TypeOfLine.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_DatumAspect.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Graphic3d_Structure.hxx>
 #include <TColgp_Array1OfPnt.hxx>
@@ -177,10 +175,7 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&,
   aPresentation->SetDisplayPriority(5);
   if (!myIsXYZAxis ){
     GeomAdaptor_Curve curv(myComponent);
-    Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
-    if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
     StdPrs_Curve::Add(aPresentation,curv,myDrawer);
-    if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
   }
   else {
     DsgPrs_XYZAxisPresentation::Add(aPresentation,myLineAspect,myDir,myVal,myText,myPfirst,myPlast);
@@ -217,13 +212,11 @@ void AIS_Axis::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
 
 
 void AIS_Axis::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
 
 void AIS_Axis::SetColor(const Quantity_Color &aCol)
-#endif
 {
   hasOwnColor=Standard_True;
   myOwnColor=aCol;
index c96ee0c..92fbb3c 100755 (executable)
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351               //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
+//GER61351             //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #include <AIS_Circle.ixx>
 #include <Aspect_TypeOfLine.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Graphic3d_Structure.hxx>
 #include <TColgp_Array1OfPnt.hxx>
@@ -122,7 +120,6 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
 //=======================================================================
 
 void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
@@ -133,7 +130,6 @@ void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
 //=======================================================================
 
 void AIS_Circle::SetColor(const Quantity_Color &aCol)
-#endif
 {
   hasOwnColor=Standard_True;
   myOwnColor=aCol;
@@ -157,17 +153,10 @@ void AIS_Circle::SetWidth(const Standard_Real aValue)
 {
   myOwnWidth=aValue;
 
-#ifndef GER61351
-  Quantity_NameOfColor CC = 
-       HasColor() ? myOwnColor : AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
-#endif
-
   if (!myDrawer->HasLineAspect ()) {
-#ifdef GER61351
     Quantity_Color CC;
     if( HasColor() ) CC = myOwnColor;
     else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-#endif
     myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
   } else
     myDrawer->LineAspect()->SetWidth(aValue);
@@ -186,17 +175,12 @@ void AIS_Circle::UnsetColor()
 
   if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
   else{
-#ifdef GER61351
-  Quantity_Color CC;
-  if( HasColor() ) CC = myOwnColor;
-  else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-#else
-    Quantity_NameOfColor CC = 
-#endif
-               AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
+    Quantity_Color CC;
+    if( HasColor() ) CC = myOwnColor;
+    else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
     myDrawer->LineAspect()->SetColor(CC);
     myOwnColor = CC;
- }
+  }
 }
 
 //=======================================================================
@@ -225,10 +209,7 @@ void AIS_Circle::ComputeCircle( const Handle(Prs3d_Presentation)& aPresentation)
   GeomAdaptor_Curve curv(myComponent);
   Standard_Real prevdev = myDrawer->DeviationCoefficient();
   myDrawer->SetDeviationCoefficient(1.e-5);
-  Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
   StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
   myDrawer->SetDeviationCoefficient(prevdev);
 
 }
@@ -240,16 +221,11 @@ void AIS_Circle::ComputeCircle( const Handle(Prs3d_Presentation)& aPresentation)
 //=======================================================================
 void AIS_Circle::ComputeArc( const Handle(Prs3d_Presentation)& aPresentation)
 {
-
   GeomAdaptor_Curve curv(myComponent,myUStart,myUEnd);
   Standard_Real prevdev = myDrawer->DeviationCoefficient();
   myDrawer->SetDeviationCoefficient(1.e-5);
-  Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
   StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
   myDrawer->SetDeviationCoefficient(prevdev);
-
 }
 
 //=======================================================================
index 1c1b19c..56712ae 100755 (executable)
@@ -19,8 +19,7 @@
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351 //GG_171199     Enable to get an object RGB color
-//              instead a restricted object NameOfColor.
+//GER61351 //GG_171199     Enable to get an object RGB color instead a restricted object NameOfColor.
 
 
 
@@ -92,7 +91,6 @@ static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
 }
 
 Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att)
-#ifdef GER61351
 {
   Quantity_Color color;
   GetLineColor(Dr,Att,color);
@@ -100,20 +98,10 @@ Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)&
 }
 
 void AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att, Quantity_Color &aColor)
-#endif
 {
   Standard_Real W;
   Aspect_TypeOfLine TYP;
-  
-  Handle(Prs3d_LineAspect) LA = GetLineAspect(Dr,Att);
-  
-#ifdef GER61351
-  LA->Aspect()->Values(aColor,TYP,W);
-#else
-  Quantity_Color QCol;
-  LA->Aspect()->Values(QCol,TYP,W);
-  return QCol.Name();
-#endif
+  GetLineAspect(Dr,Att)->Aspect()->Values(aColor,TYP,W);
 }
 
 Standard_Real AIS_GraphicTool::GetLineWidth (const Handle(Prs3d_Drawer)& Dr,
@@ -159,7 +147,6 @@ void AIS_GraphicTool::GetLineAtt(const Handle(Prs3d_Drawer)& Dr,
 }
 
 Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr)
-#ifdef GER61351
 {
   Quantity_Color color;
   GetInteriorColor(Dr,color);
@@ -167,24 +154,16 @@ Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer
 }
 
 void AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr, Quantity_Color &aColor)
-#endif
 {
   Handle(Graphic3d_AspectFillArea3d) AFA = Dr->ShadingAspect()->Aspect();
   Aspect_InteriorStyle IS;
   Aspect_TypeOfLine T;
   Standard_Real W;
-#ifdef GER61351
   Quantity_Color EC;
   AFA->Values(IS,aColor,EC,T,W);
-#else
-  Quantity_Color IC,EC;
-  AFA->Values(IS,IC,EC,T,W);
-  return IC.Name();
-#endif
 }
 
 Graphic3d_MaterialAspect AIS_GraphicTool::GetMaterial(const Handle(Prs3d_Drawer)& Dr)
 {
   return Dr->ShadingAspect()->Aspect()->BackMaterial();
-
 }
index ad0c151..9d8ce88 100755 (executable)
 #define BUC60577        //GG_101099     Enable to compute correctly
 //                      transparency with more than one object in the view.
 
-#define GER61351        //GG_171199     Enable to set an object RGB color
-//                              instead a restricted object NameOfColor. 
+//GER61351        //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #define G003            //EUG_26/01/00 Degenerate support (G003)
 
-#define IMP140200       //GG Add SetSelectedAspect() method.
+//IMP140200       //GG Add SetSelectedAspect() method.
 
 #define BUC60632        //GG 15/03/00 Add protection on SetDisplayMode()
 //                      method, compute only authorized presentation.
@@ -1914,15 +1913,13 @@ UnsetDisplayMode(const Handle(AIS_InteractiveObject)& anIObj,
 //purpose  : 
 //=======================================================================
 
-#ifdef GER61351
 void AIS_InteractiveContext::SetCurrentFacingModel(
                         const Handle(AIS_InteractiveObject)& anIObj,
-                        const Aspect_TypeOfFacingModel aModel) { 
- if (  !anIObj.IsNull ()  ) {
-   anIObj->SetCurrentFacingModel(aModel);
- }
+                        const Aspect_TypeOfFacingModel aModel)
+{
+  if (  !anIObj.IsNull ()  )
+    anIObj->SetCurrentFacingModel(aModel);
 }
-#endif
 
 //=======================================================================
 //function : SetColor
@@ -1932,7 +1929,6 @@ void AIS_InteractiveContext::SetCurrentFacingModel(
 void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj, 
                                      const Quantity_NameOfColor aColor,
                                      const Standard_Boolean updateviewer)
-#ifdef GER61351
 {
   SetColor(anIObj,Quantity_Color(aColor),updateviewer);
 }
@@ -1940,7 +1936,6 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb
 void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj, 
                                      const Quantity_Color &aColor,
                                      const Standard_Boolean updateviewer)
-#endif
 {
   if(anIObj.IsNull()) return ;
  
@@ -2292,13 +2287,11 @@ Quantity_NameOfColor AIS_InteractiveContext::Color(const Handle(AIS_InteractiveO
   return anIObj->Color();
 }
 
-#ifdef GER61351
 void AIS_InteractiveContext::Color(const Handle(AIS_InteractiveObject)& anIObj,
-                                             Quantity_Color &aColor) const 
+                                   Quantity_Color &aColor) const
 {
   anIObj->Color(aColor);
 }
-#endif
 
 //=======================================================================
 //function : Width
@@ -2541,7 +2534,6 @@ void AIS_InteractiveContext :: SetDegenerateModel (
 }  // end AIS_InteractiveContext :: SetDegenerateModel
 #endif
 
-#ifdef IMP140200
 //=======================================================================
 //function : SetSelectedAspect
 //purpose  : 
@@ -2549,7 +2541,8 @@ void AIS_InteractiveContext :: SetDegenerateModel (
 void AIS_InteractiveContext::SetSelectedAspect(
                                 const Handle(Prs3d_BasicAspect)& anAspect,
                                 const Standard_Boolean globalChange,
-                                const Standard_Boolean updateViewer) {
+                                const Standard_Boolean updateViewer)
+{
   if( !HasOpenedContext() ) {
     Standard_Boolean found = Standard_False;
     Handle(AIS_Selection) sel = 
@@ -2563,11 +2556,10 @@ void AIS_InteractiveContext::SetSelectedAspect(
     if( found && updateViewer) {
       myMainVwr->Update();
       if( !(myIsCollClosed && myCollectorVwr.IsNull()) ) 
-                                        myCollectorVwr->Update();
+        myCollectorVwr->Update();
     }
   }
 }
-#endif
 
 //=======================================================================
 //function : SetLocalAttributes
index 4057794..c5d000f 100755 (executable)
@@ -19,8 +19,7 @@
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351               //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor. 
+//GER61351             //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 
 inline Standard_Boolean  AIS_InteractiveObject::AcceptShapeDecomposition() const 
@@ -66,19 +65,13 @@ inline Standard_Integer AIS_InteractiveObject::SelectionMode() const
 
 inline Quantity_NameOfColor AIS_InteractiveObject::Color() const 
 {
-#ifdef GER61351
- return myOwnColor.Name();
-#else
- return myOwnColor;
-#endif
+  return myOwnColor.Name();
 }
 
-#ifdef GER61351
 inline void AIS_InteractiveObject::Color(Quantity_Color& aColor) const 
 {
- aColor = myOwnColor;
+  aColor = myOwnColor;
 }
-#endif
 
 inline Standard_Boolean AIS_InteractiveObject::HasWidth() const 
 {return (!myOwnWidth == 0.);}
index dc51694..95dfca0 100755 (executable)
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351       //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
+//GER61351     //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #include <AIS_Line.ixx>
 #include <Aspect_TypeOfLine.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Precision.hxx>
 #include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Graphic3d_Structure.hxx>
 #include <TColgp_Array1OfPnt.hxx>
@@ -157,13 +155,11 @@ void AIS_Line::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
 //=======================================================================
 
 void AIS_Line::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
 
 void AIS_Line::SetColor(const Quantity_Color &aCol)
-#endif
 {
   hasOwnColor=Standard_True;
   myOwnColor=aCol;
@@ -190,15 +186,9 @@ void AIS_Line::UnsetColor()
 
   if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
   else{
-#ifdef GER61351
     Quantity_Color CC;
     if( HasColor() ) CC = myOwnColor;
     else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-#else
-    Quantity_NameOfColor CC =
-               AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
-#endif 
-
     myDrawer->LineAspect()->SetColor(CC);
     myOwnColor = CC;
  }
@@ -212,17 +202,10 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
 {
   myOwnWidth=aValue;
 
-#ifndef GER61351
-  Quantity_NameOfColor CC =
-                HasColor()? myOwnColor : AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
-#endif
-
   if (!myDrawer->HasLineAspect ()) {
-#ifdef GER61351
     Quantity_Color CC;
     if( HasColor() ) CC = myOwnColor;
     else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-#endif
     myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
   } else
     myDrawer->LineAspect()->SetWidth(aValue);
@@ -251,16 +234,11 @@ void AIS_Line::UnsetWidth()
 //=======================================================================
 void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
 {
-
   GeomAdaptor_Curve curv(myComponent);
-  Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
   StdPrs_Curve::Add(aPresentation,curv,myDrawer);
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
 
   //pas de prise en compte lors du FITALL
   aPresentation->SetInfiniteState (Standard_True);
-
 }
 
 //=======================================================================
@@ -269,7 +247,6 @@ void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentat
 //=======================================================================
 void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentation)
 {
-
   gp_Pnt P1 = myStartPoint->Pnt();
   gp_Pnt P2 = myEndPoint->Pnt();
   
@@ -277,11 +254,7 @@ void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentati
 
   Standard_Real dist = P1.Distance(P2);
   GeomAdaptor_Curve curv(myComponent,0.,dist);
-  Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
   StdPrs_Curve::Add(aPresentation,curv,myDrawer);
-  if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
-
 }
 
 
index b2eb7a8..17592ab 100755 (executable)
@@ -93,7 +93,7 @@
 #include <AIS_LocalStatus.hxx>
 #include <StdPrs_WFShape.hxx>
 #include <Visual3d_TransientManager.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfTriangles.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Select3D_SensitiveTriangulation.hxx>
 #include <SelectBasics_SensitiveEntity.hxx>
@@ -1430,17 +1430,18 @@ void AIS_LocalContext::HilightTriangle(const Standard_Integer Rank,
 {
   static Standard_Integer PrevRank(0);
   if(Rank==PrevRank) return;
-//  PrevRank = Rank; 
   Handle(SelectBasics_SensitiveEntity) SE = myMainVS->Primitive(Rank);
-  if(SE->IsKind(STANDARD_TYPE(Select3D_SensitiveTriangulation))){
+  if(SE->IsKind(STANDARD_TYPE(Select3D_SensitiveTriangulation)))
+  {
     Handle(Select3D_SensitiveTriangulation) Tr = *((Handle(Select3D_SensitiveTriangulation)*)&SE);
     gp_Pnt p1,p2,p3 ; Tr->DetectedTriangle(p1,p2,p3);
-    static Graphic3d_Array1OfVertex Vtt(1,3);
 
-    Vtt.SetValue(1,Graphic3d_Vertex(p1.X(),p1.Y(),p1.Z()));
-    Vtt.SetValue(2,Graphic3d_Vertex(p2.X(),p2.Y(),p2.Z()));
-    Vtt.SetValue(3,Graphic3d_Vertex(p3.X(),p3.Y(),p3.Z()));
-    static Handle(Prs3d_Presentation)  TriPrs = 
+    Handle(Graphic3d_ArrayOfTriangles) aTris = new Graphic3d_ArrayOfTriangles(3);
+       aTris->AddVertex(p1);
+       aTris->AddVertex(p2);
+       aTris->AddVertex(p3);
+
+    static Handle(Prs3d_Presentation) TriPrs = 
       new Prs3d_Presentation(myMainPM->StructureManager());
     TriPrs->Clear();
 #ifdef IMP300101
@@ -1448,20 +1449,17 @@ void AIS_LocalContext::HilightTriangle(const Standard_Integer Rank,
     asp->SetColor(myCTX->HilightColor());
     TriPrs->SetShadingAspect(asp);
 #endif
-    Prs3d_Root::CurrentGroup(TriPrs)->Polygon(Vtt);
+    Prs3d_Root::CurrentGroup(TriPrs)->AddPrimitiveArray(aTris);
 
 #ifndef IMP300101
     if(view->TransientManagerBeginDraw())
       Visual3d_TransientManager::EndDraw();
 #endif
     if(view->TransientManagerBeginDraw()) {
-      //P->Exploration();
       Visual3d_TransientManager::DrawStructure(TriPrs);
       Visual3d_TransientManager::EndDraw();
     }
-    
   }
-  
 }
 
 //=======================================================================
index 2f32e96..570177e 100755 (executable)
@@ -31,7 +31,7 @@
 #include <gp_Pnt.hxx>
 #include <ElSLib.hxx>
 
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfQuadrangles.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -245,58 +245,59 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
 
   ComputeFields();
   aPresentation->SetInfiniteState(myInfiniteState);
-  if (myCurrentMode) 
-    myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(3);
-  else 
-    myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(1);
-  if(aMode == 0){
-    if (!myIsXYZPlane){
-      ComputeFrame();
-      const Handle(Geom_Plane)& pl = myComponent;
-      const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast
-       (pl->Translated(pl->Location(),myCenter));
-      GeomAdaptor_Surface surf(thegoodpl);
-      StdPrs_Plane::Add(aPresentation,surf,myDrawer);
-    }
-    else {
-      DsgPrs_XYZPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
+  myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(myCurrentMode == 0? 1 : 3);
+
+  switch (aMode)
+  {
+    case 0:
+    {
+      if (!myIsXYZPlane)
+      {
+        ComputeFrame();
+        const Handle(Geom_Plane)& pl = myComponent;
+        const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
+        GeomAdaptor_Surface surf(thegoodpl);
+        StdPrs_Plane::Add(aPresentation,surf,myDrawer);
+      }
+      else
+        DsgPrs_XYZPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
+      break;
     }
-  }
-  else if (aMode == 1){
-    if (!myIsXYZPlane){
-      ComputeFrame();
-      Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
-      Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
-      gp_Pnt p1;
-      Standard_Real Xmax,Ymax;
-      Xmax = Standard_Real(theaspect->PlaneXLength())/2.;
-      Ymax = Standard_Real(theaspect->PlaneYLength())/2.;
-      static Graphic3d_Array1OfVertex vertices(1,5);
-      TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
-      myComponent->D0(-Xmax,Ymax,p1);
-      vertices(1).SetCoord(p1.X(),p1.Y(),p1.Z());
-      vertices(5).SetCoord(p1.X(),p1.Y(),p1.Z());
-      myComponent->D0(Xmax,Ymax,p1);
-      vertices(2).SetCoord(p1.X(),p1.Y(),p1.Z());
-      myComponent->D0(Xmax,-Ymax,p1);
-      vertices(3).SetCoord(p1.X(),p1.Y(),p1.Z());
-      myComponent->D0(-Xmax,-Ymax,p1);
-      vertices(4).SetCoord(p1.X(),p1.Y(),p1.Z());
-      TheGroup->Polygon(vertices);
-       
+    case 1:
+    {
+      if (!myIsXYZPlane)
+      {
+        ComputeFrame();
+        Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
+        Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
+        TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
+        gp_Pnt p1;
+        const Standard_Real Xmax = 0.5*Standard_Real(theaspect->PlaneXLength());
+        const Standard_Real Ymax = 0.5*Standard_Real(theaspect->PlaneYLength());
+
+        Handle(Graphic3d_ArrayOfQuadrangles) aQuads = new Graphic3d_ArrayOfQuadrangles(4);
+
+        myComponent->D0(-Xmax,Ymax,p1);
+        aQuads->AddVertex(p1);
+        myComponent->D0(Xmax,Ymax,p1);
+        aQuads->AddVertex(p1);
+        myComponent->D0(Xmax,-Ymax,p1);
+        aQuads->AddVertex(p1);
+        myComponent->D0(-Xmax,-Ymax,p1);
+        aQuads->AddVertex(p1);
+
+        TheGroup->AddPrimitiveArray(aQuads);
       }
-    else{
-      DsgPrs_ShadedPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
-      
+      else
+        DsgPrs_ShadedPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
+      break;
     }
   }
-
 }
 
 void AIS_Plane::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
 {
-// Standard_NotImplemented::Raise("AIS_Plane::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
+  PrsMgr_PresentableObject::Compute(aProjector, aTransformation, aPresentation);
 }
 
 //=======================================================================
index 5307ee5..947c25c 100755 (executable)
@@ -19,8 +19,7 @@
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351               //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
+//GER61351             //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #define OCC218                  //SAV using DsgPrs_XYZAxisPresentation to draw axes.
 // + X/YAxis() returns AIS_Line instead of AIS_Axis
@@ -280,13 +279,11 @@ void AIS_PlaneTrihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSe
 }
 
 void AIS_PlaneTrihedron::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
 
 void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
-#endif
 {
   hasOwnColor=Standard_True;
   myOwnColor = aCol;
index a812e24..7427f9f 100755 (executable)
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351       //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
+//GER61351     //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #define BUC60915       //GG 05/06/01 Enable to compute the requested arrow size 
 //                     if any in all dimensions.
 
 #include <AIS.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
 #include <Graphic3d_Group.hxx>
 
 #include <AIS_Relation.ixx>
@@ -222,13 +220,11 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
 //=======================================================================
 
 void AIS_Relation::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
 
 void AIS_Relation::SetColor(const Quantity_Color &aCol)
-#endif
 {
   if(hasOwnColor && myOwnColor==aCol) return;
 
@@ -268,13 +264,9 @@ void AIS_Relation::UnsetColor()
   if (!hasOwnColor) return;
   hasOwnColor = Standard_False;
   const Handle(Prs3d_LineAspect)& LA = myDrawer->LineAspect();
-#ifdef GER61351
   Quantity_Color CC;
   AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
   LA->SetColor(CC);
-#else
-  LA->SetColor(AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line));
-#endif
   myDrawer->AngleAspect()->SetLineAspect(LA);
   myDrawer->LengthAspect()->SetLineAspect(LA);
   myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
index 0a02b79..864bf78 100755 (executable)
@@ -44,8 +44,7 @@
 #include <Graphic3d_AspectText3d.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Graphic3d_MaterialAspect.hxx>
 
 #include <Prs3d_Presentation.hxx>
@@ -104,24 +103,18 @@ void AIS_Shape::DisplayBox(const Handle(Prs3d_Presentation)& aPrs,
                            const Bnd_Box& B,
                            const Handle(Prs3d_Drawer)& aDrawer)
 {
-  Standard_Real X[2],Y[2],Z[2];
-  Standard_Integer Indx [16] ;
+  static const Standard_Integer Indx[][3] =
+  { { 0, 0, 0 }, { 1, 0, 0 }, { 1, 0, 1 }, { 0, 0, 1 },
+    { 0, 1, 1 }, { 1, 1, 1 }, { 1, 1, 0 }, { 0, 1, 0 },
+    { 0, 0, 0 }, { 0, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 },
+    { 0, 1, 1 }, { 0, 1, 0 }, { 1, 1, 0 }, { 1, 0, 0 } };
+
   if ( B.IsVoid() )
     return; // nothing to show
 
-  Indx [0]=1;Indx [1]=2;Indx [2]=4;Indx [3]=3;
-  Indx [4]=5;Indx [5]=6;Indx [6]=8;Indx [7]=7;
-  Indx [8]=1;Indx [9]=3;Indx [10]=7;Indx [11]=5;
-  Indx [12]=2;Indx [13]=4;Indx [14]=8;Indx [15]=6;
+  Standard_Real X[2],Y[2],Z[2];
   B.Get(X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
 
-  Graphic3d_Array1OfVertex V(1,8);
-  Standard_Integer Rank(0);
-  for(Standard_Integer k=0;k<=1;k++)
-    for(Standard_Integer j=0;j<=1;j++)
-      for(Standard_Integer i=0;i<=1;i++)
-        V(++Rank) = Graphic3d_Vertex(X[i],Y[j],Z[k]);
-
   Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPrs);
   Quantity_Color Q;
   Aspect_TypeOfLine A;
@@ -130,16 +123,11 @@ void AIS_Shape::DisplayBox(const Handle(Prs3d_Presentation)& aPrs,
 
   G->SetGroupPrimitivesAspect(new Graphic3d_AspectLine3d(Q,Aspect_TOL_DOTDASH,W));
 
-  G->BeginPrimitives();Standard_Integer I,J;
-  Graphic3d_Array1OfVertex VVV (1,5);
-  for(I=1;I<=4;I++){
-    for(J=1;J<=4;J++){
-      VVV.SetValue(J,V(Indx[J+4*I-5]));
-    }
-    VVV.SetValue(5,VVV(1));
-    G->Polyline(VVV);
-  }
-  G->EndPrimitives();
+  Handle(Graphic3d_ArrayOfPolylines) aPolyline = new Graphic3d_ArrayOfPolylines(16);
+  Standard_Integer i(0);
+  for(;i<16;i++)
+    aPolyline->AddVertex(X[Indx[i][0]],Y[Indx[i][1]],Z[Indx[i][2]]);
+  G->AddPrimitiveArray(aPolyline);
 }
 
 static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
index 87a0e11..248ff48 100755 (executable)
@@ -30,7 +30,6 @@
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_ArrayOfTriangles.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
 
 
 IMPLEMENT_STANDARD_HANDLE(AIS_Triangulation, AIS_InteractiveObject)
@@ -66,7 +65,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre
       if( myFlagColor == 1 )
         hasVColors = Standard_True; 
 
-      Handle(Graphic3d_ArrayOfTriangles) array = 
+      Handle(Graphic3d_ArrayOfTriangles) anArray =
          new Graphic3d_ArrayOfTriangles ( myNbNodes,        //maxVertexs
                                           myNbTriangles * 3,//maxEdges
                                           hasVNormals,      //hasVNormals
@@ -83,24 +82,22 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre
       Standard_Real ambient = aspect->FrontMaterial().Ambient();
       for ( i = nodes.Lower(); i<= nodes.Upper(); i++ ){ 
         if( myFlagColor == 1 )
-          array->AddVertex( nodes(i), AttenuateColor(myColor->Value(i),ambient));
+          anArray->AddVertex( nodes(i), AttenuateColor(myColor->Value(i),ambient));
         if( myFlagColor == 0 )
-          array->AddVertex( nodes(i) );
+          anArray->AddVertex( nodes(i) );
         j = (i - nodes.Lower()) * 3;
-        array->SetVertexNormal(i, normals(j+1), normals(j+2), normals(j+3));
+        anArray->SetVertexNormal(i, normals(j+1), normals(j+2), normals(j+3));
       }
 
       Standard_Integer indexTriangle[3] = {0,0,0};
       for ( i = triangles.Lower(); i<= triangles.Upper(); i++ ) {
         triangles(i).Get(indexTriangle[0], indexTriangle[1], indexTriangle[2]);
-        array->AddEdge(indexTriangle[0]);
-        array->AddEdge(indexTriangle[1]);
-        array->AddEdge(indexTriangle[2]);
+        anArray->AddEdge(indexTriangle[0]);
+        anArray->AddEdge(indexTriangle[1]);
+        anArray->AddEdge(indexTriangle[2]);
       }
       TheGroup->SetPrimitivesAspect(aspect);
-      TheGroup->BeginPrimitives();
-      TheGroup->AddPrimitiveArray(array);
-      TheGroup->EndPrimitives();
+      TheGroup->AddPrimitiveArray(anArray);
       break;
   }
 }
index 48204b8..4d3434f 100755 (executable)
@@ -19,8 +19,7 @@
 // and conditions governing the rights and limitations under the License.
 
 
-#define GER61351               //GG_171199     Enable to set an object RGB color
-//                                               instead a restricted object NameOfColor.
+//GER61351             //GG_171199     Enable to set an object RGB color instead a restricted object NameOfColor.
 
 #define IMP120100      // GG Add SetTextColor() and SetArrowColor() methods
 
@@ -430,13 +429,11 @@ void AIS_Trihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelecti
 //=======================================================================
 
 void AIS_Trihedron::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
 {
   SetColor(Quantity_Color(aCol));
 }
 
 void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
-#endif
 {
   hasOwnColor=Standard_True;
   myOwnColor = aCol;
index 552581c..053b0be 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_AnglePresentation.ixx>
 #include <gp_Lin.hxx>
 #include <gp_Dir.hxx>
 #include <ElCLib.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_AngleAspect.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 
 #include <UnitsAPI.hxx>
 
-//pop pour NT
-//#if WNT
 #include <stdio.h>
-//#endif
 
+//------------------------------------------------------------------------------------------------------------------
+// Returns 1 if C is above of CMin; 0 if C is bitween CMin and CMax; -1 if C is Below CMax   
+//-----------------------------------------------------------------------------------------------------------------
+static Standard_Integer AboveInBelowCone(const gp_Circ &CMax, const gp_Circ &CMin, const gp_Circ &C)
+{
+  const Standard_Real D = CMax.Location().Distance( CMin.Location() );
+  const Standard_Real D1 = CMax.Location().Distance( C.Location() );
+  const Standard_Real D2 = CMin.Location().Distance( C.Location() );
 
-static Standard_Integer AboveInBelowCone(gp_Circ CMax, gp_Circ CMin, gp_Circ C);
+  if ( D >= D1 && D >= D2 ) return 0;
+  if ( D < D2 && D1 < D2 ) return -1;
+  if ( D < D1 && D2 < D1 ) return 1;
+
+  return 0;
+}
 
 
 //==========================================================================
@@ -68,65 +77,49 @@ static Standard_Integer AboveInBelowCone(gp_Circ CMax, gp_Circ CMin, gp_Circ C);
 // purpose  : draws the presentation of the cone's angle;
 //==========================================================================
 void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real aVal,
-                                   const TCollection_ExtendedString& aText,
-                                   const gp_Circ& aCircle,
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real aVal,
+                                    const TCollection_ExtendedString& aText,
+                                    const gp_Circ& aCircle,
                                     const gp_Pnt& aPosition,
                                     const gp_Pnt& Apex,
-                                   const gp_Circ& VminCircle,
-                                   const gp_Circ& VmaxCircle,
-                                   const Standard_Real aArrowSize) 
+                                    const gp_Circ& VminCircle,
+                                    const gp_Circ& VmaxCircle,
+                                    const Standard_Real aArrowSize) 
 {
-  
-
-  
   Handle(Prs3d_AngleAspect) anAngleAspect = aDrawer->AngleAspect();
   Handle(Prs3d_LengthAspect) aLengthAspect = aDrawer->LengthAspect();
-  Standard_Real myArrowSize;
 
-  TCollection_ExtendedString txt = aText;
-  if( aArrowSize == 0.0 ) myArrowSize =  aCircle.Radius()/ 10.;
-  else myArrowSize = aArrowSize;
+  TCollection_ExtendedString txt(aText);
+
+  const Standard_Real myArrowSize = ( aArrowSize == 0.0 )? (0.1 * aCircle.Radius()) : aArrowSize;
 
   anAngleAspect->ArrowAspect()->SetLength(myArrowSize);
   aDrawer->ArrowAspect()->SetLength(myArrowSize);
 
-  Standard_Boolean IsArrowOut = Standard_True;    //Is arrows inside or outside of the cone
   Standard_Boolean IsConeTrimmed = Standard_False; 
   gp_Circ myCircle = aCircle;
-
-
   if( VminCircle.Radius() > 0.01 ) {
     IsConeTrimmed = Standard_True;
-    if( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 1 ) myCircle =  VminCircle;
+    if( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 1 ) myCircle = VminCircle;
   }
  
-  gp_Pnt AttachmentPnt;
-  gp_Pnt OppositePnt;
-  gp_Pnt aPnt, tmpPnt;
-
-
-  Quantity_Length X,Y,Z;
-
-  Standard_Real param = 0.; //ElCLib::Parameter(myCircle, aPosition);
-  aPnt = Apex;
   gp_Pnt P1 = ElCLib::Value(0., myCircle);
   gp_Pnt P2 = ElCLib::Value(M_PI, myCircle);
 
-  gce_MakePln mkPln(P1, P2,  aPnt);   // create a plane whitch defines plane for projection aPosition on it
+  gce_MakePln mkPln(P1, P2, Apex); // create a plane whitch defines plane for projection aPosition on it
 
   gp_Vec aVector( mkPln.Value().Location(), aPosition );     //project aPosition on a plane
   gp_Vec Normal = mkPln.Value().Axis().Direction(); 
   Normal = (aVector * Normal) * Normal;
-  aPnt = aPosition;  
 
-  aPnt =  aPnt.Translated( -Normal );
+  gp_Pnt aPnt = aPosition;
+  aPnt = aPnt.Translated( -Normal );
   
-  tmpPnt = aPnt;
+  gp_Pnt tmpPnt = aPnt;
 
-  if( aPnt.Distance(P1) <  aPnt.Distance(P2) ){
+  gp_Pnt AttachmentPnt, OppositePnt;
+  if( aPnt.Distance(P1) <  aPnt.Distance(P2) ) {
     AttachmentPnt = P1; 
     OppositePnt = P2; 
   }
@@ -134,136 +127,96 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
     AttachmentPnt = P2; 
     OppositePnt = P1;
   }
-  
+
   aPnt = AttachmentPnt ;                          // Creating of circle whitch defines a plane for a dimension arc
   gp_Vec Vec(AttachmentPnt, Apex);                // Dimension arc is a part of the circle 
-  Vec.Scale(2);
+  Vec.Scale(2.);
   aPnt.Translate(Vec);
-  GC_MakeCircle mkCirc(AttachmentPnt, OppositePnt,  aPnt); 
-  gp_Circ  aCircle2 = mkCirc.Value()->Circ();
+  GC_MakeCircle mkCirc(AttachmentPnt, OppositePnt, aPnt); 
+  gp_Circ aCircle2 = mkCirc.Value()->Circ();
 
   Standard_Integer i;
   Standard_Real AttParam = ElCLib::Parameter(aCircle2, AttachmentPnt);  //must be equal to zero (look circle construction)
   Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt);    
-  gp_Dir aDir, aDir2;
   
-  while ( AttParam >= 2 * M_PI ) AttParam -= 2 * M_PI;
-  while ( OppParam >= 2 * M_PI ) OppParam -= 2 * M_PI;
+  while ( AttParam >= 2. * M_PI ) AttParam -= 2. * M_PI;
+  while ( OppParam >= 2. * M_PI ) OppParam -= 2. * M_PI;
 
   //-------------------------- Compute angle ------------------------
-   if( txt.Length() == 0 ) {
-     Standard_Real angle = UnitsAPI::CurrentFromLS( Abs( OppParam ),"PLANE ANGLE");
-     char res[80]; 
-     sprintf(res, "%g", angle );
-     txt = TCollection_ExtendedString(res);
-   }
+  if( txt.Length() == 0 ) {
+    Standard_Real angle = UnitsAPI::CurrentFromLS( Abs( OppParam ),"PLANE ANGLE");
+    char res[80]; 
+    sprintf(res, "%g", angle );
+    txt = TCollection_ExtendedString(res);
+  }
   //-----------------------------------------------------------------
 
-   
-
+  Standard_Boolean IsArrowOut = Standard_True;    //Is arrows inside or outside of the cone
   if( ElCLib::Parameter(aCircle2, tmpPnt) < OppParam )
- // if( aPosition.Distance( myCircle.Location() ) <= myCircle.Radius() ) 
-    if( 2 * myCircle.Radius() > 4 * myArrowSize ) IsArrowOut = Standard_False;  //four times more than an arrow size
-    
-  
-  Graphic3d_Array1OfVertex V(1, 12);
-  
-  Standard_Real angle;
-//  param = ElCLib::Parameter(aCircle2, tmpPnt);
-  angle = OppParam - AttParam;
-  param = AttParam;
+    if( 2. * myCircle.Radius() > 4. * myArrowSize ) IsArrowOut = Standard_False;  //four times more than an arrow size
 
+  Standard_Real angle = OppParam - AttParam;
+  Standard_Real param = AttParam;
+
+  gp_Dir aDir, aDir2;
   if(IsArrowOut) {
-    aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam - M_PI / 12, aCircle2 ), AttachmentPnt) ) );
-    aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam + M_PI / 12, aCircle2 ), OppositePnt) ) );
+    aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam - M_PI / 12., aCircle2 ), AttachmentPnt) ) );
+    aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam + M_PI / 12., aCircle2 ), OppositePnt) ) );
   }
   else {
-    aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam + M_PI / 12, aCircle2 ), AttachmentPnt ) ) );
-    aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam - M_PI / 12, aCircle2 ),  OppositePnt ) ) );
-  }
-  
-  while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
-  for( i = 0; i <= 11; i++ ) {                                            //calculating of arc             
-    ( ElCLib::Value(param + angle/11 * i, aCircle2) ).Coord(X, Y, Z);
-    V(i+1).SetCoord(X, Y, Z);
+    aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam + M_PI / 12., aCircle2 ), AttachmentPnt ) ) );
+    aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam - M_PI / 12., aCircle2 ), OppositePnt ) ) );
   }
 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);   //add the arc  
+  while ( angle > 2. * M_PI ) angle -= 2. * M_PI;
+
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(12);
+  for( i = 0; i <= 11; i++ )
+    aPrims->AddVertex(ElCLib::Value(param + angle/11 * i, aCircle2));
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   DsgPrs::ComputeSymbol(aPresentation, anAngleAspect, AttachmentPnt,
-                         AttachmentPnt, aDir, aDir, DsgPrs_AS_LASTAR);
+                        AttachmentPnt, aDir, aDir, DsgPrs_AS_LASTAR);
   DsgPrs::ComputeSymbol(aPresentation, anAngleAspect, OppositePnt, 
-                         OppositePnt, aDir2, aDir2, DsgPrs_AS_LASTAR);
+                        OppositePnt, aDir2, aDir2, DsgPrs_AS_LASTAR);
 
   param = ElCLib::Parameter(aCircle2, tmpPnt);
   tmpPnt = ElCLib::Value(param, aCircle2);
-  tmpPnt =  tmpPnt.Translated(gp_Vec(0, 0, -1)*2);
-  Prs3d_Text::Draw(aPresentation,aLengthAspect->TextAspect(), txt, tmpPnt);   //add the TCollection_ExtendedString
-
-  angle = 2 * M_PI - param ; 
-  if( param > OppParam ) {
-    while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
-    for( i = 11; i >= 0; i-- ) {       //calculating of arc             
-      ( ElCLib::Value(-angle/11 * i, aCircle2) ).Coord(X, Y, Z);
-      V(i+1).SetCoord(X, Y, Z);
-    }
-
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);   //add additional line 
+  tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -2));
+  Prs3d_Text::Draw(aPresentation, aLengthAspect->TextAspect(), txt, tmpPnt);   //add the TCollection_ExtendedString
+
+  angle = 2. * M_PI - param ; 
+  if( param > OppParam )
+  {
+    while ( angle > 2. * M_PI ) angle -= 2. * M_PI;
+    aPrims = new Graphic3d_ArrayOfPolylines(12);
+    for( i = 11; i >= 0; i-- )
+      aPrims->AddVertex(ElCLib::Value(-angle/11 * i, aCircle2));
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
-  if( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 1 && !IsConeTrimmed ) {         //above
-    Graphic3d_Array1OfVertex V2(1,3);    
-    AttachmentPnt.Coord(X, Y, Z);
-    V2(1).SetCoord(X, Y, Z);
-    Apex.Coord(X, Y, Z);
-    V2(2).SetCoord(X, Y, Z); 
-    OppositePnt.Coord(X, Y, Z);
-    V2(3).SetCoord(X, Y, Z); 
-
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);   //add the additional lines
+
+  if( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 1 && !IsConeTrimmed )         //above
+  {
+    aPrims = new Graphic3d_ArrayOfPolylines(3);
+    aPrims->AddVertex(AttachmentPnt);
+    aPrims->AddVertex(Apex);
+    aPrims->AddVertex(OppositePnt);
   }
-  else {  
+  else
+  {
     aPnt = OppositePnt ;
     if ( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 0 ) return;
-    Graphic3d_Array1OfVertex V3(1,2);
+
     gp_Pnt P11 = ElCLib::Value( 0., VmaxCircle );
     gp_Pnt P12 = ElCLib::Value( M_PI, VmaxCircle );
-  
-    AttachmentPnt.Coord(X, Y, Z);
-    V3(1).SetCoord(X, Y, Z);
-    if( aPnt.Distance(P1) <  aPnt.Distance(P2) )  P12.Coord(X, Y, Z);
-    else P11.Coord(X, Y, Z);
-    V3(2).SetCoord(X, Y, Z);
-      
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V3);
-      
-    OppositePnt.Coord(X, Y, Z);
-    V3(1).SetCoord(X, Y, Z);
-    if( aPnt.Distance(P1) <  aPnt.Distance(P2) )  P11.Coord(X, Y, Z);
-    else P12.Coord(X, Y, Z);
-    V3(2).SetCoord(X, Y, Z);
-    
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V3);
-  }
-}
 
-//------------------------------------------------------------------------------------------------------------------
-// Returns 1 if C is above of CMin; 0 if C is bitween CMin and CMax; -1 if C is Below CMax   
-//-----------------------------------------------------------------------------------------------------------------
-static Standard_Integer AboveInBelowCone(gp_Circ CMax, gp_Circ CMin, gp_Circ C)
-{
-  Standard_Real D, D1, D2;
-  
-  D = CMax.Location().Distance( CMin.Location() );
-  D1 = CMax.Location().Distance( C.Location() );
-  D2 = CMin.Location().Distance( C.Location() );
-
-
-  if ( D >= D1 && D >= D2 ) return 0;
-  if ( D < D2 && D1 < D2 ) return -1;
-  if ( D < D1 && D2 < D1 ) return 1;
-
-  return 0;
+    aPrims = new Graphic3d_ArrayOfSegments(4);
+    aPrims->AddVertex(AttachmentPnt);
+    aPrims->AddVertex(( aPnt.Distance(P1) < aPnt.Distance(P2) )? P12 : P11);
+    aPrims->AddVertex(OppositePnt);
+    aPrims->AddVertex(( aPnt.Distance(P1) < aPnt.Distance(P2) )? P11 : P12);
+  }
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 
@@ -274,19 +227,20 @@ static Standard_Integer AboveInBelowCone(gp_Circ CMax, gp_Circ CMin, gp_Circ C)
 //==========================================================================
 
 void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real theval,
-                                   const TCollection_ExtendedString& aText,
-                                   const gp_Pnt& CenterPoint,
-                                   const gp_Pnt& AttachmentPoint1,
-                                   const gp_Pnt& AttachmentPoint2,
-                                   const gp_Dir& dir1,
-                                   const gp_Dir& dir2,
-                                   const gp_Dir& axisdir,
-                                   const gp_Pnt& OffsetPoint) {
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real theval,
+                                    const TCollection_ExtendedString& aText,
+                                    const gp_Pnt& CenterPoint,
+                                    const gp_Pnt& AttachmentPoint1,
+                                    const gp_Pnt& AttachmentPoint2,
+                                    const gp_Dir& dir1,
+                                    const gp_Dir& dir2,
+                                    const gp_Dir& axisdir,
+                                    const gp_Pnt& OffsetPoint)
+{
   char valcar[80];
   sprintf(valcar,"%5.2f",theval);
-  
+
   Handle(Prs3d_AngleAspect) LA = aDrawer->AngleAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
@@ -294,10 +248,6 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
   gp_Vec vec1(dir1);
   vec1 *= cer.Radius();
-#ifdef DEB
-  gp_Pnt p1 =
-#endif
-              CenterPoint.Translated(vec1);
   gp_Vec vec2(dir2);
   vec2 *= cer.Radius();
   gp_Pnt p2 = CenterPoint.Translated(vec2);
@@ -312,81 +262,71 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   if (uco > ufin) {
     if (Abs(theval)<M_PI) {
       // test if uco is in the opposite sector 
-      if (uco > udeb+M_PI && uco < ufin+M_PI){
-       udeb = udeb + M_PI;
-       ufin = ufin + M_PI;
-       uc1  = udeb;
-       uc2  = ufin;
+      if (uco > udeb+M_PI && uco < ufin+M_PI) {
+        udeb += M_PI;
+        ufin += M_PI;
+        uc1 = udeb;
+        uc2 = ufin;
       }
     }
   }
 
   if (uco > ufin) {
-    if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
+    if ((uco-uc2) < (uc1-uco+(2.*M_PI))) {
       ufin = uco;
     }
     else {
-      udeb = uco - 2*M_PI;
+      udeb = uco - 2.*M_PI;
     }
   }
 
-  Standard_Real alpha = Abs(ufin-udeb);
-  Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++) {
-    ptcur =  ElCLib::Value(udeb+ dteta*(i-1),cer);
-    V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  const Standard_Real alpha = Abs(ufin-udeb);
+  const Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
+  const Standard_Real dteta = alpha/(nbp-1);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+4,3);
+  aPrims->AddBound(nbp);
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
+
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,OffsetPoint);
   
+  Standard_Real length = LA->ArrowAspect()->Length();
+  if (length <  Precision::Confusion()) length = 1.e-04;
+
   gp_Vec vecarr;
   gp_Pnt ptarr;
   ElCLib::D1(uc1,cer,ptarr,vecarr);
+
   gp_Ax1 ax1(ptarr, axisdir);
   gp_Dir dirarr(-vecarr);
+
   //calculate angle of rotation
-  Standard_Real beta(0.);
-  Standard_Real length = LA->ArrowAspect()->Length();
-  if (length <  Precision::Confusion()) length = 1.e-04;
   gp_Pnt ptarr2(ptarr.XYZ() + length*dirarr.XYZ());
-  Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
+  const Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
   gp_Pnt ptarr3 = ElCLib::Value(parcir, cer);
-  gp_Vec v1(ptarr,ptarr2 );
-  gp_Vec v2(ptarr, ptarr3);
-  beta = v1.Angle(v2);
+  gp_Vec v1(ptarr,ptarr2);
+  gp_Vec v2(ptarr,ptarr3);
+  const Standard_Real beta = v1.Angle(v2);
   dirarr.Rotate(ax1, beta);
-  Prs3d_Arrow::Draw(aPresentation,
-                   ptarr,
-                   dirarr,
-                   LA->ArrowAspect()->Angle(),
-                   length);  
-
-  Graphic3d_Array1OfVertex Vrap(1,2);
-  Vrap(1).SetCoord(AttachmentPoint1.X(),
-                  AttachmentPoint1.Y(),
-                  AttachmentPoint1.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
-  
+  Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr,LA->ArrowAspect()->Angle(),length);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(ptarr);
+
   ElCLib::D1(uc2,cer,ptarr,vecarr);
+
   ax1.SetLocation(ptarr);
   gp_Dir dirarr2(vecarr);
   dirarr2.Rotate(ax1,-beta);
-  Prs3d_Arrow::Draw(aPresentation,
-                   ptarr,
-                   dirarr2,
-                   LA->ArrowAspect()->Angle(),
-                   length);  
-
-  Vrap(1).SetCoord(AttachmentPoint2.X(),
-                  AttachmentPoint2.Y(),
-                  AttachmentPoint2.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
+  Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr2,LA->ArrowAspect()->Angle(),length);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(ptarr);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 
@@ -395,23 +335,23 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
 // purpose  : Adds prezentation of angle between two faces
 //==========================================================================
 
-void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real theval,
-                                   const TCollection_ExtendedString& aText,
-                                   const gp_Pnt& CenterPoint,
-                                   const gp_Pnt& AttachmentPoint1,
-                                   const gp_Pnt& AttachmentPoint2,
-                                   const gp_Dir& dir1,
-                                   const gp_Dir& dir2,
-                                   const gp_Dir& axisdir,
-                                   const Standard_Boolean isPlane,
-                                   const gp_Ax1& AxisOfSurf,
-                                   const gp_Pnt& OffsetPoint,
-                                   const DsgPrs_ArrowSide ArrowPrs ) 
+void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real theval,
+                                    const TCollection_ExtendedString& aText,
+                                    const gp_Pnt& CenterPoint,
+                                    const gp_Pnt& AttachmentPoint1,
+                                    const gp_Pnt& AttachmentPoint2,
+                                    const gp_Dir& dir1,
+                                    const gp_Dir& dir2,
+                                    const gp_Dir& axisdir,
+                                    const Standard_Boolean isPlane,
+                                    const gp_Ax1& AxisOfSurf,
+                                    const gp_Pnt& OffsetPoint,
+                                    const DsgPrs_ArrowSide ArrowPrs )
 {
   char valcar[80];
-  sprintf( valcar, "%5.2f", theval );
+  sprintf(valcar,"%5.2f",theval);
   
   Handle( Prs3d_AngleAspect ) LA = aDrawer->AngleAspect();
   Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
@@ -443,32 +383,28 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat
                                         FirstParAttachCirc,
                                         LastParAttachCirc );
                                      
-  Graphic3d_Array1OfVertex Vrap(1,2);
-
   // Creating the angle's arc or line if null angle
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims;
   if (theval > Precision::Angular() && Abs( M_PI-theval ) > Precision::Angular())
-    {
-      Standard_Real Alpha  = Abs( LastParAngleCirc - FirstParAngleCirc );
-      Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
-      Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
-      Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 );
-      gp_Pnt CurPnt;
-      for (Standard_Integer i = 0 ; i < NodeNumber; i++)
-       {
-         CurPnt =  ElCLib::Value( FirstParAngleCirc, AngleCirc );
-         ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-         FirstParAngleCirc += delta ;
-       }
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
-    }
+  {
+    const Standard_Real Alpha  = Abs( LastParAngleCirc - FirstParAngleCirc );
+    const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
+    const Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 );
+
+    aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber+4,3);
+    aPrims->AddBound(NodeNumber);
+    for (Standard_Integer i = 0; i < NodeNumber; i++, FirstParAngleCirc += delta)
+      aPrims->AddVertex(ElCLib::Value( FirstParAngleCirc, AngleCirc ));
+
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+    aPrims = new Graphic3d_ArrayOfSegments(4);
+  }
   else // null angle
-    {
-      Vrap(1).SetCoord( OffsetPoint.X(),
-                       OffsetPoint.Y(),
-                       OffsetPoint.Z());
-      Vrap(2).SetCoord( EndOfArrow1.X(), EndOfArrow1.Y(), EndOfArrow1.Z() );
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( Vrap );
-    }
+  {
+    aPrims = new Graphic3d_ArrayOfSegments(6);
+    aPrims->AddVertex(OffsetPoint);
+    aPrims->AddVertex(EndOfArrow1);
+  }
 
   // Add presentation of arrows
   DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow2, ArrowPrs );
@@ -477,49 +413,37 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat
   Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
   
   // Line from AttachmentPoint1 to end of Arrow1
-  Vrap(1).SetCoord(AttachmentPoint1.X(),
-                  AttachmentPoint1.Y(),
-                  AttachmentPoint1.Z());
-  Vrap(2).SetCoord( EndOfArrow1.X(), EndOfArrow1.Y(), EndOfArrow1.Z() );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( Vrap );
-  
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(EndOfArrow1);
+  // Line from "projection" of AttachmentPoint2 to end of Arrow2
+  aPrims->AddVertex(ProjAttachPoint2);
+  aPrims->AddVertex(EndOfArrow2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
   // Line or arc from AttachmentPoint2 to its "projection"
   if (AttachmentPoint2.Distance( ProjAttachPoint2 ) > Precision::Confusion())
-    {
-      if (isPlane)
+  {
+    if (isPlane)
        {
          // Creating the line from AttachmentPoint2 to its projection
-         Vrap(1).SetCoord( AttachmentPoint2.X(),
-                           AttachmentPoint2.Y(),
-                           AttachmentPoint2.Z() );
-         Vrap(2).SetCoord( ProjAttachPoint2.X(),
-                           ProjAttachPoint2.Y(),
-                           ProjAttachPoint2.Z() );
-         Prs3d_Root::CurrentGroup( aPresentation )->Polyline( Vrap );
+      aPrims = new Graphic3d_ArrayOfSegments(2);
+      aPrims->AddVertex(AttachmentPoint2);
+      aPrims->AddVertex(ProjAttachPoint2);
        }      
-      else
+    else
        {
          // Creating the arc from AttachmentPoint2 to its projection
-         Standard_Real Alpha  = Abs( LastParAttachCirc - FirstParAttachCirc );
-         Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
-         Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
-         Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 );
-         gp_Pnt CurPnt;
-         for (Standard_Integer i = 0 ; i < NodeNumber; i++)
-           {
-             CurPnt =  ElCLib::Value( FirstParAttachCirc, AttachCirc );
-             ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-             FirstParAttachCirc += delta ;
-           }
-         Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
+      const Standard_Real Alpha = Abs( LastParAttachCirc - FirstParAttachCirc );
+         const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
+      const Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 );
+
+      aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
+         for (Standard_Integer i = 0; i < NodeNumber; i++, FirstParAttachCirc += delta)
+        aPrims->AddVertex(ElCLib::Value( FirstParAttachCirc, AttachCirc ));
        }
-    }
-  // Line from "projection" of AttachmentPoint2 to end of Arrow2
-  Vrap(1).SetCoord( ProjAttachPoint2.X(),
-                   ProjAttachPoint2.Y(),
-                   ProjAttachPoint2.Z() );
-  Vrap(2).SetCoord( EndOfArrow2.X(), EndOfArrow2.Y(), EndOfArrow2.Z());
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( Vrap );
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
 }
 
 
@@ -530,20 +454,22 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat
 //==========================================================================
 
 void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real theval,
-                                   const TCollection_ExtendedString& aText,
-                                   const gp_Pnt& CenterPoint,
-                                   const gp_Pnt& AttachmentPoint1,
-                                   const gp_Pnt& AttachmentPoint2,
-                                   const gp_Dir& dir1,
-                                   const gp_Dir& dir2,
-                                   const gp_Pnt& OffsetPoint) {
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real theval,
+                                    const TCollection_ExtendedString& aText,
+                                    const gp_Pnt& CenterPoint,
+                                    const gp_Pnt& AttachmentPoint1,
+                                    const gp_Pnt& AttachmentPoint2,
+                                    const gp_Dir& dir1,
+                                    const gp_Dir& dir2,
+                                    const gp_Pnt& OffsetPoint)
+{
   char valcar[80];
   sprintf(valcar,"%5.2f",theval);
   
   Handle(Prs3d_AngleAspect) LA = aDrawer->AngleAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   gp_Dir Norm;
   if (!dir1.IsParallel(dir2, Precision::Angular())) {
     Norm = dir1.Crossed(dir2);
@@ -559,10 +485,6 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
   gp_Vec vec1(dir1);
   vec1 *= cer.Radius();
-#ifdef DEB
-  gp_Pnt p1 =
-#endif
-              CenterPoint.Translated(vec1);
   gp_Vec vec2(dir2);
   vec2 *= cer.Radius();
   gp_Pnt p2 = CenterPoint.Translated(vec2);
@@ -577,116 +499,103 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   if (uco > ufin) {
     if (Abs(theval)<M_PI) {
       // test if uco is in the opposite sector 
-      if (uco > udeb+M_PI && uco < ufin+M_PI){
-       udeb = udeb + M_PI;
-       ufin = ufin + M_PI;
-       uc1  = udeb;
-       uc2  = ufin;
+      if (uco > udeb+M_PI && uco < ufin+M_PI) {
+        udeb += M_PI;
+        ufin += M_PI;
+        uc1 = udeb;
+        uc2 = ufin;
       }
     }
   }
 
   if (uco > ufin) {
-    if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
+    if ((uco-uc2) < (uc1-uco+(2.*M_PI))) {
       ufin = uco;
     }
     else {
-      udeb = uco - 2*M_PI;
+      udeb = uco - 2.*M_PI;
     }
   }
 
-  Standard_Real alpha = Abs(ufin-udeb);
-  Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++) {
-    ptcur =  ElCLib::Value(udeb+ dteta*(i-1),cer);
-    V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  const Standard_Real alpha = Abs(ufin-udeb);
+  const Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
+  const Standard_Real dteta = alpha/(nbp-1);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+4,3);
+  aPrims->AddBound(nbp);
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
   
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,OffsetPoint);
   
+  Standard_Real length = LA->ArrowAspect()->Length();
+  if (length <  Precision::Confusion()) length = 1.e-04;
+
   gp_Vec vecarr;
   gp_Pnt ptarr;
   ElCLib::D1(uc1,cer,ptarr,vecarr);
+
   gp_Ax1 ax1(ptarr, Norm);
   gp_Dir dirarr(-vecarr);
   //calculate the angle of rotation
-  Standard_Real beta;
-  Standard_Real length = LA->ArrowAspect()->Length();
-  if (length <  Precision::Confusion()) length = 1.e-04;
   gp_Pnt ptarr2(ptarr.XYZ() + length*dirarr.XYZ());
-  Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
+  const Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
   gp_Pnt ptarr3 = ElCLib::Value(parcir, cer);
-  gp_Vec v1(ptarr,ptarr2 );
-  gp_Vec v2(ptarr, ptarr3);
-  beta = v1.Angle(v2);
+  gp_Vec v1(ptarr,ptarr2);
+  gp_Vec v2(ptarr,ptarr3);
+  const Standard_Real beta = v1.Angle(v2);
   dirarr.Rotate(ax1, beta);
-  Prs3d_Arrow::Draw(aPresentation,
-                   ptarr,
-                   dirarr,
-                   LA->ArrowAspect()->Angle(),
-                   length);  
-  Graphic3d_Array1OfVertex Vrap(1,2);
-  Vrap(1).SetCoord(AttachmentPoint1.X(),
-                  AttachmentPoint1.Y(),
-                  AttachmentPoint1.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
-  
+  Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr,LA->ArrowAspect()->Angle(),length);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(ptarr);
+
   ElCLib::D1(uc2,cer,ptarr,vecarr);
+
   ax1.SetLocation(ptarr);
   gp_Dir dirarr2(vecarr);
   dirarr2.Rotate(ax1,  - beta);
-  Prs3d_Arrow::Draw(aPresentation,
-                   ptarr,
-                   dirarr2,
-                   LA->ArrowAspect()->Angle(),
-                   length);  
+  Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr2,LA->ArrowAspect()->Angle(),length);  
   
-  Vrap(1).SetCoord(AttachmentPoint2.X(),
-                  AttachmentPoint2.Y(),
-                  AttachmentPoint2.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(ptarr);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
+
 //==========================================================================
 // function : DsgPrs_AnglePresentation::Add
 // purpose  : It is possible to choose the symbol of extremities of the face (arrow, point...)
 //==========================================================================
 
 void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real theval,
-                                   const TCollection_ExtendedString& aText,
-                                   const gp_Pnt& CenterPoint,
-                                   const gp_Pnt& AttachmentPoint1,
-                                   const gp_Pnt& AttachmentPoint2,
-                                   const gp_Dir& dir1,
-                                   const gp_Dir& dir2,
-                                   const gp_Pnt& OffsetPoint,
-                                   const DsgPrs_ArrowSide ArrowPrs)
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real theval,
+                                    const TCollection_ExtendedString& aText,
+                                    const gp_Pnt& CenterPoint,
+                                    const gp_Pnt& AttachmentPoint1,
+                                    const gp_Pnt& AttachmentPoint2,
+                                    const gp_Dir& dir1,
+                                    const gp_Dir& dir2,
+                                    const gp_Pnt& OffsetPoint,
+                                    const DsgPrs_ArrowSide ArrowPrs)
 {
   char valcar[80];
   sprintf(valcar,"%5.2f",theval);
   
   Handle(Prs3d_AngleAspect) LA = aDrawer->AngleAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  gp_Dir Norm = dir1.Crossed(dir2);
 
+  gp_Dir Norm = dir1.Crossed(dir2);
   if (Abs(theval) > M_PI) Norm.Reverse();
 
   gp_Ax2 ax(CenterPoint,Norm,dir1);
   gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
   gp_Vec vec1(dir1);
   vec1 *= cer.Radius();
-#ifdef DEB
-  gp_Pnt p1 =
-#endif
-              CenterPoint.Translated(vec1);
   gp_Vec vec2(dir2);
   vec2 *= cer.Radius();
   gp_Pnt p2 = CenterPoint.Translated(vec2);
@@ -701,61 +610,57 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   if (uco > ufin) {
     if (Abs(theval)<M_PI) {
       // test if uco is in the opposite sector 
-      if (uco > udeb+M_PI && uco < ufin+M_PI){
-       udeb = udeb + M_PI;
-       ufin = ufin + M_PI;
-       uc1  = udeb;
-       uc2  = ufin;
+      if (uco > udeb+M_PI && uco < ufin+M_PI) {
+        udeb += M_PI;
+        ufin += M_PI;
+        uc1 = udeb;
+        uc2 = ufin;
       }
     }
   }
 
   if (uco > ufin) {
-    if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
+    if ((uco-uc2) < (uc1-uco+(2.*M_PI))) {
       ufin = uco;
     }
     else {
-      udeb = uco - 2*M_PI;
+      udeb = uco - 2.*M_PI;
     }
   }
 
-  Standard_Real alpha = Abs(ufin-udeb);
-  Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++) {
-    ptcur =  ElCLib::Value(udeb+ dteta*(i-1),cer);
-    V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  const Standard_Real alpha = Abs(ufin-udeb);
+  const Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
+  const Standard_Real dteta = alpha/(nbp-1);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+4,3);
+  aPrims->AddBound(nbp);
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
+
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,OffsetPoint);
   
-// Lines of recall
+  Standard_Real length = LA->ArrowAspect()->Length();
+  if (length <  Precision::Confusion()) length = 1.e-04;
+
+  // Lines of recall
   gp_Vec vecarr;
   gp_Pnt ptarr;
   ElCLib::D1(uc1,cer,ptarr,vecarr);
+
   gp_Ax1 ax1(ptarr, Norm);
   gp_Dir dirarr(-vecarr);
   //calculate angle of rotation
-  Standard_Real beta(0.);
-  Standard_Real length = LA->ArrowAspect()->Length();
-  if (length <  Precision::Confusion()) length = 1.e-04;
   gp_Pnt ptarr2(ptarr.XYZ() + length*dirarr.XYZ());
-  Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
+  const Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
   gp_Pnt ptarr3 = ElCLib::Value(parcir, cer);
   gp_Vec v1(ptarr,ptarr2 );
   gp_Vec v2(ptarr, ptarr3);
-  beta = v1.Angle(v2);
+  const Standard_Real beta = v1.Angle(v2);
   dirarr.Rotate(ax1, beta);
 
-  Graphic3d_Array1OfVertex Vrap(1,2);
-  Vrap(1).SetCoord(AttachmentPoint1.X(),
-                  AttachmentPoint1.Y(),
-                  AttachmentPoint1.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(ptarr);
   
   gp_Vec vecarr1;
   gp_Pnt ptarr1;
@@ -764,21 +669,17 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   gp_Dir dirarr2(vecarr1);
   dirarr2.Rotate(ax1,  - beta);
 
-  
-  Vrap(1).SetCoord(AttachmentPoint2.X(),
-                  AttachmentPoint2.Y(),
-                  AttachmentPoint2.Z());
-  Vrap(2).SetCoord(ptarr1.X(),ptarr1.Y(),ptarr1.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(ptarr1);
 
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
-// One traces the arrows
+  // One traces the arrows
   DsgPrs::ComputeSymbol(aPresentation,LA,ptarr,ptarr1,dirarr,dirarr2,ArrowPrs);
 }
 
 
-
-
 //==========================================================================
 // function : DsgPrs_AnglePresentation::Add
 // purpose  : 
@@ -786,35 +687,31 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
 //==========================================================================
 
 void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real theval,
-                                   const gp_Pnt& CenterPoint,
-                                   const gp_Pnt& AttachmentPoint1,
-                                   const gp_Pnt& AttachmentPoint2,
-                                   const gp_Dir& dir1,
-                                   const gp_Dir& dir2,
-                                   const gp_Pnt& OffsetPoint) {
-
-
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real theval,
+                                    const gp_Pnt& CenterPoint,
+                                    const gp_Pnt& AttachmentPoint1,
+                                    const gp_Pnt& AttachmentPoint2,
+                                    const gp_Dir& dir1,
+                                    const gp_Dir& dir2,
+                                    const gp_Pnt& OffsetPoint)
+{
   char valcar[80];
   sprintf(valcar,"%5.2f",theval);
+
   TCollection_AsciiString valas(valcar);
   TCollection_ExtendedString aText(valas);
 
   Handle(Prs3d_AngleAspect) LA = aDrawer->AngleAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  gp_Dir Norm = dir1.Crossed(dir2);
 
+  gp_Dir Norm = dir1.Crossed(dir2);
   if (Abs(theval) > M_PI) Norm.Reverse();
 
   gp_Ax2 ax(CenterPoint,Norm,dir1);
   gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
   gp_Vec vec1(dir1);
   vec1 *= cer.Radius();
-#ifdef DEB
-  gp_Pnt p1 =
-#endif
-              CenterPoint.Translated(vec1);
   gp_Vec vec2(dir2);
   vec2 *= cer.Radius();
   gp_Pnt p2 = CenterPoint.Translated(vec2);
@@ -829,90 +726,80 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   if (uco > ufin) {
     if (Abs(theval)<M_PI) {
       // test if uco is in the opposite sector 
-      if (uco > udeb+M_PI && uco < ufin+M_PI){
-       udeb = udeb + M_PI;
-       ufin = ufin + M_PI;
-       uc1  = udeb;
-       uc2  = ufin;
+      if (uco > udeb+M_PI && uco < ufin+M_PI) {
+        udeb += M_PI;
+        ufin += M_PI;
+        uc1 = udeb;
+        uc2 = ufin;
       }
     }
   }
 
   if (uco > ufin) {
-    if ((uco-uc2) < (uc1-uco+(2*M_PI))) {
+    if ((uco-uc2) < (uc1-uco+(2.*M_PI))) {
       ufin = uco;
     }
     else {
-      udeb = uco - 2*M_PI;
+      udeb = uco - 2.*M_PI;
     }
   }
 
-  Standard_Real alpha = Abs(ufin-udeb);
-  Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++) {
-    ptcur =  ElCLib::Value(udeb+ dteta*(i-1),cer);
-    V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  const Standard_Real alpha = Abs(ufin-udeb);
+  const Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
+  const Standard_Real dteta = alpha/(nbp-1);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+4,3);
+  aPrims->AddBound(nbp);
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
+
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,OffsetPoint);
 
+  Standard_Real length = LA->ArrowAspect()->Length();
+  if (length <  Precision::Confusion()) length = 1.e-04;
+
   gp_Vec vecarr;
   gp_Pnt ptarr;
   ElCLib::D1(uc1,cer,ptarr,vecarr);
+
   gp_Ax1 ax1(ptarr, Norm);
   gp_Dir dirarr(-vecarr);
   //calculate the angle of rotation
-  Standard_Real beta;
-  Standard_Real length = LA->ArrowAspect()->Length();
-  if (length <  Precision::Confusion()) length = 1.e-04;
   gp_Pnt ptarr2(ptarr.XYZ() + length*dirarr.XYZ());
-  Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
+  const Standard_Real parcir = ElCLib::Parameter(cer, ptarr2);
   gp_Pnt ptarr3 = ElCLib::Value(parcir, cer);
   gp_Vec v1(ptarr,ptarr2 );
   gp_Vec v2(ptarr, ptarr3);
-  beta = v1.Angle(v2);
+  const Standard_Real beta = v1.Angle(v2);
   dirarr.Rotate(ax1, beta);
-  Prs3d_Arrow::Draw(aPresentation,
-                   ptarr,
-                   dirarr,
-                   LA->ArrowAspect()->Angle(),
-                   length);  
-
-  Graphic3d_Array1OfVertex Vrap(1,2);
-  Vrap(1).SetCoord(AttachmentPoint1.X(),
-                  AttachmentPoint1.Y(),
-                  AttachmentPoint1.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
-  
+
+  Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr,LA->ArrowAspect()->Angle(),length);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(ptarr);
+
   ElCLib::D1(uc2,cer,ptarr,vecarr);
   ax1.SetLocation(ptarr);
   gp_Dir dirarr2(vecarr);
-  dirarr2.Rotate(ax1,  - beta);
-  Prs3d_Arrow::Draw(aPresentation,
-                   ptarr,
-                   dirarr2,
-                   LA->ArrowAspect()->Angle(),
-                   length); 
+  dirarr2.Rotate(ax1, -beta);
+
+  Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr2,LA->ArrowAspect()->Angle(),length);
   
-  Vrap(1).SetCoord(AttachmentPoint2.X(),
-                  AttachmentPoint2.Y(),
-                  AttachmentPoint2.Z());
-  Vrap(2).SetCoord(ptarr.X(),ptarr.Y(),ptarr.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(ptarr);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentation,
-                                   const Handle(Prs3d_Drawer)& aDrawer,
-                                   const Standard_Real theval,
-                                   const gp_Pnt& CenterPoint,
-                                   const gp_Pnt& AttachmentPoint1,
-                                   const gp_Ax1& theAxe,
-                                   const DsgPrs_ArrowSide ArrowSide) 
+                                    const Handle(Prs3d_Drawer)& aDrawer,
+                                    const Standard_Real theval,
+                                    const gp_Pnt& CenterPoint,
+                                    const gp_Pnt& AttachmentPoint1,
+                                    const gp_Ax1& theAxe,
+                                    const DsgPrs_ArrowSide ArrowSide)
 {
   Handle(Prs3d_AngleAspect) LA = aDrawer->AngleAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
@@ -921,67 +808,44 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   gp_Ax2 ax(CenterPoint,theAxe.Direction(),dir1);
   gp_Circ cer(ax,CenterPoint.Distance(AttachmentPoint1));
 
-  Standard_Integer nbp = Max (4 , Standard_Integer (50. * theval / M_PI));
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = theval/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++) {
-    ptcur =  ElCLib::Value(dteta*(i-1),cer);
-    V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  const Standard_Integer nbp = Max (4 , Standard_Integer (50. * theval / M_PI));
+  const Standard_Real dteta = theval/(nbp-1);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(dteta*(i-1),cer));
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
   Standard_Real uc1 = 0.;
   Standard_Real uc2 = ElCLib::Parameter(cer,AttachmentPoint1.Rotated(theAxe,theval));
 
-  gp_Vec vecarr;
-  gp_Pnt ptarr;
   Standard_Real length = LA->ArrowAspect()->Length();
-  if (length <  Precision::Confusion()) length = 1.e-04;
+  if (length < Precision::Confusion()) length = 1.e-04;
 
-  switch(ArrowSide) {
-  case DsgPrs_AS_NONE:
-    {
-      break;
-    }
-  case DsgPrs_AS_FIRSTAR:
+  gp_Vec vecarr;
+  gp_Pnt ptarr;
+  switch(ArrowSide)
+  {
+    case DsgPrs_AS_FIRSTAR:
     {
       ElCLib::D1(uc1,cer,ptarr,vecarr);
-      Prs3d_Arrow::Draw(aPresentation,
-                       ptarr,
-                       gp_Dir(-vecarr),
-                       LA->ArrowAspect()->Angle(),
-                       length);
+      Prs3d_Arrow::Draw(aPresentation,ptarr,gp_Dir(-vecarr),LA->ArrowAspect()->Angle(),length);
       break;
     }
-  case DsgPrs_AS_LASTAR:
+    case DsgPrs_AS_LASTAR:
     {
       ElCLib::D1(uc2,cer,ptarr,vecarr);
-      Prs3d_Arrow::Draw(aPresentation,
-                       ptarr,
-                       gp_Dir(vecarr),
-                       LA->ArrowAspect()->Angle(),
-                       length);
+      Prs3d_Arrow::Draw(aPresentation,ptarr,gp_Dir(vecarr),LA->ArrowAspect()->Angle(),length);
       break;
     }
-  case DsgPrs_AS_BOTHAR:
+    case DsgPrs_AS_BOTHAR:
     {
       ElCLib::D1(uc1,cer,ptarr,vecarr);
-      Prs3d_Arrow::Draw(aPresentation,
-                       ptarr,
-                       gp_Dir(-vecarr),
-                       LA->ArrowAspect()->Angle(),
-                       length);
+      Prs3d_Arrow::Draw(aPresentation,ptarr,gp_Dir(-vecarr),LA->ArrowAspect()->Angle(),length);
       ElCLib::D1(uc2,cer,ptarr,vecarr);
-      Prs3d_Arrow::Draw(aPresentation,
-                       ptarr,
-                       gp_Dir(vecarr),
-                       LA->ArrowAspect()->Angle(),
-                       length);
+      Prs3d_Arrow::Draw(aPresentation,ptarr,gp_Dir(vecarr),LA->ArrowAspect()->Angle(),length);
       break;
     }
-  default:
-      break;
+    default: break;
   }
 }
-
index cae1897..d8a157d 100755 (executable)
@@ -23,7 +23,7 @@
 #include <DsgPrs_Chamf2dPresentation.ixx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -44,25 +44,17 @@ void DsgPrs_Chamf2dPresentation::Add(
 {
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   
-  Prs3d_Root::CurrentGroup(aPresentation)
-    ->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
-  Graphic3d_Array1OfVertex V(1,2);
-  V(1).SetCoord(aPntAttach.X(),aPntAttach.Y(),aPntAttach.Z());
-
-  V(2).SetCoord(aPntEnd.X(),aPntEnd.Y(),aPntEnd.Z());
-
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aPntAttach);
+  aPrims->AddVertex(aPntEnd);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
-  Prs3d_Arrow::Draw(aPresentation,
-                   aPntAttach,
-                   ArrowDir,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,aPntAttach,ArrowDir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
                     
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd);
-
 }
 
 
@@ -81,24 +73,18 @@ void DsgPrs_Chamf2dPresentation::Add(
 {
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   
-  Prs3d_Root::CurrentGroup(aPresentation)
-    ->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
-  Graphic3d_Array1OfVertex V(1,2);
-  V(1).SetCoord(aPntAttach.X(),aPntAttach.Y(),aPntAttach.Z());
-
-  V(2).SetCoord(aPntEnd.X(),aPntEnd.Y(),aPntEnd.Z());
-
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aPntAttach);
+  aPrims->AddVertex(aPntEnd);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd);
 
   gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
-
   gp_Dir ArrowDir1 = ArrowDir;
   ArrowDir1.Reverse();
 
   DsgPrs::ComputeSymbol(aPresentation,LA,aPntEnd,aPntAttach,ArrowDir1,ArrowDir,ArrowPrs);
-
-
 }
index 08f896e..5f34a56 100755 (executable)
@@ -23,7 +23,7 @@
 #include <DsgPrs_ConcentricPresentation.ixx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_LengthAspect.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -47,51 +47,43 @@ void DsgPrs_ConcentricPresentation::Add(
 
   //Creation et discretisation du plus gros cercle
   gp_Circ Circ(gp_Ax2(aCenter,aNorm), aRadius);
-  Standard_Integer nbp = 50;
-  Standard_Real dteta = (2 * M_PI)/nbp;
-  Graphic3d_Array1OfVertex V(1,nbp+1);
-  gp_Pnt ptcur;
-  Standard_Real ucur = 0;
+  const Standard_Integer nbp = 50;
+  const Standard_Real dteta = (2. * M_PI)/nbp;
+
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(2*nbp+6,4);
+
+  gp_Pnt pt1 = ElCLib::Value(0., Circ);
+  aPrims->AddBound(nbp+1);
+  aPrims->AddVertex(pt1);
+  Standard_Real ucur = dteta;
   Standard_Integer i ;
-  for ( i = 1; i<=nbp; i++) {
-    ptcur = ElCLib::Value(ucur, Circ);
-    V(i).SetCoord(ptcur.X(), ptcur.Y(),ptcur.Z());
-    ucur = ucur + dteta;
-  }
-  V(nbp+1).SetCoord( V(1).X(), V(1).Y(), V(1).Z());
-  Prs3d_Root::CurrentGroup(aPresentation)
-    ->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  for (i = 2; i<=nbp; i++, ucur += dteta)
+    aPrims->AddVertex(ElCLib::Value(ucur, Circ));
+  aPrims->AddVertex(pt1);
 
   //Creation et discretisation du plus petit cercle
-  Circ.SetRadius(aRadius/2);
-  ucur = 0;
-  for ( i = 1; i<=nbp; i++) {
-    ptcur = ElCLib::Value(ucur, Circ);
-    V(i).SetCoord(ptcur.X(), ptcur.Y(),ptcur.Z());
-    ucur = ucur + dteta;
-  }
-  V(nbp+1).SetCoord( V(1).X(), V(1).Y(), V(1).Z());
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)
-    ->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Circ.SetRadius(0.5*aRadius);
+  pt1 = ElCLib::Value(0., Circ);
+  aPrims->AddBound(nbp+1);
+  aPrims->AddVertex(pt1);
+  ucur = dteta;
+  for (i = 2; i<=nbp; i++, ucur += dteta)
+    aPrims->AddVertex(ElCLib::Value(ucur, Circ));
+  aPrims->AddVertex(pt1);
 
   //Creation de la croix
      //1er segment
-  gp_Dir vecnorm(aPoint.XYZ() - aCenter.XYZ() );
+  gp_Dir vecnorm(aPoint.XYZ() - aCenter.XYZ());
   gp_Vec vec(vecnorm);
   vec.Multiply(aRadius);
   gp_Pnt p1 = aCenter.Translated(vec);
   gp_Pnt p2 = aCenter.Translated(-vec);
-  
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->
-    SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Graphic3d_Array1OfVertex VExt(1,2);
-  VExt(1).SetCoord(p1.X(), p1.Y(), p1.Z());
-  VExt(2).SetCoord(p2.X(), p2.Y(), p2.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VExt);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(p1);
+  aPrims->AddVertex(p2);
 
      //2ieme segment
   vec.Cross(aNorm);
@@ -100,12 +92,10 @@ void DsgPrs_ConcentricPresentation::Add(
   vec.Multiply(aRadius);
   p1 = aCenter.Translated(vec);
   p2 = aCenter.Translated(-vec);
-  VExt(1).SetCoord(p1.X(), p1.Y(), p1.Z());
-  VExt(2).SetCoord(p2.X(), p2.Y(), p2.Z());
 
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->
-    SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VExt);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(p1);
+  aPrims->AddVertex(p2);
 
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
index 606bf9d..99dab74 100755 (executable)
@@ -31,7 +31,7 @@
 #include <Prs3d_ArrowAspect.hxx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 
 #include <gp_Dir.hxx>
 #include <gp_Pnt.hxx>
@@ -60,8 +60,6 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
                                       const DsgPrs_ArrowSide ArrowPrs,
                                       const Standard_Boolean IsDiamSymbol )
 {
-
-
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
@@ -69,32 +67,26 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   gp_Pnt        ptoncirc = ElCLib::Value    (parat, aCircle);
 
   // sideline
-
   gp_Pnt        center  = aCircle.Location();
   gp_Vec        vecrap  (ptoncirc,center);
 
   Standard_Real dist    = center.Distance(AttachmentPoint);
   Standard_Real aRadius = aCircle.Radius();
-  Standard_Boolean inside  = Standard_False;
+  Standard_Boolean inside = (dist < aRadius);
 
   gp_Pnt pt1 = AttachmentPoint;
-  if (dist < aRadius) {
+  if (inside) {
     pt1 = ptoncirc;
     dist = aRadius;
-    inside = Standard_True;
   }
   vecrap.Normalize();
   vecrap *= (dist+aRadius);
-  gp_Pnt        OppositePoint = pt1.Translated(vecrap);
-
+  gp_Pnt OppositePoint = pt1.Translated(vecrap);
   
-  Graphic3d_Array1OfVertex V(1,2);
-  Quantity_Length X,Y,Z;
-  pt1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  OppositePoint.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(pt1);
+  aPrims->AddVertex(OppositePoint);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // value
   TCollection_ExtendedString Text = aText;
@@ -103,11 +95,9 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, AttachmentPoint);
 
   // arrows
-
   gp_Dir arrdir (vecrap);
   if (inside) arrdir.Reverse();
 
-
   gp_Vec vecrap2 = vecrap; 
   gp_Pnt ptoncirc2 = ptoncirc;
   gp_Dir arrdir2 = arrdir;
@@ -128,7 +118,7 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
     if(lpar > fpar)
       return ((para >= fpar) && (para <= lpar));
     else { // fpar > lpar
-      Standard_Real delta = 2*M_PI-fpar;
+      Standard_Real delta = 2.*M_PI-fpar;
       Standard_Real lp, par, fp;
       lp = lpar + delta;
       par = para + delta;
@@ -137,7 +127,6 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
       fp = 0.;
       return ((par >= fp) && (par <= lp));
     }
-      
   }
   if (para >= (fpar+2*M_PI)) return Standard_True;
   if (para <= lpar) return Standard_True;
@@ -162,16 +151,14 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
 {
   Standard_Real fpara = uFirst;
   Standard_Real lpara = uLast;
-  while (lpara > 2*M_PI) {
-    fpara -= 2*M_PI;
-    lpara -= 2*M_PI;
+  while (lpara > 2.*M_PI) {
+    fpara -= 2.*M_PI;
+    lpara -= 2.*M_PI;
   }
 
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-//  Handle(Prs3d_TextAspect) TA = aDrawer->TextAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-// AspectText3d from Graphic3d
-  Standard_Real parEndOfArrow = ElCLib::Parameter(aCircle,AttachmentPoint); //
+  Standard_Real parEndOfArrow = ElCLib::Parameter(aCircle,AttachmentPoint);
   gp_Pnt EndOfArrow;
   gp_Pnt DrawPosition = AttachmentPoint;// point of attachment
   Standard_Boolean otherside = Standard_False;
@@ -194,34 +181,26 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
       gp_Lin L1( Center, dir1 );
       gp_Lin L2( Center, dir2 );
       if(L1.Distance(AttachmentPoint) < L2.Distance(AttachmentPoint))
-       {
-         EndOfArrow = FirstPoint; //***
-         DrawPosition = ElCLib::Value(ElCLib::Parameter( L1, AttachmentPoint ), L1);   
-       }
+      {
+        EndOfArrow = FirstPoint; //***
+        DrawPosition = ElCLib::Value(ElCLib::Parameter( L1, AttachmentPoint ), L1);    
+      }
       else
-       {
-         EndOfArrow = SecondPoint; //***
-         DrawPosition = ElCLib::Value(ElCLib::Parameter( L2, AttachmentPoint ), L2);
-       }      
+      {
+        EndOfArrow = SecondPoint; //***
+        DrawPosition = ElCLib::Value(ElCLib::Parameter( L2, AttachmentPoint ), L2);
+      }      
     }
-//    EndOfArrow   = ElCLib::Value(parEndOfArrow, aCircle);
-//    DrawPosition = AttachmentPoint;
   } 
   else {
     EndOfArrow   = ElCLib::Value(parEndOfArrow, aCircle);
     DrawPosition = AttachmentPoint;
   }
-  Graphic3d_Array1OfVertex Vrap(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  DrawPosition.Coord(X,Y,Z);
-  Vrap(1).SetCoord(X,Y,Z);
 
-  EndOfArrow.Coord(X,Y,Z);
-  Vrap(2).SetCoord(X,Y,Z);
-
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(DrawPosition);
+  aPrims->AddVertex(EndOfArrow);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // text
   TCollection_ExtendedString Text = aText;
@@ -229,8 +208,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
     Text = TCollection_ExtendedString("\330 ") +  Text;//  => \330 | \370?
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),Text,DrawPosition);
 
-// Add presentation of arrow 
+  // Add presentation of arrow 
   gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ()); 
-  DsgPrs::ComputeSymbol(aPresentation, LA,  EndOfArrow,  EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs);
-
+  DsgPrs::ComputeSymbol(aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs);
 }
index d938713..9c70bed 100755 (executable)
@@ -18,8 +18,6 @@
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_EllipseRadiusPresentation.ixx>
 
 #include <gp_Lin.hxx>
@@ -27,7 +25,8 @@
 #include <gp_Elips.hxx>
 #include <ElCLib.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_LengthAspect.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
@@ -51,6 +50,7 @@
 #include <Geom_TrimmedCurve.hxx>
 #include <GeomAPI_ExtremaCurveCurve.hxx>
 #include <Geom_OffsetCurve.hxx>
+
 //=======================================================================
 //function : Add
 //purpose  : 
@@ -60,49 +60,34 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
                                            const Handle(Prs3d_Drawer)& aDrawer,
                                            const Standard_Real theval,
                                            const TCollection_ExtendedString & aText,
-//                                         const gp_Elips & anEllipse,
                                            const gp_Pnt & aPosition,
                                            const gp_Pnt & anEndOfArrow,
                                            const gp_Pnt & aCenter,
                                            const Standard_Boolean IsMaxRadius,
                                            const DsgPrs_ArrowSide ArrowPrs)
 {
-
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
  
-  Standard_Boolean inside  = Standard_False;
-//  gp_Pnt EndPoint, EndOfArrow;
-  gp_Pnt EndPoint;
-  Standard_Real dist    = aCenter.Distance( aPosition );
-  if( dist > theval ) EndPoint = aPosition;
-  else {
-    EndPoint = anEndOfArrow;
-    inside   = Standard_True;
-  }
-  Graphic3d_Array1OfVertex V(1,2);
-  Quantity_Length X,Y,Z;
-  aCenter.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  EndPoint.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
-   // value
-  TCollection_ExtendedString Text;
-  if(IsMaxRadius)
-    Text = TCollection_ExtendedString("a = ");
-  else
-    Text = TCollection_ExtendedString("b = ");
-  Text +=  aText;
+  const Standard_Real dist = aCenter.Distance( aPosition );
+  const Standard_Boolean inside = ( dist <= theval );
+  gp_Pnt EndPoint(inside? anEndOfArrow : aPosition);
+
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aCenter);
+  aPrims->AddVertex(EndPoint);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+  // value
+  TCollection_ExtendedString Text(IsMaxRadius? "a = " : "b = ");
+  Text += aText;
   Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, aPosition );
 
-   // arrows
+  // arrows
   gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow));
   if (!inside) arrdir.Reverse();
 
-  DsgPrs::ComputeSymbol(aPresentation, LA,  anEndOfArrow,  anEndOfArrow, arrdir, arrdir, ArrowPrs );
-
+  DsgPrs::ComputeSymbol(aPresentation, LA, anEndOfArrow, anEndOfArrow, arrdir, arrdir, ArrowPrs );
 }
 
 //=======================================================================
@@ -123,40 +108,30 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
                                            const Standard_Boolean IsMaxRadius,
                                            const DsgPrs_ArrowSide ArrowPrs)
 {
-
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   if(!IsInDomain)
-    {
-      Standard_Real parFirst;
-      Standard_Real uLast = ElCLib::Parameter ( anEllipse, anEndOfArrow );
-      Standard_Real Alpha = DsgPrs::DistanceFromApex(anEllipse, anEndOfArrow, uFirst);//length of ellipse arc
-      gp_Vec Vapex(aCenter, ElCLib::Value( uLast, anEllipse )) ;
-      gp_Vec Vpnt(aCenter,  ElCLib::Value( uFirst, anEllipse )) ;
-      gp_Dir dir(Vpnt ^ Vapex);
-      if(anEllipse.Position().Direction().IsOpposite( dir, Precision::Angular()))
-       parFirst = uLast;
-      else
-       parFirst = uFirst;
-      Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
-      Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
-      Standard_Real delta = Alpha / ( NodeNumber - 1 );
-      gp_Pnt CurPnt;
-      for (Standard_Integer i = 0 ; i < NodeNumber; i++)
-       {
-         CurPnt =  ElCLib::Value( parFirst, anEllipse );
-         ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-         parFirst += delta ;
-       }
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
-    }
+  {
+    const Standard_Real uLast = ElCLib::Parameter ( anEllipse, anEndOfArrow );
+    const Standard_Real Alpha = DsgPrs::DistanceFromApex(anEllipse, anEndOfArrow, uFirst);//length of ellipse arc
+    gp_Vec Vapex(aCenter, ElCLib::Value( uLast, anEllipse )) ;
+    gp_Vec Vpnt(aCenter,  ElCLib::Value( uFirst, anEllipse )) ;
+    gp_Dir dir(Vpnt ^ Vapex);
+       Standard_Real parFirst = anEllipse.Position().Direction().IsOpposite( dir, Precision::Angular())? uLast : uFirst;
+    const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
+    const Standard_Real delta = Alpha / ( NodeNumber - 1 );
+
+    Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
+    for (Standard_Integer i = 0 ; i < NodeNumber; i++, parFirst += delta)
+         aPrims->AddVertex(ElCLib::Value( parFirst, anEllipse ));
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
   DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
-                                       aPosition, anEndOfArrow, aCenter,  IsMaxRadius, ArrowPrs);
-  
+                                        aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
 }
 
 
-
 //=======================================================================
 //function : Add
 //purpose  : // for offset curve
@@ -175,41 +150,35 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
                                            const Standard_Boolean IsMaxRadius,
                                            const DsgPrs_ArrowSide ArrowPrs)
 {
-
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   if(!IsInDomain)
-    {
-      Standard_Real parFirst;
-      if(!aCurve->IsCN(1)) return ;
-      gp_Elips aBEllipse = Handle(Geom_Ellipse)::DownCast(aCurve->BasisCurve ())->Elips();
-      Standard_Real Offset = aCurve->Offset();
-      aBEllipse.SetMajorRadius(aBEllipse.MajorRadius() + Offset);
-      aBEllipse.SetMinorRadius(aBEllipse.MinorRadius() + Offset);
-      Standard_Real uLast = ElCLib::Parameter ( aBEllipse, anEndOfArrow );
-      Standard_Real Alpha = DsgPrs::DistanceFromApex(aBEllipse, anEndOfArrow, uFirst);//length of ellipse arc
-      gp_Pnt p1;
-      aCurve->D0(uFirst, p1);
-      gp_Vec Vapex(aCenter,  anEndOfArrow) ;
-      gp_Vec Vpnt (aCenter,   p1) ;
-      gp_Dir dir(Vpnt ^ Vapex);
-      if(aCurve->Direction().IsOpposite( dir, Precision::Angular()))
-       parFirst = uLast;
-      else
-       parFirst = uFirst;
-      Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
-      Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
-      Standard_Real delta = Alpha / ( NodeNumber - 1 );
-      gp_Pnt CurPnt;
-      for (Standard_Integer i = 0 ; i < NodeNumber; i++)
+  {
+    if(!aCurve->IsCN(1)) return ;
+    gp_Elips aBEllipse = Handle(Geom_Ellipse)::DownCast(aCurve->BasisCurve ())->Elips();
+    const Standard_Real Offset = aCurve->Offset();
+    aBEllipse.SetMajorRadius(aBEllipse.MajorRadius() + Offset);
+    aBEllipse.SetMinorRadius(aBEllipse.MinorRadius() + Offset);
+    const Standard_Real uLast = ElCLib::Parameter ( aBEllipse, anEndOfArrow );
+    const Standard_Real Alpha = DsgPrs::DistanceFromApex(aBEllipse, anEndOfArrow, uFirst);//length of ellipse arc
+    gp_Pnt p1;
+    aCurve->D0(uFirst, p1);
+    gp_Vec Vapex(aCenter, anEndOfArrow) ;
+    gp_Vec Vpnt (aCenter, p1) ;
+    gp_Dir dir(Vpnt ^ Vapex);
+       Standard_Real parFirst = aCurve->Direction().IsOpposite( dir, Precision::Angular())? uLast : uFirst;
+    const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
+    const Standard_Real delta = Alpha / ( NodeNumber - 1 );
+
+    Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
+    for (Standard_Integer i = 0 ; i < NodeNumber; i++, parFirst += delta)
        {
-         aCurve->D0( parFirst, CurPnt );
-         ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-         parFirst += delta ;
+         aCurve->D0( parFirst, p1 );
+         aPrims->AddVertex(p1);
        }
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
-    }
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
   DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
-                                       aPosition, anEndOfArrow, aCenter,  IsMaxRadius, ArrowPrs);
-
+                                        aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
 }
index f0d7723..a75e065 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_EqualDistancePresentation.ixx>
 
 #include <DsgPrs.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Prs3d_LengthAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_Root.hxx>
 #include <gp_Dir.hxx>
 #include <gce_MakeDir.hxx>
@@ -52,24 +51,17 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
   Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
 
-  Graphic3d_Array1OfVertex VertexArray( 1, 2 );
-  Quantity_Length X,Y,Z;
-
   // Line between two middles
   gp_Pnt Middle12( (Point1.XYZ() + Point2.XYZ()) * 0.5 ), Middle34( (Point3.XYZ() + Point4.XYZ()) * 0.5 );
 
-  Middle12.Coord( X, Y, Z );
-  VertexArray( 1 ).SetCoord( X, Y, Z );
-  Middle34.Coord( X, Y, Z );
-  VertexArray( 2 ).SetCoord( X, Y, Z );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(Middle12);
+  aPrims->AddVertex(Middle34);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // Add presentation of arrows (points)
   gp_Dir aDir( 0, 0, 1 );
-  DsgPrs::ComputeSymbol(aPresentation, LA,
-                       Middle12, Middle34,
-                       aDir, aDir,
-                       DsgPrs_AS_BOTHPT );
+  DsgPrs::ComputeSymbol(aPresentation, LA, Middle12, Middle34, aDir, aDir, DsgPrs_AS_BOTHPT );
 // ota -- begin --  
   // Two small lines in the middle of this line
   gp_Pnt Middle( (Middle12.XYZ() + Middle34.XYZ()) * 0.5 ), aTextPos;
@@ -79,22 +71,22 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
   gp_Vec LineVec, OrtVec;
 
   if (Dist > Precision::Confusion())
-    {
-      SmallDist = Dist * 0.05; // 1/20.0 part
-      if (SmallDist <= Precision::Confusion())
-       SmallDist = Dist;
-      LineDir = gce_MakeDir( Middle12, Middle34 );
-      OrtDir  = Plane->Pln().Axis().Direction() ^ LineDir;
-      LineVec = gp_Vec( LineDir ) * SmallDist;
-      OrtVec  = gp_Vec( OrtDir ) * SmallDist;
-
-      aTextPos = Middle.Translated( OrtVec );
-    }
+  {
+    SmallDist = Dist * 0.05; // 1/20.0 part
+    if (SmallDist <= Precision::Confusion())
+      SmallDist = Dist;
+    LineDir = gce_MakeDir( Middle12, Middle34 );
+    OrtDir  = Plane->Pln().Axis().Direction() ^ LineDir;
+    LineVec = gp_Vec( LineDir ) * SmallDist;
+    OrtVec  = gp_Vec( OrtDir ) * SmallDist;
+
+    aTextPos = Middle.Translated( OrtVec );
+  }
   else
-    {
-      gp_Vec Vec1( Middle, Point1 );
+  {
+    gp_Vec Vec1( Middle, Point1 );
 
-      if (Vec1.SquareMagnitude() > Precision::SquareConfusion())
+    if (Vec1.SquareMagnitude() > Precision::Confusion()*Precision::Confusion())
        {
          Standard_Real Angle = gp_Vec( Middle, Point1 ).Angle( gp_Vec( Middle, Point3 ) );
          gp_Pnt MidPnt = Point1.Rotated( Plane->Pln().Axis(), Angle*0.5 );
@@ -109,14 +101,14 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
          OrtVec = gp_Vec( OrtDir ) * SmallDist;
          LineVec = gp_Vec( LineDir ) * SmallDist;
        }
-      else
+    else
        {
          SmallDist = 5.0;
          OrtVec = gp_Vec( Plane->Pln().XAxis().Direction() ) * SmallDist;
          LineVec = gp_Vec( Plane->Pln().YAxis().Direction() ) * SmallDist;
        }
-      aTextPos =  Middle.Translated (OrtVec);
-    }
+    aTextPos =  Middle.Translated (OrtVec);
+  }
 
   TCollection_ExtendedString aText("==");
 
@@ -124,6 +116,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(), aText, aTextPos);
 }
 
+
 //==================================================================================
 //function  : AddInterval
 //purpose   : is used for presentation of interval between two lines or two points, 
@@ -140,7 +133,6 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
                                                    gp_Pnt& aProj2) 
 {
   const Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-//set color
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
   gp_Lin L1 (aPoint1,aDirection);
@@ -148,39 +140,20 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
   aProj1 = ElCLib::Value(ElCLib::Parameter(L1, aPosition),L1);
   aProj2 = ElCLib::Value(ElCLib::Parameter(L2, aPosition),L2);
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  aProj1.Coord (X, Y, Z);
-  V(1).SetCoord(X, Y, Z);
-
-  aPoint1.Coord(X, Y, Z);
-  V(2).SetCoord(X, Y, Z);
-
-  //add first attached line  
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
-  //add distance interval 
-  aProj2.Coord(X, Y, Z);
-  V(2).SetCoord(X, Y, Z);
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
-
-  //add second attached line
-  aPoint2.Coord(X, Y, Z);
-  V(1).SetCoord(X, Y, Z);
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
+  aPrims->AddVertex(aPoint1);
+  aPrims->AddVertex(aProj1);
+  aPrims->AddVertex(aProj2);
+  aPrims->AddVertex(aPoint2);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   //add arrows presentation
   gp_Dir aDir(aProj2.XYZ() - aProj1.XYZ());
   
-  DsgPrs::ComputeSymbol(aPresentation, LA,
-                       aProj1, aProj2,
-                       aDir.Reversed(), aDir,
-                       anArrowSide);
+  DsgPrs::ComputeSymbol(aPresentation, LA, aProj1, aProj2, aDir.Reversed(), aDir, anArrowSide);
 }
 
+
 //========================================================================
 // function : AddIntervalBetweenTwoArcs 
 // purpose  : is used for presentation of interval between two arcs. One
@@ -197,9 +170,9 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
                                                              const gp_Pnt& aPoint4,
                                                              const DsgPrs_ArrowSide anArrowSide) 
 {
-//it seems to set color
   const Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   Standard_Real aPar11, aPar12, aPar21, aPar22;
   if(aCirc1.Radius() > Precision::Confusion()){
     aPar11 = ElCLib::Parameter (aCirc1, aPoint1);
@@ -218,49 +191,48 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
     aPar22 = M_PI;
   }
 
-  Graphic3d_Array1OfVertex V(1,2);
-  V(1).SetCoord(aPoint2.X(), aPoint2.Y(), aPoint2.Z());
-  V(2).SetCoord(aPoint4.X(), aPoint4.Y(), aPoint4.Z());
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( V );
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aPoint2);
+  aPrims->AddVertex(aPoint4);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
-  Standard_Integer aNodeNb; 
+  Standard_Integer i, aNodeNb;
   Standard_Real aDelta, aCurPar;
-  if(aPar12 < aPar11 ) aPar12 +=2*M_PI;
-  if (Abs(aPar12 - aPar11) > Precision::Confusion()) {
+  if(aPar12 < aPar11 ) aPar12 += 2.*M_PI;
+  if (Abs(aPar12 - aPar11) > Precision::Confusion())
+  {
     aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./M_PI + 0.5, 4.));
-    Graphic3d_Array1OfVertex ApproxArc1( 1, aNodeNb+1);
     aDelta = (aPar12 - aPar11)/aNodeNb;
     aCurPar= aPar11;
-    for ( int i = 1; i<= aNodeNb ; aCurPar+= aDelta, i++)
-      {
-       gp_Pnt CurPnt =  ElCLib::Value( aCurPar, aCirc1);
-       ApproxArc1(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-      }
-    ApproxArc1(aNodeNb+1).SetCoord( aPoint2.X(), aPoint2.Y(), aPoint2.Z() );
 
-    Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc1 );
+    aPrims = new Graphic3d_ArrayOfPolylines(aNodeNb+1);
+    for (i = 1; i<= aNodeNb; aCurPar += aDelta, i++)
+      aPrims->AddVertex(ElCLib::Value( aCurPar, aCirc1));
+    aPrims->AddVertex(aPoint2);
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
-  if (aPar22 < aPar21) aPar22 += 2*M_PI;
-  if ( Abs(aPar22 - aPar21) > Precision::Confusion()){
+  if (aPar22 < aPar21) aPar22 += 2.*M_PI;
+  if ( Abs(aPar22 - aPar21) > Precision::Confusion())
+  {
     aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./M_PI + 0.5, 4.));
-    Graphic3d_Array1OfVertex ApproxArc2( 1, aNodeNb+1);
     aDelta = (aPar22 - aPar21)/aNodeNb;
     aCurPar= aPar21;
-    for ( int i=1; i<= aNodeNb; aCurPar+= aDelta, i++)
-      {
-       gp_Pnt CurPnt =  ElCLib::Value( aCurPar, aCirc2);
-       ApproxArc2(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-      }
-    ApproxArc2(aNodeNb+1).SetCoord( aPoint4.X(), aPoint4.Y(), aPoint4.Z() );
-    Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc2 );
+
+    aPrims = new Graphic3d_ArrayOfPolylines(aNodeNb+1);
+    for (i = 1; i<= aNodeNb; aCurPar += aDelta, i++)
+      aPrims->AddVertex(ElCLib::Value( aCurPar, aCirc2));
+    aPrims->AddVertex(aPoint4);
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
 
   //get the direction of interval
-  gp_Dir  DirOfArrow;
-  if(aPoint4.Distance(aPoint2) > Precision::Confusion()){
+  gp_Dir DirOfArrow;
+  if(aPoint4.Distance(aPoint2) > Precision::Confusion())
+  {
     DirOfArrow.SetXYZ(aPoint4.XYZ() - aPoint2.XYZ());
   }
-  else {
+  else
+  {
     //Let's take the radius direction
     gp_Pnt aCenter = aCirc1.Location();
     if(aPoint4.Distance(aCenter) < Precision::Confusion())
@@ -270,6 +242,5 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
 
   // Add presentation of arrows
   DsgPrs::ComputeSymbol( aPresentation, LA, aPoint2, aPoint4, DirOfArrow.Reversed(), DirOfArrow, anArrowSide );
-  
 }
 //-- ota -- end
index 960e676..e4afdb1 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_EqualRadiusPresentation.ixx>
 
 #include <DsgPrs.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Prs3d_LengthAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_Root.hxx>
 #include <gp_Dir.hxx>
 #include <gce_MakeDir.hxx>
@@ -47,40 +45,19 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
   Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
 
-  Graphic3d_Array1OfVertex VertexArray( 1, 2 );
-  Quantity_Length X,Y,Z;
-
-  // Radius lines
-  FirstCenter.Coord( X, Y, Z );
-  VertexArray( 1 ).SetCoord( X, Y, Z );
-  FirstPoint.Coord( X, Y, Z );
-  VertexArray( 2 ).SetCoord( X, Y, Z );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
-
-  SecondCenter.Coord( X, Y, Z );
-  VertexArray( 1 ).SetCoord( X, Y, Z );
-  SecondPoint.Coord( X, Y, Z );
-  VertexArray( 2 ).SetCoord( X, Y, Z );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
+  aPrims->AddVertex(FirstPoint);
+  aPrims->AddVertex(FirstCenter);
+  aPrims->AddVertex(SecondCenter);
+  aPrims->AddVertex(SecondPoint);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // Add presentation of arrows
   gp_Dir FirstDir = gce_MakeDir( FirstCenter, FirstPoint ), SecondDir = gce_MakeDir( SecondCenter, SecondPoint );
-  DsgPrs::ComputeSymbol( aPresentation, LA,
-                        FirstCenter, FirstPoint,
-                        FirstDir.Reversed(), FirstDir,
-                        DsgPrs_AS_FIRSTPT_LASTAR );
-  DsgPrs::ComputeSymbol( aPresentation, LA,
-                        SecondCenter, SecondPoint,
-                        SecondDir.Reversed(), SecondDir,
-                        DsgPrs_AS_FIRSTPT_LASTAR );
+  DsgPrs::ComputeSymbol( aPresentation, LA, FirstCenter, FirstPoint, FirstDir.Reversed(), FirstDir, DsgPrs_AS_FIRSTPT_LASTAR );
+  DsgPrs::ComputeSymbol( aPresentation, LA, SecondCenter, SecondPoint, SecondDir.Reversed(), SecondDir, DsgPrs_AS_FIRSTPT_LASTAR );
 
-  // Line between two centers
-  FirstCenter.Coord( X, Y, Z );
-  VertexArray( 2 ).SetCoord( X, Y, Z );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
-  
 //ota === beging ===
-
   gp_Pnt Middle( (FirstCenter.XYZ() + SecondCenter.XYZ()) *0.5 ), aTextPos;
   Standard_Real SmallDist;
   //Mark of constraint
@@ -88,34 +65,33 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
   
   Standard_Real Dist = FirstCenter.Distance( SecondCenter );
   if (Dist > Precision::Confusion())
-    {
-      SmallDist = Dist * 0.05; // take 1/20 part of length;
-      if (SmallDist <= Precision::Confusion())
-       SmallDist = Dist;
-      gp_Dir LineDir = gce_MakeDir( FirstCenter, SecondCenter );
-      gp_Dir OrtDir  = Plane->Pln().Axis().Direction() ^ LineDir;
+  {
+    SmallDist = Dist * 0.05; // take 1/20 part of length;
+    if (SmallDist <= Precision::Confusion())
+      SmallDist = Dist;
+    gp_Dir LineDir = gce_MakeDir( FirstCenter, SecondCenter );
+    gp_Dir OrtDir  = Plane->Pln().Axis().Direction() ^ LineDir;
 
-      gp_Vec OrtVec  = gp_Vec( OrtDir ) * SmallDist;
+    gp_Vec OrtVec  = gp_Vec( OrtDir ) * SmallDist;
       
-      //Compute the text position
-      aTextPos = Middle.Translated(OrtVec);
-    }
+    //Compute the text position
+    aTextPos = Middle.Translated(OrtVec);
+  }
   else
-    {
-      Standard_Real Rad = Max(FirstCenter.Distance( FirstPoint ),
-                             SecondCenter.Distance(SecondPoint));
+  {
+    Standard_Real Rad = Max(FirstCenter.Distance( FirstPoint ), SecondCenter.Distance(SecondPoint));
       
-      SmallDist = Rad *0.05; // take 1/20 part of length;
-      if (SmallDist <= Precision::Confusion())
-       SmallDist = Rad;
+    SmallDist = Rad *0.05; // take 1/20 part of length;
+    if (SmallDist <= Precision::Confusion())
+      SmallDist = Rad;
 
-      gp_Vec aVec(SmallDist, SmallDist, SmallDist);
+    gp_Vec aVec(SmallDist, SmallDist, SmallDist);
       
-      //Compute the text position
-      aTextPos = FirstCenter.Translated(aVec);
-    }
+    //Compute the text position
+    aTextPos = FirstCenter.Translated(aVec);
+  }
   
   //Draw the text
-  Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText, aTextPos);
+  Prs3d_Text::Draw(aPresentation, LA->TextAspect(),aText, aTextPos);
 //ota === end ===     
 }
index 442f004..d9ee636 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_FilletRadiusPresentation.ixx>
 
 #include <gp_Lin.hxx>
 #include <gp_Dir.hxx>
 #include <ElCLib.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_LengthAspect.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
@@ -79,6 +78,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
 {
   char valcar[80];
   sprintf(valcar,"%5.2f",theval);
+
   Standard_Real FirstParCirc, LastParCirc;
   Standard_Boolean SpecCase;
   gp_Dir DirOfArrow;
@@ -86,6 +86,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
   //  gp_Pnt NewPosition, EndOfArrow;
   Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
+
   Standard_Real ArrowLength = LA->Arrow1Aspect()->Length();
   DsgPrs::ComputeFilletRadiusPresentation( ArrowLength,
                                           theval,
@@ -106,40 +107,34 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
                                           );
   // Creating the fillet's arc                                       
   if( !SpecCase )
-    {
-      Standard_Real Alpha = Abs(LastParCirc - FirstParCirc);
-      Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
-      Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
-      Standard_Real delta = Alpha / ( NodeNumber - 1 );
-      gp_Pnt CurPnt;
-      for (Standard_Integer i = 0 ; i < NodeNumber; i++)
-       {
-         CurPnt =  ElCLib::Value( FirstParCirc, FilletCirc );
-         ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-         FirstParCirc += delta ;
-       }
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
-      HasCircle = Standard_True;
-      Handle(Geom_Circle) Circle = new Geom_Circle( FilletCirc );
-      TrimCurve = new Geom_TrimmedCurve( Circle,  FirstParCirc, LastParCirc );
-    }
+  {
+    const Standard_Real Alpha = Abs(LastParCirc - FirstParCirc);
+    const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
+    const Standard_Real delta = Alpha / ( NodeNumber - 1 );
+
+    Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
+    for (Standard_Integer i = 0 ; i < NodeNumber; i++, FirstParCirc += delta)
+         aPrims->AddVertex(ElCLib::Value( FirstParCirc, FilletCirc ));
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+    HasCircle = Standard_True;
+    Handle(Geom_Circle) Circle = new Geom_Circle( FilletCirc );
+    TrimCurve = new Geom_TrimmedCurve( Circle,  FirstParCirc, LastParCirc );
+  }
   else // null or PI anle or Radius = 0
-    {
-      HasCircle = Standard_False;
-    }
+  {
+    HasCircle = Standard_False;
+  }
   
   // Line from position to intersection point on fillet's circle (EndOfArrow)
-  Graphic3d_Array1OfVertex Vrap(1,2);
-  Vrap(1).SetCoord(DrawPosition.X(),
-                  DrawPosition.Y(),
-                  DrawPosition.Z());
-  Vrap(2).SetCoord( EndOfArrow.X(), EndOfArrow.Y(), EndOfArrow.Z() );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( Vrap );
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(DrawPosition);
+  aPrims->AddVertex(EndOfArrow);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
   // Drawing the text
   Prs3d_Text::Draw(aPresentation, LA->TextAspect(), aText, DrawPosition);
    
   // Add presentation of arrows
   DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs );
-  
 }
-
index 773a1e8..f14dd1e 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_FixPresentation.ixx>
 
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
@@ -44,8 +42,6 @@
 #include <Quantity_Color.hxx>
 
 
-
-
 //=======================================================================
 //function : Add
 //purpose  : 
@@ -62,57 +58,52 @@ void DsgPrs_FixPresentation::Add(
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(10);
+
   //Trace du segment de raccordement
-  Graphic3d_Array1OfVertex V(1,2);
-  V(1).SetCoord(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
-  V(2).SetCoord(aPntEnd.X(), aPntEnd.Y(), aPntEnd.Z() );
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(aPntAttach);
+  aPrims->AddVertex(aPntEnd);
 
   // trace du symbole 'Fix'
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-
-  
-  gp_Vec dirac(aPntAttach, aPntEnd);
-                                   // vecteur directeur du seg. de raccord
+  gp_Vec dirac(aPntAttach, aPntEnd); // vecteur directeur du seg. de raccord
   dirac.Normalize();
   gp_Vec norac = dirac.Crossed(gp_Vec(aNormPln));
   gp_Ax1 ax(aPntEnd, aNormPln);
-  norac.Rotate(ax, M_PI/8);
-                                  // vecteur normal au seg. de raccord
+  norac.Rotate(ax, M_PI/8); // vecteur normal au seg. de raccord
   norac*=(symbsize/2);
   gp_Pnt P1 = aPntEnd.Translated(norac);
   gp_Pnt P2 = aPntEnd.Translated(-norac);
 
-  V(1).SetCoord(P1.X(),P1.Y(),P1.Z());
-  V(2).SetCoord(P2.X(),P2.Y(),P2.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(P1);
+  aPrims->AddVertex(P2);
 
   // trace des 'dents'
   norac*=0.8;
   P1 = aPntEnd.Translated(norac);
   P2 = aPntEnd.Translated(-norac);
   dirac*=(symbsize/2);
-  gp_Pnt PF(P1.XYZ());
+  gp_Pnt PF = P1;
   gp_Pnt PL = PF.Translated(dirac);
   PL.Translate(norac);
-  V(1).SetCoord( PF.X(), PF.Y(), PF.Z() );
-  V(2).SetCoord( PL.X(), PL.Y(), PL.Z() );
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
 
-  PF.SetXYZ(P2.XYZ());
+  aPrims->AddVertex(PF);
+  aPrims->AddVertex(PL);
+
+  PF = P2;
   PL = PF.Translated(dirac);
   PL.Translate(norac);
-  V(1).SetCoord( PF.X(), PF.Y(), PF.Z() );
-  V(2).SetCoord( PL.X(), PL.Y(), PL.Z() );
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
 
-  PF.SetXYZ((P1.XYZ() + P2.XYZ())/2);
+  aPrims->AddVertex(PF);
+  aPrims->AddVertex(PL);
+
+  PF.SetXYZ(0.5*(P1.XYZ() + P2.XYZ()));
   PL = PF.Translated(dirac);
   PL.Translate(norac);
-  V(1).SetCoord( PF.X(), PF.Y(), PF.Z() );
-  V(2).SetCoord( PL.X(), PL.Y(), PL.Z() );
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+  aPrims->AddVertex(PF);
+  aPrims->AddVertex(PL);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // On ajoute un rond au point d'attache
   Prs3d_Root::NewGroup(aPresentation);
@@ -128,5 +119,4 @@ void DsgPrs_FixPresentation::Add(
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
   Graphic3d_Vertex V3d(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
   Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-
 }
index 6eccd7c..390d867 100755 (executable)
@@ -23,7 +23,8 @@
 #include <DsgPrs_IdenticPresentation.ixx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 
@@ -50,12 +51,10 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
-  Graphic3d_Array1OfVertex V(1,2);
-  V(1).SetCoord(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
-  V(2).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
-
-  // trait de cote 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aPntAttach);
+  aPrims->AddVertex(aPntOffset);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // On ajoute un rond au point d'attache
   Prs3d_Root::NewGroup(aPresentation);
@@ -77,7 +76,6 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
 }
 
 
-
 void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresentation,
                                      const Handle(Prs3d_Drawer)& aDrawer,
                                      const TCollection_ExtendedString& aText,
@@ -88,33 +86,32 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
-  Graphic3d_Array1OfVertex V(1,2);
-  V(1).SetCoord(aFAttach.X(), aFAttach.Y(), aFAttach.Z());
-  V(2).SetCoord(aSAttach.X(), aSAttach.Y(), aSAttach.Z());
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(4);
 
-  // trait de cote 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(aFAttach);
+  aPrims->AddVertex(aSAttach);
 
   // trait joignant aPntOffset
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   gp_Vec v1(aFAttach, aSAttach);
   gp_Vec v2(aSAttach, aPntOffset);
-  V(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
-  if ( !v1.IsParallel(v2, Precision::Angular())) {
+
+  aPrims->AddVertex(aPntOffset);
+  if ( !v1.IsParallel(v2, Precision::Angular()))
+  {
     // on joint aPntOffset a son projete
     gp_Lin ll(aFAttach, gp_Dir(v1));
-    gp_Pnt ProjPntOffset = ElCLib::Value(ElCLib::Parameter(ll,aPntOffset ), ll);
-    V(2).SetCoord(ProjPntOffset.X(), ProjPntOffset.Y(), ProjPntOffset.Z());
+    aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(ll,aPntOffset ), ll));
   }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V); 
+  else
+    aPrims->AddVertex(aSAttach);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // texte 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
 }
 
 
-
 void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresentation,
                                     const Handle(Prs3d_Drawer)& aDrawer,
                                     const TCollection_ExtendedString& aText,
@@ -134,32 +131,29 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
   Standard_Real pFAttach =  ElCLib::Parameter(CC, aFAttach);
   Standard_Real pSAttach =  ElCLib::Parameter(CC, aSAttach);
   Standard_Real alpha = pSAttach - pFAttach;
-  if ( alpha < 0 ) alpha += 2 * M_PI;
-  Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
-  Standard_Integer nbp = Max (4 , nb);
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++)
-    {
-      ptcur =  ElCLib::Value(pFAttach + dteta*(i-1),CC);
-      V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-    }
+  if ( alpha < 0 ) alpha += 2. * M_PI;
+  const Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
+  const Standard_Integer nbp = Max (4, nb);
+  const Standard_Real dteta = alpha/(nbp-1);
 
-  // trait de cote 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfPolylines) aPrims;
   
   // trait joignant aPntOffset
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Graphic3d_Array1OfVertex V2(1,2);
-  if ( Abs((aPntOffset.Distance(aCenter) - rad )) >= Precision::Confusion() ) {
-    gp_Pnt ProjPntOffset = ElCLib::Value(ElCLib::Parameter(CC,aPntOffset ), CC);
-    
-    V2(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
-    V2(2).SetCoord(ProjPntOffset.X(), ProjPntOffset.Y(), ProjPntOffset.Z());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2); 
+  if ( Abs((aPntOffset.Distance(aCenter) - rad )) >= Precision::Confusion() )
+  {
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(2);
+    aPrims->AddVertex(aPntOffset);
+    aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(CC,aPntOffset ), CC));
+    aPrims->AddBound(nbp);
   }
+  else
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp);
+
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),CC));
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // texte 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
@@ -183,34 +177,32 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
   ax.SetLocation(aCenter);
   Standard_Real rad = aCenter.Distance(aFAttach);
   gp_Circ CC(ax,rad );
-  Standard_Real pFAttach =  ElCLib::Parameter(CC, aFAttach);
-  Standard_Real pSAttach =  ElCLib::Parameter(CC, aSAttach);
+  Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
+  Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
   Standard_Real alpha = pSAttach - pFAttach;
-  if ( alpha < 0 ) alpha += 2 * M_PI;
-  Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
-  Standard_Integer nbp = Max (4 , nb);
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++)
-    {
-      ptcur =  ElCLib::Value(pFAttach + dteta*(i-1),CC);
-      V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-    }
+  if ( alpha < 0 ) alpha += 2. * M_PI;
+  const Standard_Integer nb = (Standard_Integer)( 50. * alpha / M_PI);
+  const Standard_Integer nbp = Max (4, nb);
+  const Standard_Real dteta = alpha/(nbp-1);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims;
 
-  // trait de cote 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
   // trait joignant aPntOffset
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Graphic3d_Array1OfVertex V2(1,2);
   if ( aPntOffset.Distance(aPntOnCirc) >= Precision::Confusion() )
-    {
-      V2(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
-      V2(2).SetCoord(aPntOnCirc.X(), aPntOnCirc.Y(), aPntOnCirc.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2); 
-    }
+  {
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(2);
+    aPrims->AddVertex(aPntOffset);
+    aPrims->AddVertex(aPntOnCirc);
+    aPrims->AddBound(nbp);
+  }
+  else
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp);
+
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),CC));
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // texte 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
@@ -233,32 +225,29 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
   Standard_Real pFAttach =  ElCLib::Parameter(anEllipse, aFAttach);
   Standard_Real pSAttach =  ElCLib::Parameter(anEllipse, aSAttach);
   Standard_Real alpha = pSAttach - pFAttach;
-  if ( alpha < 0 ) alpha += 2 * M_PI;
-  Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
-  Standard_Integer nbp = Max (4 , nb);
-  Graphic3d_Array1OfVertex V(1,nbp);
-  Standard_Real dteta = alpha/(nbp-1);
-  gp_Pnt ptcur;
-  for (Standard_Integer i = 1; i<=nbp; i++)
-    {
-      ptcur =  ElCLib::Value(pFAttach + dteta*(i-1),anEllipse);
-      V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-    }
+  if ( alpha < 0 ) alpha += 2. * M_PI;
+  const Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
+  const Standard_Integer nbp = Max (4, nb);
+  const Standard_Real dteta = alpha/(nbp-1);
 
-  // trait de cote 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfPolylines) aPrims;
   
   // trait joignant aPntOffset
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Graphic3d_Array1OfVertex V2(1,2);
-
   if ( ! aPntOnElli.IsEqual(aPntOffset, Precision::Confusion()) )
-    {
-      V2(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
-      V2(2).SetCoord(aPntOnElli.X(), aPntOnElli.Y(), aPntOnElli.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2); 
-    }
+  {
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(2);
+    aPrims->AddVertex(aPntOffset);
+    aPrims->AddVertex(aPntOnElli);
+    aPrims->AddBound(nbp);
+  }
+  else
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp);
+
+  for (Standard_Integer i = 1; i<=nbp; i++)
+    aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),anEllipse));
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // texte 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
index 1c702fd..1151215 100755 (executable)
@@ -22,7 +22,8 @@
 #include <ElCLib.hxx>
 #include <gce_MakeLin.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
@@ -53,17 +54,12 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
 {
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   gp_Lin L1 (AttachmentPoint1,aDirection);
   gp_Lin L2 (AttachmentPoint2,aDirection);
   gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
   gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
-  gp_Lin L3;
-  if (!Proj1.IsEqual(Proj2,Precision::Confusion())) {
-    L3 = gce_MakeLin(Proj1,Proj2);
-  }
-  else {
-    L3 = gp_Lin(Proj1,aDirection);
-  }
+  gp_Lin L3 = Proj1.IsEqual(Proj2,Precision::Confusion())? gp_Lin(Proj1,aDirection) : gce_MakeLin(Proj1,Proj2);
   Standard_Real parmin,parmax,parcur;
   parmin = ElCLib::Parameter(L3,Proj1);
   parmax = parmin;
@@ -87,67 +83,43 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  PointMin.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  PointMax.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
   // face processing : 1st group
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
+  aPrims->AddVertex(PointMin);
+  aPrims->AddVertex(PointMax);
 
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  
-  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
+  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
     outside = Standard_True;
-  }
-  gp_Dir arrdir = L3.Direction().Reversed();
 
-  if (outside) {
+  gp_Dir arrdir = L3.Direction().Reversed();
+  if (outside)
     arrdir.Reverse();
-  }
+
   // arrow 1 : 2nd group
-  Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir, LA->Arrow1Aspect()->Angle(), LA->Arrow1Aspect()->Length());
 
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
   // arrow 2 : 3rd group
-  Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(),
-                   LA->Arrow2Aspect()->Angle(),
-                   LA->Arrow2Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(), LA->Arrow2Aspect()->Angle(), LA->Arrow2Aspect()->Length());
 
   Prs3d_Root::NewGroup(aPresentation);
   
   // text : 4th group
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
   
-  AttachmentPoint1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj1.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
-  Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   // processing of call 1 : 5th group
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(Proj1);
   
-  AttachmentPoint2.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   // processing of call 2 : 6th group
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(Proj2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 //==================================================================================
@@ -181,7 +153,6 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
                                                EndOfArrow1,
                                                EndOfArrow2,
                                                DirOfArrow1 );
-  Graphic3d_Array1OfVertex VertexArray( 1, 2 );
 
   // Parameters for length's line
   gp_Lin LengthLine( OffsetPoint, DirOfArrow1 );
@@ -189,42 +160,37 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
   Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
   gp_Pnt FirstPoint, LastPoint;
   if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
-    {
-      FirstPoint = OffsetPoint;
-      LastPoint  = (Abs( Par1 ) > Abs( Par2 ))? EndOfArrow1 : EndOfArrow2;
-    }
+  {
+    FirstPoint = OffsetPoint;
+    LastPoint  = (Abs( Par1 ) > Abs( Par2 ))? EndOfArrow1 : EndOfArrow2;
+  }
   else
-    {
-      FirstPoint = EndOfArrow1;
-      LastPoint  = EndOfArrow2;
-    }
+  {
+    FirstPoint = EndOfArrow1;
+    LastPoint  = EndOfArrow2;
+  }
 
   // Creating the length's line
-  VertexArray(1).SetCoord( FirstPoint.X(), FirstPoint.Y(), FirstPoint.Z() );
-  VertexArray(2).SetCoord( LastPoint.X(), LastPoint.Y(), LastPoint.Z() );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
+
+  aPrims->AddVertex(FirstPoint);
+  aPrims->AddVertex(LastPoint);
 
   // Add presentation of arrows
-  DsgPrs::ComputeSymbol( aPresentation, LA,
-                        EndOfArrow1, EndOfArrow2, //EndOfArrow1,
-                        DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
+  DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
  
   // Drawing the text
   Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
 
   // Line from AttachmentPoint1 to end of Arrow1
-  VertexArray(1).SetCoord(AttachmentPoint1.X(),
-                         AttachmentPoint1.Y(),
-                         AttachmentPoint1.Z());
-  VertexArray(2).SetCoord( EndOfArrow1.X(), EndOfArrow1.Y(), EndOfArrow1.Z() );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(EndOfArrow1);
 
   // Line from AttachmentPoint2 to end of Arrow2
-  VertexArray(1).SetCoord(AttachmentPoint2.X(),
-                         AttachmentPoint2.Y(),
-                         AttachmentPoint2.Z());
-  VertexArray(2).SetCoord( EndOfArrow2.X(), EndOfArrow2.Y(), EndOfArrow2.Z() );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(EndOfArrow2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 
@@ -249,13 +215,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
   gp_Lin L2 (AttachmentPoint2,aDirection);
   gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
   gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
-  gp_Lin L3;
-  if (!Proj1.IsEqual(Proj2,Precision::Confusion())) {
-    L3 = gce_MakeLin(Proj1,Proj2);
-  }
-  else {
-    L3 = gp_Lin(Proj1,aDirection);
-  }
+  gp_Lin L3 = Proj1.IsEqual(Proj2,Precision::Confusion())? gp_Lin(Proj1,aDirection) : gce_MakeLin(Proj1,Proj2);
   Standard_Real parmin,parmax,parcur;
   parmin = ElCLib::Parameter(L3,Proj1);
   parmax = parmin;
@@ -279,47 +239,29 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  PointMin.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
+  // processing of face 
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
 
-  PointMax.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
+  aPrims->AddVertex(PointMin);
+  aPrims->AddVertex(PointMax);
 
-  // processing of face 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
-  
-  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
+  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
     outside = Standard_True;
-  }
-  gp_Dir arrdir = L3.Direction().Reversed();
 
-  if (outside) {
+  gp_Dir arrdir = L3.Direction().Reversed();
+  if (outside)
     arrdir.Reverse();
-  }
-
   
-  AttachmentPoint1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj1.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
   // processing of call  1 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(Proj1);
   
-  AttachmentPoint2.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
   // processing of call 2 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(Proj2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // text 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
 
@@ -328,7 +270,6 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
 }
 
 
-
 //==================================================================================
 //function : Add
 //purpose  : Adds presentation of length dimension between two curvilinear faces
@@ -365,32 +306,29 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
                                                     FirstU, deltaU,
                                                     FirstV, deltaV );
                                                       
-  Graphic3d_Array1OfVertex VertexArray( 1, 2 );
-
   gp_Lin LengthLine( OffsetPoint, DirOfArrow1 );
   Standard_Real Par1 = ElCLib::Parameter( LengthLine, AttachmentPoint1 );
   Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
   gp_Pnt FirstPoint, LastPoint;
   if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
-    {
-      FirstPoint = OffsetPoint;
-      LastPoint  = (Abs( Par1 ) > Abs( Par2 ))? AttachmentPoint1 : EndOfArrow2;
-    }
+  {
+    FirstPoint = OffsetPoint;
+    LastPoint  = (Abs( Par1 ) > Abs( Par2 ))? AttachmentPoint1 : EndOfArrow2;
+  }
   else
-    {
-      FirstPoint = AttachmentPoint1;
-      LastPoint  = EndOfArrow2;
-    }
+  {
+    FirstPoint = AttachmentPoint1;
+    LastPoint  = EndOfArrow2;
+  }
 
   // Creating the length's line
-  VertexArray(1).SetCoord( FirstPoint.X(), FirstPoint.Y(), FirstPoint.Z() );
-  VertexArray(2).SetCoord( LastPoint.X(), LastPoint.Y(), LastPoint.Z() );
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(FirstPoint);
+  aPrims->AddVertex(LastPoint);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // Add presentation of arrows
-  DsgPrs::ComputeSymbol( aPresentation, LA, 
-                        AttachmentPoint1, EndOfArrow2,
-                        DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
+  DsgPrs::ComputeSymbol( aPresentation, LA, AttachmentPoint1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
  
   // Drawing the text
   Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
@@ -401,41 +339,27 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
   
   Alpha  = Abs( deltaU );
   if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
-    {
-      NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
-      Graphic3d_Array1OfVertex ApproxCurve( 1, NodeNumber );
-      delta = deltaU / (Standard_Real)( NodeNumber - 1 );
-      gp_Pnt CurPnt;
-      for (Standard_Integer i = 1; i <= NodeNumber; i++)
-       {
-         CurPnt =  VCurve->Value( FirstU );
-         ApproxCurve(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-         FirstU += delta;
-       }
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxCurve );
-    }
+  {
+    NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
+    delta = deltaU / (Standard_Real)( NodeNumber - 1 );
+    aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
+    for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstU += delta)
+      aPrims->AddVertex(VCurve->Value( FirstU ));
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
   Alpha  = Abs( deltaV );
   if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
-    {
-      NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
-      Graphic3d_Array1OfVertex ApproxCurve( 1, NodeNumber );
-      delta = deltaV / (Standard_Real)( NodeNumber - 1 );
-      gp_Pnt CurPnt;
-      for (Standard_Integer i = 1; i <= NodeNumber; i++)
-       {
-         CurPnt =  UCurve->Value( FirstV );
-         ApproxCurve(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
-         FirstV += delta;
-       }
-      Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxCurve );
-    }
+  {
+    NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
+    delta = deltaV / (Standard_Real)( NodeNumber - 1 );
+    aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
+    for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstV += delta)
+      aPrims->AddVertex(UCurve->Value( FirstV ));
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
 }
 
 
-
-
-
-
 //================================
 // Function:
 // Purpose: Rob 26-mar-96
@@ -447,27 +371,25 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs,
                                     const gp_Pnt& Pt2,
                                     const DsgPrs_ArrowSide ArrowPrs) 
 {
-  Prs3d_Root::CurrentGroup(aPrs)->BeginPrimitives();
-  Graphic3d_Array1OfVertex Vx(1,2);
-  Vx(1).SetCoord(Pt1.X(),Pt1.Y(),Pt1.Z());
-  Vx(2).SetCoord(Pt2.X(),Pt2.Y(),Pt2.Z());
-  Prs3d_Root::CurrentGroup(aPrs)->Polyline(Vx);
-  
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(Pt1);
+  aPrims->AddVertex(Pt2);
+  Prs3d_Root::CurrentGroup(aPrs)->AddPrimitiveArray(aPrims);
+
   gp_Vec V ;
-  switch(ArrowPrs){
-  case DsgPrs_AS_NONE:
-    break;
-  case DsgPrs_AS_LASTAR:
+  switch(ArrowPrs)
+  {
+    case DsgPrs_AS_LASTAR:
     Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(gp_Vec(Pt1,Pt2)), 
                      aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
                      aDrawer->LengthAspect()->Arrow1Aspect()->Length());
     break;
-  case DsgPrs_AS_FIRSTAR:
+    case DsgPrs_AS_FIRSTAR:
     Prs3d_Arrow::Draw(aPrs,Pt1,gp_Dir(gp_Vec(Pt2,Pt1)), 
                      aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
                      aDrawer->LengthAspect()->Arrow1Aspect()->Length());
     break;
-  case DsgPrs_AS_BOTHAR:
+    case DsgPrs_AS_BOTHAR:
     V = gp_Vec(Pt1,Pt2);
     Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(V), 
                      aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
@@ -476,9 +398,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs,
                      aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
                      aDrawer->LengthAspect()->Arrow1Aspect()->Length());
     break;
-  default:
+    default:
     break;
   }
-  Prs3d_Root::CurrentGroup(aPrs)->EndPrimitives();
-  
 }
index 359a371..352a62e 100755 (executable)
@@ -17,7 +17,6 @@
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
 #include <DsgPrs_MidPointPresentation.ixx>
 
 #include <Precision.hxx>
@@ -35,7 +34,8 @@
 #include <ElCLib.hxx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 
 #include <Prs3d_Root.hxx>
@@ -58,61 +58,52 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   Standard_Real rad = AttachPoint.Distance(MidPoint)/20.0;
 
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-  Graphic3d_Array1OfVertex V(1,2);
-
-  gp_Pnt Ptmp;
 
   gp_Ax2 ax = theAxe;
   ax.SetLocation(MidPoint);
   gp_Circ aCircleM (ax,rad);
 
   if ( first )
-    {
-      // center of the symmetry - circle around the MidPoint
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      Standard_Real alpha = 2 * M_PI;
-      Standard_Integer nbp = 100;
-      Graphic3d_Array1OfVertex VC(1,nbp);
-      Standard_Real dteta = alpha/(nbp-1);
-      gp_Pnt ptcur;
-      for (Standard_Integer i = 1; i <= nbp; i++)
-        {
-          ptcur =  ElCLib::Value(dteta*(i-1),aCircleM);
-          VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-        }
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
-
-      // segment from mid point to the text position
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      if ( Position.IsEqual(MidPoint,rad) )
-        Ptmp = MidPoint;
-      else
-        Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // text position
-      V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
-      // texte 
-      TCollection_ExtendedString aText (" (+)");
-      Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
-    }
+  {
+    // center of the symmetry - circle around the MidPoint
+    Prs3d_Root::NewGroup(aPresentation);
+    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
+    const Standard_Real alpha = 2. * M_PI;
+    const Standard_Integer nbp = 100;
+    const Standard_Real dteta = alpha/(nbp-1);
+
+    Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(nbp);
+    for (Standard_Integer i = 1; i <= nbp; i++)
+      aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
+
+    // segment from mid point to the text position
+    aPrims->AddBound(2);
+    aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
+    aPrims->AddVertex(Position); // text position
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+    // texte 
+    TCollection_ExtendedString aText(" (+)");
+    Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
+  }
 
   if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
+  {
+    if ( !first )
     {
-      // segment from mid point to the geometry
       Prs3d_Root::NewGroup(aPresentation);
       Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // attach point to the geometry
-      V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
     }
+
+    // segment from mid point to the geometry
+    Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+    aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
+    aPrims->AddVertex(AttachPoint); // attach point to the geometry
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
 }
   
 //===================================================================
@@ -133,68 +124,52 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
 
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-  Graphic3d_Array1OfVertex V(1,2);
-
-  gp_Pnt Ptmp;
 
   gp_Ax2 ax = theAxe;
   ax.SetLocation(MidPoint);
   gp_Circ aCircleM (ax,rad);
 
-  if ( first )
-    {
-      // center of the symmetry - circle around the MidPoint
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      Standard_Real alpha = 2 * M_PI;
-      Standard_Integer nbp = 100;
-      Graphic3d_Array1OfVertex VC(1,nbp);
-      Standard_Real dteta = alpha/(nbp-1);
-      gp_Pnt ptcur;
-      for (Standard_Integer i = 1; i <= nbp; i++)
-        {
-          ptcur =  ElCLib::Value(dteta*(i-1),aCircleM);
-          VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-        }
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
-
-      // segment from mid point to the text position
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      if ( Position.IsEqual(MidPoint,rad) )
-        Ptmp = MidPoint;
-      else
-        Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // text position
-      V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
-      // texte 
-      TCollection_ExtendedString aText (" (+)");
-      Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
-    }
-
-  if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
-    {
-      // segment from mid point to the geometry
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // attach point to the geometry
-      V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-    }
-
   // segment on line
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  V(1).SetCoord(Point1.X(),Point1.Y(),Point1.Z());
-  V(2).SetCoord(Point2.X(),Point2.Y(),Point2.Z());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(Point1);
+  aPrims->AddVertex(Point2);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+  if ( first )
+  {
+    // center of the symmetry - circle around the MidPoint
+    const Standard_Real alpha = 2. * M_PI;
+    const Standard_Integer nbp = 100;
+    const Standard_Real dteta = alpha/(nbp-1);
+
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(nbp);
+    for (Standard_Integer i = 1; i <= nbp; i++)
+      aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
+
+    // segment from mid point to the text position
+    aPrims->AddBound(2);
+    aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
+    aPrims->AddVertex(Position); // text position
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+    // texte
+    TCollection_ExtendedString aText (" (+)");
+    Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
+  }
+
+  if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
+  {
+    // mid point
+    aPrims = new Graphic3d_ArrayOfSegments(2);
+    aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM));
+    aPrims->AddVertex(AttachPoint); // attach point to the geometry
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
 }
   
 //===================================================================
@@ -215,79 +190,60 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
 
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-  Graphic3d_Array1OfVertex V(1,2);
-
-  gp_Pnt Ptmp,ptcur;
 
   gp_Ax2 ax = aCircle.Position();
   ax.SetLocation(MidPoint);
   gp_Circ aCircleM (ax,rad);
 
-  if ( first )
-    {
-      // center of the symmetry - circle around the MidPoint
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      Standard_Real alpha = 2 * M_PI;
-      Standard_Integer nbp = 100;
-      Graphic3d_Array1OfVertex VC(1,nbp);
-      Standard_Real dteta = alpha/(nbp-1);
-      for (Standard_Integer i = 1; i <= nbp; i++)
-        {
-          ptcur =  ElCLib::Value(dteta*(i-1),aCircleM);
-          VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-        }
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
-
-      // segment from mid point to the text position
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      if ( Position.IsEqual(MidPoint,rad) )
-        Ptmp = MidPoint;
-      else
-        Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // text position
-      V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
-      // texte 
-      TCollection_ExtendedString aText (" (+)");
-      Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
-    }
-
-  if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
-    {
-      // segment from mid point to the geometry
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // attach point to the geometry
-      V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-    }
-
   // segment on circle
-  Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
-  Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
+  Prs3d_Root::NewGroup(aPresentation);
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
+  const Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
+  const Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
   Standard_Real alpha = pl - pf;
-  if ( alpha < 0 ) alpha += 2 * M_PI;
-  Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
+  if ( alpha < 0 ) alpha += 2. * M_PI;
+  const Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
   Standard_Integer nbp = Max(4,nb);
-  Graphic3d_Array1OfVertex VC1(1,nbp);
   Standard_Real dteta = alpha/(nbp-1);
 
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
   for (Standard_Integer i = 1; i <= nbp; i++)
-    {
-      ptcur = ElCLib::Value(pf + dteta*(i-1),aCircle);
-      VC1(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-    }
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC1);
+    aPrims->AddVertex(ElCLib::Value(pf + dteta*(i-1),aCircle));
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+  if ( first )
+  {
+    // center of the symmetry - circle around the MidPoint
+    alpha = 2. * M_PI;
+    nbp = 100;
+    dteta = alpha/(nbp-1);
+
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(nbp);
+    for (Standard_Integer i = 1; i <= nbp; i++)
+      aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
+
+    // segment from mid point to the text position
+    aPrims->AddBound(2);
+    aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
+    aPrims->AddVertex(Position); // text position
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+    // texte 
+    TCollection_ExtendedString aText (" (+)");
+    Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
+  }
+
+  if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
+  {
+    // segment from mid point to the geometry
+    aPrims = new Graphic3d_ArrayOfSegments(2);
+    aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
+    aPrims->AddVertex(AttachPoint); // attach point to the geometry
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
 }
   
 //===================================================================
@@ -308,7 +264,6 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
 
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-  Graphic3d_Array1OfVertex V(1,2);
 
   gp_Pnt Ptmp,ptcur;
 
@@ -316,69 +271,53 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
   ax.SetLocation(MidPoint);
   gp_Circ aCircleM (ax,rad);
 
-  if ( first )
-    {
-      // center of the symmetry - circle around the MidPoint
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      Standard_Real alpha = 2 * M_PI;
-      Standard_Integer nbp = 100;
-      Graphic3d_Array1OfVertex VC(1,nbp);
-      Standard_Real dteta = alpha/(nbp-1);
-      for (Standard_Integer i = 1; i <= nbp; i++)
-        {
-          ptcur =  ElCLib::Value(dteta*(i-1),aCircleM);
-          VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-        }
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
-
-      // segment from mid point to the text position
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      if ( Position.IsEqual(MidPoint,rad) )
-        Ptmp = MidPoint;
-      else
-        Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // text position
-      V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
-      // texte 
-      TCollection_ExtendedString aText (" (+)");
-      Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
-    }
-
-  if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
-    {
-      // segment from mid point to the geometry
-      Prs3d_Root::NewGroup(aPresentation);
-      Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-      // mid point
-      Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
-      V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
-      // attach point to the geometry
-      V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
-      Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-    }
-
   // segment on ellipse
-  Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
-  Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
+  Prs3d_Root::NewGroup(aPresentation);
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
+  const Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
+  const Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
   Standard_Real alpha = pl - pf;
   if ( alpha < 0 ) alpha += 2 * M_PI;
-  Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
+  const Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
   Standard_Integer nbp = Max(4,nb);
-  Graphic3d_Array1OfVertex VC1(1,nbp);
   Standard_Real dteta = alpha/(nbp-1);
 
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
   for (Standard_Integer i = 1; i <= nbp; i++)
-    {
-      ptcur = ElCLib::Value(pf + dteta*(i-1),aCircle);
-      VC1(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
-    }
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC1);
+    aPrims->AddVertex(ElCLib::Value(pf + dteta*(i-1),aCircle));
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+  if ( first )
+  {
+    // center of the symmetry - circle around the MidPoint
+    alpha = 2. * M_PI;
+    nbp = 100;
+    dteta = alpha/(nbp-1);
+
+    aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
+    aPrims->AddBound(nbp);
+    for (Standard_Integer i = 1; i <= nbp; i++)
+      aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
+
+    // segment from mid point to the text position
+    aPrims->AddBound(2);
+       aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
+    aPrims->AddVertex(Position); // text position
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
+    // texte 
+    TCollection_ExtendedString aText (" (+)");
+    Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
+  }
+
+  if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
+  {
+    // segment from mid point to the geometry
+    aPrims = new Graphic3d_ArrayOfSegments(2);
+    aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
+    aPrims->AddVertex(AttachPoint); // attach point to the geometry
+    Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  }
 }
index 84a27a5..c126e9c 100755 (executable)
@@ -18,7 +18,6 @@
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
 #include <DsgPrs_OffsetPresentation.ixx>
 
 #include <gp_Lin.hxx>
@@ -29,7 +28,7 @@
 #include <gce_MakeLin.hxx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
@@ -59,11 +58,11 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
                                     const gp_Pnt& AttachmentPoint2,
                                     const gp_Dir& aDirection,
                                     const gp_Dir& aDirection2,
-                                    const gp_Pnt& OffsetPoint) {
-
-
+                                    const gp_Pnt& OffsetPoint)
+{
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   gp_Lin L1 (AttachmentPoint1,aDirection);
   gp_Lin L2 (AttachmentPoint2,aDirection2);
   gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
@@ -104,55 +103,34 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  PointMin.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  PointMax.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
   // trait de cote : 1er groupe
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
+  aPrims->AddVertex(PointMin);
+  aPrims->AddVertex(PointMax);
 
-  if (DimNulle) {
-
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction(),
-                     LA->Arrow1Aspect()->Angle(),
-                     LA->Arrow1Aspect()->Length());
+  Prs3d_Root::NewGroup(aPresentation);
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction().Reversed(),
-                     LA->Arrow1Aspect()->Angle(),
-                     LA->Arrow1Aspect()->Length());
-  } else {
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    
-    if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
+  if (DimNulle)
+  {
+    Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction(),LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
+    Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction().Reversed(),LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
+  }
+  else
+  {
+    if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
       outside = Standard_True;
-    }
     gp_Dir arrdir = L3.Direction().Reversed();
-    
-    if (outside) {
+    if (outside)
       arrdir.Reverse();
-    }
+
     // fleche 1 : 2eme groupe
-    Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,
-                     LA->Arrow1Aspect()->Angle(),
-                     LA->Arrow1Aspect()->Length());
-    
-    
+    Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
+
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
     
     // ball 1 : 3eme groupe
-    
     Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
     MarkerAsp->SetType(Aspect_TOM_BALL);
     MarkerAsp->SetScale(0.8);
@@ -171,26 +149,18 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
     Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
   }
 
-  AttachmentPoint1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj1.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   // trait de rappel 1 : 5eme groupe
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
-  AttachmentPoint2.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(Proj1);
 
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   // trait de rappel 2 : 6eme groupe
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(Proj2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPresentation,
@@ -200,10 +170,8 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
                                         const gp_Pnt& AttachmentPoint2,
                                         const gp_Dir& aDirection,
                                         const gp_Dir& aDirection2,
-                                        const gp_Pnt& OffsetPoint) {
-
-
-
+                                        const gp_Pnt& OffsetPoint)
+{
   gp_Lin L1 (AttachmentPoint1,aDirection);
   gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
 
@@ -221,33 +189,26 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(AxeAsp);
 
-  Graphic3d_Array1OfVertex V(1,2);
-  Quantity_Length X,Y,Z;
-
-  AttachmentPoint1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  Proj1.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
   // trait d'axe : 1er groupe
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(Proj1);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   Prs3d_Root::NewGroup(aPresentation);
+
   Handle(Graphic3d_AspectLine3d) Axe2Asp = new Graphic3d_AspectLine3d (acolor, atype, awidth);
   Axe2Asp->SetType  ( Aspect_TOL_DOTDASH);
   Axe2Asp->SetWidth ( 4.);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Axe2Asp);
 
-  AttachmentPoint2.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  Proj2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
   // trait d'axe: 2eme groupe
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(Proj2);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // anneau : 3eme et 4eme groupes
-
   Graphic3d_Vertex V3d(Proj2.X() ,Proj2.Y(), Proj2.Z());
 
   Prs3d_Root::NewGroup(aPresentation);
@@ -267,5 +228,4 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
   Marker2Asp->SetColor(acolor);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Marker2Asp);
   Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
-  
 }
index 7f0c742..d4258db 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_ParalPresentation.ixx>
 #include <gp_Lin.hxx>
 #include <gp_Dir.hxx>
 #include <ElCLib.hxx>
 #include <gce_MakeLin.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -42,9 +40,8 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
                                    const gp_Pnt& AttachmentPoint1,
                                    const gp_Pnt& AttachmentPoint2,
                                    const gp_Dir& aDirection,
-                                   const gp_Pnt& OffsetPoint) {
-
-
+                                   const gp_Pnt& OffsetPoint)
+{
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   gp_Lin L1 (AttachmentPoint1,aDirection);
@@ -75,67 +72,45 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  PointMin.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  PointMax.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
   // processing of side : 1st group
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
+  aPrims->AddVertex(PointMin);
+  aPrims->AddVertex(PointMax);
 
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
-  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
+  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
     outside = Standard_True;
-  }
   gp_Dir arrdir = L3.Direction().Reversed();
-
-  if (outside) {
+  if (outside)
     arrdir.Reverse();
-  }
+
   // arrow 1 : 2nd group
-  Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
 
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
   // arrow 2 : 3rd group
-  Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(),
-                   LA->Arrow2Aspect()->Angle(),
-                   LA->Arrow2Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
 
   Prs3d_Root::NewGroup(aPresentation);
   
   // text : 4th group
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
-  
-  AttachmentPoint1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj1.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
 
-  Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   // processing of call 1 : 5th group
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(Proj1);
   
-  AttachmentPoint2.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   // processing of call 2 : 6th group
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(Proj2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
 
 
@@ -150,9 +125,8 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
                                    const gp_Pnt& AttachmentPoint2,
                                    const gp_Dir& aDirection,
                                    const gp_Pnt& OffsetPoint,
-                                   const DsgPrs_ArrowSide ArrowPrs){
-
-
+                                   const DsgPrs_ArrowSide ArrowPrs)
+{
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
@@ -184,53 +158,30 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  PointMin.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  PointMax.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
   // processing of face 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
+  aPrims->AddVertex(PointMin);
+  aPrims->AddVertex(PointMax);
   
-  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
+  if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
     outside = Standard_True;
-  }
   gp_Dir arrdir = L3.Direction().Reversed();
-
-  if (outside) {
+  if (outside)
     arrdir.Reverse();
-  }
-
-
-  AttachmentPoint1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj1.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
 
   // processing of call 1 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddVertex(AttachmentPoint1);
+  aPrims->AddVertex(Proj1);
   
-  AttachmentPoint2.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  Proj2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
+  // processing of call 2 
+  aPrims->AddVertex(AttachmentPoint2);
+  aPrims->AddVertex(Proj2);
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
-   // processing of call 2 
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
-  
   // text 
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
   
   //arrows
   DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
-
-
 }
-
-
index 122a02f..7275c1f 100755 (executable)
@@ -38,7 +38,8 @@
 #include <Prs3d_LengthAspect.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 
 #include <StdPrs_Point.hxx>
 
@@ -56,82 +57,49 @@ void DsgPrs_PerpenPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
   LA->LineAspect()->SetTypeOfLine(Aspect_TOL_SOLID); // ou DOT ou DOTDASH
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   
-  Graphic3d_Array1OfVertex V1(1,2);
-  Graphic3d_Array1OfVertex V2(1,2);
-  Quantity_Length X1,Y1,Z1;
-  Quantity_Length X2,Y2,Z2;
-  
-  // 1er segment
-  OffsetPoint.Coord(X1,Y1,Z1);
-  V1(1).SetCoord(X1,Y1,Z1);
-  pAx1.Coord(X2,Y2,Z2);
-  V1(2).SetCoord(X2,Y2,Z2);  //ou directt dir1.XYZ
-  
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V1);
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  
-  // 2e segment
-  pAx2.Coord(X2,Y2,Z2);
-  V2(1).SetCoord(X1,Y1,Z1);
-  V2(2).SetCoord(X2,Y2,Z2);
-
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+  // segments
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(6,2);
 
-  // points attache
-  Graphic3d_Array1OfVertex V3(1,2);
-  if (intOut1) {
-    pAx1.Coord(X1,Y1,Z1);
-    V3(1).SetCoord(X1,Y1,Z1);
-    pnt1.Coord(X2,Y2,Z2);
-    V3(2).SetCoord(X2,Y2,Z2);
-    LA->LineAspect()->SetTypeOfLine(Aspect_TOL_DOT); // ou DOT ou DOTDASH
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V3);
-  }
-  if (intOut2) {
-    pAx2.Coord(X1,Y1,Z1);
-    V3(1).SetCoord(X1,Y1,Z1);
-    pnt2.Coord(X2,Y2,Z2);
-    V3(2).SetCoord(X2,Y2,Z2);
-    LA->LineAspect()->SetTypeOfLine(Aspect_TOL_DOT); // ou DOT ou DOTDASH
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->
-      SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V3);
-  }
+  aPrims->AddBound(3);
+  aPrims->AddVertex(OffsetPoint);
+  aPrims->AddVertex(pAx1);
+  aPrims->AddVertex(pAx2);
 
   // Symbol
-  Graphic3d_Array1OfVertex V4(1,3);
   gp_Vec vec1(gce_MakeDir(OffsetPoint,pAx1));
   gp_Vec vec2(gce_MakeDir(OffsetPoint,pAx2));
-  Standard_Real dist1(OffsetPoint.Distance(pAx1));
-  Standard_Real dist2(OffsetPoint.Distance(pAx2));
-  vec1 *= dist1;
-  vec1 *= .2;
-  vec2 *= dist2;
-  vec2 *= .2;
+  vec1 *= .2 * OffsetPoint.Distance(pAx1);
+  vec2 *= .2 * OffsetPoint.Distance(pAx2);
 
   gp_Pnt pAx11 = OffsetPoint.Translated(vec1);
   gp_Pnt pAx22 = OffsetPoint.Translated(vec2);
   gp_Pnt p_symb = pAx22.Translated(vec1);
 
-  pAx11.Coord(X1,Y1,Z1);
-  V4(1).SetCoord(X1,Y1,Z1);
-  p_symb.Coord(X1,Y1,Z1);
-  V4(2).SetCoord(X1,Y1,Z1);
-  pAx22.Coord(X1,Y1,Z1);
-  V4(3).SetCoord(X1,Y1,Z1);
-  
-  LA->LineAspect()->SetTypeOfLine(Aspect_TOL_SOLID); 
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V4);
-  Prs3d_Root::NewGroup(aPresentation);
-}
-
+  aPrims->AddBound(3);
+  aPrims->AddVertex(pAx11);
+  aPrims->AddVertex(p_symb);
+  aPrims->AddVertex(pAx22);
 
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
+  // points attache
+  if (intOut1 || intOut2)
+  {
+    LA->LineAspect()->SetTypeOfLine(Aspect_TOL_DOT); // ou DOT ou DOTDASH
+    Prs3d_Root::NewGroup(aPresentation);
+    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
 
+    if (intOut1) {
+      aPrims = new Graphic3d_ArrayOfSegments(2);
+      aPrims->AddVertex(pAx1);
+      aPrims->AddVertex(pnt1);
+      Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+    }
+    if (intOut2) {
+      aPrims = new Graphic3d_ArrayOfSegments(2);
+      aPrims->AddVertex(pAx2);
+      aPrims->AddVertex(pnt2);
+      Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+    }
+  }
+}
index e2d129a..736fa27 100755 (executable)
@@ -27,7 +27,7 @@
 #include <gp_Circ.hxx>
 #include <ElCLib.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 
 
 static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
-                                       const Standard_Real lpar,
-                                       const Standard_Real para) 
+                                        const Standard_Real lpar,
+                                        const Standard_Real para)
 {
-  if (fpar >= 0.) {
+  if (fpar >= 0.)
     return ((para >= fpar) && (para <= lpar));
-  }
-  if (para >= (fpar+2*M_PI)) return Standard_True;
+  if (para >= (fpar+2.*M_PI)) return Standard_True;
   if (para <= lpar) return Standard_True;
   return Standard_False;
 }
@@ -76,48 +75,36 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
 {
   Standard_Real fpara = firstparam;
   Standard_Real lpara = lastparam;
-  while (lpara > 2*M_PI) {
-    fpara -= 2*M_PI;
-    lpara -= 2*M_PI;
+  while (lpara > 2.*M_PI) {
+    fpara -= 2.*M_PI;
+    lpara -= 2.*M_PI;
   }
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   Standard_Real parat = ElCLib::Parameter(aCircle,AttachmentPoint);
   gp_Pnt attpoint = AttachmentPoint;
   Standard_Boolean otherside = Standard_False;
   if ( !DsgPrs_InDomain(fpara,lpara,parat)) {
     Standard_Real otherpar = parat + M_PI;
-    if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
+    if (otherpar > 2.*M_PI) otherpar -= 2.*M_PI;
     if (DsgPrs_InDomain(fpara,lpara,otherpar)) {
       parat = otherpar;
       otherside = Standard_True;
     }
     else {
-      Standard_Real ecartpar = Min(Abs(fpara-parat),
-                                  Abs(lpara-parat));
-      Standard_Real ecartoth = Min(Abs(fpara-otherpar),
-                                  Abs(lpara-otherpar));
+      const Standard_Real ecartpar = Min(Abs(fpara-parat),Abs(lpara-parat));
+      const Standard_Real ecartoth = Min(Abs(fpara-otherpar),Abs(lpara-otherpar));
       if (ecartpar <= ecartoth) {
-       if (parat < fpara) {
-         parat = fpara;
-       }
-       else {
-         parat = lpara;
-       }
+        parat = (parat < fpara)? fpara : lpara;
       }
       else {
-       otherside = Standard_True;
-       if (otherpar < fpara) {
-         parat = fpara;
-       }
-       else {
-         parat = lpara;
-       }
+        otherside = Standard_True;
+        parat = (otherpar < fpara)? fpara : lpara;
       }
       gp_Pnt ptdir = ElCLib::Value(parat,aCircle);
-      gp_Lin lsup(aCircle.Location(),
-                 gp_Dir(ptdir.XYZ()-aCircle.Location().XYZ()));
-      Standard_Real parpos = ElCLib::Parameter(lsup,AttachmentPoint);
+      gp_Lin lsup(aCircle.Location(),gp_Dir(ptdir.XYZ()-aCircle.Location().XYZ()));
+      const Standard_Real parpos = ElCLib::Parameter(lsup,AttachmentPoint);
       attpoint = ElCLib::Value(parpos,lsup);
     }
   }
@@ -126,40 +113,28 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
   gp_Pnt firstpoint = attpoint;
   gp_Pnt drawtopoint = ptoncirc;
   if (drawFromCenter && !otherside) {
-    Standard_Real uatt = ElCLib::Parameter(L,attpoint);
-    Standard_Real uptc = ElCLib::Parameter(L,ptoncirc);
-    if (Abs(uatt) > Abs(uptc)) {
+    const Standard_Real uatt = ElCLib::Parameter(L,attpoint);
+    const Standard_Real uptc = ElCLib::Parameter(L,ptoncirc);
+    if (Abs(uatt) > Abs(uptc))
       drawtopoint = aCircle.Location();
-    }
-    else {
+    else
       firstpoint = aCircle.Location();
-    }
   }
 
-  Graphic3d_Array1OfVertex V(1,2);
-
-  Quantity_Length X,Y,Z;
-
-  firstpoint.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-
-  drawtopoint.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(firstpoint);
+  aPrims->AddVertex(drawtopoint);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   gp_Dir arrdir = L.Direction();
-  if (reverseArrow) {
+  if (reverseArrow)
     arrdir.Reverse();
-  }
+
   // fleche
-  Prs3d_Arrow::Draw(aPresentation,ptoncirc,arrdir,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,ptoncirc,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
 
   // texte
   Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,attpoint);
-  
 }
 
 //=======================================================================
@@ -181,27 +156,19 @@ void DsgPrs_RadiusPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
   Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
 
-  Graphic3d_Array1OfVertex VertexArray( 1, 2 );
-  gp_Pnt  LineOrigin, LineEnd;
-  Quantity_Length X,Y,Z;
-
-  DsgPrs::ComputeRadiusLine( Center, EndOfArrow, AttachmentPoint, drawFromCenter,
-                           LineOrigin, LineEnd);
-//
-  LineOrigin.Coord( X, Y, Z );
-  VertexArray(1).SetCoord( X, Y, Z );
+  gp_Pnt LineOrigin, LineEnd;
+  DsgPrs::ComputeRadiusLine(Center, EndOfArrow, AttachmentPoint, drawFromCenter, LineOrigin, LineEnd);
 
-  LineEnd.Coord( X, Y, Z );
-  VertexArray(2).SetCoord( X, Y, Z );
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(LineOrigin);
+  aPrims->AddVertex(LineEnd);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
-  Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
   // text
   Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, AttachmentPoint );
 
   gp_Dir ArrowDir = gce_MakeDir( LineOrigin , LineEnd );
   if (reverseArrow)
     ArrowDir.Reverse();
-  DsgPrs::ComputeSymbol( aPresentation, LA, Center, EndOfArrow, ArrowDir.Reversed(), ArrowDir,
-                       ArrowPrs, drawFromCenter );
+  DsgPrs::ComputeSymbol( aPresentation, LA, Center, EndOfArrow, ArrowDir.Reversed(), ArrowDir, ArrowPrs, drawFromCenter );
 }
-  
index 404cbb5..f4ba943 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_ShadedPlanePresentation.ixx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_PlaneAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPolygons.hxx>
 
 
 //=======================================================================
@@ -43,18 +41,11 @@ void DsgPrs_ShadedPlanePresentation::Add(const Handle(Prs3d_Presentation)& aPres
   Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
   TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
   TheGroup->SetPrimitivesAspect(aDrawer->ShadingAspect()->Aspect());
-  Quantity_Length x1,y1,z1,x2,y2,z2,x3,y3,z3;
-  
-  aPt1.Coord(x1,y1,z1);
-  aPt2.Coord(x2,y2,z2);
-  aPt3.Coord(x3,y3,z3);
-  
-  Graphic3d_Array1OfVertex A(1,5);
-  A(1).SetCoord(x1,y1,z1);
-  A(2).SetCoord(x2,y2,z2);
-  A(3).SetCoord(x3,y3,z3);
-  A(4).SetCoord(x1,y1,z1);
-  A(5)=A(1);
-  TheGroup->Polygon(A);
+
+  Handle(Graphic3d_ArrayOfPolygons) aPrims = new Graphic3d_ArrayOfPolygons(4);
+  aPrims->AddVertex(aPt1);
+  aPrims->AddVertex(aPt2);
+  aPrims->AddVertex(aPt3);
+  aPrims->AddVertex(aPt1);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
index 171a6da..16e8637 100755 (executable)
@@ -18,8 +18,6 @@
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_ShapeDirPresentation.ixx>
 
 #include <gp.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepTools_WireExplorer.hxx>
-//#include <BRepAdaptor_Curve2d.hxx>
 #include <BRepClass_FaceClassifier.hxx>
 #include <BRepClass_Edge.hxx>
 #include <BRepBndLib.hxx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Vertex.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_LineAspect.hxx>
 
@@ -57,7 +53,6 @@
 #include <TColgp_Array1OfPnt2d.hxx>
 
 
-
 //=======================================================================
 //function : FindPointOnFace
 //purpose  : internal use
@@ -157,15 +152,9 @@ static Standard_Boolean ComputeDir(const TopoDS_Shape& shape, gp_Pnt& pt, gp_Dir
     Handle(Geom_Curve) curve = Handle(Geom_Curve)::DownCast(curv0->Copy());
     curve->Transform(loc.Transformation()); 
     GeomLProp_CLProps lProps(curve, 1, gp::Resolution());
-    if (mode == 0) {
-      lProps.SetParameter(last);
-    }
-    else if (mode == 1) {
-      lProps.SetParameter(first);
-    }
-    if (!lProps.IsTangentDefined()) {
+    lProps.SetParameter((mode == 0)? last : first);
+    if (!lProps.IsTangentDefined())
       return Standard_False;
-    }
     pt = lProps.Value();
     lProps.Tangent(dir);
   }
@@ -178,16 +167,13 @@ static Standard_Boolean ComputeDir(const TopoDS_Shape& shape, gp_Pnt& pt, gp_Dir
       pt2d.SetCoord((u1+u2)*0.5, (v1+v2)*0.5);
     }
     else {
-      Standard_Boolean found = FindPointOnFace(TopoDS::Face(shape), pt2d);
-      if (!found) {
-       return Standard_False;
-      }
+      if (!FindPointOnFace(TopoDS::Face(shape), pt2d))
+        return Standard_False;
     }
     
     GeomLProp_SLProps lProps(surface, pt2d.X(), pt2d.Y(), 1, gp::Resolution());
-    if (!lProps.IsNormalDefined()) {
+    if (!lProps.IsNormalDefined())
       return Standard_False;
-    }
 
     pt = lProps.Value();
     dir = lProps.Normal();
@@ -211,9 +197,8 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
                                      const Standard_Integer mode)
      
 {
-  if ((mode != 0) && (mode != 1)) {
+  if ((mode != 0) && (mode != 1))
     return;
-  }
   
   gp_Dir dir;
   gp_Pnt pt;
@@ -234,9 +219,8 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
     for (anExp.Init(TopoDS::Wire(shape)); anExp.More(); anExp.Next()) {
       const TopoDS_Edge& edge = anExp.Current();
       nb++;
-      if (nb <=3) {
-       BRepBndLib::Add(edge, box);
-      }
+      if (nb <=3)
+        BRepBndLib::Add(edge, box);
       aList.Append(edge);
     }
 
@@ -273,15 +257,14 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
   // mei 19/09/96 extrusion infinie -> taille fixe
   if (leng >= 20000.) leng = 50;
 
-  gp_Pnt pt2(pt.X()+leng*dir.X(), pt.Y()+leng*dir.Y(), pt.Z()+leng*dir.Z());
-  Graphic3d_Array1OfVertex line(1,2);
-  line(1).SetCoord(pt.X(), pt.Y(), pt.Z());
-  line(2).SetCoord(pt2.X(), pt2.Y(), pt2.Z());
-  
+  gp_Pnt pt2(pt.XYZ()+leng*dir.XYZ());
+
   Prs3d_Root::CurrentGroup(prs)->SetPrimitivesAspect(drawer->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(prs)->Polyline(line);
+
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(pt);
+  aPrims->AddVertex(pt2);
+  Prs3d_Root::CurrentGroup(prs)->AddPrimitiveArray(aPrims);
 
   Prs3d_Arrow::Draw(prs, pt2, dir, M_PI/180.*10., leng*0.3);
 }
-
-
index ee47926..8da9410 100755 (executable)
@@ -18,8 +18,6 @@
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_SymmetricPresentation.ixx>
 
 #include <Precision.hxx>
@@ -42,7 +40,8 @@
 #include <gce_MakeDir.hxx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_Vertex.hxx>
@@ -74,11 +73,11 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
                                        const gp_Pnt& OffsetPoint)
 { 
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());  
+  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
   gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPoint),aAxis);
   gp_Pnt PjAttachPnt1    = ElCLib::Value(ElCLib::Parameter(aAxis,AttachmentPoint1),aAxis);
   gp_Dir aDirectionAxis  = aAxis.Direction();
-//  gp_Lin L1 (AttachmentPoint1,aDirection1);
   Standard_Real h = fabs(ProjOffsetPoint.Distance(PjAttachPnt1)/cos(aDirectionAxis.Angle(aDirection1)));
   
   gp_Vec VL1(aDirection1);
@@ -132,19 +131,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
 
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
-  Graphic3d_Array1OfVertex V(1,2);
-  Graphic3d_Array1OfVertex Vc(1,3);
-  Quantity_Length X,Y,Z;
-  Standard_Real D1,coeff;
-  coeff = .5;
-  D1 = aAxis.Distance(AttachmentPoint1);
-  gp_Pnt pint,Pj_P1,P1Previous;
-  P1Previous.SetX(P1.X());
-  P1Previous.SetY(P1.Y());
-  P1Previous.SetZ(P1.Z());
 
+  Quantity_Length X,Y,Z;
+  Standard_Real D1(aAxis.Distance(AttachmentPoint1)),coeff(.5);
+  gp_Pnt pint,Pj_P1,P1Previous = P1;
   
-/*//=======================================================
+  //=======================================================
   // TO AVOID CROSSING
   //        P1  -=- P2                P2  -=- P1         
   //          \<-->/                    |<-->|
@@ -155,7 +147,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   // Pattach2 /____\ Pattach1 Pattach2 /______\ Pattach1
   //         /  NO \                  /   YES  \
   //=======================================================
-*/
 
   Standard_Boolean Cross = Standard_False;
   gp_Vec Attch1_PjAttch1(AttachmentPoint1,PjAttachPnt1);
@@ -167,16 +158,15 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     P1       = P2;
     P2       = PntTempo;
   }  
-/*  //===================================
+  //===================================
   // FRACTURES OF TRAITS OF CALL    
   //        /             \         
   //       /               \
   //       |      -=-      |
   //       |<------------->| 
   //===================================
-*/
+
   gp_Vec        Vfix;
-//  Standard_Real alpha,b,s,d;
   Standard_Real alpha,b;
 
   if(aAxis.Distance(P1) > D1*(1 + coeff) && !Cross){
@@ -184,13 +174,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     //==== PROCESSING OF FACE ===========
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
     Pj_P1 = ElCLib::Value(ElCLib::Parameter(aAxis,P1),aAxis);
     gp_Vec Vp(Pj_P1,P1);
     Vfix = Vp.Divided(Vp.Magnitude()).Multiplied(D1*(1 + coeff));
-    Pj_P1.Translated(Vfix).Coord(X,Y,Z);
-    P1.SetCoord(X,Y,Z);
-    Pj_P1.Translated(Vfix.Reversed()).Coord(X,Y,Z);
-    P2.SetCoord(X,Y,Z);
+    P1 = Pj_P1.Translated(Vfix);
+    P2 = Pj_P1.Translated(Vfix.Reversed());
 
     //=================================
     // LISTING AT THE EXTERIOR
@@ -220,49 +209,37 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     PointMin = ElCLib::Value(parmin,L3);
     PointMax = ElCLib::Value(parmax,L3);
 
-    PointMin.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    PointMax.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+    Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(8,3);
+
+    aPrims->AddBound(2);
+    aPrims->AddVertex(PointMin);
+    aPrims->AddVertex(PointMax);
     
     //==== PROCESSING OF CALL 1 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    AttachmentPoint1.Coord(X,Y,Z);
-    Vc(1).SetCoord(X,Y,Z);
-    
     alpha = aDirectionAxis.Angle(aDirection1);
     b = (coeff*D1)/sin(alpha);
     gp_Vec Vpint(AttachmentPoint1,P1Previous);
-    AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b)).Coord(X,Y,Z);
-    pint.SetCoord(X,Y,Z);
-
-    pint.Coord(X,Y,Z);
-    Vc(2).SetCoord(X,Y,Z);
-    P1.Coord(X,Y,Z);
-    Vc(3).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
-    
+    pint = AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b));
+
+    aPrims->AddBound(3);
+    aPrims->AddVertex(AttachmentPoint1);
+    aPrims->AddVertex(pint);
+    aPrims->AddVertex(P1);
+
     //==== PROCESSING OF CALL 2 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    AttachmentPoint2.Coord(X,Y,Z);
-    Vc(1).SetCoord(X,Y,Z);
     gp_Pnt Pj_pint  = ElCLib::Value(ElCLib::Parameter(aAxis,pint),aAxis);
     gp_Vec V_int(pint, Pj_pint);
-    gp_Pnt Sym_pint;
-    Pj_pint.Translated(V_int).Coord(X,Y,Z);
-    Sym_pint.SetCoord(X,Y,Z);
-
-    Sym_pint.Coord(X,Y,Z);
-    Vc(2).SetCoord(X,Y,Z);
-    P2.Coord(X,Y,Z);
-    Vc(3).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
+    gp_Pnt Sym_pint = Pj_pint.Translated(V_int);
+
+    aPrims->AddBound(3);
+    aPrims->AddVertex(AttachmentPoint2);
+    aPrims->AddVertex(Sym_pint);
+    aPrims->AddVertex(P2);
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
 
-/*//===================================
+  //===================================
   // FRACTURES OF PROCESSING OF CALL    
   //              -=-    
   //         |<--------->| 
@@ -270,12 +247,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   //        /             \         
   //       /               \
   //===================================
-*/
   else if (aAxis.Distance(P1) < D1*(1 - coeff) || Cross) {
 
     //------ PROCESSING OF FACE ------------
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
     Pj_P1 = ElCLib::Value(ElCLib::Parameter(aAxis,P1),aAxis);
     gp_Vec VpInf(Pj_P1,P1);
     Vfix = VpInf.Divided(VpInf.Magnitude()).Multiplied(D1*(1 - coeff));
@@ -311,75 +288,55 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     PointMin = ElCLib::Value(parmin,L3);
     PointMax = ElCLib::Value(parmax,L3);
 
-    PointMin.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    PointMax.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+    Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(8,3);
+
+    aPrims->AddBound(2);
+       aPrims->AddVertex(PointMin);
+    aPrims->AddVertex(PointMax);
     
     //==== PROCESSING OF CALL 1 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    AttachmentPoint1.Coord(X,Y,Z);
-    Vc(1).SetCoord(X,Y,Z);
-    
     alpha = aDirectionAxis.Angle(aDirection1);
     b = (coeff*D1)/sin(alpha);
     gp_Vec Vpint(AttachmentPoint1,P1Previous);
-    AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b)).Coord(X,Y,Z);
-    pint.SetCoord(X,Y,Z);
-
-    pint.Coord(X,Y,Z);
-    Vc(2).SetCoord(X,Y,Z);
-    P1.Coord(X,Y,Z);
-    Vc(3).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
+    pint = AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b));
+
+    aPrims->AddBound(3);
+    aPrims->AddVertex(AttachmentPoint1);
+    aPrims->AddVertex(pint);
+    aPrims->AddVertex(P1);
     
     //==== PROCESSING OF CALL 2 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    AttachmentPoint2.Coord(X,Y,Z);
-    Vc(1).SetCoord(X,Y,Z);
     gp_Pnt Pj_pint  = ElCLib::Value(ElCLib::Parameter(aAxis,pint),aAxis);
     gp_Vec V_int(pint, Pj_pint);
-    gp_Pnt Sym_pint;
-    Pj_pint.Translated(V_int).Coord(X,Y,Z);
-    Sym_pint.SetCoord(X,Y,Z);
-
-    Sym_pint.Coord(X,Y,Z);
-    Vc(2).SetCoord(X,Y,Z);
-    P2.Coord(X,Y,Z);
-    Vc(3).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
+    gp_Pnt Sym_pint = Pj_pint.Translated(V_int);
+
+    aPrims->AddBound(3);
+    aPrims->AddVertex(AttachmentPoint2);
+    aPrims->AddVertex(Sym_pint);
+    aPrims->AddVertex(P2);
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
   else {
     
     //==== PROCESSING OF FACE ===========
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    PointMin.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    PointMax.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
 
+    Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
+
+       aPrims->AddVertex(PointMin);
+    aPrims->AddVertex(PointMax);
+    
     //==== PROCESSING OF CALL 1 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    AttachmentPoint1.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    P1.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+    aPrims->AddVertex(AttachmentPoint1);
+    aPrims->AddVertex(P1);
 
     //==== PROCESSING OF CALL 2 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    AttachmentPoint2.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    P2.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+    aPrims->AddVertex(AttachmentPoint2);
+    aPrims->AddVertex(P2);
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
 
   //==== ARROWS ================
@@ -390,14 +347,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   gp_Dir arrdir = L3.Direction().Reversed();
   if (outside) arrdir.Reverse();
   // arrow 1 ----
-  Prs3d_Arrow::Draw(aPresentation,P1,arrdir,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,P1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
   
   // arrow 2 ----
-  Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),
-                   LA->Arrow2Aspect()->Angle(),
-                   LA->Arrow2Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
 
   //-------------------------------------------------------------------------------------
   //|                                SYMBOL OF SYMMETRY                                 |
@@ -427,42 +380,35 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   else {
     pm = P1.Translated(Vvar.Multiplied(.5));
   }
-  //pm = P1.Translated(Vvar.Multiplied(.5));
   pOff = OffsetPoint.Translated(vecB);
   
   //Calculate the extremities of the symbol axis
   gp_Vec vecAxe = vecA.Multiplied(.7);
-  pOff.Translated(vecAxe).Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  pOff.Translated(vecAxe.Reversed()).Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
+
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(13,5);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pOff.Translated(vecAxe));
+  aPrims->AddVertex(pOff.Translated(vecAxe.Reversed()));
 
   //Calculate the extremities of the superior segment of the symbol
   gp_Vec vec1 = vecAxe.Multiplied(.6);
   vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
   gp_Vec vec2 = vecAxe.Multiplied(.4);
 
-  pOff.Translated(vec1.Added(vec2)).Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  pOff.Translated(vec1.Reversed().Added(vec2)).Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pOff.Translated(vec1.Added(vec2)));
+  aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2)));
 
   //Calculate the extremities of the inferior segment of the symbol
-  pOff.Translated(vec1.Added(vec2.Reversed())).Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  pOff.Translated(vec1.Reversed().Added(vec2.Reversed())).Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-  
-/*//--------------------------------------------------------------------------------------
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pOff.Translated(vec1.Added(vec2.Reversed())));
+  aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2.Reversed())));
+
+  //--------------------------------------------------------------------------------------
   //|                          MARKING OF THE SYMMETRY AXIS                             |
   //--------------------------------------------------------------------------------------     
   //        ____
@@ -470,42 +416,31 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   //         \/
   //         /\
   //        /__\
-*/
 
-  Graphic3d_Array1OfVertex cursor(1,5);
-  Standard_Real Dist = (aAxis.Distance(AttachmentPoint1)+
-                       aAxis.Distance(AttachmentPoint2))/75;
+  Standard_Real Dist = (aAxis.Distance(AttachmentPoint1)+aAxis.Distance(AttachmentPoint2))/75;
   gp_Vec vs(aDirectionAxis);
   gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
-  
   gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
   
+  aPrims->AddBound(5);
   gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
-  cursor(1).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
-  cursor(2).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsymper.Multiplied(2));
-  cursor(3).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
-  cursor(4).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsymper.Multiplied(2));
-  cursor(5).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
-
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(cursor);
+  aPrims->AddVertex(pm1);
 
   vsym.Multiply(4);
-  V(1).SetCoord(pm.Translated(vsym).X(),
-               pm.Translated(vsym).Y(),
-               pm.Translated(vsym).Z());
-  V(2).SetCoord(pm.Translated(vsym.Reversed()).X(),
-               pm.Translated(vsym.Reversed()).Y(),
-               pm.Translated(vsym.Reversed()).Z());
 
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);  
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pm.Translated(vsym));
+  aPrims->AddVertex(pm.Translated(vsym.Reversed()));
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
   
 //===================================================================
@@ -522,6 +457,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
 {
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());  
+
   gp_Pnt OffsetPnt(OffsetPoint.X(),OffsetPoint.Y(),OffsetPoint.Z());
   gp_Pnt Center1 = aCircle1.Location();
   gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPnt),aAxis);
@@ -529,7 +465,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   gp_Vec Vp(ProjCenter1,Center1);
   if (Vp.Magnitude() <= Precision::Confusion()) Vp = gp_Vec(aAxis.Direction())^aCircle1.Position().Direction();
 
-
   Standard_Real Dt,R,h;
   Dt = ProjCenter1.Distance(ProjOffsetPoint);
   R  = aCircle1.Radius();
@@ -553,10 +488,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   if (parcur < parmin) parmin = parcur;
   if (parcur > parmax) parmax = parcur;
   parcur = ElCLib::Parameter(L3,OffsetPnt);
-#ifdef DEB
-  gp_Pnt offp =
-#endif
-                ElCLib::Value(parcur,L3);
 
   Standard_Boolean outside = Standard_False;
   if (parcur < parmin) {
@@ -569,32 +500,23 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   }
   gp_Pnt PointMin = ElCLib::Value(parmin,L3);
   gp_Pnt PointMax = ElCLib::Value(parmax,L3);
-  Graphic3d_Array1OfVertex V(1,2);
-  Quantity_Length X,Y,Z;
-    
+
   //==== PROCESSING OF FACE ===========
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  PointMin.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  PointMax.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(PointMin);
+  aPrims->AddVertex(PointMax);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   //==== PROCESSING OF CALL 1 =====
   Standard_Integer nbp = 10;
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); 
   Standard_Real ParamP1       = ElCLib::Parameter(aCircle1,P1);
   Standard_Real ParamPAttach1 = ElCLib::Parameter(aCircle1,AttachmentPoint1);
-//  gp_Vec Center1_PAttach1(Center1,AttachmentPoint1);
-//  gp_Vec Center1_P1(Center1,P1);
   Standard_Real alpha,Dalpha,alphaIter;
 
   alpha = fabs(ParamP1 - ParamPAttach1);
   if(ParamP1 < ParamPAttach1){
     if(alpha > M_PI){
-      alpha  = (2*M_PI) - alpha;
+      alpha  = (2.*M_PI) - alpha;
       nbp    = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
       Dalpha = alpha/(nbp - 1);
     }
@@ -605,7 +527,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   }
   else{
     if(alpha > M_PI){
-      alpha  = (2*M_PI) - alpha;
+      alpha  = (2.*M_PI) - alpha;
       nbp    = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
       Dalpha = -alpha/(nbp - 1);
     }
@@ -615,28 +537,17 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     }
   }
 
-  Graphic3d_Array1OfVertex Vc1(1,nbp);
-  AttachmentPoint1.Coord(X,Y,Z);
-  Vc1(1).SetCoord(X,Y,Z);
+  aPrims = new Graphic3d_ArrayOfPolylines(nbp);
+  aPrims->AddVertex(AttachmentPoint1);
   alphaIter = Dalpha;
   gp_Pnt PntIter;
-  Standard_Integer i ;
-  for( i = 2; i <= nbp; i++){    
-    PntIter = ElCLib::Value(ParamPAttach1 + alphaIter,aCircle1);
-    alphaIter = alphaIter + Dalpha;
-    PntIter.Coord(X,Y,Z);
-    Vc1(i).SetCoord(X,Y,Z);
-    
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc1);
+  Standard_Integer i;
+  for(i = 2; i <= nbp; i++, alphaIter += Dalpha)
+    aPrims->AddVertex(ElCLib::Value(ParamPAttach1 + alphaIter,aCircle1));
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   
   //==== PROCESSING OF CALL 2 =====
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
   gp_Pnt Center2 = ProjCenter1.Translated(Vp.Reversed());
-//  gp_Vec Center2_PAttach2(Center2,AttachmentPoint2);
-//  gp_Vec Center2_P2(Center2,P2);
-  
   gp_Dir DirC2 = aCircle1.Axis().Direction();
   gp_Ax2 AxeC2(Center2,DirC2);
   gp_Circ aCircle2(AxeC2,aCircle1.Radius());
@@ -668,18 +579,13 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     }
   }
 
-  Graphic3d_Array1OfVertex Vc2(1,nbp);
-  AttachmentPoint2.Coord(X,Y,Z);
-  Vc2(1).SetCoord(X,Y,Z);
+  aPrims = new Graphic3d_ArrayOfPolylines(nbp);
+  aPrims->AddVertex(AttachmentPoint2);
   alphaIter = Dalpha;
-  for(i = 2; i <= nbp; i++){
-    PntIter = ElCLib::Value(ParamPAttach2 + alphaIter,aCircle2);
-    alphaIter = alphaIter + Dalpha;
-    PntIter.Coord(X,Y,Z);
-    Vc2(i).SetCoord(X,Y,Z);
-  }
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc2);
-  
+  for(i = 2; i <= nbp; i++, alphaIter += Dalpha)
+    aPrims->AddVertex(ElCLib::Value(ParamPAttach2 + alphaIter,aCircle2));
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+
   //==== ARROWS ================
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
@@ -688,14 +594,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   gp_Dir arrdir = L3.Direction().Reversed();
   if (outside) arrdir.Reverse();
   // arrow 1 ----
-  Prs3d_Arrow::Draw(aPresentation,P1,arrdir,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,P1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
   
   // arrow 2 ----
-  Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),
-                   LA->Arrow2Aspect()->Angle(),
-                   LA->Arrow2Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
 
   //-------------------------------------------------------------------------------------
   //|                                SYMBOL OF SYMMETRY                                 |
@@ -706,9 +608,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   //           -------    : Inferior Segment 
   
   gp_Vec Vvar(P1,P2);
-  gp_Vec vec;
   gp_Vec Vtmp = Vvar.Divided(Vvar.Magnitude()).Multiplied(2*(aAxis.Distance(Center1)));
-  vec.SetCoord(Vtmp.X(),Vtmp.Y(),Vtmp.Z());
+  gp_Vec vec = Vtmp;
   gp_Vec vecA = vec.Multiplied(.1);
 
   gp_Dir DirAxis = aAxis.Direction();
@@ -716,48 +617,36 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   gp_Vec vecB = Vaxe.Multiplied(vecA.Magnitude());
   vecB.Multiply(.5);
 
-  //gp_Vec vecB(-vec.Y(),vec.X(),vec.Z());
-  //vecB.Multiply(.05);
-  gp_Pnt pm,pOff;
-  pm = P1.Translated(Vvar.Multiplied(.5));
-  pOff = OffsetPnt.Translated(vecB);
+  gp_Pnt pm = P1.Translated(Vvar.Multiplied(.5));
+  gp_Pnt pOff = OffsetPnt.Translated(vecB);
 
   //Calculation of extremas of the axis of the symbol
   gp_Vec vecAxe = vecA.Multiplied(.7);
-  pOff.Translated(vecAxe).Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  pOff.Translated(vecAxe.Reversed()).Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
+
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+  aPrims = new Graphic3d_ArrayOfPolylines(13,5);
+
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pOff.Translated(vecAxe));
+  aPrims->AddVertex(pOff.Translated(vecAxe.Reversed()));
 
   //Calculation of extremas of the superior segment of the symbol
   gp_Vec vec1 = vecAxe.Multiplied(.6);
-
   vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
-  //vecAxe.SetCoord(-vecAxe.Y(),vecAxe.X(),vecAxe.Z());
-
   gp_Vec vec2 = vecAxe.Multiplied(.4);
 
-  pOff.Translated(vec1.Added(vec2)).Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  pOff.Translated(vec1.Reversed().Added(vec2)).Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pOff.Translated(vec1.Added(vec2)));
+  aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2)));
 
   //Calculation of extremas of the inferior segment of the symbol
-  pOff.Translated(vec1.Added(vec2.Reversed())).Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  pOff.Translated(vec1.Reversed().Added(vec2.Reversed())).Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pOff.Translated(vec1.Added(vec2.Reversed())));
+  aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2.Reversed())));
   
-/*//--------------------------------------------------------------------------------------
+  //--------------------------------------------------------------------------------------
   //|                          MARKING OF THE AXIS OF SYMMETRY                           |
   //--------------------------------------------------------------------------------------     
   //        ____
@@ -765,44 +654,34 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   //         \/
   //         /\
   //        /__\
-*/
 
-  Graphic3d_Array1OfVertex cursor(1,5);
-  //Standard_Real Dist = aCircle1.Radius()/37;
   Standard_Real Dist = aAxis.Distance(Center1)/37;
   gp_Dir aDirectionAxis = aAxis.Direction();
   gp_Vec vs(aDirectionAxis);
   gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
-  
   gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
+
+  aPrims->AddBound(5);
   gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
-  cursor(1).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
-  cursor(2).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsymper.Multiplied(2));
-  cursor(3).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
-  cursor(4).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+  aPrims->AddVertex(pm1);
   pm1 = pm1.Translated(vsymper.Multiplied(2));
-  cursor(5).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
-
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(cursor);
+  aPrims->AddVertex(pm1);
 
   vsym.Multiply(4);
-  V(1).SetCoord(pm.Translated(vsym).X(),
-               pm.Translated(vsym).Y(),
-               pm.Translated(vsym).Z());
-  V(2).SetCoord(pm.Translated(vsym.Reversed()).X(),
-               pm.Translated(vsym.Reversed()).Y(),
-               pm.Translated(vsym.Reversed()).Z());
 
-  Prs3d_Root::NewGroup(aPresentation);
-  Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);  
+  aPrims->AddBound(2);
+  aPrims->AddVertex(pm.Translated(vsym));
+  aPrims->AddVertex(pm.Translated(vsym.Reversed()));
+
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 }
-  
+
 //===================================================================
 //Function:Add
 //Purpose: draws the representation of an axial symmetry between two vertex.
@@ -817,7 +696,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
   Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());  
 
-  if (AttachmentPoint1.IsEqual(AttachmentPoint2,Precision::Confusion())){
+  if (AttachmentPoint1.IsEqual(AttachmentPoint2,Precision::Confusion()))
+  {
     //==============================================================
     //  SYMMETRY WHEN THE REFERENCE POINT IS ON THE AXIS OF SYM.:
     //==============================================================
@@ -831,22 +711,17 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
     MarkerAsp->SetColor(acolor);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
-    Graphic3d_Vertex V3d(AttachmentPoint1.X(),
-                        AttachmentPoint1.Y(), 
-                        AttachmentPoint1.Z());
+    Graphic3d_Vertex V3d(AttachmentPoint1.X(),AttachmentPoint1.Y(),AttachmentPoint1.Z());
     Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
 
     //Trace of the linking segment 
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Graphic3d_Array1OfVertex Vrac(1,2);
-    Vrac(1).SetCoord(AttachmentPoint1.X(),
-                    AttachmentPoint1.Y(), 
-                    AttachmentPoint1.Z());
-    Vrac(2).SetCoord(OffsetPoint.X(),
-                    OffsetPoint.Y(),
-                    OffsetPoint.Z());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
+
+    Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(8);
+
+       aPrims->AddVertex(AttachmentPoint1);
+    aPrims->AddVertex(OffsetPoint);
   
     //--------------------------------------------------------------------------------------
     //|                                SYMBOL OF SYMMETRY                                 |
@@ -860,43 +735,39 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     gp_Vec uVAO  = VAO.Divided(VAO.Magnitude());
     gp_Pnt pDaxe = OffsetPoint.Translated(uVAO.Multiplied(3.));
     gp_Pnt pFaxe = pDaxe.Translated(uVAO.Multiplied(12.));
-    Vrac(1).SetCoord(pDaxe.X(),pDaxe.Y(),pDaxe.Z());
-    Vrac(2).SetCoord(pFaxe.X(),pFaxe.Y(),pFaxe.Z());
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
+
+    aPrims->AddVertex(pDaxe);
+    aPrims->AddVertex(pFaxe);
 
     //Calculate extremas of the superior segment of the symbol
     gp_Vec nVAO  (-uVAO.Y(),uVAO.X(),uVAO.Z());
     gp_Pnt sgP11 = pDaxe.Translated(uVAO.Multiplied(2.).Added(nVAO.Multiplied(2.)));
     gp_Pnt sgP12 = sgP11.Translated(uVAO.Multiplied(8.));
-    Vrac(1).SetCoord(sgP11.X(),sgP11.Y(),sgP11.Z());
-    Vrac(2).SetCoord(sgP12.X(),sgP12.Y(),sgP12.Z());
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
+
+    aPrims->AddVertex(sgP11);
+    aPrims->AddVertex(sgP12);
 
     //Calculate extremas of the inferior segment of the symbol
     gp_Vec nVAOr = nVAO.Reversed();
     gp_Pnt sgP21 = pDaxe.Translated(uVAO.Multiplied(2.).Added(nVAOr.Multiplied(2.)));
     gp_Pnt sgP22 = sgP21.Translated(uVAO.Multiplied(8.));
-    Vrac(1).SetCoord(sgP21.X(),sgP21.Y(),sgP21.Z());
-    Vrac(2).SetCoord(sgP22.X(),sgP22.Y(),sgP22.Z());
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
+
+    aPrims->AddVertex(sgP21);
+    aPrims->AddVertex(sgP22);
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
   }
   //==============================================================
   //  OTHER CASES                                                 :
   //==============================================================
 
-  else{
+  else {
     gp_Pnt ProjOffsetPoint      = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPoint),aAxis);
     gp_Pnt ProjAttachmentPoint1 = ElCLib::Value(ElCLib::Parameter(aAxis,AttachmentPoint1),aAxis);
     gp_Vec PjAtt1_Att1(ProjAttachmentPoint1,AttachmentPoint1);
     gp_Pnt P1 = ProjOffsetPoint.Translated(PjAtt1_Att1);
     gp_Pnt P2 = ProjOffsetPoint.Translated(PjAtt1_Att1.Reversed());
-        
+
     gp_Lin L3 = gce_MakeLin(P1,P2);
     Standard_Real parmin,parmax,parcur;
     parmin = ElCLib::Parameter(L3,P1);
@@ -906,10 +777,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     if (parcur < parmin) parmin = parcur;
     if (parcur > parmax) parmax = parcur;
     parcur = ElCLib::Parameter(L3,OffsetPoint);
-#ifdef DEB
-    gp_Pnt offp =
-#endif
-                  ElCLib::Value(parcur,L3);
     
     Standard_Boolean outside = Standard_False;
     if (parcur < parmin) {
@@ -922,57 +789,41 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     }
     gp_Pnt PointMin = ElCLib::Value(parmin,L3);
     gp_Pnt PointMax = ElCLib::Value(parmax,L3);
-    Graphic3d_Array1OfVertex V(1,2);
-    Quantity_Length X,Y,Z;
-    
+
     //==== PROCESSING OF FACE ===========
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    PointMin.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    PointMax.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+    Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(6);
+
+       aPrims->AddVertex(PointMin);
+    aPrims->AddVertex(PointMax);
     
     //==== PROCESSING OF CALL 1 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); 
-    AttachmentPoint1.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    P1.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+    aPrims->AddVertex(AttachmentPoint1);
+    aPrims->AddVertex(P1);
     
     //==== PROCESSING OF CALL 2 =====
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); 
-    AttachmentPoint2.Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    P2.Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+    aPrims->AddVertex(AttachmentPoint2);
+    aPrims->AddVertex(P2);
+
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
  
     //==== ARROWS ================
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    
     if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) outside = Standard_True;
     gp_Dir arrdir = L3.Direction().Reversed();
     if (outside) arrdir.Reverse();
     // arrow 1 ----
-    Prs3d_Arrow::Draw(aPresentation,P1,arrdir,
-                     LA->Arrow1Aspect()->Angle(),
-                     LA->Arrow1Aspect()->Length());
+    Prs3d_Arrow::Draw(aPresentation,P1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
   
     // arrow 2 ----
-    Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),
-                     LA->Arrow2Aspect()->Angle(),
-                     LA->Arrow2Aspect()->Length());
+    Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
     
     //==== POINTS ================
     //Marker of localization of attachment points:
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
+
     Handle(Graphic3d_AspectMarker3d) MarkerAspAtt = new Graphic3d_AspectMarker3d();
     MarkerAspAtt->SetType(Aspect_TOM_BALL);
     MarkerAspAtt->SetScale(0.8);
@@ -982,18 +833,14 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     LA->LineAspect()->Aspect()->Values(color, type, width);
     MarkerAspAtt->SetColor(color);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
-    Graphic3d_Vertex Vatt1(AttachmentPoint1.X(),
-                          AttachmentPoint1.Y(), 
-                          AttachmentPoint1.Z());
-    Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt1);  
+    Graphic3d_Vertex Vatt1(AttachmentPoint1.X(),AttachmentPoint1.Y(),AttachmentPoint1.Z());
+    Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt1);
 
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
-    Graphic3d_Vertex Vatt2(AttachmentPoint2.X(),
-                          AttachmentPoint2.Y(), 
-                          AttachmentPoint2.Z());
-    Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt2);    
+    Graphic3d_Vertex Vatt2(AttachmentPoint2.X(),AttachmentPoint2.Y(),AttachmentPoint2.Z());
+    Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt2);
       
     //-------------------------------------------------------------------------------------
     //|                                SYMBOL OF SYMMETRY                                 |
@@ -1011,49 +858,36 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     gp_Vec vecB = Vaxe.Multiplied(vecA.Magnitude());
     vecB.Multiply(.5);
 
-    //gp_Vec vecB(-vec.Y(),vec.X(),vec.Z());
-    //vecB.Multiply(.05);
-
-    gp_Pnt pm,pOff;
-    pm = P1.Translated(vec.Multiplied(.5));
-    pOff = OffsetPoint.Translated(vecB);
+    gp_Pnt pm = P1.Translated(vec.Multiplied(.5));
+    gp_Pnt pOff = OffsetPoint.Translated(vecB);
     
     //Calculate the extremas of the axis of the symbol
     gp_Vec vecAxe = vecA.Multiplied(.7);
-    pOff.Translated(vecAxe).Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    pOff.Translated(vecAxe.Reversed()).Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
+
     Prs3d_Root::NewGroup(aPresentation);
     Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-    
+
+       aPrims = new Graphic3d_ArrayOfPolylines(13,5);
+
+    aPrims->AddBound(2);
+       aPrims->AddVertex(pOff.Translated(vecAxe));
+    aPrims->AddVertex(pOff.Translated(vecAxe.Reversed()));
+
     //Calculate the extremas of the superior segment of the symbol
     gp_Vec vec1 = vecAxe.Multiplied(.6);
-
     vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
-
-    //vecAxe.SetCoord(-vecAxe.Y(),vecAxe.X(),vecAxe.Z());
     gp_Vec vec2 = vecAxe.Multiplied(.4);
-    
-    pOff.Translated(vec1.Added(vec2)).Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    pOff.Translated(vec1.Reversed().Added(vec2)).Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+    aPrims->AddBound(2);
+    aPrims->AddVertex(pOff.Translated(vec1.Added(vec2)));
+    aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2)));
     
     //Calculate the extremas of the inferior segment of the symbol
-    pOff.Translated(vec1.Added(vec2.Reversed())).Coord(X,Y,Z);
-    V(1).SetCoord(X,Y,Z);
-    pOff.Translated(vec1.Reversed().Added(vec2.Reversed())).Coord(X,Y,Z);
-    V(2).SetCoord(X,Y,Z);
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
-    
-/*  //--------------------------------------------------------------------------------------
+    aPrims->AddBound(2);
+    aPrims->AddVertex(pOff.Translated(vec1.Added(vec2.Reversed())));
+    aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2.Reversed())));
+
+    //--------------------------------------------------------------------------------------
     //|                          MARKING OF THE AXIS OF SYMMETRY                           |
     //--------------------------------------------------------------------------------------     
     //        ____
@@ -1061,49 +895,31 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
     //         \/
     //         /\
     //        /__\
-*/
     
-    Graphic3d_Array1OfVertex cursor(1,5);
     Standard_Real Dist = P1.Distance(P2)/75;
     gp_Dir aDirectionAxis = aAxis.Direction();
     gp_Vec vs(aDirectionAxis);
     gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
-    
     gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
+
+    aPrims->AddBound(5);
     gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
-    cursor(1).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+    aPrims->AddVertex(pm1);
     pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
-    cursor(2).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+    aPrims->AddVertex(pm1);
     pm1 = pm1.Translated(vsymper.Multiplied(2));
-    cursor(3).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+    aPrims->AddVertex(pm1);
     pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
-    cursor(4).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
+    aPrims->AddVertex(pm1);
     pm1 = pm1.Translated(vsymper.Multiplied(2));
-    cursor(5).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
-    
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(cursor);
-    
-    vsym.Multiply(4);
-    V(1).SetCoord(pm.Translated(vsym).X(),
-                 pm.Translated(vsym).Y(),
-                 pm.Translated(vsym).Z());
-    V(2).SetCoord(pm.Translated(vsym.Reversed()).X(),
-                 pm.Translated(vsym.Reversed()).Y(),
-                 pm.Translated(vsym.Reversed()).Z());
-    
-    Prs3d_Root::NewGroup(aPresentation);
-    Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-    Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V); 
-  } 
-}
-
-
-
-
-
-
+    aPrims->AddVertex(pm1);
 
+    vsym.Multiply(4);
 
+    aPrims->AddBound(2);
+    aPrims->AddVertex(pm.Translated(vsym));
+    aPrims->AddVertex(pm.Translated(vsym.Reversed()));
 
+       Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
+  } 
+}
index 074567b..a0dbbae 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-
 #include <DsgPrs_TangentPresentation.ixx>
 
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -57,27 +55,19 @@ void DsgPrs_TangentPresentation::Add (const Handle(Prs3d_Presentation)& aPresent
 
   // Array1OfVertex
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Graphic3d_Array1OfVertex V(1,2);
-  Quantity_Length X,Y,Z;
-  p1.Coord(X,Y,Z);
-  V(1).SetCoord(X,Y,Z);
-  p2.Coord(X,Y,Z);
-  V(2).SetCoord(X,Y,Z);
-  Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
+
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(p1);
+  aPrims->AddVertex(p2);
+  Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
 
   // fleche 1 : 
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Arrow::Draw(aPresentation,p1,aDirection,
-                   LA->Arrow1Aspect()->Angle(),
-                   LA->Arrow1Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,p1,aDirection,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
 
   // fleche 2
   Prs3d_Root::NewGroup(aPresentation);
   Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
-  Prs3d_Arrow::Draw(aPresentation,p2,aDirection.Reversed(),
-                   LA->Arrow2Aspect()->Angle(),
-                   LA->Arrow2Aspect()->Length());
+  Prs3d_Arrow::Draw(aPresentation,p2,aDirection.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
 }
-
-
index ccbbccd..9372154 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
-#define OCC218 // SAV Enable to compute the triedhron color texts and arrows.
-
-
 #include <DsgPrs_XYZAxisPresentation.ixx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Arrow.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfSegments.hxx>
 
 
 //=======================================================================
@@ -43,24 +39,18 @@ void DsgPrs_XYZAxisPresentation::Add(
                       const gp_Pnt& aPfirst,
                       const gp_Pnt& aPlast)
 {
+  Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
+  G->SetPrimitivesAspect(aLineAspect->Aspect());
 
-
- Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
-
- Quantity_Length xo,yo,zo,x,y,z;
-  
- aPfirst.Coord(xo,yo,zo);
- aPlast.Coord(x,y,z);
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aPfirst);
+  aPrims->AddVertex(aPlast);
+  G->AddPrimitiveArray(aPrims);
  
- Graphic3d_Array1OfVertex A(1,2);
- A(1).SetCoord(xo,yo,zo);
- A(2).SetCoord(x,y,z);
- G->SetPrimitivesAspect(aLineAspect->Aspect());
- G->Polyline(A);
- Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.);
- Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.);
+  Prs3d_Arrow::Draw(aPresentation,aPlast,aDir,M_PI/180.*10.,aVal/10.);
 
+  Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
+  Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
 }
 
 
@@ -74,23 +64,18 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
                                     const gp_Pnt& aPfirst,
                                     const gp_Pnt& aPlast)
 {
-#ifdef OCC218
   Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
-
-  Quantity_Length xo,yo,zo,x,y,z;
-  
-  aPfirst.Coord(xo,yo,zo);
-  aPlast.Coord(x,y,z);
-  Graphic3d_Array1OfVertex A(1,2);
-  A(1).SetCoord(xo,yo,zo);
-  A(2).SetCoord(x,y,z);
   G->SetPrimitivesAspect(aLineAspect->Aspect());
-  G->Polyline(A);
+
+  Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
+  aPrims->AddVertex(aPfirst);
+  aPrims->AddVertex(aPlast);
+  G->AddPrimitiveArray(aPrims);
+
   G->SetPrimitivesAspect( anArrowAspect->Aspect() );
-  Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.);
+  Prs3d_Arrow::Draw(aPresentation,aPlast,aDir,M_PI/180.*10.,aVal/10.);
+
   G->SetPrimitivesAspect(aTextAspect->Aspect());
-  Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.);
-#endif
+  Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
+  Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
 }
index 18c44a0..1582ab9 100755 (executable)
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
 #include <DsgPrs_XYZPlanePresentation.ixx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_PlaneAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Graphic3d_Group.hxx>
-#include <Graphic3d_Array1OfVertex.hxx>
+#include <Graphic3d_ArrayOfPolylines.hxx>
 
 
 //=======================================================================
@@ -39,23 +38,13 @@ void DsgPrs_XYZPlanePresentation::Add(
                       const gp_Pnt& aPt2,
                       const gp_Pnt& aPt3)
 {
-
-
- Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
- TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
-
- Quantity_Length x1,y1,z1,x2,y2,z2,x3,y3,z3;
-  
- aPt1.Coord(x1,y1,z1);
- aPt2.Coord(x2,y2,z2);
- aPt3.Coord(x3,y3,z3);
- Graphic3d_Array1OfVertex A(1,4);
- A(1).SetCoord(x1,y1,z1);
- A(2).SetCoord(x2,y2,z2);
- A(3).SetCoord(x3,y3,z3);
- A(4).SetCoord(x1,y1,z1);
- TheGroup->Polyline(A);
-
+  Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
+  TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
+
+  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
+  aPrims->AddVertex(aPt1);
+  aPrims->AddVertex(aPt2);
+  aPrims->AddVertex(aPt3);
+  aPrims->AddVertex(aPt1);
+  TheGroup->AddPrimitiveArray(aPrims);
 }
index 81fa3ce..dc5212b 100755 (executable)
@@ -31,8 +31,6 @@ Graphic3d_Group.pxx
 Graphic3d_Group_1.cxx
 Graphic3d_Group_2.cxx
 Graphic3d_Group_3.cxx
-Graphic3d_Group_5.cxx
-Graphic3d_Group_7.cxx
 Graphic3d_Group_8.cxx
 Graphic3d_Group_10.cxx
 Graphic3d_Structure.pxx
@@ -54,3 +52,5 @@ Graphic3d_BufferType.hxx
 Graphic3d_Vec2.hxx
 Graphic3d_Vec3.hxx
 Graphic3d_Vec4.hxx
+Graphic3d_Vertex.hxx
+Graphic3d_Vertex.cxx
index 645d2f2..3b98532 100755 (executable)
@@ -69,6 +69,7 @@ uses
 
     TCollection,
     TColStd,
+    TColgp,
     OSD,
     Quantity,
     Aspect,
@@ -502,26 +503,10 @@ is
     ---Purpose: 3d vector
     ---Category: Classes
 
-    class Vertex;
+    imported Vertex;
     ---Purpose: 3d vertex
     ---Category: Classes
 
-    class VertexN;
-    ---Purpose: 3d vertex with a normal vector
-    ---Category: Classes
-
-    class VertexNT;
-    ---Purpose: 3d vertex with a normal vector and texture coordinate
-    ---Category: Classes
-
-    class VertexC;
-    ---Purpose: 3d vertex with a colour
-    ---Category: Classes
-
-    class VertexNC;
-    ---Purpose: 3d vertex with a normal and a colour
-    ---Category: Classes
-
     ---------------------
     -- Category: Pointers
     ---------------------
@@ -589,38 +574,6 @@ is
             Array2 from TCollection (Vertex from Graphic3d);
     ---Category: Instantiated classes
 
-    class Array1OfVertexC instantiates
-            Array1 from TCollection (VertexC from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array2OfVertexC instantiates
-            Array2 from TCollection (VertexC from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array1OfVertexN instantiates
-            Array1 from TCollection (VertexN from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array2OfVertexN instantiates
-            Array2 from TCollection (VertexN from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array1OfVertexNT instantiates
-            Array1 from TCollection (VertexNT from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array2OfVertexNT instantiates
-            Array2 from TCollection (VertexNT from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array1OfVertexNC instantiates
-            Array1 from TCollection (VertexNC from Graphic3d);
-    ---Category: Instantiated classes
-
-    class Array2OfVertexNC instantiates
-            Array2 from TCollection (VertexNC from Graphic3d);
-    ---Category: Instantiated classes
-
     class ListOfShortReal instantiates
             List from TCollection (ShortReal from Standard);
     ---Category: Instantiated classes
index c8ef003..b5cc4c0 100755 (executable)
@@ -85,16 +85,27 @@ is
     -- -------------------------------------------------------------------
 
     AddVertex( me:mutable;
-           aVertice: Pnt from gp)
+               aVertice: Pnt from gp)
     returns Integer from Standard
     ---Level: Public 
     ---Purpose: Adds a vertice in the array.
     -- returns the actual vertex number.
     raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
+
+    AddVertex( me:mutable;
+               X,Y,Z: Real from Standard)
+    returns Integer from Standard
+    ---Level: Public 
+    ---Purpose: Adds a vertice in the array.
+    -- returns the actual vertex number.
+    raises OutOfRange from Standard;
+    -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
 
     AddVertex( me:mutable;
-           X,Y,Z: Real from Standard)
+               X,Y,Z: ShortReal from Standard)
     returns Integer from Standard
     ---Level: Public 
     ---Purpose: Adds a vertice in the array.
@@ -102,9 +113,9 @@ is
     raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
 
-        AddVertex( me:mutable;
-                   aVertice: Pnt from gp;
-                   aColor: Color from Quantity)
+    AddVertex( me:mutable;
+               aVertice: Pnt from gp;
+               aColor: Color from Quantity)
         returns Integer from Standard
         ---Level: Public
     ---Purpose: Adds a vertice and vertex color in the vertex array.
@@ -117,7 +128,7 @@ is
     AddVertex( me       : mutable;
                aVertice : Pnt from gp;
                aColor   : Integer from Standard)
-        returns Integer from Standard
+    returns Integer from Standard
     ---Level: Public
     ---Purpose: Adds a vertice and vertex color in the vertex array.
     -- returns the actual vertex number.
@@ -129,37 +140,50 @@ is
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
 
-
     AddVertex( me       :mutable;
-                   aVertice : Pnt from gp;
-                   aNormal  : Dir from gp)
-        returns Integer from Standard
-        ---Level: Public
+               aVertice : Pnt from gp;
+               aNormal  : Dir from gp)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice and vertex normal in the vertex array.
     -- returns the actual vertex number.
     --  Warning: <aNormal> is ignored when the <hasVNormals>
     -- constructor parameter is FALSE.
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
 
     AddVertex( me:mutable;
-           X,Y,Z: Real from Standard;
-           NX,NY,NZ: Real from Standard)
-        returns Integer from Standard
-        ---Level: Public
+               X,Y,Z: Real from Standard;
+               NX,NY,NZ: Real from Standard)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice and vertex normal in the vertex array.
     -- returns the actual vertex number.
     --  Warning: <aNormal> is ignored when the <hasVNormals>
     -- constructor parameter is FALSE.
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
 
     AddVertex( me:mutable;
-                   aVertice: Pnt from gp;
-                   aNormal: Dir from gp;
-                   aColor: Color from Quantity)
-        returns Integer from Standard
-        ---Level: Public
+               X,Y,Z: ShortReal from Standard;
+               NX,NY,NZ: ShortReal from Standard)
+    returns Integer from Standard
+    ---Level: Public
+    ---Purpose: Adds a vertice and vertex normal in the vertex array.
+    -- returns the actual vertex number.
+    --  Warning: <aNormal> is ignored when the <hasVNormals>
+    -- constructor parameter is FALSE.
+        raises OutOfRange from Standard;
+    -- if the actual vertex number is >= <maxVertexs>
+
+    AddVertex( me:mutable;
+               aVertice: Pnt from gp;
+               aNormal: Dir from gp;
+               aColor: Color from Quantity)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice,vertex normal and color in the vertex array.
     -- returns the actual vertex number.
     --  Warning: <aNormal> is ignored when the <hasVNormals>
@@ -173,7 +197,7 @@ is
                aVertice : Pnt from gp;
                aNormal  : Dir from gp;
                aColor   : Integer from Standard)
-        returns Integer from Standard
+    returns Integer from Standard
     ---Level: Public
     ---Purpose: Adds a vertice,vertex normal and color in the vertex array.
     -- returns the actual vertex number.
@@ -186,38 +210,51 @@ is
     -- use this byte order.
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
-                                                         
 
     AddVertex( me:mutable;
-                   aVertice: Pnt from gp;
-                   aTexel: Pnt2d from gp)
-        returns Integer from Standard
-        ---Level: Public
+               aVertice: Pnt from gp;
+               aTexel: Pnt2d from gp)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice and vertex texture in the vertex array.
     -- returns the actual vertex number.
     -- <aTexel> is ignored when the <hasVTexels>
     -- constructor parameter is FALSE.
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
 
     AddVertex( me:mutable;
-           X,Y,Z: Real from Standard;
-           TX,TY: Real from Standard)
-        returns Integer from Standard
-        ---Level: Public
+               X,Y,Z: Real from Standard;
+               TX,TY: Real from Standard)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
     -- returns the actual vertex number.
     -- <aTexel> is ignored when the <hasVTexels>
     -- constructor parameter is FALSE.
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
 
     AddVertex( me:mutable;
-                   aVertice: Pnt from gp;
-                   aNormal: Dir from gp;
-                   aTexel: Pnt2d from gp)
-        returns Integer from Standard
-        ---Level: Public
+               X,Y,Z: ShortReal from Standard;
+               TX,TY: ShortReal from Standard)
+    returns Integer from Standard
+    ---Level: Public
+    ---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
+    -- returns the actual vertex number.
+    -- <aTexel> is ignored when the <hasVTexels>
+    -- constructor parameter is FALSE.
+        raises OutOfRange from Standard;
+    -- if the actual vertex number is >= <maxVertexs>
+
+    AddVertex( me:mutable;
+               aVertice: Pnt from gp;
+               aNormal: Dir from gp;
+               aTexel: Pnt2d from gp)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
     -- returns the actual vertex number.
     --  Warning: <aNormal> is ignored when the <hasVNormals>
@@ -226,13 +263,30 @@ is
     -- constructor parameter is FALSE.
         raises OutOfRange from Standard;
     -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
 
     AddVertex( me:mutable;
-           X,Y,Z: Real from Standard;
-           NX,NY,NZ: Real from Standard;
-           TX,TY: Real from Standard)
-        returns Integer from Standard
-        ---Level: Public
+               X,Y,Z: Real from Standard;
+               NX,NY,NZ: Real from Standard;
+               TX,TY: Real from Standard)
+    returns Integer from Standard
+    ---Level: Public
+    ---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
+    -- returns the actual vertex number.
+    --  Warning: <aNormal> is ignored when the <hasVNormals>
+    -- constructor parameter is FALSE.
+    -- <aTexel> is ignored when the <hasVTexels>
+    -- constructor parameter is FALSE.
+        raises OutOfRange from Standard;
+    -- if the actual vertex number is >= <maxVertexs>
+    ---C++: inline
+
+    AddVertex( me:mutable;
+               X,Y,Z: ShortReal from Standard;
+               NX,NY,NZ: ShortReal from Standard;
+               TX,TY: ShortReal from Standard)
+    returns Integer from Standard
+    ---Level: Public
     ---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
     -- returns the actual vertex number.
     --  Warning: <aNormal> is ignored when the <hasVNormals>
@@ -252,8 +306,8 @@ is
     -- if the actual Bound number is >= <maxBounds>
 
     AddBound( me:mutable;
-                edgeNumber: Integer from Standard;
-                aBColor: Color from Quantity)
+              edgeNumber: Integer from Standard;
+              aBColor: Color from Quantity)
         returns Integer from Standard
         ---Level: Public
     ---Purpose: Adds a bound of length <edgeNumber> and bound color 
@@ -338,16 +392,16 @@ is
     -- or if the <aBoundIndex> parameter is < 1 or > ItemNumber()
 
     SetVertice( me:mutable;
-         anIndex: Integer from Standard;
-                 aVertice: Pnt from gp)
+                anIndex: Integer from Standard;
+                aVertice: Pnt from gp)
         ---Level: Public
         ---Purpose: Change the vertice of rank <anIndex> in the array.
         raises OutOfRange from Standard;
         -- if the index is <1 or > VertexNumber()
 
     SetVertice( me:mutable;
-         anIndex: Integer from Standard;
-                 X,Y,Z: Real from Standard)
+                anIndex: Integer from Standard;
+                X,Y,Z: ShortReal from Standard)
         ---Level: Public
         ---Purpose: Change the vertice of rank <anIndex> in the array.
         raises OutOfRange from Standard;
@@ -633,25 +687,6 @@ is
     -- Category Miscellaneous 
     -------------------------------------------------------------------
 
-    Enable( myclass );
-    ---Level: Public 
-    ---Purpose: Enable to use the arrays of primitives
-    --  Warning: Updates the current value of the environment symbol 
-    --  CSF_USE_ARRAY_OF_PRIMITIVES
-
-    Disable( myclass );
-    ---Level: Public 
-    ---Purpose: Disable to use the arrays of primitives
-    --  Warning: Updates the current value of the environment symbol 
-    --  CSF_USE_ARRAY_OF_PRIMITIVES
-
-    IsEnable( myclass )
-    returns Boolean from Standard;
-    ---Level: Public 
-    ---Purpose: Returns TRUE when the arrays are enable to use.
-    --  Warning: The initial value can be defined seting the symbol
-    --  CSF_USE_ARRAY_OF_PRIMITIVES to "Yes" or "No"
-
     IsValid( me:mutable )
     returns Boolean from Standard;
     ---Level: Public 
index 28cb2bc..ef6a774 100755 (executable)
@@ -36,9 +36,10 @@ Graphic3d_ArrayOfPrimitives :: Graphic3d_ArrayOfPrimitives (
                         const Standard_Boolean hasVColors,
                         const Standard_Boolean hasFColors,
                         const Standard_Boolean hasVTexels,
-                        const Standard_Boolean hasEdgeInfos
-) : myMaxBounds(0),myMaxVertexs(0),myMaxEdges(0) {
-  Standard_Integer size = sizeof(CALL_DEF_PARRAY);
+                        const Standard_Boolean hasEdgeInfos )
+: myMaxBounds(0),myMaxVertexs(0),myMaxEdges(0)
+{
+  const Standard_Integer size = sizeof(CALL_DEF_PARRAY);
   Standard_Integer format = MVERTICE;
   if( hasVNormals ) format |= MVNORMAL;
   if( hasVColors ) format |= MVCOLOR;
@@ -98,7 +99,8 @@ Graphic3d_ArrayOfPrimitives :: Graphic3d_ArrayOfPrimitives (
   myPrimitiveArray->num_edges     = 0;
 }
 
-void Graphic3d_ArrayOfPrimitives::Destroy (  ){
+void Graphic3d_ArrayOfPrimitives::Destroy ()
+{
   if( myPrimitiveArray ) {
     if( myPrimitiveArray->vertices ){
       Standard::Free( (Standard_Address&)myPrimitiveArray->vertices );
@@ -147,167 +149,86 @@ void Graphic3d_ArrayOfPrimitives::Destroy (  ){
   }
 }
 
-void Graphic3d_ArrayOfPrimitives::Enable() {
-  ///
-}
-
-void Graphic3d_ArrayOfPrimitives::Disable() {
-  ///
-}
-
-Standard_Boolean Graphic3d_ArrayOfPrimitives::IsEnable() {
-  return Standard_True;
-}
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                const gp_Pnt& aVertice) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  return AddVertex(x,y,z);
-}
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-        const Standard_Real X, const Standard_Real Y, const Standard_Real Z) {
-
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z)
+{
   if( !myPrimitiveArray ) return 0;
-
-  Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
-  if( index > myMaxVertexs ) {
-    Standard_OutOfRange::Raise(" TOO many VERTEX");
-  }
+  const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
   SetVertice(index,X,Y,Z);
   return index;
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
-                                                        const Quantity_Color& aColor) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Integer index = AddVertex(x,y,z);
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const Quantity_Color& aColor)
+{
+  const Standard_Integer index = AddVertex(aVertice);
   Standard_Real r,g,b;
   aColor.Values(r,g,b,Quantity_TOC_RGB);
   SetVertexColor(index,r,g,b);
   return index;
 }
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
-                                                        const Standard_Integer aColor) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Integer index = AddVertex(x,y,z);
+
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const Standard_Integer aColor)
+{
+  const Standard_Integer index = AddVertex(aVertice);
   SetVertexColor(index,aColor);
   return index;
 }
 
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
-                                                        const gp_Dir& aNormal) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Real nx,ny,nz;
-  aNormal.Coord(nx,ny,nz);
-  return AddVertex(x,y,z,nx,ny,nz);
-}
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-        const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
-        const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ) {
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z,
+                                                        const Standard_ShortReal NX, const Standard_ShortReal NY, const Standard_ShortReal NZ)
+{
   if( !myPrimitiveArray ) return 0;
-
-  Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
-  if( index > myMaxVertexs ) {
-    Standard_OutOfRange::Raise(" TOO many VERTEX");
-  }
+  const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
   SetVertice(index,X,Y,Z);
   SetVertexNormal(index,NX,NY,NZ);
   return index;
 }
 
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice,
                                                         const gp_Dir& aNormal,
-                                                        const Quantity_Color& aColor) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Real nx,ny,nz;
-  aNormal.Coord(nx,ny,nz);
-  Standard_Integer index = AddVertex(x,y,z,nx,ny,nz);
+                                                        const Quantity_Color& aColor)
+{
+  const Standard_Integer index = AddVertex(aVertice,aNormal);
   Standard_Real r,g,b;
   aColor.Values(r,g,b,Quantity_TOC_RGB);
   SetVertexColor(index,r,g,b);
   return index;
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice,
                                                         const gp_Dir& aNormal,
-                                                        const Standard_Integer aColor) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Real nx,ny,nz;
-  aNormal.Coord(nx,ny,nz);
-  Standard_Integer index = AddVertex(x,y,z,nx,ny,nz);
+                                                        const Standard_Integer aColor)
+{
+  const Standard_Integer index = AddVertex(aVertice,aNormal);
   SetVertexColor(index,aColor);
   return index;
 }
 
 Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
-                                                        const gp_Pnt2d& aTexel) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Real tx,ty;
-  aTexel.Coord(tx,ty);
-  return AddVertex(x,y,z,tx,ty);
-}
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-        const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
-        const Standard_Real TX, const Standard_Real TY) {
+        const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z,
+        const Standard_ShortReal TX, const Standard_ShortReal TY)
+{
   if( !myPrimitiveArray ) return 0;
-
-  Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
-  if( index > myMaxVertexs ) {
-    Standard_OutOfRange::Raise(" TOO many VERTEX");
-  }
+  const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
   SetVertice(index,X,Y,Z);
   SetVertexTexel(index,TX,TY);
   return index;
 }
 
 Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-                                                        const gp_Pnt& aVertice,
-                                                        const gp_Dir& aNormal,
-                                                        const gp_Pnt2d& aTexel) {
-  Standard_Real x,y,z;
-  aVertice.Coord(x,y,z);
-  Standard_Real nx,ny,nz;
-  aNormal.Coord(nx,ny,nz);
-  Standard_Real tx,ty;
-  aTexel.Coord(tx,ty);
-  return AddVertex(x,y,z,nx,ny,nz,tx,ty);
-}
-
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
-        const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
-        const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ,
-        const Standard_Real TX, const Standard_Real TY) {
+        const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z,
+        const Standard_ShortReal NX, const Standard_ShortReal NY, const Standard_ShortReal NZ,
+        const Standard_ShortReal TX, const Standard_ShortReal TY)
+{
   if( !myPrimitiveArray ) return 0;
-
-  Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
-  if( index > myMaxVertexs ) {
-    Standard_OutOfRange::Raise(" TOO many VERTEX");
-  }
+  const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
   SetVertice(index,X,Y,Z);
   SetVertexNormal(index,NX,NY,NZ);
   SetVertexTexel(index,TX,TY);
   return index;
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber) {
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber)
+{
   Standard_Integer index = 0;
   if( myPrimitiveArray && myPrimitiveArray->bounds ) {
     index = myPrimitiveArray->num_bounds;
@@ -322,22 +243,20 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer e
   return index;
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(
-                                                        const Standard_Integer edgeNumber,
-                                                        const Quantity_Color& aFColor
-) {
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber,
+                                                        const Quantity_Color& aFColor)
+{
   Standard_Real r,g,b;
   aFColor.Values(r,g,b,Quantity_TOC_RGB);
   return AddBound(edgeNumber,r,g,b);
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(
-                                                        const Standard_Integer edgeNumber,
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber,
                                                         const Standard_Real R, 
                                                         const Standard_Real G,
-                                                        const Standard_Real B) { 
+                                                        const Standard_Real B)
+{
   if( !myPrimitiveArray ) return 0;
-
   Standard_Integer index = myPrimitiveArray->num_bounds;
   if( index >= myMaxBounds ) {
     Standard_OutOfRange::Raise(" TOO many BOUND");
@@ -348,9 +267,9 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(
   return index;
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(
-                                                      const Standard_Integer vertexIndex,
-                                                      const Standard_Boolean isVisible) {
+Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(const Standard_Integer vertexIndex,
+                                                      const Standard_Boolean isVisible)
+{
   if( !myPrimitiveArray ) return 0;
 
   Standard_Integer index = myPrimitiveArray->num_edges;
@@ -371,15 +290,15 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(
   return index;
 }
 
-Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
-                        const gp_Dir& aNormal) {
+Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(const gp_Dir& aNormal)
+{
   return Orientate(1,Max(VertexNumber(),EdgeNumber()),aNormal);
 }
 
-Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
-                                                        const Standard_Integer aVertexIndex,
+Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(const Standard_Integer aVertexIndex,
                                                         const Standard_Integer aVertexNumber,
-                                                        const gp_Dir& aNormal) {
+                                                        const gp_Dir& aNormal)
+{
   Standard_Boolean somethingHasChange = Standard_False;
   if( myPrimitiveArray && (myPrimitiveArray->num_vertexs > 2) ) {
     Standard_Integer i,j,k=aVertexNumber,n=aVertexIndex-1;
@@ -495,9 +414,9 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
   return somethingHasChange;
 }
 
-Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
-                                                        const Standard_Integer aBoundIndex,
-                                                        const gp_Dir& aNormal) {
+Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(const Standard_Integer aBoundIndex,
+                                                        const gp_Dir& aNormal)
+{
   Standard_Boolean somethingHasChange = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->vertices ) {
     if( myPrimitiveArray->bounds && 
@@ -537,26 +456,25 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
   return somethingHasChange;
 }
 
-void Graphic3d_ArrayOfPrimitives::SetVertice(
-                                              const Standard_Integer anIndex,
-                                              const gp_Pnt& aVertice) {
+void Graphic3d_ArrayOfPrimitives::SetVertice( const Standard_Integer anIndex,
+                                              const gp_Pnt& aVertice)
+{
   Standard_Real x,y,z;
   aVertice.Coord(x,y,z);
-  SetVertice(anIndex,x,y,z);
+  SetVertice(anIndex,Standard_ShortReal(x),Standard_ShortReal(y),Standard_ShortReal(z));
 }
 
-void Graphic3d_ArrayOfPrimitives::SetVertexColor(
-                                                  const Standard_Integer anIndex,
-                                                  const Quantity_Color& aColor) {
+void Graphic3d_ArrayOfPrimitives::SetVertexColor( const Standard_Integer anIndex,
+                                                  const Quantity_Color& aColor)
+{
   Standard_Real r,g,b;
   aColor.Values(r,g,b,Quantity_TOC_RGB);
   SetVertexColor(anIndex,r,g,b);
 }
 
-void Graphic3d_ArrayOfPrimitives::SetVertexColor(
-                                                  const Standard_Integer anIndex,
-                                                  const Standard_Integer aColor) {
-
+void Graphic3d_ArrayOfPrimitives::SetVertexColor( const Standard_Integer anIndex,
+                                                  const Standard_Integer aColor)
+{
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myMaxVertexs ) {
     Standard_OutOfRange::Raise(" BAD VERTEX index");
@@ -580,31 +498,33 @@ void Graphic3d_ArrayOfPrimitives::SetVertexColor(
 
   }
 }
-void Graphic3d_ArrayOfPrimitives::SetVertexNormal(
-                                                  const Standard_Integer anIndex,
-                                                  const gp_Dir& aNormal) {
+
+void Graphic3d_ArrayOfPrimitives::SetVertexNormal(const Standard_Integer anIndex,
+                                                  const gp_Dir& aNormal)
+{
   Standard_Real x,y,z;
   aNormal.Coord(x,y,z);
   SetVertexNormal(anIndex,x,y,z);
 }
 
-void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
-                                                  const Standard_Integer anIndex,
-                                                  const gp_Pnt2d& aTexel) {
+void Graphic3d_ArrayOfPrimitives::SetVertexTexel( const Standard_Integer anIndex,
+                                                  const gp_Pnt2d& aTexel)
+{
   Standard_Real x,y;
   aTexel.Coord(x,y);
   SetVertexTexel(anIndex,x,y);
 }
 
-void Graphic3d_ArrayOfPrimitives::SetBoundColor(
-                                                const Standard_Integer anIndex,
-                                                const Quantity_Color& aColor) {
+void Graphic3d_ArrayOfPrimitives::SetBoundColor(const Standard_Integer anIndex,
+                                                const Quantity_Color& aColor)
+{
   Standard_Real r,g,b;
   aColor.Values(r,g,b,Quantity_TOC_RGB);
   SetBoundColor(anIndex,r,g,b);
 }
 
-Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const {
+Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
+{
   TCollection_AsciiString name("UndefinedArray");
   switch( myPrimitiveArray->type ) {
     case TelPointsArrayType:
@@ -641,37 +561,43 @@ Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const {
   return name.ToCString();
 }
 
-gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer aRank) const {
+gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer aRank) const
+{
   Standard_Real x,y,z;
   Vertice(aRank,x,y,z);
   return gp_Pnt(x,y,z);
 }
 
-Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer aRank) const {
+Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer aRank) const
+{
   Standard_Real r,g,b;
   VertexColor(aRank,r,g,b);
   return Quantity_Color(r,g,b,Quantity_TOC_RGB);
 }
 
-gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer aRank) const {
+gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer aRank) const
+{
   Standard_Real x,y,z;
   VertexNormal(aRank,x,y,z);
   return gp_Dir(x,y,z);
 }
 
-gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer aRank) const {
+gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer aRank) const
+{
   Standard_Real x,y;
   VertexTexel(aRank,x,y);
   return gp_Pnt2d(x,y);
 }
 
-Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer aRank) const {
+Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer aRank) const
+{
   Standard_Real r,g,b;
   BoundColor(aRank,r,g,b);
   return Quantity_Color(r,g,b,Quantity_TOC_RGB);
 }
 
-Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const {
+Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
+{
   Standard_Integer number=-1;
   if( myPrimitiveArray ) switch( myPrimitiveArray->type ) {
     case TelPointsArrayType:
@@ -720,9 +646,9 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const {
   return number;
 }
 
-void Graphic3d_ArrayOfPrimitives::ComputeVNormals(
-                                                  const Standard_Integer from,
-                                                  const Standard_Integer to) {
+void Graphic3d_ArrayOfPrimitives::ComputeVNormals(const Standard_Integer from,
+                                                  const Standard_Integer to)
+{
   Standard_Integer next = from+1;
   Standard_Integer last = to+1;
   gp_Pnt p1,p2,p3;
@@ -769,8 +695,8 @@ void Graphic3d_ArrayOfPrimitives::ComputeVNormals(
   }
 }
 
-Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid() {
-
+Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
+{
   if( !myPrimitiveArray ) return Standard_False;
 
   Standard_Integer nvertexs = myPrimitiveArray->num_vertexs;
index dba08d1..f7ba38a 100755 (executable)
 #include <stdio.h>
 #include <stdlib.h>
 
-inline Graphic3d_PrimitiveArray Graphic3d_ArrayOfPrimitives::Array() const {
+#include <gp_Dir.hxx>
+#include <gp_Pnt.hxx>
 
+inline Graphic3d_PrimitiveArray Graphic3d_ArrayOfPrimitives::Array() const
+{
   return myPrimitiveArray;
 }
 
-inline Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type() const {
-
+inline Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type() const
+{
   Graphic3d_TypeOfPrimitiveArray type = Graphic3d_TOPA_UNDEFINED;
   if( myPrimitiveArray ) type = (Graphic3d_TypeOfPrimitiveArray) myPrimitiveArray->type;
   return type;
 }
 
-inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals() const {
+inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals() const
+{
   Standard_Boolean defined = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->vnormals ) defined = Standard_True;
   return defined;
 }
 
-inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors() const {
+inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors() const
+{
   Standard_Boolean defined = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->vcolours ) defined = Standard_True;
   return defined;
 }
 
-inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels() const {
+inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels() const
+{
   Standard_Boolean defined = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->vtexels ) defined = Standard_True;
   return defined;
 }
 
-inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasEdgeInfos() const {
+inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasEdgeInfos() const
+{
   Standard_Boolean defined = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->edge_vis ) defined = Standard_True;
   return defined;
 }
 
-inline Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber() const {
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber() const
+{
   Standard_Integer number = -1;
   if( myPrimitiveArray ) number = myPrimitiveArray->num_vertexs;
   return number;
 }
 
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice)
+{
+  return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z());
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
+        const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
+{
+  return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z));
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const gp_Dir& aNormal)
+{
+  return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z(),aNormal.X(),aNormal.Y(),aNormal.Z());
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
+        const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
+        const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ)
+{
+  return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z),
+                   Standard_ShortReal(NX),Standard_ShortReal(NY),Standard_ShortReal(NZ));
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const gp_Pnt2d& aTexel)
+{
+  return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z(),aTexel.X(),aTexel.Y());
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
+        const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
+        const Standard_Real TX, const Standard_Real TY)
+{
+  return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z),
+                   Standard_ShortReal(TX),Standard_ShortReal(TY));
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const gp_Dir& aNormal, const gp_Pnt2d& aTexel)
+{
+  return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z(),aNormal.X(),aNormal.Y(),aNormal.Z(),aTexel.X(),aTexel.Y());
+}
+
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
+        const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
+        const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ,
+        const Standard_Real TX, const Standard_Real TY)
+{
+  return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z),
+                   Standard_ShortReal(NX),Standard_ShortReal(NY),Standard_ShortReal(NZ),
+                   Standard_ShortReal(TX),Standard_ShortReal(TY));
+}
+
 inline void Graphic3d_ArrayOfPrimitives::SetVertice(
         const Standard_Integer anIndex,
-        const Standard_Real X, const Standard_Real Y, const Standard_Real Z) {
-
+        const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z)
+{
   if( !myPrimitiveArray ) return;
-  if( anIndex < 1 || anIndex > myMaxVertexs ) {
+  if( anIndex < 1 || anIndex > myMaxVertexs )
     Standard_OutOfRange::Raise(" BAD VERTEX index");
-  }
 
-  Standard_Integer index = anIndex-1;
-  {
-    if( myPrimitiveArray->vertices ) {
-      Tfloat *p = myPrimitiveArray->vertices[index].xyz;
-      *p++ = Standard_ShortReal(X);
-      *p++ = Standard_ShortReal(Y);
-      *p = Standard_ShortReal(Z);
-    }
+  if( myPrimitiveArray->vertices ) {
+    Tfloat *p = myPrimitiveArray->vertices[anIndex-1].xyz;
+    *p++ = X;
+    *p++ = Y;
+    *p   = Z;
   }
   myPrimitiveArray->num_vertexs = Max(anIndex,myPrimitiveArray->num_vertexs);
 }
 
-
-inline void Graphic3d_ArrayOfPrimitives::SetVertexColor(
-                                                        const Standard_Integer anIndex,
+inline void Graphic3d_ArrayOfPrimitives::SetVertexColor(const Standard_Integer anIndex,
                                                         const Standard_Real R, 
                                                         const Standard_Real G, 
-                                                        const Standard_Real B) {
+                                                        const Standard_Real B)
+{
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myMaxVertexs ) {
     Standard_OutOfRange::Raise(" BAD VERTEX index");
   }
 
   if( myPrimitiveArray->vcolours ) {
-    unsigned char red   = (unsigned char)(R <= 0. ? 0. : R >= 1. ? 255. : R * 255.);
-    unsigned char green = (unsigned char)(G <= 0. ? 0. : G >= 1. ? 255. : G * 255.);
-    unsigned char blue  = (unsigned char)(B <= 0. ? 0. : B >= 1. ? 255. : B * 255.);
+    unsigned char red   = (unsigned int)(R * 255.);
+    unsigned char green = (unsigned int)(G * 255.);
+    unsigned char blue  = (unsigned int)(B * 255.);
     unsigned char alpha = 0;
     Standard_Integer outColor ;
     outColor = red;
@@ -136,7 +191,8 @@ inline void Graphic3d_ArrayOfPrimitives::SetVertexNormal(
 
 inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
         const Standard_Integer anIndex,
-        const Standard_Real TX, const Standard_Real TY) {
+        const Standard_Real TX, const Standard_Real TY)
+{
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myMaxVertexs ) {
     Standard_OutOfRange::Raise(" BAD VERTEX index");
@@ -153,7 +209,8 @@ inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
 
 inline void Graphic3d_ArrayOfPrimitives::SetBoundColor(
         const Standard_Integer anIndex,
-        const Standard_Real R, const Standard_Real G, const Standard_Real B) {
+        const Standard_Real R, const Standard_Real G, const Standard_Real B)
+{
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myMaxBounds ) {
     Standard_OutOfRange::Raise(" BAD BOUND index");
@@ -169,7 +226,8 @@ inline void Graphic3d_ArrayOfPrimitives::SetBoundColor(
 }
 
 inline void Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer anIndex,
-        Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
+        Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const
+{
   X = Y = Z = 0.;
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
@@ -184,7 +242,8 @@ inline void Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer anIndex,
 }
 
 inline void Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer anIndex,
-        Standard_Real& R, Standard_Real& G, Standard_Real& B) const {
+        Standard_Real& R, Standard_Real& G, Standard_Real& B) const
+{
   R = G = B = 0;
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
@@ -234,9 +293,9 @@ inline void Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer anIn
     }
 }
 
-
 inline void Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer anIndex,
-        Standard_Real& NX, Standard_Real& NY, Standard_Real& NZ) const {
+        Standard_Real& NX, Standard_Real& NY, Standard_Real& NZ) const
+{
   NX = NY = NZ = 0.;
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
@@ -251,7 +310,8 @@ inline void Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer anI
 }
 
 inline void Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer anIndex,
-        Standard_Real& TX, Standard_Real& TY) const {
+        Standard_Real& TX, Standard_Real& TY) const
+{
   TX = TY = 0.;
   if( !myPrimitiveArray ) return;
   if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
@@ -265,14 +325,15 @@ inline void Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer anIn
   }
 }
 
-inline Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber() const {
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber() const
+{
   Standard_Integer number = -1;
   if( myPrimitiveArray ) number = myPrimitiveArray->num_edges;
   return number;
 }
 
-inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge(
-        const Standard_Integer anIndex ) const {
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge(const Standard_Integer anIndex ) const
+{
   Standard_Integer index=0;
   if( myPrimitiveArray && myPrimitiveArray->edge_vis && 
     (anIndex > 0) && (anIndex <= myPrimitiveArray->num_edges) ) {
@@ -283,8 +344,8 @@ inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge(
   return index+1;
 }
 
-inline Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible(
-        const Standard_Integer anIndex ) const {
+inline Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible(const Standard_Integer anIndex ) const
+{
   Standard_Boolean isVisible = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->edge_vis && 
     (anIndex > 0) && (anIndex <= myPrimitiveArray->num_edges) ) {
@@ -296,19 +357,22 @@ inline Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible(
   return isVisible;
 }
 
-inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors() const {
+inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors() const
+{
   Standard_Boolean defined = Standard_False;
   if( myPrimitiveArray && myPrimitiveArray->fcolours ) defined = Standard_True;
   return defined;
 }
 
-inline Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber() const {
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber() const
+{
   Standard_Integer number = -1;
   if( myPrimitiveArray ) number = myPrimitiveArray->num_bounds;
   return number;
 }
 
-inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound(const Standard_Integer anIndex) const {
+inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound(const Standard_Integer anIndex) const
+{
   Standard_Integer number=-1;
   if( myPrimitiveArray && myPrimitiveArray->bounds && 
     (anIndex > 0) && (anIndex <= myPrimitiveArray->num_bounds) ) {
@@ -320,7 +384,8 @@ inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound(const Standard_Intege
 }
 
 inline void Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer anIndex,
-        Standard_Real& R, Standard_Real& G, Standard_Real& B) const {
+        Standard_Real& R, Standard_Real& G, Standard_Real& B) const
+{
   if( myPrimitiveArray && myPrimitiveArray->fcolours && 
     (anIndex > 0) && (anIndex <= myPrimitiveArray->num_bounds) ) {
     Tfloat *p = myPrimitiveArray->fcolours[anIndex-1].rgb;
index c33011d..72afa44 100755 (executable)
@@ -90,12 +90,8 @@ class Graphic3d_CGroup
 
 public:
 
-  int   LabelBegin;
-  int   LabelEnd;
   void* ptrGroup;
 
-  int   StructureEnd;
-
   CALL_DEF_CONTEXTLINE     ContextLine;
   CALL_DEF_CONTEXTFILLAREA ContextFillArea;
   CALL_DEF_CONTEXTMARKER   ContextMarker;
@@ -105,9 +101,6 @@ public:
 
   CALL_DEF_PICKID PickId;
 
-  unsigned IsDeleted : 1;
-  unsigned IsOpen    : 1;
-
 };
 
 const Handle(Standard_Type)& TYPE(Graphic3d_CGroup);
index 93091e9..c00cc33 100755 (executable)
@@ -31,8 +31,6 @@ public:
 
   int   Priority;
   int   PreviousPriority;
-  int   GroupBegin;
-  int   GroupEnd;
 
   CALL_DEF_CONTEXTLINE     ContextLine;
   CALL_DEF_CONTEXTFILLAREA ContextFillArea;
index 2423688..f7db574 100755 (executable)
@@ -74,25 +74,12 @@ uses
     Structure           from Graphic3d,
     TextPath            from Graphic3d,
     TypeOfComposition   from Graphic3d,
-    TypeOfPolygon       from Graphic3d,
     TypeOfPrimitive     from Graphic3d,
     Vector              from Graphic3d,
     Array1OfVertex      from Graphic3d,
     Array2OfVertex      from Graphic3d,
     Vertex              from Graphic3d,
-    Array1OfVertexC     from Graphic3d,
-    Array2OfVertexC     from Graphic3d,
-    VertexC             from Graphic3d,
-    Array1OfVertexN     from Graphic3d,
-    Array2OfVertexN     from Graphic3d,
-    VertexN             from Graphic3d,
-    Array1OfVertexNC    from Graphic3d,
-    Array2OfVertexNC    from Graphic3d,
-    VertexNC            from Graphic3d,
     VerticalTextAlignment   from Graphic3d,
-    VertexNT            from Graphic3d,
-    Array1OfVertexNT    from Graphic3d,
-    Array2OfVertexNT    from Graphic3d,
     PrimitiveArray      from Graphic3d,
     PtrFrameBuffer      from Graphic3d,
     HArray1OfByte       from TColStd,
@@ -201,11 +188,6 @@ is
         is deferred;
     ---Purpose: call_togl_cleargroup
 
-    CloseGroup ( me     : mutable;
-             ACGroup    : CGroup from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_closegroup
-
     FaceContextGroup ( me       : mutable;
                        ACGroup  : CGroup from Graphic3d;
                        NoInsert : Integer from Standard )
@@ -238,11 +220,6 @@ is
                 is deferred;
     ---Purpose: call_togl_markercontextgroup
 
-    OpenGroup ( me      : mutable;
-                ACGroup : CGroup from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_opengroup
-
     RemoveGroup ( me        : mutable;
                   ACGroup   : CGroup from Graphic3d )
         is deferred;
@@ -500,30 +477,15 @@ is
 
     Marker ( me         : mutable;
              ACGroup    : CGroup from Graphic3d;
-             APoint     : Vertex from Graphic3d;
-             EvalMinMax : Boolean from Standard = Standard_True )
+             APoint     : Vertex from Graphic3d )
         is deferred;
 
     MarkerSet ( me          : mutable;
                 ACGroup     : CGroup from Graphic3d;
-                ListVertex  : Array1OfVertex from Graphic3d;
-                EvalMinMax  : Boolean from Standard = Standard_True )
+           &nbs