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

0030857: Visualization - using one implementation of Text in graphic group

Graphic3d_Group::Text(...) are obsolete, AddText() should be used instead of these methods.
Graphic3d_Text is a new class for parameters necessary to fill OpenGl_Text. All parameters of Graphic3d_Group::Text() are moved into this class.

OpenGl_TextParam is removed, these fields were moved into Graphic3d_Text.
OpenGl_Text constructors/Init with OpenGl_TextParam parameter were removed. Constructor with Graphic3d_Text should be used instead of it.
Using OpenGl_Text Init() with OpenGl_TextParam should be now replaced on two cases. The first case is setting values into Graphic3d_Text and the second case is calling Reset() after. As example, look at modification in OpenGl_FrameStatsPrs.
This commit is contained in:
nds
2019-08-23 14:28:04 +03:00
committed by apn
parent 077a220c51
commit 8ed0708507
21 changed files with 608 additions and 490 deletions

View File

@@ -19,6 +19,7 @@
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_Text.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
@@ -36,7 +37,7 @@ void DsgPrs_XYZAxisPresentation::Add(
const Handle(Prs3d_LineAspect)& aLineAspect,
const gp_Dir & aDir,
const Standard_Real aVal,
const Standard_CString aText,
const Standard_CString theText,
const gp_Pnt& aPfirst,
const gp_Pnt& aPlast)
{
@@ -50,10 +51,12 @@ void DsgPrs_XYZAxisPresentation::Add(
Prs3d_Arrow::Draw (Prs3d_Root::CurrentGroup (aPresentation), aPlast,aDir, M_PI/180.*10., aVal/10.);
if (*aText != '\0')
if (*theText != '\0')
{
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
Handle(Graphic3d_Text) aText = new Graphic3d_Text (1.0f/81.0f);
aText->SetText (theText);
aText->SetPosition (aPlast);
Prs3d_Root::CurrentGroup(aPresentation)->AddText (aText);
}
}
@@ -64,7 +67,7 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
const Handle(Prs3d_TextAspect)& aTextAspect,
const gp_Dir & aDir,
const Standard_Real aVal,
const Standard_CString aText,
const Standard_CString theText,
const gp_Pnt& aPfirst,
const gp_Pnt& aPlast)
{
@@ -81,9 +84,11 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
G->SetPrimitivesAspect(aTextAspect->Aspect());
if (*aText != '\0')
if (*theText != '\0')
{
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
Handle(Graphic3d_Text) aText = new Graphic3d_Text (1.0f/81.0f);
aText->SetText (theText);
aText->SetPosition (aPlast);
Prs3d_Root::CurrentGroup(aPresentation)->AddText(aText);
}
}