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

updating from OCC 7.2 to 7.3 problems

Marco Balen's picture
Forums: 

Hi, 

I am trying to use the 7.3 version but I have a problem linking my application. I get unresolved methods for

AIS_InteractiveContext::Deactivate(), BRep_Tool::CurveOnSurface(),V3d_Viewer::SetLightOn(), Viewer::SetLightOff(), V3d_Light::SetColor().

I am updating from 7.2 to 73. reading the release notes I have noted that AIS_InteractiveContext::Deactivate() must be changed with a new method, but for the other methods I haven't seen any changes to be done.

I am using VS2015, but I have downloaded the VS2017 binary setup. Can It be the problem ?

Thanks,

Here below the linker messages

- error LNK2019: unresolved external symbol "public: void __cdecl AIS_InteractiveContext::Deactivate(class opencascade::handle<class AIS_InteractiveObject> const &)" (?Deactivate@AIS_InteractiveContext@@QEAAXAEBV?$handle@VAIS_InteractiveObject@@@opencascade@@@Z) referenced in function "public: void __cdecl CMachineConfigManager::UpdateGraphics(class opencascade::handle<class AIS_InteractiveContext>)" (?UpdateGraphics@CMachineConfigManager@@QEAAXV?$handle@VAIS_InteractiveContext@@@opencascade@@@Z)
- error LNK2019: unresolved external symbol "public: static class opencascade::handle<class Geom2d_Curve> __cdecl BRep_Tool::CurveOnSurface(class TopoDS_Edge const &,class TopoDS_Face const &,double &,double &)" (?CurveOnSurface@BRep_Tool@@SA?AV?$handle@VGeom2d_Curve@@@opencascade@@AEBVTopoDS_Edge@@AEBVTopoDS_Face@@AEAN2@Z) referenced in function "private: static class misc::mwAutoPointer<class mwCurve> __cdecl OCCConverter::ConvertToCurve2d(class TopoDS_Edge const &,class TopoDS_Face const &)" (?ConvertToCurve2d@OCCConverter@@CA?AV?$mwAutoPointer@VmwCurve@@@misc@@AEBVTopoDS_Edge@@AEBVTopoDS_Face@@@Z)
- error LNK2019: unresolved external symbol "public: void __cdecl V3d_Viewer::SetLightOn(class opencascade::handle<class V3d_Light> const &)" (?SetLightOn@V3d_Viewer@@QEAAXAEBV?$handle@VV3d_Light@@@opencascade@@@Z) referenced in function "protected: __cdecl CThinSimulatorDoc::CThinSimulatorDoc(void)" (??0CThinSimulatorDoc@@IEAA@XZ)
- error LNK2019: unresolved external symbol "public: void __cdecl V3d_Viewer::SetLightOff(class opencascade::handle<class V3d_Light> const &)" (?SetLightOff@V3d_Viewer@@QEAAXAEBV?$handle@VV3d_Light@@@opencascade@@@Z) referenced in function "public: void __cdecl CThinSimulatorDoc::ChangeAmbientLight(float)" (?ChangeAmbientLight@CThinSimulatorDoc@@QEAAXM@Z)
- : error LNK2019: unresolved external symbol "public: void __cdecl V3d_Light::SetColor(class Quantity_Color const &)" (?SetColor@V3d_Light@@QEAAXAEBVQuantity_Color@@@Z) referenced in function "public: void __cdecl CThinSimulatorDoc::ChangeAmbientLight(float)" (?ChangeAmbientLight@CThinSimulatorDoc@@QEAAXM@Z)
 

Kirill Gavrilov's picture

Linkage issues are unrelated to deprecated / removed functions - they will hit you on compiling stage.
Make sure you don't have configuration issues in your setup (like messed up paths to headers / libraries of OCCT of different versions / builds).

VS2015 libraries are expected to be compatible with VS2017, but I'm not sure that opposite is also true (haven't chance to try).

Marco Balen's picture

Hi Kirill,

You are right, I had a reference to the occ7.2.0.

Now I can built the application.

I have another question for you.

About a month ago I have tried to change the code I use to read an stl file into a brep object building a compound shape with all the triangles.

This is not an efficient way to do this. You told me to do like the draw command that load an stl. 

Here below the code I have implemented , but it doesn't work. It seems I get an emptuy shape.

	Handle(Poly_Triangulation) aSTLMesh = RWStl::ReadFile(aFile);

	if (aSTLMesh.IsNull())
		return IFSelect_RetError;

	TopoDS_Face aFace;
	BRep_Builder aB;
	aB.MakeFace(aFace);
	aB.UpdateFace(aFace, aSTLMesh);
	
        TopoDS_Shape aShape = aFace;

Have you any suggestion ?

Marco Balen's picture

Hi Kirill,

I have tried with 7.3.0 version and the shape can be build. In 7.2 it doesn't work. Is it true ?

But, the face shape built in this way is rendered in a less precision way. And it seems that on this shape I can't get the triangulation. I cannot built the triangulation with BRepMesh_IncrementalMesh().
What about this ?

Kirill Gavrilov's picture

STL is a triangulation, not some BSpline or another kind of geometry which can be re-meshed.
If you need a geometry - either ask user exporting model from originating system into STEP file (or another supported BRep format) instead of STL,
or consider surface reconstruction algorithms like SSP:
https://www.opencascade.com/content/surfaces-scattered-points

Note that surface reconstruction is NOT easy to do.
You may also contact commercial OCC support services so that they might suggest alternative solutions, specific to your problem and considering your real needs.
https://www.opencascade.com/content/technology-support

I have tried with 7.3.0 version and the shape can be build. In 7.2 it doesn't work. Is it true ?

OCCT is continuously improving, so it is quite possible that some bug fixes and new features affect your specific use case.

Marco Balen's picture

Hi Kirill,

My problem is that I can load in my application STL, VRML, IGES or STEP files.

When loading IGES or STEP I can convert the geometry in mesh with BRepMesh_IncrementalMesh() and get the triangulation with BRep_Tool::Triangulation().

When loading STL or VRML I can load and display the TopoDS_Shape built from the triangulation, but I cannot get the mesh with the same previous methods.

When I load the STL I build a TopoDS_Shape using the triangles and building a COMPOUND. When loading the VRML I get the Shape from the Scene.

I think the solution may be that I use the triangulation already present in the TopoDs_Shapes builded from STL or VRML. Is it a real solution ? How may I check from IGES/STEP and STL/WRML for using meshes ?

I Need to get the mesh from all the four types of file.

How can I get this ?

Thank you in advance

Kirill Gavrilov's picture

I think the solution may be that I use the triangulation already present in the TopoDs_Shapes builded from STL or VRML. Is it a real solution ?

I would expect this already working for you as far as there is no bugs in logic - BRep_Tool::Triangulation() should return triangulation
for both mesh imported from STL file or generated by BRepMesh_IncrementalMesh for STEP/IGES.