1 #include "SceneTextScreen.hh"
3 #ifdef BIAS_HAVE_OPENGL
4 # include <Gui/biasgl.h>
6 # include <OpenGL/glu.h>
10 # include <Utils/StatekeeperGL.hh>
18 SceneTextScreen::SceneTextScreen(
bool MakeDemoText): isInitialized_(false) {
25 fontName_ =
"-*-helvetica-bold-r-normal--12-*-*-*-p-*-iso8859-1";
29 #ifdef BIAS_HAVE_FONTGL
36 BIASWARNONCE(
"windows font selection mechanism not yet implmented here.");
39 #ifdef BIAS_HAVE_OPENGL
42 #ifdef BIAS_HAVE_FONTGL
44 cerr<<
"init of font failed ..."<<endl;
48 BIASWARNONCE(
"FontGL is disabled in BIAS.");
55 #ifdef BIAS_HAVE_FONTGL
61 glColor3f(0.0, 0.0, 1.0);
77 double& Version)
const {
78 TopLevelTag =
"SceneTextScreen";
85 xmlNodePtr childNode = XMLObject.
addChildNode(mainNode,
"Text");
106 while (!(childNode==NULL)) {
124 cout<<
"Found "<<theContent<<
" at "<<theposition<<
" with color "
134 #endif // BIAS_HAVE_XML2
void addAttribute(const xmlNodePtr Node, const std::string &AttributeName, bool AttributeValue)
Add an attribute to a node.
virtual int XMLOut(const xmlNodePtr Node, BIAS::XMLIO &XMLObject) const
specialization of XML write function
xmlNodePtr getNextChild()
Get the next child of the parent specified in the last getFirstChild() call, the class remembers the ...
virtual void Draw()
To do anything usefull, overload this method, assume context is ready and draw.
virtual int XMLGetClassName(std::string &TopLevelTag, double &Version) const
specialization of XML block name function
int InitFont(void *handleDC, const std::string theFontname=std::string(DrawTextGL_DEFAULT_FONTNAME), const int fontHeight=DrawTextGL_DEFAULT_FONTSIZE)
set the font up
virtual int XMLIn(const xmlNodePtr Node, BIAS::XMLIO &XMLObject)
specialization of XML read function
void addContent(const xmlNodePtr Node, const std::string &Content)
Add content to a node.
BIAS::Vector3< float > RGBf
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
xmlNodePtr addChildNode(const xmlNodePtr ParentNode, const std::string &NewNodeName)
Add a child node to an incoming node with the given name.
std::vector< BIAS::RGBf > textColors_
std::vector< std::string > textContents_
xmlNodePtr getFirstChild(const xmlNodePtr ParentNode)
Get the first child of a given parent, or NULL for no childs.
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
void DeleteFont()
frees the display lists JW
double getAttributeValueDouble(const xmlAttrPtr Attribute) const
std::vector< BIAS::HomgPoint3D > textPositions_
std::string getNodeName(const xmlNodePtr Node) const
Get the name of a given Node.
std::string getNodeContentString(const xmlNodePtr Node) const
Get the content of a given Node.
class BIASGeometryBase_EXPORT HomgPoint3D
void PrintWinCoords(const std::string &text, const int &xpos, const int &ypos, const int &winWidthFallback=640, const int &winHeightFallback=480) const
print text on OpenGL screen at 2D pos (xpos,ypos) in windows (pixel) coordiantes. ...