mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0027756: Visualization - add Draw() method taking Graphic3d_Group to tools Prs3d_Arrow, Prs3d_Text
and deprecate Draw() methods taking Prs3d_Presentation.
This commit is contained in:
parent
521b0d7f81
commit
4ad142d9cb
@ -87,7 +87,7 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
|||||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||||
// Draw arrow
|
// Draw arrow
|
||||||
Prs3d_Arrow::Draw (aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
aLastPoint,
|
aLastPoint,
|
||||||
myDir,
|
myDir,
|
||||||
anArrowAspect->Angle(),
|
anArrowAspect->Angle(),
|
||||||
@ -97,7 +97,7 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
|||||||
if (myText.Length() != 0)
|
if (myText.Length() != 0)
|
||||||
{
|
{
|
||||||
gp_Pnt aTextPosition = aLastPoint;
|
gp_Pnt aTextPosition = aLastPoint;
|
||||||
Prs3d_Text::Draw (aPresentation,
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
myDrawer->TextAspect(),
|
myDrawer->TextAspect(),
|
||||||
myText,
|
myText,
|
||||||
aTextPosition);
|
aTextPosition);
|
||||||
|
@ -64,7 +64,7 @@ void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPrese
|
|||||||
const Handle(Prs3d_Presentation)& aPresentation,
|
const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
const Standard_Integer /*aMode*/)
|
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*/,
|
void ISession_Text::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
|
||||||
|
@ -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)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||||
// Draw arrow
|
// Draw arrow
|
||||||
Prs3d_Arrow::Draw (aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
myEndPnt,
|
myEndPnt,
|
||||||
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
|
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
|
||||||
anArrowAspect->Angle(),
|
anArrowAspect->Angle(),
|
||||||
|
@ -47,5 +47,5 @@ void Sample2D_Text::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPres
|
|||||||
asp->Aspect()->SetTextAngle(myAngle);
|
asp->Aspect()->SetTextAngle(myAngle);
|
||||||
asp->Aspect()->SetTextFontAspect(myFontAspect);
|
asp->Aspect()->SetTextFontAspect(myFontAspect);
|
||||||
asp->SetHeight(myHeight);
|
asp->SetHeight(myHeight);
|
||||||
Prs3d_Text::Draw(aPresentation, asp, myText, myPosition);
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), asp, myText, myPosition);
|
||||||
}
|
}
|
||||||
|
@ -762,7 +762,7 @@ void AIS_ColorScale::drawText (const Handle(Prs3d_Presentation)& thePresentation
|
|||||||
anAspect->Aspect()->SetTextZoomable (Standard_True);
|
anAspect->Aspect()->SetTextZoomable (Standard_True);
|
||||||
anAspect->Aspect()->SetTextAngle (0.0);
|
anAspect->Aspect()->SetTextAngle (0.0);
|
||||||
anAspect->Aspect()->SetTextFontAspect (Font_FA_Regular);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -340,20 +340,19 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation
|
|||||||
const gp_Pnt& theLocation,
|
const gp_Pnt& theLocation,
|
||||||
const gp_Dir& theDirection)
|
const gp_Dir& theDirection)
|
||||||
{
|
{
|
||||||
Prs3d_Root::NewGroup (thePresentation);
|
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
|
||||||
|
|
||||||
Quantity_Length aLength = myDrawer->DimensionAspect()->ArrowAspect()->Length();
|
Quantity_Length aLength = myDrawer->DimensionAspect()->ArrowAspect()->Length();
|
||||||
Standard_Real anAngle = myDrawer->DimensionAspect()->ArrowAspect()->Angle();
|
Standard_Real anAngle = myDrawer->DimensionAspect()->ArrowAspect()->Angle();
|
||||||
|
|
||||||
if (myDrawer->DimensionAspect()->IsArrows3d())
|
if (myDrawer->DimensionAspect()->IsArrows3d())
|
||||||
{
|
{
|
||||||
Prs3d_Arrow::Draw (thePresentation,
|
Prs3d_Arrow::Draw (aGroup,
|
||||||
theLocation,
|
theLocation,
|
||||||
theDirection,
|
theDirection,
|
||||||
anAngle,
|
anAngle,
|
||||||
aLength);
|
aLength);
|
||||||
|
aGroup->SetGroupPrimitivesAspect (myDrawer->DimensionAspect()->ArrowAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup (thePresentation)->SetGroupPrimitivesAspect (myDrawer->DimensionAspect()->ArrowAspect()->Aspect());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -379,8 +378,8 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation
|
|||||||
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
||||||
aShadingStyle->SetMaterial (aShadeMat);
|
aShadingStyle->SetMaterial (aShadeMat);
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aShadingStyle->Aspect());
|
aGroup->SetPrimitivesAspect (aShadingStyle->Aspect());
|
||||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (anArrow);
|
aGroup->AddPrimitiveArray (anArrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionGeometry::Arrow& aSensitiveArrow = mySelectionGeom.NewArrow();
|
SelectionGeometry::Arrow& aSensitiveArrow = mySelectionGeom.NewArrow();
|
||||||
@ -532,7 +531,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
// generate primitives for 2D text
|
// generate primitives for 2D text
|
||||||
myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
|
myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
|
||||||
|
|
||||||
Prs3d_Text::Draw (thePresentation,
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePresentation),
|
||||||
myDrawer->DimensionAspect()->TextAspect(),
|
myDrawer->DimensionAspect()->TextAspect(),
|
||||||
theText,
|
theText,
|
||||||
theTextPos);
|
theTextPos);
|
||||||
|
@ -298,7 +298,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
|||||||
|
|
||||||
gp_Ax2 anOrientation = myOrientation3D;
|
gp_Ax2 anOrientation = myOrientation3D;
|
||||||
anOrientation.SetLocation (aPosition);
|
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)
|
if (myHasFlipping && isInit)
|
||||||
{
|
{
|
||||||
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_False, gp_Ax2());
|
Prs3d_Root::CurrentGroup (thePrs)->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||||
@ -306,7 +306,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Prs3d_Text::Draw (thePrs, anAsp, myText, Position());
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePrs), anAsp, myText, Position());
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -70,8 +70,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
case DsgPrs_AS_FIRSTAR:
|
case DsgPrs_AS_FIRSTAR:
|
||||||
{
|
{
|
||||||
|
Prs3d_Arrow::Draw(Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
|
||||||
pt1,
|
pt1,
|
||||||
dir1,
|
dir1,
|
||||||
LA->ArrowAspect()->Angle(),
|
LA->ArrowAspect()->Angle(),
|
||||||
@ -81,7 +80,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
case DsgPrs_AS_LASTAR:
|
case DsgPrs_AS_LASTAR:
|
||||||
{
|
{
|
||||||
|
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
pt2,
|
pt2,
|
||||||
dir2,
|
dir2,
|
||||||
LA->ArrowAspect()->Angle(),
|
LA->ArrowAspect()->Angle(),
|
||||||
@ -91,12 +90,12 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
|
|
||||||
case DsgPrs_AS_BOTHAR:
|
case DsgPrs_AS_BOTHAR:
|
||||||
{
|
{
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
pt1,
|
pt1,
|
||||||
dir1,
|
dir1,
|
||||||
LA->ArrowAspect()->Angle(),
|
LA->ArrowAspect()->Angle(),
|
||||||
LA->ArrowAspect()->Length());
|
LA->ArrowAspect()->Length());
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
pt2,
|
pt2,
|
||||||
dir2,
|
dir2,
|
||||||
LA->ArrowAspect()->Angle(),
|
LA->ArrowAspect()->Angle(),
|
||||||
@ -145,7 +144,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
case DsgPrs_AS_FIRSTAR_LASTPT:
|
case DsgPrs_AS_FIRSTAR_LASTPT:
|
||||||
{
|
{
|
||||||
// an Arrow
|
// an Arrow
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
pt1,
|
pt1,
|
||||||
dir1,
|
dir1,
|
||||||
LA->ArrowAspect()->Angle(),
|
LA->ArrowAspect()->Angle(),
|
||||||
@ -167,7 +166,7 @@ void DsgPrs::ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
||||||
}
|
}
|
||||||
// an Arrow
|
// an Arrow
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
pt2,
|
pt2,
|
||||||
dir2,
|
dir2,
|
||||||
LA->ArrowAspect()->Angle(),
|
LA->ArrowAspect()->Angle(),
|
||||||
|
@ -171,7 +171,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
param = ElCLib::Parameter(aCircle2, tmpPnt);
|
param = ElCLib::Parameter(aCircle2, tmpPnt);
|
||||||
tmpPnt = ElCLib::Value(param, aCircle2);
|
tmpPnt = ElCLib::Value(param, aCircle2);
|
||||||
tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -2));
|
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 ;
|
angle = 2. * M_PI - param ;
|
||||||
if( param > OppParam )
|
if( param > OppParam )
|
||||||
@ -230,7 +230,8 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
sprintf(valcar,"%5.2f",theval);
|
sprintf(valcar,"%5.2f",theval);
|
||||||
|
|
||||||
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
|
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_Ax2 ax(CenterPoint,axisdir,dir1);
|
||||||
gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint));
|
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++)
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
|
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();
|
Standard_Real length = LA->ArrowAspect()->Length();
|
||||||
if (length < Precision::Confusion()) length = 1.e-04;
|
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);
|
gp_Vec v2(ptarr,ptarr3);
|
||||||
const Standard_Real beta = v1.Angle(v2);
|
const Standard_Real beta = v1.Angle(v2);
|
||||||
dirarr.Rotate(ax1, beta);
|
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->AddBound(2);
|
||||||
aPrims->AddVertex(AttachmentPoint1);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
@ -308,13 +309,13 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
ax1.SetLocation(ptarr);
|
ax1.SetLocation(ptarr);
|
||||||
gp_Dir dirarr2(vecarr);
|
gp_Dir dirarr2(vecarr);
|
||||||
dirarr2.Rotate(ax1,-beta);
|
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->AddBound(2);
|
||||||
aPrims->AddVertex(AttachmentPoint2);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
aPrims->AddVertex(ptarr);
|
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 );
|
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow2, ArrowPrs );
|
||||||
|
|
||||||
// Drawing the text
|
// 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
|
// Line from AttachmentPoint1 to end of Arrow1
|
||||||
aPrims->AddVertex(AttachmentPoint1);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
@ -514,7 +515,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
for (Standard_Integer i = 1; i<=nbp; i++)
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
|
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();
|
Standard_Real length = LA->ArrowAspect()->Length();
|
||||||
if (length < Precision::Confusion()) length = 1.e-04;
|
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);
|
gp_Vec v2(ptarr,ptarr3);
|
||||||
const Standard_Real beta = v1.Angle(v2);
|
const Standard_Real beta = v1.Angle(v2);
|
||||||
dirarr.Rotate(ax1, beta);
|
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->AddBound(2);
|
||||||
aPrims->AddVertex(AttachmentPoint1);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
@ -544,7 +545,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
ax1.SetLocation(ptarr);
|
ax1.SetLocation(ptarr);
|
||||||
gp_Dir dirarr2(vecarr);
|
gp_Dir dirarr2(vecarr);
|
||||||
dirarr2.Rotate(ax1, - beta);
|
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->AddBound(2);
|
||||||
aPrims->AddVertex(AttachmentPoint2);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
@ -625,7 +626,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
for (Standard_Integer i = 1; i<=nbp; i++)
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
|
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();
|
Standard_Real length = LA->ArrowAspect()->Length();
|
||||||
if (length < Precision::Confusion()) length = 1.e-04;
|
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++)
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
aPrims->AddVertex(ElCLib::Value(udeb+ dteta*(i-1),cer));
|
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();
|
Standard_Real length = LA->ArrowAspect()->Length();
|
||||||
if (length < Precision::Confusion()) length = 1.e-04;
|
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);
|
const Standard_Real beta = v1.Angle(v2);
|
||||||
dirarr.Rotate(ax1, beta);
|
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->AddBound(2);
|
||||||
aPrims->AddVertex(AttachmentPoint1);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
@ -772,7 +773,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
gp_Dir dirarr2(vecarr);
|
gp_Dir dirarr2(vecarr);
|
||||||
dirarr2.Rotate(ax1, -beta);
|
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->AddBound(2);
|
||||||
aPrims->AddVertex(AttachmentPoint2);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
@ -817,21 +818,21 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
case DsgPrs_AS_FIRSTAR:
|
case DsgPrs_AS_FIRSTAR:
|
||||||
{
|
{
|
||||||
ElCLib::D1(uc1,cer,ptarr,vecarr);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case DsgPrs_AS_LASTAR:
|
case DsgPrs_AS_LASTAR:
|
||||||
{
|
{
|
||||||
ElCLib::D1(uc2,cer,ptarr,vecarr);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case DsgPrs_AS_BOTHAR:
|
case DsgPrs_AS_BOTHAR:
|
||||||
{
|
{
|
||||||
ElCLib::D1(uc1,cer,ptarr,vecarr);
|
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);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -46,9 +46,9 @@ void DsgPrs_Chamf2dPresentation::Add(
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
|
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);
|
aPrims->AddVertex(aPntEnd);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
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 ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
|
||||||
gp_Dir ArrowDir1 = ArrowDir;
|
gp_Dir ArrowDir1 = ArrowDir;
|
||||||
|
@ -55,7 +55,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
aGroup->AddPrimitiveArray(aPrims);
|
aGroup->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect());
|
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());
|
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
|
||||||
Graphic3d_Vertex aVertex1(aPoint1.X(),aPoint1.Y(),aPoint1.Z());
|
Graphic3d_Vertex aVertex1(aPoint1.X(),aPoint1.Y(),aPoint1.Z());
|
||||||
if (toDrawLabels)
|
if (toDrawLabels)
|
||||||
@ -73,7 +73,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
aGroup->AddPrimitiveArray(aPrims);
|
aGroup->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect());
|
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());
|
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
|
||||||
Graphic3d_Vertex aVertex2(aPoint2.X(),aPoint2.Y(),aPoint2.Z());
|
Graphic3d_Vertex aVertex2(aPoint2.X(),aPoint2.Y(),aPoint2.Z());
|
||||||
if (toDrawLabels)
|
if (toDrawLabels)
|
||||||
@ -93,7 +93,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
aGroup->AddPrimitiveArray(aPrims);
|
aGroup->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect());
|
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());
|
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
|
||||||
Graphic3d_Vertex aVertex3(aPoint3.X(),aPoint3.Y(),aPoint3.Z());
|
Graphic3d_Vertex aVertex3(aPoint3.X(),aPoint3.Y(),aPoint3.Z());
|
||||||
if (toDrawLabels)
|
if (toDrawLabels)
|
||||||
|
@ -79,7 +79,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
TCollection_ExtendedString Text = aText;
|
TCollection_ExtendedString Text = aText;
|
||||||
if(IsDiamSymbol)
|
if(IsDiamSymbol)
|
||||||
Text = TCollection_ExtendedString("\330 ") + aText; // VRO (2007-05-17) inserted a blank.
|
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
|
// arrows
|
||||||
gp_Dir arrdir (vecrap);
|
gp_Dir arrdir (vecrap);
|
||||||
@ -191,7 +191,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
TCollection_ExtendedString Text = aText;
|
TCollection_ExtendedString Text = aText;
|
||||||
if(IsDiamSymbol)
|
if(IsDiamSymbol)
|
||||||
Text = TCollection_ExtendedString("\330 ") + Text;// => \330 | \370?
|
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
|
// Add presentation of arrow
|
||||||
gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ());
|
gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ());
|
||||||
|
@ -71,7 +71,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
|
|||||||
// value
|
// value
|
||||||
TCollection_ExtendedString Text(IsMaxRadius? "a = " : "b = ");
|
TCollection_ExtendedString Text(IsMaxRadius? "a = " : "b = ");
|
||||||
Text += aText;
|
Text += aText;
|
||||||
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, aPosition );
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), Text, aPosition);
|
||||||
|
|
||||||
// arrows
|
// arrows
|
||||||
gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow));
|
gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow));
|
||||||
|
@ -112,7 +112,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
TCollection_ExtendedString aText("==");
|
TCollection_ExtendedString aText("==");
|
||||||
|
|
||||||
//Draw the text
|
//Draw the text
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(), aText, aTextPos);
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation),LA->TextAspect(), aText, aTextPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,6 +91,6 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Draw the text
|
//Draw the text
|
||||||
Prs3d_Text::Draw(aPresentation, LA->TextAspect(),aText, aTextPos);
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aTextPos);
|
||||||
//ota === end ===
|
//ota === end ===
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// Drawing the text
|
// 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
|
// Add presentation of arrows
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs );
|
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs );
|
||||||
|
@ -60,7 +60,7 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
|
||||||
|
|
||||||
// texte
|
// 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);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// 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);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// texte
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, aPntOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// jfa 16/10/2000
|
// jfa 16/10/2000
|
||||||
@ -193,7 +193,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// 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
|
// jfa 16/10/2000 end
|
||||||
|
|
||||||
@ -238,6 +238,6 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// 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
|
// jfa 10/10/2000 end
|
||||||
|
@ -91,18 +91,18 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
|
|
||||||
// arrow 1 : 2nd group
|
// 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::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// arrow 2 : 3rd group
|
// 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);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
|
||||||
// text : 4th group
|
// 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)->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 );
|
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
|
||||||
|
|
||||||
// Drawing the text
|
// 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
|
// Line from AttachmentPoint1 to end of Arrow1
|
||||||
aPrims->AddVertex(AttachmentPoint1);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
@ -258,7 +258,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// text
|
// 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
|
// symbols at the extremities of the face
|
||||||
DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
|
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 );
|
DsgPrs::ComputeSymbol( aPresentation, LA, AttachmentPoint1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
|
||||||
|
|
||||||
// Drawing the text
|
// 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
|
// Two curves from end of Arrow2 to AttachmentPoint2
|
||||||
Standard_Real Alpha, delta;
|
Standard_Real Alpha, delta;
|
||||||
@ -375,21 +375,21 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs,
|
|||||||
switch(ArrowPrs)
|
switch(ArrowPrs)
|
||||||
{
|
{
|
||||||
case DsgPrs_AS_LASTAR:
|
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()->Angle(),
|
||||||
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
||||||
break;
|
break;
|
||||||
case DsgPrs_AS_FIRSTAR:
|
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()->Angle(),
|
||||||
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
||||||
break;
|
break;
|
||||||
case DsgPrs_AS_BOTHAR:
|
case DsgPrs_AS_BOTHAR:
|
||||||
V = gp_Vec(Pt1,Pt2);
|
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()->Angle(),
|
||||||
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
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()->Angle(),
|
||||||
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
aDrawer->DimensionAspect()->ArrowAspect()->Length());
|
||||||
break;
|
break;
|
||||||
|
@ -80,7 +80,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
|
|
||||||
// texte
|
// texte
|
||||||
TCollection_ExtendedString aText(" (+)");
|
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 ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
@ -152,7 +152,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
|
|
||||||
// texte
|
// texte
|
||||||
TCollection_ExtendedString aText (" (+)");
|
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 ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
@ -226,7 +226,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
|
|
||||||
// texte
|
// texte
|
||||||
TCollection_ExtendedString aText (" (+)");
|
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 ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
@ -302,7 +302,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
|
|
||||||
// texte
|
// texte
|
||||||
TCollection_ExtendedString aText (" (+)");
|
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 ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
|
@ -98,8 +98,8 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
|
|
||||||
if (DimNulle)
|
if (DimNulle)
|
||||||
{
|
{
|
||||||
Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction(),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(aPresentation,offp,L4.Direction().Reversed(),LA->ArrowAspect()->Angle(),LA->ArrowAspect()->Length());
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), offp, L4.Direction().Reversed(), LA->ArrowAspect()->Angle(), LA->ArrowAspect()->Length());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -110,7 +110,7 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
|
|
||||||
// fleche 1 : 2eme groupe
|
// 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::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
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);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
|
||||||
// texte : 4eme groupe
|
// 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);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
@ -87,18 +87,18 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
|
|
||||||
// arrow 1 : 2nd group
|
// 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::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// arrow 2 : 3rd group
|
// 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);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
|
||||||
// text : 4th group
|
// 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)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// text
|
// text
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (aPresentation), LA->TextAspect(), aText, offp);
|
||||||
|
|
||||||
//arrows
|
//arrows
|
||||||
DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
|
DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
|
||||||
|
@ -121,10 +121,10 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
|
|
||||||
// fleche
|
// 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
|
// 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);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// text
|
// 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 );
|
gp_Dir ArrowDir = gce_MakeDir( LineOrigin , LineEnd );
|
||||||
if (reverseArrow)
|
if (reverseArrow)
|
||||||
|
@ -257,5 +257,5 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
|
|||||||
aPrims->AddVertex(pt2);
|
aPrims->AddVertex(pt2);
|
||||||
Prs3d_Root::CurrentGroup(prs)->AddPrimitiveArray(aPrims);
|
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);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ void DsgPrs_SymbPresentation::Add (const Handle(Prs3d_Presentation)& aPresentati
|
|||||||
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
|
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
|
||||||
Handle(Prs3d_TextAspect) TA = LA->TextAspect();
|
Handle(Prs3d_TextAspect) TA = LA->TextAspect();
|
||||||
TA->SetColor(Quantity_NOC_GREEN);
|
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
|
// 2eme groupe : marker
|
||||||
Handle(Geom_CartesianPoint) theP = new Geom_CartesianPoint(OffsetPoint);
|
Handle(Geom_CartesianPoint) theP = new Geom_CartesianPoint(OffsetPoint);
|
||||||
|
@ -334,10 +334,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
if (outside) arrdir.Reverse();
|
if (outside) arrdir.Reverse();
|
||||||
// arrow 1 ----
|
// 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 ----
|
// 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 |
|
//| SYMBOL OF SYMMETRY |
|
||||||
@ -581,10 +581,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
if (outside) arrdir.Reverse();
|
if (outside) arrdir.Reverse();
|
||||||
// arrow 1 ----
|
// 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 ----
|
// 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 |
|
//| SYMBOL OF SYMMETRY |
|
||||||
@ -797,10 +797,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
if (outside) arrdir.Reverse();
|
if (outside) arrdir.Reverse();
|
||||||
// arrow 1 ----
|
// 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 ----
|
// 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 ================
|
//==== POINTS ================
|
||||||
//Marker of localization of attachment points:
|
//Marker of localization of attachment points:
|
||||||
|
@ -62,10 +62,10 @@ void DsgPrs_TangentPresentation::Add (const Handle(Prs3d_Presentation)& aPresent
|
|||||||
// fleche 1 :
|
// fleche 1 :
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
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
|
// fleche 2
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
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());
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ void DsgPrs_XYZAxisPresentation::Add(
|
|||||||
aPrims->AddVertex(aPlast);
|
aPrims->AddVertex(aPlast);
|
||||||
G->AddPrimitiveArray(aPrims);
|
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());
|
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
|
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->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
G->SetPrimitivesAspect( anArrowAspect->Aspect() );
|
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());
|
G->SetPrimitivesAspect(aTextAspect->Aspect());
|
||||||
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
|
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
|
||||||
|
@ -37,7 +37,6 @@ Prs3d_PresentationShadow.cxx
|
|||||||
Prs3d_PresentationShadow.hxx
|
Prs3d_PresentationShadow.hxx
|
||||||
Prs3d_Projector.cxx
|
Prs3d_Projector.cxx
|
||||||
Prs3d_Projector.hxx
|
Prs3d_Projector.hxx
|
||||||
Prs3d_Root.cxx
|
|
||||||
Prs3d_Root.hxx
|
Prs3d_Root.hxx
|
||||||
Prs3d_ShadingAspect.cxx
|
Prs3d_ShadingAspect.cxx
|
||||||
Prs3d_ShadingAspect.hxx
|
Prs3d_ShadingAspect.hxx
|
||||||
|
@ -12,20 +12,20 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#include <Prs3d_Arrow.hxx>
|
||||||
|
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_ArrayOfSegments.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
|
||||||
#include <Prs3d_Presentation.hxx>
|
#include <Prs3d_Presentation.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Draw
|
//function : Draw
|
||||||
//purpose :
|
//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_Pnt& aLocation,
|
||||||
const gp_Dir& aDirection,
|
const gp_Dir& aDirection,
|
||||||
const Quantity_PlaneAngle anAngle,
|
const Quantity_PlaneAngle anAngle,
|
||||||
@ -82,19 +82,6 @@ void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
aPrims2->AddVertex(p1);
|
aPrims2->AddVertex(p1);
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims1);
|
theGroup->AddPrimitiveArray (aPrims1);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims2);
|
theGroup->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*/)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
@ -17,66 +17,44 @@
|
|||||||
#ifndef _Prs3d_Arrow_HeaderFile
|
#ifndef _Prs3d_Arrow_HeaderFile
|
||||||
#define _Prs3d_Arrow_HeaderFile
|
#define _Prs3d_Arrow_HeaderFile
|
||||||
|
|
||||||
#include <Standard.hxx>
|
|
||||||
#include <Standard_DefineAlloc.hxx>
|
|
||||||
#include <Standard_Handle.hxx>
|
|
||||||
|
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Quantity_PlaneAngle.hxx>
|
#include <Quantity_PlaneAngle.hxx>
|
||||||
#include <Quantity_Length.hxx>
|
#include <Quantity_Length.hxx>
|
||||||
class Prs3d_Presentation;
|
|
||||||
class gp_Pnt;
|
class gp_Pnt;
|
||||||
class gp_Dir;
|
class gp_Dir;
|
||||||
|
|
||||||
|
//! Provides class methods to draw an arrow at a given location, along a given direction and using a given angle.
|
||||||
//! provides class methods to draw an arrow at a given
|
class Prs3d_Arrow : public Prs3d_Root
|
||||||
//! location, along a given direction and using a given
|
|
||||||
//! angle.
|
|
||||||
class Prs3d_Arrow : public Prs3d_Root
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DEFINE_STANDARD_ALLOC
|
DEFINE_STANDARD_ALLOC
|
||||||
|
|
||||||
|
//! Defines the representation of the arrow.
|
||||||
//! Defines the representation of the arrow defined by
|
//! Note that this method does NOT assign any presentation aspects to the primitives group!
|
||||||
//! the location point aLocation, the direction
|
//! @param theGroup presentation group to add primitives
|
||||||
//! aDirection and the length aLength.
|
//! @param theLocation location of the arrow tip
|
||||||
//! The angle anAngle defines the angle of opening of the arrow head.
|
//! @param theDirection direction of the arrow
|
||||||
//! The presentation object aPresentation stores the
|
//! @param theAngle angle of opening of the arrow head
|
||||||
//! information defined in this framework.
|
//! @param theLength length of the arrow (from the tip)
|
||||||
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);
|
Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup,
|
||||||
|
const gp_Pnt& theLocation,
|
||||||
//! Defines the representation of the arrow defined by
|
const gp_Dir& theDirection,
|
||||||
//! the location point aLocation, the direction vector
|
const Quantity_PlaneAngle theAngle,
|
||||||
//! aDirection and the length aLength.
|
const Quantity_Length theLength);
|
||||||
//! 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:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//! 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
|
#endif // _Prs3d_Arrow_HeaderFile
|
||||||
|
@ -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 <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();
|
|
||||||
}
|
|
@ -17,55 +17,33 @@
|
|||||||
#ifndef _Prs3d_Root_HeaderFile
|
#ifndef _Prs3d_Root_HeaderFile
|
||||||
#define _Prs3d_Root_HeaderFile
|
#define _Prs3d_Root_HeaderFile
|
||||||
|
|
||||||
|
#include <Graphic3d_Group.hxx>
|
||||||
|
#include <Prs3d_Presentation.hxx>
|
||||||
#include <Standard.hxx>
|
#include <Standard.hxx>
|
||||||
#include <Standard_DefineAlloc.hxx>
|
#include <Standard_DefineAlloc.hxx>
|
||||||
#include <Standard_Handle.hxx>
|
#include <Standard_Handle.hxx>
|
||||||
|
|
||||||
class Graphic3d_Group;
|
//! A root class for the standard presentation algorithms of the StdPrs package.
|
||||||
class Prs3d_Presentation;
|
|
||||||
|
|
||||||
|
|
||||||
//! A root class for the standard presentation algorithms
|
|
||||||
//! of the StdPrs package.
|
|
||||||
class Prs3d_Root
|
class Prs3d_Root
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DEFINE_STANDARD_ALLOC
|
DEFINE_STANDARD_ALLOC
|
||||||
|
|
||||||
|
//! Returns the current (last created) group of primititves inside graphic objects in the display.
|
||||||
//! 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.
|
|
||||||
//! A group also contains the attributes whose ranges are limited to the primitives in it.
|
//! 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);
|
static Handle(Graphic3d_Group) CurrentGroup (const Handle(Prs3d_Presentation)& thePrs3d)
|
||||||
|
{
|
||||||
|
return thePrs3d->CurrentGroup();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//! 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
|
#endif // _Prs3d_Root_HeaderFile
|
||||||
|
@ -14,69 +14,56 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#include <Prs3d_Text.hxx>
|
||||||
|
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
#include <Graphic3d_Vertex.hxx>
|
||||||
#include <Prs3d_Presentation.hxx>
|
#include <Prs3d_Presentation.hxx>
|
||||||
#include <Prs3d_Text.hxx>
|
|
||||||
#include <Prs3d_TextAspect.hxx>
|
#include <Prs3d_TextAspect.hxx>
|
||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <TCollection_ExtendedString.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);
|
|
||||||
|
|
||||||
|
|
||||||
// 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
|
// function : Draw
|
||||||
// purpose :
|
// 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 Handle(Prs3d_TextAspect)& theAspect,
|
||||||
const TCollection_ExtendedString& theText,
|
const TCollection_ExtendedString& theText,
|
||||||
const gp_Ax2& theOrientation,
|
const gp_Ax2& theOrientation,
|
||||||
const Standard_Boolean theHasOwnAnchor)
|
const Standard_Boolean theHasOwnAnchor)
|
||||||
{
|
{
|
||||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (theAspect->Aspect());
|
theGroup->SetPrimitivesAspect (theAspect->Aspect());
|
||||||
Prs3d_Root::CurrentGroup (thePresentation)->Text (theText,
|
theGroup->Text (theText,
|
||||||
theOrientation,
|
theOrientation,
|
||||||
theAspect->Height(),
|
theAspect->Height(),
|
||||||
theAspect->Angle(),
|
theAspect->Angle(),
|
||||||
theAspect->Orientation(),
|
theAspect->Orientation(),
|
||||||
theAspect->HorizontalJustification(),
|
theAspect->HorizontalJustification(),
|
||||||
theAspect->VerticalJustification(),
|
theAspect->VerticalJustification(),
|
||||||
Standard_True,
|
Standard_True,
|
||||||
theHasOwnAnchor);
|
theHasOwnAnchor);
|
||||||
}
|
}
|
||||||
|
@ -17,79 +17,77 @@
|
|||||||
#ifndef _Prs3d_Text_HeaderFile
|
#ifndef _Prs3d_Text_HeaderFile
|
||||||
#define _Prs3d_Text_HeaderFile
|
#define _Prs3d_Text_HeaderFile
|
||||||
|
|
||||||
#include <Standard.hxx>
|
|
||||||
#include <Standard_DefineAlloc.hxx>
|
|
||||||
#include <Standard_Handle.hxx>
|
|
||||||
|
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <Prs3d_TextAspect.hxx>
|
#include <Prs3d_TextAspect.hxx>
|
||||||
|
|
||||||
#include <gp_Ax2.hxx>
|
#include <gp_Ax2.hxx>
|
||||||
|
|
||||||
class Prs3d_Presentation;
|
|
||||||
class TCollection_ExtendedString;
|
class TCollection_ExtendedString;
|
||||||
class gp_Pnt;
|
class gp_Pnt;
|
||||||
|
|
||||||
//! A framework to define the display of texts.
|
//! A framework to define the display of texts.
|
||||||
class Prs3d_Text : public Prs3d_Root
|
class Prs3d_Text : public Prs3d_Root
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DEFINE_STANDARD_ALLOC
|
DEFINE_STANDARD_ALLOC
|
||||||
|
|
||||||
|
//! Defines the display of the text.
|
||||||
//! Defines the display of the text aText at the point AttachmentPoint.
|
//! @param theGroup group to add primitives
|
||||||
//! The drawer aDrawer specifies the display attributes which texts will have.
|
//! @param theAspect presentation attributes
|
||||||
//! The presentation object aPresentation stores the
|
//! @param theText text to draw
|
||||||
//! information defined in this framework.
|
//! @param theAttachmentPoint attachment point
|
||||||
//! static void Draw (const Handle(Prs3d_Presentation)&
|
Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup,
|
||||||
//! aPresentation, const Handle(Prs3d_TextAspect)&
|
const Handle(Prs3d_TextAspect)& theAspect,
|
||||||
//! anAspect, const TCollection_ExtendedString& aText,
|
const TCollection_ExtendedString& theText,
|
||||||
//! const gp_Pnt& AttachmentPoint);
|
const gp_Pnt& theAttachmentPoint);
|
||||||
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
|
//! Draws the text label.
|
||||||
//! specified in the model 3D space through theOrientation argument.
|
//! @param theGroup group to add primitives
|
||||||
Standard_EXPORT static void Draw (const Handle(Prs3d_Presentation)& thePresentation,
|
//! @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 Handle(Prs3d_TextAspect)& theAspect,
|
||||||
const TCollection_ExtendedString& theText,
|
const TCollection_ExtendedString& theText,
|
||||||
const gp_Ax2& theOrientation,
|
const gp_Ax2& theOrientation,
|
||||||
const Standard_Boolean theHasOwnAnchor = Standard_True);
|
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
|
#endif // _Prs3d_Text_HeaderFile
|
||||||
|
@ -5222,7 +5222,7 @@ public:
|
|||||||
// create separate group for text elements
|
// create separate group for text elements
|
||||||
Handle(Graphic3d_Group) aTextGroup = Prs3d_Root::NewGroup (thePresentation);
|
Handle(Graphic3d_Group) aTextGroup = Prs3d_Root::NewGroup (thePresentation);
|
||||||
TCollection_ExtendedString aString ("YOU SHOULD SEE THIS TEXT", Standard_True);
|
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*/,
|
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& /*theSelection*/,
|
||||||
|
@ -232,7 +232,7 @@ void StdPrs_Curve::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
gp_Pnt Location;
|
gp_Pnt Location;
|
||||||
gp_Vec Direction;
|
gp_Vec Direction;
|
||||||
aCurve.D1(aCurve.LastParameter(),Location,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()->Angle(),
|
||||||
aDrawer->ArrowAspect()->Length());
|
aDrawer->ArrowAspect()->Length());
|
||||||
}
|
}
|
||||||
@ -298,7 +298,7 @@ void StdPrs_Curve::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
gp_Pnt Location;
|
gp_Pnt Location;
|
||||||
gp_Vec Direction;
|
gp_Vec Direction;
|
||||||
aCurve.D1(aCurve.LastParameter(),Location,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()->Angle(),
|
||||||
aDrawer->ArrowAspect()->Length());
|
aDrawer->ArrowAspect()->Length());
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati
|
|||||||
gp_Pnt Location;
|
gp_Pnt Location;
|
||||||
gp_Vec Direction;
|
gp_Vec Direction;
|
||||||
aCurve.D1(V2, Location,Direction);
|
aCurve.D1(V2, Location,Direction);
|
||||||
Prs3d_Arrow::Draw (aPresentation,
|
Prs3d_Arrow::Draw (aGroup,
|
||||||
Location,
|
Location,
|
||||||
gp_Dir(Direction),
|
gp_Dir(Direction),
|
||||||
aDrawer->ArrowAspect()->Angle(),
|
aDrawer->ArrowAspect()->Angle(),
|
||||||
@ -355,7 +355,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati
|
|||||||
gp_Pnt Location;
|
gp_Pnt Location;
|
||||||
gp_Vec Direction;
|
gp_Vec Direction;
|
||||||
aCurve.D1(V2, Location,Direction);
|
aCurve.D1(V2, Location,Direction);
|
||||||
Prs3d_Arrow::Draw (aPresentation,
|
Prs3d_Arrow::Draw (aGroup,
|
||||||
Location,
|
Location,
|
||||||
gp_Dir(Direction),
|
gp_Dir(Direction),
|
||||||
aDrawer->ArrowAspect()->Angle(),
|
aDrawer->ArrowAspect()->Angle(),
|
||||||
|
@ -96,7 +96,7 @@ void StdPrs_Plane::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
aPrims->AddVertex(loc);
|
aPrims->AddVertex(loc);
|
||||||
aPrims->AddVertex(p1);
|
aPrims->AddVertex(p1);
|
||||||
TheGroup->AddPrimitiveArray(aPrims);
|
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()) {
|
if (theaspect->DisplayEdgesArrows()) {
|
||||||
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(8);
|
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);
|
p1 = loc.Translated(trans);
|
||||||
aPrims->AddVertex(loc);
|
aPrims->AddVertex(loc);
|
||||||
aPrims->AddVertex(p1);
|
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);
|
thegeom->D0(-Xmax,Ymax,loc);
|
||||||
p1 = loc.Translated(trans);
|
p1 = loc.Translated(trans);
|
||||||
aPrims->AddVertex(loc);
|
aPrims->AddVertex(loc);
|
||||||
aPrims->AddVertex(p1);
|
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);
|
thegeom->D0(Xmax,Ymax,loc);
|
||||||
p1 = loc.Translated(trans);
|
p1 = loc.Translated(trans);
|
||||||
aPrims->AddVertex(loc);
|
aPrims->AddVertex(loc);
|
||||||
aPrims->AddVertex(p1);
|
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);
|
thegeom->D0(Xmax,-Ymax,loc);
|
||||||
p1 = loc.Translated(trans);
|
p1 = loc.Translated(trans);
|
||||||
aPrims->AddVertex(loc);
|
aPrims->AddVertex(loc);
|
||||||
aPrims->AddVertex(p1);
|
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);
|
TheGroup->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ void StdPrs_PoleCurve::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
gp_Pnt Location;
|
gp_Pnt Location;
|
||||||
gp_Vec Direction;
|
gp_Vec Direction;
|
||||||
aCurve.D1(aCurve.LastParameter(),Location,Direction);
|
aCurve.D1(aCurve.LastParameter(),Location,Direction);
|
||||||
Prs3d_Arrow::Draw (aPresentation,
|
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation),
|
||||||
Location,
|
Location,
|
||||||
gp_Dir(Direction),
|
gp_Dir(Direction),
|
||||||
aDrawer->ArrowAspect()->Angle(),
|
aDrawer->ArrowAspect()->Angle(),
|
||||||
|
@ -77,7 +77,7 @@ static void DisplayText (const TDF_Label& aLabel,
|
|||||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||||
aBox.Get (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));
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user