mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0028990: Coding Rules - deprecate redundant class Prs3d_Root
Prs3d_Root usage has been replaced by direct calls to Prs3d_Presentation methods.
This commit is contained in:
@@ -30,7 +30,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer )
|
||||
{
|
||||
Handle(Graphic3d_Group) aPrsGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
Handle(Graphic3d_Group) aPrsGroup = thePrs->CurrentGroup();
|
||||
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
|
||||
|
||||
|
@@ -84,10 +84,10 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrims->AddVertex (myPnt);
|
||||
aPrims->AddVertex (aLastPoint);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
|
||||
aLastPoint,
|
||||
myDir,
|
||||
anArrowAspect->Angle(),
|
||||
@@ -97,7 +97,7 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
if (myText.Length() != 0)
|
||||
{
|
||||
gp_Pnt aTextPosition = aLastPoint;
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
Prs3d_Text::Draw (aPresentation->CurrentGroup(),
|
||||
myDrawer->TextAspect(),
|
||||
myText,
|
||||
aTextPosition);
|
||||
|
@@ -214,7 +214,6 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
|
@@ -42,10 +42,10 @@ void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& /*a
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrims->AddVertex (myStartPnt);
|
||||
aPrims->AddVertex (myEndPnt);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||
Prs3d_Arrow::Draw (aPresentation->CurrentGroup(),
|
||||
myEndPnt,
|
||||
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
|
||||
anArrowAspect->Angle(),
|
||||
|
@@ -126,7 +126,6 @@
|
||||
#include <Plate_GtoCConstraint.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <GeomPlate_Surface.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
|
@@ -46,7 +46,7 @@ void Sample2D_Face::DrawMarker(const Handle(Geom2d_TrimmedCurve)& theCurve, cons
|
||||
anArrow->AddVertex(aPoint);
|
||||
anArrow->AddVertex(aRight);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(anArrow);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(anArrow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,19 +212,19 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
{
|
||||
case TopAbs_FORWARD: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
case TopAbs_REVERSED: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
case TopAbs_INTERNAL: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
|
||||
mySeq_INTERNAL.Append(aCurve3d);
|
||||
@@ -232,7 +232,7 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
}
|
||||
case TopAbs_EXTERNAL: {
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
DrawMarker(aTrimmedCurve, thePresentation);
|
||||
break;
|
||||
}
|
||||
@@ -242,17 +242,17 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
ex.Next();
|
||||
}
|
||||
//add all primitives to the presentation
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myForwardArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_FORWARD);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myForwardArray);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myReversedArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_REVERSED);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myReversedArray);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myInternalArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_INTERNAL);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myInternalArray);
|
||||
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(myExternalArray);
|
||||
thePresentation->CurrentGroup()->SetPrimitivesAspect(aLineAspect_EXTERNAL);
|
||||
thePresentation->CurrentGroup()->AddPrimitiveArray(myExternalArray);
|
||||
}
|
||||
|
||||
//Method for advanced customizable selection of picked object
|
||||
@@ -275,8 +275,7 @@ void Sample2D_Face::HilightSelected
|
||||
aSelectionPrs->Clear();
|
||||
FillData();
|
||||
|
||||
Prs3d_Root::NewGroup ( aSelectionPrs );
|
||||
Handle (Graphic3d_Group) aSelectGroup = Prs3d_Root::CurrentGroup ( aSelectionPrs);
|
||||
Handle (Graphic3d_Group) aSelectGroup = aSelectionPrs->NewGroup();
|
||||
|
||||
for(Standard_Integer i=1; i<=aLength; ++i)
|
||||
{
|
||||
@@ -344,8 +343,7 @@ void Sample2D_Face::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationMana
|
||||
FillData();
|
||||
|
||||
//Direct highlighting
|
||||
Prs3d_Root::NewGroup ( aHighlightPrs );
|
||||
Handle (Graphic3d_Group) aHilightGroup = Prs3d_Root::CurrentGroup(aHighlightPrs);
|
||||
Handle (Graphic3d_Group) aHilightGroup = aHighlightPrs->NewGroup();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAspect =
|
||||
new Graphic3d_AspectLine3d(theStyle->Color(), Aspect_TOL_SOLID,2);
|
||||
switch(theOwner->Priority())
|
||||
|
@@ -43,15 +43,15 @@ void Sample2D_Markers::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aP
|
||||
if(myMarkerType == Aspect_TOM_USERDEFINED)
|
||||
{
|
||||
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,myColor,myIndex);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
|
||||
aPresentation->CurrentGroup()->SetGroupPrimitivesAspect(aMarker);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (myArrayOfPoints);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect(aMarker);
|
||||
aPresentation->CurrentGroup()->SetPrimitivesAspect(aMarker);
|
||||
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
|
||||
anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
|
||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (anArrayOfPoints);
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,6 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
|
@@ -76,7 +76,7 @@ case 6: //color
|
||||
|
||||
Handle(Graphic3d_StructureManager) aStrucMana = GetContext()->MainPrsMgr()->StructureManager();
|
||||
|
||||
Handle(Graphic3d_Group) mygroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
Handle(Graphic3d_Group) mygroup = aPresentation->CurrentGroup();
|
||||
myAspect = (new Prs3d_ShadingAspect())->Aspect();
|
||||
Graphic3d_MaterialAspect material = myAspect->FrontMaterial();
|
||||
material.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
@@ -281,7 +281,7 @@ case 6: //color
|
||||
} // end of "if the triangle is valid
|
||||
} // end of the "parcours" of the triangles
|
||||
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aOP);
|
||||
aPresentation->CurrentGroup()->AddPrimitiveArray (aOP);
|
||||
|
||||
mygroup->SetGroupPrimitivesAspect(myAspect);
|
||||
}// end of the exploration of the shape in faces
|
||||
|
Reference in New Issue
Block a user