Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media3D / GeometryModel3D.cs / 1305600 / GeometryModel3D.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: 3D geometry primitive implementation. // // See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht // // History: // 06/10/2004 : [....] - Created from MeshPrimitive3D.cs (deprecated) // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.Media3D; using System; using System.Collections; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Windows.Media; using System.Windows.Media.Composition; using System.Windows.Media.Media3D; using System.Windows.Markup; namespace System.Windows.Media.Media3D { ////// GeometryModel3D is for modeling with a Geometry3D and a Material. /// public sealed partial class GeometryModel3D : Model3D { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- ////// Builds a GeometryModel3D with empty Geometry3D and Material. /// public GeometryModel3D() {} ////// Constructor. /// /// Geometry of the new mesh primitive. /// Material of the new mesh primitive. public GeometryModel3D(Geometry3D geometry, Material material) { Geometry = geometry; Material = material; } //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- //------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods internal override Rect3D CalculateSubgraphBoundsInnerSpace() { Geometry3D geometry = Geometry; if (geometry == null) { return Rect3D.Empty; } return geometry.Bounds; } internal override void RayHitTestCore(RayHitTestParameters rayParams) { Geometry3D geometry = Geometry; if (geometry != null) { // If our Geometry3D hit test intersects anything we should return "this" Model3D // as the HitTestResult.ModelHit. rayParams.CurrentModel = this; FaceType facesToHit = FaceType.None; if (Material != null) { facesToHit |= FaceType.Front; } if (BackMaterial != null) { facesToHit |= FaceType.Back; } if (facesToHit != FaceType.None) { geometry.RayHitTest(rayParams, facesToHit); } } } internal void MaterialPropertyChangedHook(DependencyPropertyChangedEventArgs e) { } internal void BackMaterialPropertyChangedHook(DependencyPropertyChangedEventArgs e) { MaterialPropertyChangedHook(e); } #endregion Internal Methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: 3D geometry primitive implementation. // // See spec at http://avalon/medialayer/Specifications/Avalon3D%20API%20Spec.mht // // History: // 06/10/2004 : [....] - Created from MeshPrimitive3D.cs (deprecated) // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.Media3D; using System; using System.Collections; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Windows.Media; using System.Windows.Media.Composition; using System.Windows.Media.Media3D; using System.Windows.Markup; namespace System.Windows.Media.Media3D { ////// GeometryModel3D is for modeling with a Geometry3D and a Material. /// public sealed partial class GeometryModel3D : Model3D { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- ////// Builds a GeometryModel3D with empty Geometry3D and Material. /// public GeometryModel3D() {} ////// Constructor. /// /// Geometry of the new mesh primitive. /// Material of the new mesh primitive. public GeometryModel3D(Geometry3D geometry, Material material) { Geometry = geometry; Material = material; } //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- //------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods internal override Rect3D CalculateSubgraphBoundsInnerSpace() { Geometry3D geometry = Geometry; if (geometry == null) { return Rect3D.Empty; } return geometry.Bounds; } internal override void RayHitTestCore(RayHitTestParameters rayParams) { Geometry3D geometry = Geometry; if (geometry != null) { // If our Geometry3D hit test intersects anything we should return "this" Model3D // as the HitTestResult.ModelHit. rayParams.CurrentModel = this; FaceType facesToHit = FaceType.None; if (Material != null) { facesToHit |= FaceType.Front; } if (BackMaterial != null) { facesToHit |= FaceType.Back; } if (facesToHit != FaceType.None) { geometry.RayHitTest(rayParams, facesToHit); } } } internal void MaterialPropertyChangedHook(DependencyPropertyChangedEventArgs e) { } internal void BackMaterialPropertyChangedHook(DependencyPropertyChangedEventArgs e) { MaterialPropertyChangedHook(e); } #endregion Internal Methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeSnippetCompileUnit.cs
- XslTransformFileEditor.cs
- TextStore.cs
- ITreeGenerator.cs
- _OverlappedAsyncResult.cs
- SQLRoleProvider.cs
- WindowsStartMenu.cs
- SqlFormatter.cs
- UnmanagedBitmapWrapper.cs
- FlowPosition.cs
- ScriptReferenceBase.cs
- SqlRowUpdatingEvent.cs
- SingleConverter.cs
- TextSelection.cs
- FunctionDescription.cs
- SqlMultiplexer.cs
- GcSettings.cs
- SrgsElementFactory.cs
- BaseTreeIterator.cs
- WebCategoryAttribute.cs
- ErrorHandlingAcceptor.cs
- NullReferenceException.cs
- PkcsMisc.cs
- PTProvider.cs
- RunClient.cs
- XmlResolver.cs
- ProfilePropertyNameValidator.cs
- TdsParser.cs
- ConnectionPointGlyph.cs
- InfoCardSchemas.cs
- ThreadSafeList.cs
- BinHexDecoder.cs
- QueryMath.cs
- RouteData.cs
- SafeEventLogReadHandle.cs
- FileLoadException.cs
- StateRuntime.cs
- SubMenuStyle.cs
- OleDbConnectionInternal.cs
- WebPartsSection.cs
- HtmlShimManager.cs
- ProcessHostServerConfig.cs
- MediaPlayer.cs
- WebServiceClientProxyGenerator.cs
- WindowsHyperlink.cs
- DataServiceBehavior.cs
- DataGridViewCheckBoxColumn.cs
- GB18030Encoding.cs
- MimeMultiPart.cs
- TemplatedEditableDesignerRegion.cs
- _CacheStreams.cs
- _CommandStream.cs
- DataReceivedEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- codemethodreferenceexpression.cs
- VirtualPathExtension.cs
- ForEachDesigner.xaml.cs
- HotSpot.cs
- TableChangeProcessor.cs
- NameSpaceEvent.cs
- EntityDataSourceConfigureObjectContext.cs
- DocComment.cs
- ServerValidateEventArgs.cs
- AnimationLayer.cs
- VirtualPathProvider.cs
- DeclarativeCatalogPart.cs
- DecoderExceptionFallback.cs
- XamlToRtfParser.cs
- RemoveStoryboard.cs
- ErrorInfoXmlDocument.cs
- TaiwanLunisolarCalendar.cs
- Perspective.cs
- IPEndPoint.cs
- SchemaDeclBase.cs
- StrongNameIdentityPermission.cs
- ListenerElementsCollection.cs
- Region.cs
- SymmetricKeyWrap.cs
- EnterpriseServicesHelper.cs
- CounterSet.cs
- DuplicateContext.cs
- CqlParser.cs
- OuterGlowBitmapEffect.cs
- LinqMaximalSubtreeNominator.cs
- ServiceHttpModule.cs
- BoundField.cs
- NavigationFailedEventArgs.cs
- SafeNativeMethods.cs
- TemplateColumn.cs
- Stream.cs
- recordstate.cs
- TextPointer.cs
- Normalization.cs
- RichTextBox.cs
- UnescapedXmlDiagnosticData.cs
- WebPartEditorOkVerb.cs
- precedingquery.cs
- ManageRequest.cs
- SQLDoubleStorage.cs
- processwaithandle.cs