and deprecate Draw() methods taking Prs3d_Presentation.
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(),
if (myText.Length() != 0)
{
gp_Pnt aTextPosition = aLastPoint;
- Prs3d_Text::Draw (aPresentation,
+ Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),
myDrawer->TextAspect(),
myText,
aTextPosition);
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*/,
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(),
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);
}
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));
}
//=======================================================================
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
{
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();
// 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);
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());
}
else
{
- Prs3d_Text::Draw (thePrs, anAsp, myText, Position());
+ Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, Position());
}
break;
}
case DsgPrs_AS_FIRSTAR:
{
-
- Prs3d_Arrow::Draw(aPresentation,
+ Prs3d_Arrow::Draw(Prs3d_Root::CurrentGroup (aPresentation),
pt1,
dir1,
LA->ArrowAspect()->Angle(),
case DsgPrs_AS_LASTAR:
{
- Prs3d_Arrow::Draw(aPresentation,
+ Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
pt2,
dir2,
LA->ArrowAspect()->Angle(),
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(),
case DsgPrs_AS_FIRSTAR_LASTPT:
{
// an Arrow
- Prs3d_Arrow::Draw(aPresentation,
+ Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
pt1,
dir1,
LA->ArrowAspect()->Angle(),
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
// an Arrow
- Prs3d_Arrow::Draw(aPresentation,
+ Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
pt2,
dir2,
LA->ArrowAspect()->Angle(),
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 )
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));
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;
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);
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);
}
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);
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;
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);
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);
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;
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;
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);
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);
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;
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);
}
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;
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)
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)
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)
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);
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());
// 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));
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);
}
}
//Draw the text
- Prs3d_Text::Draw(aPresentation, LA->TextAspect(),aText, aTextPos);
+ Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aTextPos);
//ota === end ===
}
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 );
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);
}
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);
}
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
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
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
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());
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);
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);
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;
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;
// 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()) )
// 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()) )
// 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()) )
// 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()) )
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
{
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());
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);
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());
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);
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);
}
//=======================================================================
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)
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);
}
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);
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 |
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 |
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:
// 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());
}
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.);
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());
Prs3d_PresentationShadow.hxx
Prs3d_Projector.cxx
Prs3d_Projector.hxx
-Prs3d_Root.cxx
Prs3d_Root.hxx
Prs3d_ShadingAspect.cxx
Prs3d_ShadingAspect.hxx
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <Prs3d_Arrow.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_Group.hxx>
-#include <Prs3d_Arrow.hxx>
#include <Prs3d_Presentation.hxx>
//=======================================================================
//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,
}
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);
}
#ifndef _Prs3d_Arrow_HeaderFile
#define _Prs3d_Arrow_HeaderFile
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
#include <Prs3d_Root.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Quantity_Length.hxx>
-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
+++ /dev/null
-// 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 <Graphic3d_Group.hxx>
-#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Root.hxx>
-
-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();
-}
#ifndef _Prs3d_Root_HeaderFile
#define _Prs3d_Root_HeaderFile
+#include <Graphic3d_Group.hxx>
+#include <Prs3d_Presentation.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
-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
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <Prs3d_Text.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
-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);
+// =======================================================================
+// function : Draw
+// purpose :
+// =======================================================================
+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);
-
-// 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());
+ theGroup->SetPrimitivesAspect (theAspect->Aspect());
+ theGroup->Text (theText,
+ Graphic3d_Vertex(x,y,z),
+ theAspect->Height(),
+ theAspect->Angle(),
+ theAspect->Orientation(),
+ theAspect->HorizontalJustification(),
+ theAspect->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_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);
}
#ifndef _Prs3d_Text_HeaderFile
#define _Prs3d_Text_HeaderFile
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
#include <Prs3d_Root.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_TextAspect.hxx>
#include <gp_Ax2.hxx>
-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);
-
- //! 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,
+ //! 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 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
// 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*/,
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());
}
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());
}
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(),
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(),
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);
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);
}
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(),
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);
}
}
}