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

Problems with SMESH_MeshVSLink

Braunstein's picture
Forums: 

Hello,

I want to include the SMESH_MeshVSLink into my Visual Studio Project.

#include

But the compiler throws an error:

error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall MeshVS_DataMapOfHArray1OfSequenceOfInteger::MeshVS_DataMapOfHArray1OfSequenceOfInteger(int)" (??0MeshVS_DataMapOfHArray1OfSequenceOfInteger@@QAE@H@Z)" in Funktion ""public: void __thiscall MeshVS_DataMapOfHArray1OfSequenceOfInteger::`default constructor closure'(void)" (??_FMeshVS_DataMapOfHArray1OfSequenceOfInteger@@QAEXXZ)".

I did nothing with the class SMESH_MeshVSLink. I just want to import.
I cant find the failure. Has anybody an idea???

Thanks.

Patrik Mueller's picture

Hi,

have you linked "TKMeshVS.lib" to your project?

Greets,

Patrik

Braunstein's picture

Hi Patrik,

thank you for answering so quickly.
I was hoping that this was the fault, but unfortunately not :-( I have linked the folder (c:\opencascade6.3.0\ros\win32\lib) where the file "TKMeshVS.lib" is.

Greets, Alex

Fotis Sioutis's picture

Hi Braunstein,

This is clearly a linking problem with TKMeshVS.lib -

Make sure that the library is linked, and also make sure that you have added the library in the right configuration , or mode in your IDE.

Fotis

Braunstein's picture

Indeed it was a linking problem. I only linked the folder where the TKMeshVS.lib file is stored, but i had to link the file explicitly. Anyway now it works, but i have another problem. I want to display a mesh in OCC and use the following code.

//DISPLAY MESH
Handle( SMESH_MeshVSLink ) aDS = new SMESH_MeshVSLink( aMesh );
Handle( MeshVS_Mesh ) aMeshVS = new MeshVS_Mesh(Standard_True);
Handle( MeshVS_MeshPrsBuilder ) aPrsBuilder = new MeshVS_MeshPrsBuilder(aMeshVS, MeshVS_DMF_OCCMask, aDS, 0, MeshVS_BP_Mesh);
aMeshVS->SetDataSource( aDS );
aMeshVS->AddBuilder( aPrsBuilder, Standard_True );
aMeshVS->GetDrawer()->SetMaterial( MeshVS_DA_FrontMaterial, Graphic3d_MaterialAspect(Graphic3d_NOM_GOLD) );
aMeshVS->SetDisplayMode(MeshVS_DMF_Shrink);
Handle( AIS_InteractiveContext ) aContext = GetAISContext();
aContext->Display( aMeshVS );
aContext->Deactivate( aMeshVS );
//
My compiler throws an error by compiling:
Handle( AIS_InteractiveContext ) aContext = GetAISContext();

The error message is: GetAISContext()->Identifier was not found.

Has anybody an idea?

Thanks!

Greets,Alex

Fotis Sioutis's picture

Braunstein,

You must replace GetAISContext() with your own Handle( AIS_InteractiveContext ) provider. I think you must first understand basics of OCC usage through the given samples and documentation, then create a skeleton application, and afterwards proceed with testing smesh.

Fotis

PS: it is always good to avoid double posting :)

Braunstein's picture

You are right ;) Can you recommend me a sample or tutorial where i can learn how to create a skeleton for displaying an object in OCC?
Thanks.

PS: I will avoid double posting :)

Fotis Sioutis's picture

Under folder /samples/standard/qt and or /samples/standard/mfc (check mfcsample plus the subfolder you are interested in ) you can find all you may need.Take your time and investigate the sources.

Good luck

Fotis

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.