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

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / Visual3D_Layer DrawText problem

Visual3D_Layer DrawText problem

Visual3D_Layer DrawText problem
Marco Balen 2013/05/09 15:20
I am converting an app from OCC6.3 to OCC6.6.
I have recompiled all the OCC sources and my app with VS2010 using the msvc.bat file provided.
I have a compilation problem using the DrawText method of the Visual3D_Layer class.
When I try to use the original code
myLayer->DrawText("any text",anyX,anyY,anyH);
I get a compiler error the tell me that there is no method "DrawText" for that class.

In the methods list I can see an "DrawTextA" method; Using this method I can compile the source code but I get a linker error that reports that there is no DrawtextA method fro the class Visual3D_Layer.

Introducing a remark to this line the app can be linked and seem works correctly. (without the text)

I am compiling my code with MultiByte option.

Have anyone a suggestion ?

François Lauzon 2013/05/09 15:26
Hello Marco,
for me the method DrawText has always work, no compiler error, I currently use OCC Release 6.5.4.

Marco Balen 2013/05/09 15:33
Also for me it works in OCC6.3.0 and VC2010.
I think I have a problem when building the OCC library.
It seem that the method exported in the tkv3d.lib uses a wrong type of character code (unicode,multibyte, undefined ?).
I am building my app with MFC,without ATL,in multibyte, and you ?
François Lauzon 2013/05/09 15:36
We are using the supplied vcproj file without any modification and have been compiling on VC2005 and VC2008, in 32 and 64 bits, on Windows XP and 7.
Marco Balen 2013/05/09 17:17
Have anyone used the OCC6.6.0 with VS2010 ?     
Thorsten 2013/11/22 17:38

I am getting the same linker error using DrawTextW. I managed it by using the graphic drivers "Text" Method.

Somewhere you created your V3D_Viewer like this:
Handle(Graphic3d_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver ("TKOpenGl");
aGraphicDriver->Begin (new Aspect_DisplayConnection());
TCollection_ExtendedString aNameOfViewer ("Visu3D");
Handle(V3d_Viewer) aViewer = new V3d_Viewer(
aGraphicDriver, aName, aDomain, ViewSize, ViewProj,
ComputedMode, aDefaultComputedMode, V3d_TEX_NONE);

Now you can call the graphic drivers Text Method directly:
aViewer->Driver()->Text("Hello World!", 100, 100, 20);
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