0024752: Visualization - inherit OpenGl_Group from Graphic3d_Group
[occt.git] / src / V3d / V3d_PositionalLight.cxx
index f5f3364..352f444 100644 (file)
@@ -215,19 +215,22 @@ void V3d_PositionalLight::Display( const Handle(V3d_View)& aView,
     MyGraphicStructure1 = snopick;
   }
 
-  Handle(Graphic3d_Group) gradius;
-  Handle(Graphic3d_Group) gExtArrow;
-  Handle(Graphic3d_Group) gIntArrow;
-  if (Pres == V3d_COMPLETE) {
-    gradius = new Graphic3d_Group(MyGraphicStructure);
-    gExtArrow = new Graphic3d_Group(MyGraphicStructure);
-    gIntArrow = new Graphic3d_Group(MyGraphicStructure);
+  Handle(Graphic3d_Group) gradius, gExtArrow, gIntArrow;
+  if (Pres == V3d_COMPLETE)
+  {
+    gradius   = MyGraphicStructure->NewGroup();
+    gExtArrow = MyGraphicStructure->NewGroup();
+    gIntArrow = MyGraphicStructure->NewGroup();
   }
-  Handle(Graphic3d_Group) glight  = new Graphic3d_Group(MyGraphicStructure);
+  Handle(Graphic3d_Group) glight = MyGraphicStructure->NewGroup();
   Handle(Graphic3d_Group) gsphere;
-  if (Pres == V3d_COMPLETE || Pres == V3d_PARTIAL) gsphere = new Graphic3d_Group(MyGraphicStructure);
+  if (Pres == V3d_COMPLETE
+   || Pres == V3d_PARTIAL)
+  {
+    gsphere = MyGraphicStructure->NewGroup();
+  }
   
-  Handle(Graphic3d_Group) gnopick = new Graphic3d_Group(MyGraphicStructure1);
+  Handle(Graphic3d_Group) gnopick = MyGraphicStructure1->NewGroup();
   MyGraphicStructure1->SetPick(Standard_False);
   
   X0 = MyTarget.X();