Grasshopper

algorithmic modeling for Rhino

Is it possible to use rhino.geometry.Base As a New starting Point for implementing a geometry Class with extendet functions ( for example a Point with plane Features, Visual Features and Handling Features like controlpoints

Views: 760

Replies to This Discussion

The only thing that prevents a given class from being able to be inherited is if is declared as either sealed in C# or NotIheritable in VB.Net. Once the class is inherited, then you will be required to implement any methods that the base class has declared as abstract in C# or MustInherit in VB.Net.  Any methods that the base class has declared as virtual in C# or Overridable in VB.Net can have their behavior overridden if you would prefer to provide your own implementation of that method (the ToString method is a great example of that).  After that, you're free do whatever you'd like within your class.


The GeometryBase class was not designed to be directly inherited by classes outside of RhinoCommon. I thought I had this protected by hiding all of the constructors, but it looks like there is a protected GeometryBase class constructor which should have been made internal.  This will be made internal in the future making it so you will not be able to subclass GeometryBase.

 

That being said, I do hope to provide for custom geometry/rhino objects in a different way in the future. If and when we support custom Geometry or RhinoObject classes in RhinoCommon, these will most likely show up in a Custom namespace.

 

In short, don't do this.

 

Thanks,

-Steve

More good news.  Custom Rhino objects with .Net would be a great addition to the SDK.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service