Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

problem with ISession_Text

problem with ISession_Text
thierry MAIRE 2003/09/25 15:36
Hi,

I have problems with ISession_Text class in a V3d_Viewer. I cannot :
- change color
- modify type of alignment
- change scale, width, height ...

Every change has no effect !!!
Thank you for answer.
Jendrik Seiler 2013/04/23 10:23
In case anyone stumbles across this thread in the future with the same problem: I was able to fix the color changing by adding the following line to the ISession_Text.cpp file:

void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
myDrawer->TextAspect()->SetColor(this->myOwnColor); // This one
Prs3d_Text::Draw(aPresentation,myDrawer,MyText,gp_Pnt( MyX ,MyY,MyZ ));
}

I had to include the following files as well

#include <AIS_Drawer.hxx>
#include "Prs3d_TextAspect.hxx"

but now it works just fine.
Jendrik Seiler 2013/09/17 11:35
I added a few more lines of code:

myDrawer->TextAspect()->SetColor(this->myOwnColor); // color does not change otherwise
if(this->MyScale != 0) { myDrawer->TextAspect()->SetHeight(this->MyScale); } // size does not change otherwise
myDrawer->TextAspect()->SetFont("Rock"); // size resets font

Possible font types are "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Courier", "ZapfChancery-MediumItalic", "Rock", "Symbol", "Iris" and "ZapfDingbats"

Also, any time the ISession_Text is removed and redisplayed in the viewer I have to call the Redisplay() function or the properties reset.

Hope this helps someone at some point.
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map