Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Community Bloggers

The Petzold.Media3D Library: Uniting the Two Triangulation Strategies

In the section "Using Type Visibility and Member Accessibility Intelligently" of the modern classic CLR via C# (pages 169-172), Jeffrey Richter discusses why he believes that most classes should be defined as sealed. The Microsoft developers behind the System.Windows.Media.Media3D namespace seem to agree: In this namespace, every class is either abstract or sealed with just one exception: ModelVisual3D . This architecture creates challenges for the programmer wishing to write classes that generate triangle meshes algorithmically. The most straightforward approach would be deriving from MeshGeometry3D but you just can't do it. As I discuss in Chapter 6 of my new book 3D Programming for Windows , you have two good alternatives that let you reference your mesh-generation classes in XAML: Write a class that has a public property of type MeshGeometry3D . Instantiate this class as a resource in a XAML file. Define a binding between the property of this resource and the Geometry property of a Read More...
Published Friday, August 24, 2007 12:48 PM by Charles Petzold
Filed under:

Comments

No Comments
Anonymous comments are disabled

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us