Font_TextFormatter inherits Standard_Transient, now it is given as a handle in functions.
Graphic3d_Text - extended with Font_TextFormatter to be able to have it filled out of text render. If it is not defined here, the default text formatter of context is used.
OpenGl_Context - has default Font_TextFormatter for rendering OpenGl_Text.
# Conflicts:
# src/Font/Font_TextFormatter.cxx
# src/Font/Font_TextFormatter.hxx
# src/Graphic3d/Graphic3d_Text.hxx
# src/OpenGl/OpenGl_Context.cxx
# src/OpenGl/OpenGl_Text.cxx
# src/OpenGl/OpenGl_TextBuilder.cxx
# src/StdPrs/StdPrs_BRepTextBuilder.cxx
#define Font_BRepTextBuilder_Header
#include <StdPrs_BRepTextBuilder.hxx>
+class Font_TextFormatter;
+
//! Alias for porting from old name.
typedef StdPrs_BRepTextBuilder Font_BRepTextBuilder;
#include <Graphic3d_TransformUtils.hxx>
#include <Graphic3d_RenderingParams.hxx>
#include <Image_SupportedFormats.hxx>
+#include <Font_TextFormatter.hxx>
#include <Message_Messenger.hxx>
#include <NCollection_Vector.hxx>
#include <Standard_ProgramError.hxx>
memset (myFuncs.operator->(), 0, sizeof(OpenGl_GlFunctions));
myShaderManager = new OpenGl_ShaderManager (this);
+
+ myDefaultFormatter = new Font_TextFormatter();
}
// =======================================================================
typedef OpenGl_TmplCore45<OpenGl_GlCore44Back> OpenGl_GlCore45Back;
typedef OpenGl_TmplCore45<OpenGl_GlCore44> OpenGl_GlCore45;
+class Font_TextFormatter;
class Graphic3d_Camera;
class Graphic3d_PresentationAttributes;
class OpenGl_Aspects;
//! @return tool for management of shader programs within this context.
inline const Handle(OpenGl_ShaderManager)& ShaderManager() const { return myShaderManager; }
+ //! @return default formatter of text withing this context
+ inline const Handle(Font_TextFormatter)& DefaultTextFormatter() const { return myDefaultFormatter; }
+
public:
//! Either GL_CLAMP_TO_EDGE (1.2+) or GL_CLAMP (1.1).
Graphic3d_TextureUnit myPBRSpecIBLMapTexUnit; //!< samplerCube occSpecIBLMap, texture unit where specular IBL map is expected to be binded (0 if PBR is not supported)
Handle(OpenGl_ShaderManager) myShaderManager; //! support object for managing shader programs
+ Handle(Font_TextFormatter) myDefaultFormatter;//!< default text formatter, an alternative to text params
private: //! @name fields tracking current state
Handle(Font_TextFormatter) aFormatter = myText->TextFormatter();
if (aFormatter.IsNull())
{
- aFormatter = new Font_TextFormatter();
+ aFormatter = theCtx->DefaultTextFormatter();
}
aFormatter->SetupAlignment (myText->HorizontalAlignment(), myText->VerticalAlignment());
aFormatter->Reset();