Migrating Plug-ins from Rhino 5 to Rhino 6 C++


#1

Hi,

I tried migrating some of my Rhino 5 Plug-ins to Rhino 6…used the migrator.exe - it worked fine…but the builds give me hundreds of errors. So without going into specifics for now, I would have a general question…is it possible that so many classes and functions have changed in Rhino 6 SDK? If yes that is it…have to find new solutions for every method that changed…and it will probably take me at least a week per plug-in to migrate them :slight_smile: But I would just like to know (somehow) if that is it…because maybe all of those methods and classes still exist in the same form but the problem is somewhere else…I will just give you couple of examples to start the conversation…

CRhinoUiEdit - not a recognized class anymore

Problems with Annotations…
error C2065: ‘CRhinoAngularDimension’: undeclared identifier (this is the case with most Dimension classes)
error C2065: ‘CRhinoRadialDimension’: undeclared identifier
CRhinoAnnotationLeader not recognized

Some problems with the meshes - I guess some members became private…:

error C2248: ‘ON_MeshParameters::m_mesher’: cannot access private member declared in class 'ON_MeshParameters’
error C2248: ‘ON_MeshParameters::m_grid_amplification’: cannot access private member declared in class 'ON_MeshParameters’
error C2248: ‘ON_MeshParameters::m_grid_max_count’: cannot access private member declared in class ‘ON_MeshParameters’

Some functions have changed?
error C2664: ‘ON_Brep *RhinoCreateEdgeSrf(int,const ON_Curve **)’: cannot convert argument 2 from ‘ON_NurbsCurve [3]’ to ‘const ON_Curve **’

I guess this was deprecated and now removed:
error C2039: ‘FindLayer’: is not a member of 'CRhinoLayerTable’
error C2039: ‘m_layer_id’: is not a member of 'CRhinoLayer’
error C2039: ‘m_parent_layer_id’: is not a member of ‘ON_Layer’

And a huge bulk of the problems comes from the Conduit…and rhinosdkdisplayconduit.h

CRhinoDisplayConduit

error C2039: ‘IsEnabled’: is not a member of ‘CConduitPreview’

1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(161): error C2011: ‘CRhinoDisplayConduit’: ‘class’ type redefinition

1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(65): error C2011: ‘CSupportChannels’: ‘struct’ type redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(55): note: see declaration of 'CSupportChannels’
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(113): warning C4005: ‘CHANNELS_SUPPORTED’: macro redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(100): note: see previous definition of 'CHANNELS_SUPPORTED’
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(139): error C2011: ‘EConduitNotifiers’: ‘enum’ type redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(118): note: see declaration of 'EConduitNotifiers’
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(161): error C2011: ‘CRhinoDisplayConduit’: ‘class’ type redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(142): note: see declaration of 'CRhinoDisplayConduit’
1>x:\triangle\proarch\develop\rhino\plug-ins\free\eve_explode\eve_explode_r6\ConduitPreview.h(5): error C2504: ‘CRhinoDisplayConduit’: base class undefined
1>ConduitPreview.cpp
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(65): error C2011: ‘CSupportChannels’: ‘struct’ type redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(55): note: see declaration of 'CSupportChannels’
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(113): warning C4005: ‘CHANNELS_SUPPORTED’: macro redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(100): note: see previous definition of 'CHANNELS_SUPPORTED’
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(139): error C2011: ‘EConduitNotifiers’: ‘enum’ type redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(118): note: see declaration of 'EConduitNotifiers’
1>c:\program files (x86)\rhino 5.0 x64 sdk\inc\rhinosdkdisplayconduit.h(161): error C2011: ‘CRhinoDisplayConduit’: ‘class’ type redefinition
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(142): note: see declaration of 'CRhinoDisplayConduit’
1>x:\triangle\proarch\develop\rhino\plug-ins\free\eve_explode\eve_explode_r6\ConduitPreview.h(5): error C2504: ‘CRhinoDisplayConduit’: base class undefined
1>ConduitPreview.cpp(6): error C2027: use of undefined type 'CSupportChannels’
1>c:\program files\rhino 6 sdk\inc\RhinoSdkDisplayConduit.h(55): note: see declaration of 'CSupportChannels’
1>ConduitPreview.cpp(6): error C2065: ‘SC_PREDRAWOBJECTS’: undeclared identifier
1>ConduitPreview.cpp(6): error C2065: ‘SC_CALCBOUNDINGBOX’: undeclared identifier
1>ConduitPreview.cpp(6): error C2614: ‘CConduitPreview’: illegal member initialization: ‘CRhinoDisplayConduit’ is not a base or member
1>ConduitPreview.cpp(27): error C2027: use of undefined type ‘CSupportChannels’

I am also getting some errors from opennurbs…but I am not sure what that is about…and it does not appear in the Output:

And I realize that there is a problem with the Dialogs…I am not seeing the CDialog…which I assume comes from removing the dependence from MFC?


(Dale Fugier) #2

Hi @dimcic,

Yep, a lot has changed in the C++ SDK. The first thing you will want to do is review the What’s New? document. Also, all of the Rhino 5 SDK samples have been ported to Rhino 6. So this is always a good resource to compare the changes between the two versions.

To some of your large issues:

1.) The C++ SDK is now MFC free. But we do still provide some MFC classes. If you want to use them, add the following to your stdafx.h file.


// If you want to use Rhino's MFC UI classes, then
// uncomment the #define RHINO_SDK_MFC statement below. 
// Note, doing so will requrie that your plug-in is
// built with the same version of Visual Studio as was
// used to build Rhino.
#define RHINO_SDK_MFC

Note, the plug-in wizards adds this for you.

2.) Annotations have been completely overhauled. This document should help you.

3.) The signatures of many classes and functions have changed. Check the updated SDK samples or the online API to see what is’ new and available.

http://developer.rhino3d.com/api/cpp/

If you can’t find what you are looking for, let us know.

– Dale