For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Problem displaying text in Interactive Context

Hannes Kroeger's picture
Forums: 

Dear OCC experts,

I have ported some code to OCE 0.17 (OCC 6.8), Ubuntu 16,04 LTS from Debian Jessie and the according OCE version there. It used to work up to now.

The problem lies in some text output in a user derived AIS_InteractiveObject using Prs3d_Text::Draw using this code:

void InteractiveText::Compute (const Handle_PrsMgr_PresentationManager3d& /*pm*/,
                               const Handle_Prs3d_Presentation& pres,
                               const Standard_Integer mode)
{

 myDrawer->SetTextAspect (new Prs3d_TextAspect());

 TCollection_ExtendedString aTCoText(/*text_.c_str()*/"test123");
    Prs3d_Text::Draw (
      pres, 
      myDrawer,
      aTCoText,
      gp_Pnt (position_(0), position_(1), position_(2))
    );

}

Unfortunately, there is no text in the output but only vertical lines (see attached screenshot).

I have noted the same issue when e.g. creating a AIS_LinearDimension object,

What might be the reason? Any hints are welcome.

Regards, Hannes

Attachments: 
Benjamin Bihler's picture

Hi Hannes,

most probably your code is correct. I have found the same problem with OCC on my virtual Linux machine. But my text display code works perfectly on Windows. Since I have display problems with the Linux virtual computer anyway and the text display is not crucial for me, I didn't bother.

My System:

  • Windows 7 Professional 64 bit (Service Pack 1)
  • NVIDIA Quadro 4000
  • Virtual Machine: Oracle VM Virtual Box with Debian 7.1

Where did you face the display problem? Do you have any configuration where it works?

Benjamin

Hannes Kroeger's picture

Dear Benjamin,

thank you for reporting your observation.

I have noted the display problem after changing the linux distribution in use (Debian Jessie to Ubuntu 16.04). I always used the OCE libraries from the repositories, which also changed with the linux distribution.

Meanwhile I tried to vary the display driver: i used the Nvidia-Drivers 304 and 340 and the Xorg noveau-driver (I have an Nvidia graphics card). The problems occurs in all cases. So far, I have no working configuration in Ubuntu 16.04.

I suspect a problem with the font. Is there some font setup required? Maybe some environment variable to set?

Regards, Hannes

Benjamin Bihler's picture

I am not sure whether it is a configuration problem. If I display a lot of text (on the attached screenshot I am displaying numbers from 1 to 16), sometimes the display works and sometimes not. At least it seems to be deterministic (if I close and reopen the application and display the numbers again, then the numbers that are displayed correctly or displayed as vertical lines are the same).

...

I have done some tests in the meanwhile. It seems to be an OCE problem. When I link my application against OCCT (7.1.0 beta), then the problem is gone (see second screenshot). Do you have the possibility to switch to OCCT?

Forum supervisor's picture

Dear Hannes,

Please try your code using directly actual OCCT version.

If issue described by you is reproduced please register it in OCCT Mantis BugTracker available via the Collaborative portal - http://dev.opencascade.org/index.php?q=home/get_involved.

Best regards

FSR

Hannes Kroeger's picture

Dear Benjamin and FSR,

I proceeded to the most recent version of OCE (0.18, based on OCC6.9.1) and there the problem is gone as well.

Also, I had another problem with clipping of the 3D model which is fixed by this update as well.

Thanks for your effort,

Regards, Hannes

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.