1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024752: Visualization - inherit OpenGl_Group from Graphic3d_Group

Graphic3d_Group is now abstract class and should be instantiated
using Graphic3d_Structure::NewGroup() method.
Graphic3d_CGroup has been removed.

The groups list is no more duplicated within Graphic3d_Structure and OpenGl_Structure.
Removed unused/duplicated fields from Graphic3d_Group.

Prs3d_Presentation - remove redundnant field myCurrentGroup.
PrsMgr_Presentation3d::Erase(), ::Clear() - avoid possible NULL dereference.
OpenGl_GraphicDriver/Graphic3d_GraphicDriver - group management methods have been removed
(moved to Graphic3d_CStructure and Graphic3d_Group interfaces).

Graphic3d_Group::GroupPrimitivesAspect() - copy IsEmission flag
Fix wrong iterator
Fix compilation issues
This commit is contained in:
kgv
2014-03-27 17:12:18 +04:00
committed by bugmaster
parent 6b1fe48c8a
commit b64d84be99
62 changed files with 1959 additions and 3004 deletions

View File

@@ -247,7 +247,7 @@ void V3d::DrawSphere(const Handle(V3d_Viewer)& aViewer,const Quantity_Length ray
const Standard_Boolean inf = ray < 0;
const Standard_Real aRadius = Standard_ShortReal(Abs(ray));
Handle(Graphic3d_Structure) Struct = new Graphic3d_Structure(aViewer->Viewer()) ;
Handle(Graphic3d_Group) Group = new Graphic3d_Group(Struct) ;
Handle(Graphic3d_Group) Group = Struct->NewGroup();
Handle(Graphic3d_AspectLine3d) LineAttrib = new Graphic3d_AspectLine3d() ;
LineAttrib->SetColor(Quantity_Color(Quantity_NOC_YELLOW));

View File

@@ -69,7 +69,7 @@
V3d_CircularGrid::V3d_CircularGrid (const V3d_ViewerPointer& aViewer, const Quantity_Color& aColor, const Quantity_Color& aTenthColor)
: Aspect_CircularGrid (1.,8),
myStructure (new Graphic3d_Structure (aViewer->Viewer ())),
myGroup (new Graphic3d_Group (myStructure)),
myGroup (myStructure->NewGroup()),
myViewer (aViewer),
myCurAreDefined (Standard_False)
{

View File

@@ -230,11 +230,15 @@ void V3d_DirectionalLight::Display( const Handle(V3d_View)& aView,
MyGraphicStructure1 = snopick;
}
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();

View File

@@ -65,8 +65,8 @@ void V3d_Plane::Display (const Handle(V3d_View)& theView,
}
myGraphicStructure = new Graphic3d_Structure (aViewer->Viewer());
Handle(Graphic3d_Group) aGroup = new Graphic3d_Group (myGraphicStructure);
Handle(Graphic3d_AspectFillArea3d) anAsp = new Graphic3d_AspectFillArea3d();
Handle(Graphic3d_Group) aGroup = myGraphicStructure->NewGroup();
Handle(Graphic3d_AspectFillArea3d) anAsp = new Graphic3d_AspectFillArea3d();
Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC);
aPlastic.SetColor (theColor);
aPlastic.SetTransparency (0.5);

View File

@@ -166,22 +166,23 @@ void V3d_PositionLight::Display( const Handle(V3d_View)& aView,
MyGraphicStructure1 = snopick;
}
Handle(Graphic3d_Group) gradius;
Handle(Graphic3d_Group) gExtArrow;
Handle(Graphic3d_Group) gIntArrow;
if (MyType != V3d_DIRECTIONAL) {
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 (MyType != V3d_DIRECTIONAL
&& 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();

View 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();

View File

@@ -67,7 +67,7 @@
V3d_RectangularGrid::V3d_RectangularGrid (const V3d_ViewerPointer& aViewer, const Quantity_Color& aColor, const Quantity_Color& aTenthColor)
: Aspect_RectangularGrid (1.,1.),
myStructure (new Graphic3d_Structure (aViewer->Viewer ())),
myGroup (new Graphic3d_Group (myStructure)),
myGroup (myStructure->NewGroup()),
myViewer (aViewer),
myCurAreDefined (Standard_False)
{

View File

@@ -233,19 +233,22 @@ void V3d_SpotLight::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();

View File

@@ -116,7 +116,7 @@ void V3d_Viewer::DisplayPrivilegedPlane(const Standard_Boolean OnOff, const Quan
else
myPlaneStructure->Clear();
Handle(Graphic3d_Group) Group = new Graphic3d_Group(myPlaneStructure);
Handle(Graphic3d_Group) Group = myPlaneStructure->NewGroup();
Handle(Graphic3d_AspectLine3d) LineAttrib = new Graphic3d_AspectLine3d() ;
LineAttrib->SetColor(Quantity_Color(Quantity_NOC_GRAY60));

View File

@@ -256,7 +256,7 @@ void V3d_Viewer::SetGridEcho (const Handle(Graphic3d_AspectMarker3d)& theMarker)
if (myGridEchoStructure.IsNull())
{
myGridEchoStructure = new Graphic3d_Structure (Viewer());
myGridEchoGroup = new Graphic3d_Group (myGridEchoStructure);
myGridEchoGroup = myGridEchoStructure->NewGroup();
}
myGridEchoAspect = theMarker;
@@ -287,7 +287,7 @@ void V3d_Viewer::ShowGridEcho (const Handle(V3d_View)& theView,
if (myGridEchoStructure.IsNull())
{
myGridEchoStructure = new Graphic3d_Structure (Viewer());
myGridEchoGroup = new Graphic3d_Group (myGridEchoStructure);
myGridEchoGroup = myGridEchoStructure->NewGroup();
myGridEchoAspect = new Graphic3d_AspectMarker3d (Aspect_TOM_STAR, Quantity_Color (Quantity_NOC_GRAY90), 3.0);
myGridEchoGroup->SetPrimitivesAspect (myGridEchoAspect);