diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp index 94b21f1d95..fe084f12aa 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp @@ -87,7 +87,7 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /* Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims); // Draw arrow - Prs3d_Arrow::Draw (aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), 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 (aPresentation, + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), myDrawer->TextAspect(), myText, aTextPosition); diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Text.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Text.cpp index f12e597dd2..29a5286afe 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Text.cpp +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Text.cpp @@ -64,7 +64,7 @@ void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPrese const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer /*aMode*/) { - Prs3d_Text::Draw(aPresentation,myDrawer,MyText,gp_Pnt( MyX ,MyY,MyZ )); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), myDrawer->TextAspect(), MyText, gp_Pnt(MyX, MyY, MyZ)); } void ISession_Text::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, diff --git a/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp b/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp index 6743c63f92..833f4ba816 100755 --- a/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp +++ b/samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp @@ -45,7 +45,7 @@ void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& /*a Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims); // Draw arrow - Prs3d_Arrow::Draw (aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), myEndPnt, gp_Dir (gp_Vec(myStartPnt, myEndPnt)), anArrowAspect->Angle(), diff --git a/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp b/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp index 607f698e45..db2bebe15f 100755 --- a/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp +++ b/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp @@ -47,5 +47,5 @@ void Sample2D_Text::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPres asp->Aspect()->SetTextAngle(myAngle); asp->Aspect()->SetTextFontAspect(myFontAspect); asp->SetHeight(myHeight); - Prs3d_Text::Draw(aPresentation, asp, myText, myPosition); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), asp, myText, myPosition); } diff --git a/src/AIS/AIS_ColorScale.cxx b/src/AIS/AIS_ColorScale.cxx index daadd8ae67..b8fada3007 100644 --- a/src/AIS/AIS_ColorScale.cxx +++ b/src/AIS/AIS_ColorScale.cxx @@ -762,7 +762,7 @@ void AIS_ColorScale::drawText (const Handle(Prs3d_Presentation)& thePresentation anAspect->Aspect()->SetTextZoomable (Standard_True); anAspect->Aspect()->SetTextAngle (0.0); anAspect->Aspect()->SetTextFontAspect (Font_FA_Regular); - Prs3d_Text::Draw (thePresentation, anAspect, theText,gp_Pnt (theX,theY,0.0)); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePresentation), anAspect, theText,gp_Pnt (theX,theY,0.0)); } //======================================================================= diff --git a/src/AIS/AIS_Dimension.cxx b/src/AIS/AIS_Dimension.cxx index 8139c0579f..a9fd50d609 100755 --- a/src/AIS/AIS_Dimension.cxx +++ b/src/AIS/AIS_Dimension.cxx @@ -340,20 +340,19 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation const gp_Pnt& theLocation, const gp_Dir& theDirection) { - Prs3d_Root::NewGroup (thePresentation); + Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation); Quantity_Length aLength = myDrawer->DimensionAspect()->ArrowAspect()->Length(); Standard_Real anAngle = myDrawer->DimensionAspect()->ArrowAspect()->Angle(); if (myDrawer->DimensionAspect()->IsArrows3d()) { - Prs3d_Arrow::Draw (thePresentation, + Prs3d_Arrow::Draw (aGroup, theLocation, theDirection, anAngle, aLength); - - Prs3d_Root::CurrentGroup (thePresentation)->SetGroupPrimitivesAspect (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()); + aGroup->SetGroupPrimitivesAspect (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()); } else { @@ -379,8 +378,8 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color()); aShadingStyle->SetMaterial (aShadeMat); - Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aShadingStyle->Aspect()); - Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (anArrow); + aGroup->SetPrimitivesAspect (aShadingStyle->Aspect()); + aGroup->AddPrimitiveArray (anArrow); } SelectionGeometry::Arrow& aSensitiveArrow = mySelectionGeom.NewArrow(); @@ -532,7 +531,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation, // generate primitives for 2D text myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION); - Prs3d_Text::Draw (thePresentation, + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePresentation), myDrawer->DimensionAspect()->TextAspect(), theText, theTextPos); diff --git a/src/AIS/AIS_TextLabel.cxx b/src/AIS/AIS_TextLabel.cxx index 863ec5f052..6033cc0238 100644 --- a/src/AIS/AIS_TextLabel.cxx +++ b/src/AIS/AIS_TextLabel.cxx @@ -298,7 +298,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr gp_Ax2 anOrientation = myOrientation3D; anOrientation.SetLocation (aPosition); - Prs3d_Text::Draw (thePrs, anAsp, myText, myOrientation3D, !myHasFlipping); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, myOrientation3D, !myHasFlipping); if (myHasFlipping && isInit) { Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_False, gp_Ax2()); @@ -306,7 +306,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr } else { - Prs3d_Text::Draw (thePrs, anAsp, myText, Position()); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, Position()); } break; diff --git a/src/DsgPrs/DsgPrs.cxx b/src/DsgPrs/DsgPrs.cxx index bbb3d5b350..9acb962f3b 100644 --- a/src/DsgPrs/DsgPrs.cxx +++ b/src/DsgPrs/DsgPrs.cxx @@ -70,8 +70,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, } case DsgPrs_AS_FIRSTAR: { - - Prs3d_Arrow::Draw(aPresentation, + Prs3d_Arrow::Draw(Prs3d_Root::CurrentGroup (aPresentation), pt1, dir1, LA->ArrowAspect()->Angle(), @@ -81,7 +80,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, case DsgPrs_AS_LASTAR: { - Prs3d_Arrow::Draw(aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), pt2, dir2, LA->ArrowAspect()->Angle(), @@ -91,12 +90,12 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, case DsgPrs_AS_BOTHAR: { - Prs3d_Arrow::Draw(aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), pt1, dir1, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); - Prs3d_Arrow::Draw(aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), pt2, dir2, LA->ArrowAspect()->Angle(), @@ -145,7 +144,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, case DsgPrs_AS_FIRSTAR_LASTPT: { // an Arrow - Prs3d_Arrow::Draw(aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), pt1, dir1, LA->ArrowAspect()->Angle(), @@ -167,7 +166,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints); } // an Arrow - Prs3d_Arrow::Draw(aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), pt2, dir2, LA->ArrowAspect()->Angle(), diff --git a/src/DsgPrs/DsgPrs_AnglePresentation.cxx b/src/DsgPrs/DsgPrs_AnglePresentation.cxx index d85b2046ec..f71d8d7964 100644 --- a/src/DsgPrs/DsgPrs_AnglePresentation.cxx +++ b/src/DsgPrs/DsgPrs_AnglePresentation.cxx @@ -171,7 +171,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat param = ElCLib::Parameter(aCircle2, tmpPnt); tmpPnt = ElCLib::Value(param, aCircle2); tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -2)); - Prs3d_Text::Draw(aPresentation, aDimensionAspect->TextAspect(), txt, tmpPnt); //add the TCollection_ExtendedString + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), aDimensionAspect->TextAspect(), txt, tmpPnt); angle = 2. * M_PI - param ; if( param > OppParam ) @@ -230,7 +230,8 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat sprintf(valcar,"%5.2f",theval); Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect(); - Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); + Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPresentation); + aGroup->SetPrimitivesAspect(LA->LineAspect()->Aspect()); gp_Ax2 ax(CenterPoint,axisdir,dir1); gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint)); @@ -277,7 +278,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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); + Prs3d_Text::Draw (aGroup, LA->TextAspect(), aText, OffsetPoint); Standard_Real length = LA->ArrowAspect()->Length(); if (length < Precision::Confusion()) length = 1.e-04; @@ -297,7 +298,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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); + Prs3d_Arrow::Draw (aGroup, ptarr, dirarr, LA->ArrowAspect()->Angle(), length); aPrims->AddBound(2); aPrims->AddVertex(AttachmentPoint1); @@ -308,13 +309,13 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat ax1.SetLocation(ptarr); gp_Dir dirarr2(vecarr); dirarr2.Rotate(ax1,-beta); - Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr2,LA->ArrowAspect()->Angle(),length); + Prs3d_Arrow::Draw (aGroup, ptarr, dirarr2, LA->ArrowAspect()->Angle(), length); aPrims->AddBound(2); aPrims->AddVertex(AttachmentPoint2); aPrims->AddVertex(ptarr); - Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); + aGroup->AddPrimitiveArray (aPrims); } @@ -398,7 +399,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow2, ArrowPrs ); // Drawing the text - Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint ); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint); // Line from AttachmentPoint1 to end of Arrow1 aPrims->AddVertex(AttachmentPoint1); @@ -514,7 +515,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText,OffsetPoint); Standard_Real length = LA->ArrowAspect()->Length(); if (length < Precision::Confusion()) length = 1.e-04; @@ -533,7 +534,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr, LA->ArrowAspect()->Angle(), length); aPrims->AddBound(2); aPrims->AddVertex(AttachmentPoint1); @@ -544,7 +545,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat ax1.SetLocation(ptarr); gp_Dir dirarr2(vecarr); dirarr2.Rotate(ax1, - beta); - Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr2,LA->ArrowAspect()->Angle(),length); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr2, LA->ArrowAspect()->Angle(), length); aPrims->AddBound(2); aPrims->AddVertex(AttachmentPoint2); @@ -625,7 +626,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint); Standard_Real length = LA->ArrowAspect()->Length(); if (length < Precision::Confusion()) length = 1.e-04; @@ -741,7 +742,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint); Standard_Real length = LA->ArrowAspect()->Length(); if (length < Precision::Confusion()) length = 1.e-04; @@ -761,7 +762,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat const Standard_Real beta = v1.Angle(v2); dirarr.Rotate(ax1, beta); - Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr,LA->ArrowAspect()->Angle(),length); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr, LA->ArrowAspect()->Angle(), length); aPrims->AddBound(2); aPrims->AddVertex(AttachmentPoint1); @@ -772,7 +773,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat gp_Dir dirarr2(vecarr); dirarr2.Rotate(ax1, -beta); - Prs3d_Arrow::Draw(aPresentation,ptarr,dirarr2,LA->ArrowAspect()->Angle(),length); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptarr, dirarr2, LA->ArrowAspect()->Angle(), length); aPrims->AddBound(2); aPrims->AddVertex(AttachmentPoint2); @@ -817,21 +818,21 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat 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 (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(-vecarr), LA->ArrowAspect()->Angle(), length); break; } 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 (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(vecarr), LA->ArrowAspect()->Angle(), length); break; } 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 (Prs3d_Root::CurrentGroup (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 (Prs3d_Root::CurrentGroup (aPresentation), ptarr, gp_Dir(vecarr), LA->ArrowAspect()->Angle(), length); break; } default: break; diff --git a/src/DsgPrs/DsgPrs_Chamf2dPresentation.cxx b/src/DsgPrs/DsgPrs_Chamf2dPresentation.cxx index aa88f78878..83be3638d8 100644 --- a/src/DsgPrs/DsgPrs_Chamf2dPresentation.cxx +++ b/src/DsgPrs/DsgPrs_Chamf2dPresentation.cxx @@ -46,9 +46,9 @@ void DsgPrs_Chamf2dPresentation::Add( Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ()); - Prs3d_Arrow::Draw(aPresentation,aPntAttach,ArrowDir,LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), aPntAttach, ArrowDir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntEnd); } @@ -74,7 +74,7 @@ void DsgPrs_Chamf2dPresentation::Add( aPrims->AddVertex(aPntEnd); Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntEnd); gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ()); gp_Dir ArrowDir1 = ArrowDir; diff --git a/src/DsgPrs/DsgPrs_DatumPrs.cxx b/src/DsgPrs/DsgPrs_DatumPrs.cxx index 13e5dd89e9..698192abea 100755 --- a/src/DsgPrs/DsgPrs_DatumPrs.cxx +++ b/src/DsgPrs/DsgPrs_DatumPrs.cxx @@ -55,7 +55,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation, aGroup->AddPrimitiveArray(aPrims); aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect()); - Prs3d_Arrow::Draw(thePresentation,aPoint1,aXDir,anArrowAngle,anAxisLength/10.); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (thePresentation), aPoint1, aXDir, anArrowAngle, anAxisLength/10.); aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect()); Graphic3d_Vertex aVertex1(aPoint1.X(),aPoint1.Y(),aPoint1.Z()); if (toDrawLabels) @@ -73,7 +73,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation, aGroup->AddPrimitiveArray(aPrims); aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect()); - Prs3d_Arrow::Draw(thePresentation,aPoint2,aYDir,anArrowAngle,anAxisLength/10.); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (thePresentation), aPoint2, aYDir, anArrowAngle, anAxisLength/10.); aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect()); Graphic3d_Vertex aVertex2(aPoint2.X(),aPoint2.Y(),aPoint2.Z()); if (toDrawLabels) @@ -93,7 +93,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation, aGroup->AddPrimitiveArray(aPrims); aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect()); - Prs3d_Arrow::Draw(thePresentation,aPoint3,aZDir,anArrowAngle,anAxisLength/10.); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (thePresentation), aPoint3, aZDir, anArrowAngle, anAxisLength/10.); aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect()); Graphic3d_Vertex aVertex3(aPoint3.X(),aPoint3.Y(),aPoint3.Z()); if (toDrawLabels) diff --git a/src/DsgPrs/DsgPrs_DiameterPresentation.cxx b/src/DsgPrs/DsgPrs_DiameterPresentation.cxx index c13f8da3ec..ecd6d42f7f 100644 --- a/src/DsgPrs/DsgPrs_DiameterPresentation.cxx +++ b/src/DsgPrs/DsgPrs_DiameterPresentation.cxx @@ -79,7 +79,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen TCollection_ExtendedString Text = aText; if(IsDiamSymbol) Text = TCollection_ExtendedString("\330 ") + aText; // VRO (2007-05-17) inserted a blank. - Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, AttachmentPoint); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, AttachmentPoint); // arrows gp_Dir arrdir (vecrap); @@ -191,7 +191,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen TCollection_ExtendedString Text = aText; if(IsDiamSymbol) Text = TCollection_ExtendedString("\330 ") + Text;// => \330 | \370? - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),Text,DrawPosition); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, DrawPosition); // Add presentation of arrow gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ()); diff --git a/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx index 110ab77099..e6deeea7bb 100644 --- a/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx @@ -71,7 +71,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP // value TCollection_ExtendedString Text(IsMaxRadius? "a = " : "b = "); Text += aText; - Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, aPosition ); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, aPosition); // arrows gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow)); diff --git a/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx b/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx index ba6c1d9faa..b255d3ba02 100644 --- a/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx +++ b/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx @@ -112,7 +112,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& TCollection_ExtendedString aText("=="); //Draw the text - Prs3d_Text::Draw(aPresentation,LA->TextAspect(), aText, aTextPos); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),LA->TextAspect(), aText, aTextPos); } diff --git a/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx index e52bc93bf1..b3349ea347 100644 --- a/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx @@ -91,6 +91,6 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP } //Draw the text - Prs3d_Text::Draw(aPresentation, LA->TextAspect(),aText, aTextPos); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aTextPos); //ota === end === } diff --git a/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx index ca3818306a..6c4ffe263d 100644 --- a/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx @@ -119,7 +119,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // Drawing the text - Prs3d_Text::Draw(aPresentation, LA->TextAspect(), aText, DrawPosition); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, DrawPosition); // Add presentation of arrows DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs ); diff --git a/src/DsgPrs/DsgPrs_IdenticPresentation.cxx b/src/DsgPrs/DsgPrs_IdenticPresentation.cxx index 67d4aa077d..9c197a6c7b 100644 --- a/src/DsgPrs/DsgPrs_IdenticPresentation.cxx +++ b/src/DsgPrs/DsgPrs_IdenticPresentation.cxx @@ -60,7 +60,7 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints); // texte - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset); } @@ -96,7 +96,7 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // texte - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset); } @@ -144,7 +144,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // texte - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset); } // jfa 16/10/2000 @@ -193,7 +193,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // texte - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset); } // jfa 16/10/2000 end @@ -238,6 +238,6 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // texte - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset); } // jfa 10/10/2000 end diff --git a/src/DsgPrs/DsgPrs_LengthPresentation.cxx b/src/DsgPrs/DsgPrs_LengthPresentation.cxx index cae16ab1da..6518940d2a 100644 --- a/src/DsgPrs/DsgPrs_LengthPresentation.cxx +++ b/src/DsgPrs/DsgPrs_LengthPresentation.cxx @@ -91,18 +91,18 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta arrdir.Reverse(); // arrow 1 : 2nd group - Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->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->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); Prs3d_Root::NewGroup(aPresentation); // text : 4th group - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); @@ -175,7 +175,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs ); // Drawing the text - Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint ); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint); // Line from AttachmentPoint1 to end of Arrow1 aPrims->AddVertex(AttachmentPoint1); @@ -258,7 +258,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // text - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp); // symbols at the extremities of the face DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs); @@ -326,7 +326,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta DsgPrs::ComputeSymbol( aPresentation, LA, AttachmentPoint1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs ); // Drawing the text - Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint ); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, OffsetPoint); // Two curves from end of Arrow2 to AttachmentPoint2 Standard_Real Alpha, delta; @@ -375,21 +375,21 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs, switch(ArrowPrs) { case DsgPrs_AS_LASTAR: - Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(gp_Vec(Pt1,Pt2)), + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt2, gp_Dir(gp_Vec(Pt1,Pt2)), aDrawer->DimensionAspect()->ArrowAspect()->Angle(), aDrawer->DimensionAspect()->ArrowAspect()->Length()); break; case DsgPrs_AS_FIRSTAR: - Prs3d_Arrow::Draw(aPrs,Pt1,gp_Dir(gp_Vec(Pt2,Pt1)), + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt1, gp_Dir(gp_Vec(Pt2,Pt1)), aDrawer->DimensionAspect()->ArrowAspect()->Angle(), aDrawer->DimensionAspect()->ArrowAspect()->Length()); break; case DsgPrs_AS_BOTHAR: V = gp_Vec(Pt1,Pt2); - Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(V), + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt2, gp_Dir(V), aDrawer->DimensionAspect()->ArrowAspect()->Angle(), aDrawer->DimensionAspect()->ArrowAspect()->Length()); - Prs3d_Arrow::Draw(aPrs,Pt1,gp_Dir(V.Reversed()), + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPrs), Pt1, gp_Dir(V.Reversed()), aDrawer->DimensionAspect()->ArrowAspect()->Angle(), aDrawer->DimensionAspect()->ArrowAspect()->Length()); break; diff --git a/src/DsgPrs/DsgPrs_MidPointPresentation.cxx b/src/DsgPrs/DsgPrs_MidPointPresentation.cxx index 7b155aa294..e4a037c367 100644 --- a/src/DsgPrs/DsgPrs_MidPointPresentation.cxx +++ b/src/DsgPrs/DsgPrs_MidPointPresentation.cxx @@ -80,7 +80,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // texte TCollection_ExtendedString aText(" (+)"); - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position); } if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) ) @@ -152,7 +152,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // texte TCollection_ExtendedString aText (" (+)"); - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position); } if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) ) @@ -226,7 +226,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // texte TCollection_ExtendedString aText (" (+)"); - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position); } if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) ) @@ -302,7 +302,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // texte TCollection_ExtendedString aText (" (+)"); - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, Position); } if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) ) diff --git a/src/DsgPrs/DsgPrs_OffsetPresentation.cxx b/src/DsgPrs/DsgPrs_OffsetPresentation.cxx index a650414856..64e3f714a0 100644 --- a/src/DsgPrs/DsgPrs_OffsetPresentation.cxx +++ b/src/DsgPrs/DsgPrs_OffsetPresentation.cxx @@ -98,8 +98,8 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta if (DimNulle) { - Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); - Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction().Reversed(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), offp, L4.Direction(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), offp, L4.Direction().Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); } else { @@ -110,7 +110,7 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta arrdir.Reverse(); // fleche 1 : 2eme groupe - Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); Prs3d_Root::NewGroup(aPresentation); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); @@ -126,7 +126,7 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta Prs3d_Root::NewGroup(aPresentation); // texte : 4eme groupe - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp); } Prs3d_Root::NewGroup(aPresentation); diff --git a/src/DsgPrs/DsgPrs_ParalPresentation.cxx b/src/DsgPrs/DsgPrs_ParalPresentation.cxx index e48e7b5db2..c391aa068b 100644 --- a/src/DsgPrs/DsgPrs_ParalPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ParalPresentation.cxx @@ -87,18 +87,18 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat arrdir.Reverse(); // arrow 1 : 2nd group - Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->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->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Proj2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); Prs3d_Root::NewGroup(aPresentation); // text : 4th group - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); @@ -180,7 +180,7 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // text - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp); //arrows DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs); diff --git a/src/DsgPrs/DsgPrs_RadiusPresentation.cxx b/src/DsgPrs/DsgPrs_RadiusPresentation.cxx index dc60814ec8..48dd7cb891 100644 --- a/src/DsgPrs/DsgPrs_RadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_RadiusPresentation.cxx @@ -121,10 +121,10 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta arrdir.Reverse(); // fleche - Prs3d_Arrow::Draw(aPresentation,ptoncirc,arrdir,LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), ptoncirc, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); // texte - Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,attpoint); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, attpoint); } //======================================================================= @@ -155,7 +155,7 @@ void DsgPrs_RadiusPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims); // text - Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, AttachmentPoint ); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, AttachmentPoint); gp_Dir ArrowDir = gce_MakeDir( LineOrigin , LineEnd ); if (reverseArrow) diff --git a/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx b/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx index 5b483d306c..88fcd4f8e4 100644 --- a/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx @@ -257,5 +257,5 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs, aPrims->AddVertex(pt2); Prs3d_Root::CurrentGroup(prs)->AddPrimitiveArray(aPrims); - Prs3d_Arrow::Draw(prs, pt2, dir, M_PI/180.*10., leng*0.3); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (prs), pt2, dir, M_PI/180.*10., leng*0.3); } diff --git a/src/DsgPrs/DsgPrs_SymbPresentation.cxx b/src/DsgPrs/DsgPrs_SymbPresentation.cxx index ae6f94b31f..98cb2e5fc5 100644 --- a/src/DsgPrs/DsgPrs_SymbPresentation.cxx +++ b/src/DsgPrs/DsgPrs_SymbPresentation.cxx @@ -37,7 +37,7 @@ void DsgPrs_SymbPresentation::Add (const Handle(Prs3d_Presentation)& aPresentati Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect(); Handle(Prs3d_TextAspect) TA = LA->TextAspect(); TA->SetColor(Quantity_NOC_GREEN); - Prs3d_Text::Draw(aPresentation,TA,aText, OffsetPoint); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), TA, aText, OffsetPoint); // 2eme groupe : marker Handle(Geom_CartesianPoint) theP = new Geom_CartesianPoint(OffsetPoint); diff --git a/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx b/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx index d1aba850bb..3e429ae744 100644 --- a/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx +++ b/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx @@ -334,10 +334,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->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), P1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); // arrow 2 ---- - Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), P2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); //------------------------------------------------------------------------------------- //| SYMBOL OF SYMMETRY | @@ -581,10 +581,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->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), P1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); // arrow 2 ---- - Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), P2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); //------------------------------------------------------------------------------------- //| SYMBOL OF SYMMETRY | @@ -797,10 +797,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->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), P1, arrdir, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); // arrow 2 ---- - Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), P2, arrdir.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); //==== POINTS ================ //Marker of localization of attachment points: diff --git a/src/DsgPrs/DsgPrs_TangentPresentation.cxx b/src/DsgPrs/DsgPrs_TangentPresentation.cxx index bf3cf4dfc1..417c9ec9fd 100644 --- a/src/DsgPrs/DsgPrs_TangentPresentation.cxx +++ b/src/DsgPrs/DsgPrs_TangentPresentation.cxx @@ -62,10 +62,10 @@ void DsgPrs_TangentPresentation::Add (const Handle(Prs3d_Presentation)& aPresent // fleche 1 : Prs3d_Root::NewGroup(aPresentation); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); - Prs3d_Arrow::Draw(aPresentation,p1,aDirection,LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p1, aDirection, LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); // fleche 2 Prs3d_Root::NewGroup(aPresentation); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); - Prs3d_Arrow::Draw(aPresentation,p2,aDirection.Reversed(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length()); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p2, aDirection.Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length()); } diff --git a/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx b/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx index 5b45c32a50..e1696578bb 100644 --- a/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx +++ b/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx @@ -48,7 +48,7 @@ void DsgPrs_XYZAxisPresentation::Add( aPrims->AddVertex(aPlast); G->AddPrimitiveArray(aPrims); - Prs3d_Arrow::Draw(aPresentation,aPlast,aDir,M_PI/180.*10.,aVal/10.); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (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,7 +74,7 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta G->AddPrimitiveArray(aPrims); G->SetPrimitivesAspect( anArrowAspect->Aspect() ); - Prs3d_Arrow::Draw(aPresentation,aPlast,aDir,M_PI/180.*10.,aVal/10.); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), aPlast, aDir, M_PI/180.*10., aVal/10.); G->SetPrimitivesAspect(aTextAspect->Aspect()); Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z()); diff --git a/src/Prs3d/FILES b/src/Prs3d/FILES index daa96b6ca1..4bd4270717 100755 --- a/src/Prs3d/FILES +++ b/src/Prs3d/FILES @@ -37,7 +37,6 @@ Prs3d_PresentationShadow.cxx Prs3d_PresentationShadow.hxx Prs3d_Projector.cxx Prs3d_Projector.hxx -Prs3d_Root.cxx Prs3d_Root.hxx Prs3d_ShadingAspect.cxx Prs3d_ShadingAspect.hxx diff --git a/src/Prs3d/Prs3d_Arrow.cxx b/src/Prs3d/Prs3d_Arrow.cxx index 369c69d70c..619d6aa712 100644 --- a/src/Prs3d/Prs3d_Arrow.cxx +++ b/src/Prs3d/Prs3d_Arrow.cxx @@ -12,20 +12,20 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include #include #include #include #include -#include #include //======================================================================= //function : Draw //purpose : //======================================================================= -void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation, +void Prs3d_Arrow::Draw(const Handle(Graphic3d_Group)& theGroup, const gp_Pnt& aLocation, const gp_Dir& aDirection, const Quantity_PlaneAngle anAngle, @@ -82,19 +82,6 @@ void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation, } aPrims2->AddVertex(p1); - Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims1); - Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims2); -} - -//======================================================================= -//function : Fill -//purpose : -//======================================================================= - -void Prs3d_Arrow::Fill(const Handle(Prs3d_Presentation)& /*aPresentation*/, - const gp_Pnt& /*aLocation*/, - const gp_Dir& /*aDirection*/, - const Quantity_PlaneAngle /*anAngle*/, - const Quantity_Length /*aLength*/) -{ + theGroup->AddPrimitiveArray (aPrims1); + theGroup->AddPrimitiveArray (aPrims2); } diff --git a/src/Prs3d/Prs3d_Arrow.hxx b/src/Prs3d/Prs3d_Arrow.hxx index 21942cc3fa..6e813620c8 100644 --- a/src/Prs3d/Prs3d_Arrow.hxx +++ b/src/Prs3d/Prs3d_Arrow.hxx @@ -17,66 +17,44 @@ #ifndef _Prs3d_Arrow_HeaderFile #define _Prs3d_Arrow_HeaderFile -#include -#include -#include - #include #include #include -class Prs3d_Presentation; + class gp_Pnt; class gp_Dir; - -//! provides class methods to draw an arrow at a given -//! location, along a given direction and using a given -//! angle. -class Prs3d_Arrow : public Prs3d_Root +//! Provides class methods to draw an arrow at a given location, along a given direction and using a given angle. +class Prs3d_Arrow : public Prs3d_Root { public: DEFINE_STANDARD_ALLOC - - //! Defines the representation of the arrow defined by - //! the location point aLocation, the direction - //! aDirection and the length aLength. - //! The angle anAngle defines the angle of opening of the arrow head. - //! The presentation object aPresentation stores the - //! information defined in this framework. - Standard_EXPORT static void Draw (const Handle(Prs3d_Presentation)& aPresentation, const gp_Pnt& aLocation, const gp_Dir& aDirection, const Quantity_PlaneAngle anAngle, const Quantity_Length aLength); - - //! Defines the representation of the arrow defined by - //! the location point aLocation, the direction vector - //! aDirection and the length aLength. - //! The angle anAngle defines the angle of opening of - //! the arrow head, and the drawer aDrawer specifies - //! the display attributes which arrows will have. - //! With this syntax, no presentation object is created. - Standard_EXPORT static void Fill (const Handle(Prs3d_Presentation)& aPresentation, const gp_Pnt& aLocation, const gp_Dir& aDirection, const Quantity_PlaneAngle anAngle, const Quantity_Length aLength); - - - - -protected: - - - - - -private: - - - + //! Defines the representation of the arrow. + //! Note that this method does NOT assign any presentation aspects to the primitives group! + //! @param theGroup presentation group to add primitives + //! @param theLocation location of the arrow tip + //! @param theDirection direction of the arrow + //! @param theAngle angle of opening of the arrow head + //! @param theLength length of the arrow (from the tip) + Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup, + const gp_Pnt& theLocation, + const gp_Dir& theDirection, + const Quantity_PlaneAngle theAngle, + const Quantity_Length theLength); + //! Alias to another method Draw() for backward compatibility. + Standard_DEPRECATED("Prs3d_Arrow::Draw() taking Graphic3d_Group should be used instead") + static void Draw (const Handle(Prs3d_Presentation)& thePrs, + const gp_Pnt& theLocation, + const gp_Dir& theDirection, + const Quantity_PlaneAngle theAngle, + const Quantity_Length theLength) + { + Draw (Prs3d_Root::CurrentGroup (thePrs), theLocation, theDirection, theAngle, theLength); + } }; - - - - - - #endif // _Prs3d_Arrow_HeaderFile diff --git a/src/Prs3d/Prs3d_Root.cxx b/src/Prs3d/Prs3d_Root.cxx deleted file mode 100644 index 516705011b..0000000000 --- a/src/Prs3d/Prs3d_Root.cxx +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include - -Handle (Graphic3d_Group) Prs3d_Root::CurrentGroup (const Handle (Prs3d_Presentation)& Prs3d) -{ - return Prs3d->CurrentGroup(); -} -Handle (Graphic3d_Group) Prs3d_Root::NewGroup (const Handle (Prs3d_Presentation)& Prs3d) -{ - return Prs3d->NewGroup(); -} diff --git a/src/Prs3d/Prs3d_Root.hxx b/src/Prs3d/Prs3d_Root.hxx index 011a8c7400..691c9ae828 100644 --- a/src/Prs3d/Prs3d_Root.hxx +++ b/src/Prs3d/Prs3d_Root.hxx @@ -17,55 +17,33 @@ #ifndef _Prs3d_Root_HeaderFile #define _Prs3d_Root_HeaderFile +#include +#include #include #include #include -class Graphic3d_Group; -class Prs3d_Presentation; - - -//! A root class for the standard presentation algorithms -//! of the StdPrs package. +//! A root class for the standard presentation algorithms of the StdPrs package. class Prs3d_Root { public: DEFINE_STANDARD_ALLOC - - //! Returns the current group of primititves inside graphic - //! objects in the display. - //! A group also contains the attributes whose ranges are - //! limited to the primitives in it. - Standard_EXPORT static Handle(Graphic3d_Group) CurrentGroup (const Handle(Prs3d_Presentation)& Prs3d); - - //! Returns the new group of primitives inside graphic - //! objects in the display. + //! Returns the current (last created) group of primititves inside graphic objects in the display. //! A group also contains the attributes whose ranges are limited to the primitives in it. - Standard_EXPORT static Handle(Graphic3d_Group) NewGroup (const Handle(Prs3d_Presentation)& Prs3d); - - - - -protected: - - - - - -private: - - - + static Handle(Graphic3d_Group) CurrentGroup (const Handle(Prs3d_Presentation)& thePrs3d) + { + return thePrs3d->CurrentGroup(); + } + //! Returns the new group of primitives inside graphic objects in the display. + //! A group also contains the attributes whose ranges are limited to the primitives in it. + static Handle(Graphic3d_Group) NewGroup (const Handle(Prs3d_Presentation)& thePrs3d) + { + return thePrs3d->NewGroup(); + } }; - - - - - - #endif // _Prs3d_Root_HeaderFile diff --git a/src/Prs3d/Prs3d_Text.cxx b/src/Prs3d/Prs3d_Text.cxx index a3bca420b0..f6705afbd0 100644 --- a/src/Prs3d/Prs3d_Text.cxx +++ b/src/Prs3d/Prs3d_Text.cxx @@ -14,69 +14,56 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include #include #include #include -#include #include #include #include -void Prs3d_Text::Draw ( - const Handle(Prs3d_Presentation)& aPresentation, - const Handle(Prs3d_TextAspect)& anAspect, - const TCollection_ExtendedString& aText, - const gp_Pnt& AttachmentPoint) { - - - Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(anAspect->Aspect()); - Standard_Real x,y,z; - AttachmentPoint.Coord(x,y,z); - - -// POP Graphic3d_Grup accepte de l'extended - Prs3d_Root::CurrentGroup(aPresentation)->Text( -// TCollection_AsciiString(aText).ToCString(), - aText, - Graphic3d_Vertex(x,y,z), - anAspect->Height(), - anAspect->Angle(), - anAspect->Orientation(), - anAspect->HorizontalJustification(), - anAspect->VerticalJustification()); -} - - -void Prs3d_Text::Draw ( - const Handle(Prs3d_Presentation)& aPresentation, - const Handle(Prs3d_Drawer)& aDrawer, - const TCollection_ExtendedString& aText, - const gp_Pnt& AttachmentPoint) { - - - Prs3d_Text::Draw(aPresentation,aDrawer->TextAspect(),aText,AttachmentPoint); - } - // ======================================================================= // function : Draw // purpose : // ======================================================================= -void Prs3d_Text::Draw (const Handle(Prs3d_Presentation)& thePresentation, +void Prs3d_Text::Draw (const Handle(Graphic3d_Group)& theGroup, + const Handle(Prs3d_TextAspect)& theAspect, + const TCollection_ExtendedString& theText, + const gp_Pnt& theAttachmentPoint) +{ + Standard_Real x, y, z; + theAttachmentPoint.Coord(x,y,z); + + theGroup->SetPrimitivesAspect (theAspect->Aspect()); + theGroup->Text (theText, + Graphic3d_Vertex(x,y,z), + theAspect->Height(), + theAspect->Angle(), + theAspect->Orientation(), + theAspect->HorizontalJustification(), + theAspect->VerticalJustification()); +} + +// ======================================================================= +// function : Draw +// purpose : +// ======================================================================= +void Prs3d_Text::Draw (const Handle(Graphic3d_Group)& theGroup, const Handle(Prs3d_TextAspect)& theAspect, const TCollection_ExtendedString& theText, const gp_Ax2& theOrientation, const Standard_Boolean theHasOwnAnchor) { - Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (theAspect->Aspect()); - Prs3d_Root::CurrentGroup (thePresentation)->Text (theText, - theOrientation, - theAspect->Height(), - theAspect->Angle(), - theAspect->Orientation(), - theAspect->HorizontalJustification(), - theAspect->VerticalJustification(), - Standard_True, - theHasOwnAnchor); + theGroup->SetPrimitivesAspect (theAspect->Aspect()); + theGroup->Text (theText, + theOrientation, + theAspect->Height(), + theAspect->Angle(), + theAspect->Orientation(), + theAspect->HorizontalJustification(), + theAspect->VerticalJustification(), + Standard_True, + theHasOwnAnchor); } diff --git a/src/Prs3d/Prs3d_Text.hxx b/src/Prs3d/Prs3d_Text.hxx index 411861810e..ea2f98c886 100644 --- a/src/Prs3d/Prs3d_Text.hxx +++ b/src/Prs3d/Prs3d_Text.hxx @@ -17,79 +17,77 @@ #ifndef _Prs3d_Text_HeaderFile #define _Prs3d_Text_HeaderFile -#include -#include -#include - #include #include #include #include -class Prs3d_Presentation; class TCollection_ExtendedString; class gp_Pnt; //! A framework to define the display of texts. -class Prs3d_Text : public Prs3d_Root +class Prs3d_Text : public Prs3d_Root { public: DEFINE_STANDARD_ALLOC - - //! Defines the display of the text aText at the point AttachmentPoint. - //! The drawer aDrawer specifies the display attributes which texts will have. - //! The presentation object aPresentation stores the - //! information defined in this framework. - //! static void Draw (const Handle(Prs3d_Presentation)& - //! aPresentation, const Handle(Prs3d_TextAspect)& - //! anAspect, const TCollection_ExtendedString& aText, - //! const gp_Pnt& AttachmentPoint); - Standard_EXPORT static void Draw (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const TCollection_ExtendedString& aText, const gp_Pnt& AttachmentPoint); + //! Defines the display of the text. + //! @param theGroup group to add primitives + //! @param theAspect presentation attributes + //! @param theText text to draw + //! @param theAttachmentPoint attachment point + Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup, + const Handle(Prs3d_TextAspect)& theAspect, + const TCollection_ExtendedString& theText, + const gp_Pnt& theAttachmentPoint); - //! Draws theText label with the location and the orientation - //! specified in the model 3D space through theOrientation argument. - Standard_EXPORT static void Draw (const Handle(Prs3d_Presentation)& thePresentation, + //! Draws the text label. + //! @param theGroup group to add primitives + //! @param theAspect presentation attributes + //! @param theText text to draw + //! @param theOrientation location and orientation specified in the model 3D space + //! @param theHasOwnAnchor + Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup, const Handle(Prs3d_TextAspect)& theAspect, const TCollection_ExtendedString& theText, const gp_Ax2& theOrientation, const Standard_Boolean theHasOwnAnchor = Standard_True); - - //! Defines the display of the text aText at the point - //! AttachmentPoint. - //! The text aspect object anAspect specifies the display - //! attributes which texts will have. - //! The presentation object aPresentation stores the - //! information defined in this framework. - //! This syntax could be used if you had not already - //! defined text display attributes in a drawer or if you - //! wanted to exceptionally overide the definition - //! provided in your drawer. - Standard_EXPORT static void Draw (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_TextAspect)& anAspect, const TCollection_ExtendedString& aText, const gp_Pnt& AttachmentPoint); - - - - -protected: - - - - - -private: +public: + //! Alias to another method Draw() for backward compatibility. + Standard_DEPRECATED("Prs3d_Text::Draw() taking Graphic3d_Group should be used instead") + static void Draw (const Handle(Prs3d_Presentation)& thePrs, + const Handle(Prs3d_Drawer)& theDrawer, + const TCollection_ExtendedString& theText, + const gp_Pnt& theAttachmentPoint) + { + Draw (Prs3d_Root::CurrentGroup (thePrs), theDrawer->TextAspect(), theText, theAttachmentPoint); + } + //! Alias to another method Draw() for backward compatibility. + Standard_DEPRECATED("Prs3d_Text::Draw() taking Graphic3d_Group should be used instead") + static void Draw (const Handle(Prs3d_Presentation)& thePrs, + const Handle(Prs3d_TextAspect)& theAspect, + const TCollection_ExtendedString& theText, + const gp_Ax2& theOrientation, + const Standard_Boolean theHasOwnAnchor = Standard_True) + { + Draw (Prs3d_Root::CurrentGroup (thePrs), theAspect, theText, theOrientation, theHasOwnAnchor); + } + //! Alias to another method Draw() for backward compatibility. + Standard_DEPRECATED("Prs3d_Text::Draw() taking Graphic3d_Group should be used instead") + static void Draw (const Handle(Prs3d_Presentation)& thePrs, + const Handle(Prs3d_TextAspect)& theAspect, + const TCollection_ExtendedString& theText, + const gp_Pnt& theAttachmentPoint) + { + Draw (Prs3d_Root::CurrentGroup (thePrs), theAspect, theText, theAttachmentPoint); + } }; - - - - - - #endif // _Prs3d_Text_HeaderFile diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index 38cf0281a0..7829841290 100644 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -5222,7 +5222,7 @@ public: // create separate group for text elements Handle(Graphic3d_Group) aTextGroup = Prs3d_Root::NewGroup (thePresentation); TCollection_ExtendedString aString ("YOU SHOULD SEE THIS TEXT", Standard_True); - Prs3d_Text::Draw (thePresentation, myDrawer->TextAspect(), aString, gp_Ax2 (gp::Origin(), gp::DZ())); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePresentation), myDrawer->TextAspect(), aString, gp_Ax2 (gp::Origin(), gp::DZ())); } virtual void ComputeSelection (const Handle(SelectMgr_Selection)& /*theSelection*/, diff --git a/src/StdPrs/StdPrs_Curve.cxx b/src/StdPrs/StdPrs_Curve.cxx index 3171a7db78..023db0484e 100644 --- a/src/StdPrs/StdPrs_Curve.cxx +++ b/src/StdPrs/StdPrs_Curve.cxx @@ -232,7 +232,7 @@ void StdPrs_Curve::Add (const Handle (Prs3d_Presentation)& aPresentation, gp_Pnt Location; gp_Vec Direction; aCurve.D1(aCurve.LastParameter(),Location,Direction); - Prs3d_Arrow::Draw (aPresentation,Location,gp_Dir(Direction), + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Location, gp_Dir(Direction), aDrawer->ArrowAspect()->Angle(), aDrawer->ArrowAspect()->Length()); } @@ -298,7 +298,7 @@ void StdPrs_Curve::Add (const Handle (Prs3d_Presentation)& aPresentation, gp_Pnt Location; gp_Vec Direction; aCurve.D1(aCurve.LastParameter(),Location,Direction); - Prs3d_Arrow::Draw (aPresentation,Location,gp_Dir(Direction), + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Location, gp_Dir(Direction), aDrawer->ArrowAspect()->Angle(), aDrawer->ArrowAspect()->Length()); } diff --git a/src/StdPrs/StdPrs_DeflectionCurve.cxx b/src/StdPrs/StdPrs_DeflectionCurve.cxx index 5111b19740..9b1369bfb9 100644 --- a/src/StdPrs/StdPrs_DeflectionCurve.cxx +++ b/src/StdPrs/StdPrs_DeflectionCurve.cxx @@ -308,7 +308,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati gp_Pnt Location; gp_Vec Direction; aCurve.D1(V2, Location,Direction); - Prs3d_Arrow::Draw (aPresentation, + Prs3d_Arrow::Draw (aGroup, Location, gp_Dir(Direction), aDrawer->ArrowAspect()->Angle(), @@ -355,7 +355,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati gp_Pnt Location; gp_Vec Direction; aCurve.D1(V2, Location,Direction); - Prs3d_Arrow::Draw (aPresentation, + Prs3d_Arrow::Draw (aGroup, Location, gp_Dir(Direction), aDrawer->ArrowAspect()->Angle(), diff --git a/src/StdPrs/StdPrs_Plane.cxx b/src/StdPrs/StdPrs_Plane.cxx index 7a0dc50d02..7e0f97e0d8 100644 --- a/src/StdPrs/StdPrs_Plane.cxx +++ b/src/StdPrs/StdPrs_Plane.cxx @@ -96,7 +96,7 @@ void StdPrs_Plane::Add (const Handle (Prs3d_Presentation)& aPresentation, aPrims->AddVertex(loc); aPrims->AddVertex(p1); TheGroup->AddPrimitiveArray(aPrims); - Prs3d_Arrow::Draw(aPresentation,p1,norm,ang,len); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p1, norm, ang, len); } if (theaspect->DisplayEdgesArrows()) { Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(8); @@ -105,25 +105,25 @@ void StdPrs_Plane::Add (const Handle (Prs3d_Presentation)& aPresentation, p1 = loc.Translated(trans); aPrims->AddVertex(loc); aPrims->AddVertex(p1); - Prs3d_Arrow::Draw(aPresentation,p1,norm,ang,len); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p1, norm, ang, len); // thegeom->D0(-Xmax,Ymax,loc); p1 = loc.Translated(trans); aPrims->AddVertex(loc); aPrims->AddVertex(p1); - Prs3d_Arrow::Draw(aPresentation,p1,norm,ang,len); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p1, norm, ang, len); // thegeom->D0(Xmax,Ymax,loc); p1 = loc.Translated(trans); aPrims->AddVertex(loc); aPrims->AddVertex(p1); - Prs3d_Arrow::Draw(aPresentation,p1,norm,ang,len); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p1, norm, ang, len); // thegeom->D0(Xmax,-Ymax,loc); p1 = loc.Translated(trans); aPrims->AddVertex(loc); aPrims->AddVertex(p1); - Prs3d_Arrow::Draw(aPresentation,p1,norm,ang,len); + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), p1, norm, ang, len); // TheGroup->AddPrimitiveArray(aPrims); } diff --git a/src/StdPrs/StdPrs_PoleCurve.cxx b/src/StdPrs/StdPrs_PoleCurve.cxx index 66d0ab8f34..2537d9dc5e 100644 --- a/src/StdPrs/StdPrs_PoleCurve.cxx +++ b/src/StdPrs/StdPrs_PoleCurve.cxx @@ -65,7 +65,7 @@ void StdPrs_PoleCurve::Add (const Handle (Prs3d_Presentation)& aPresentation, gp_Pnt Location; gp_Vec Direction; aCurve.D1(aCurve.LastParameter(),Location,Direction); - Prs3d_Arrow::Draw (aPresentation, + Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), Location, gp_Dir(Direction), aDrawer->ArrowAspect()->Angle(), diff --git a/src/XCAFPrs/XCAFPrs_AISObject.cxx b/src/XCAFPrs/XCAFPrs_AISObject.cxx index eb2f9e68cf..4b9607a13c 100644 --- a/src/XCAFPrs/XCAFPrs_AISObject.cxx +++ b/src/XCAFPrs/XCAFPrs_AISObject.cxx @@ -77,7 +77,7 @@ static void DisplayText (const TDF_Label& aLabel, Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; aBox.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); gp_Pnt aPnt (0.5 * (aXmin + aXmax), 0.5 * (aYmin + aYmax), 0.5 * (aZmin + aZmax)); - Prs3d_Text::Draw( aPrs, anAspect, aName->Get(), aPnt); + Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPrs), anAspect, aName->Get(), aPnt); } } }