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
- BitmapMetadata.cs
- EmulateRecognizeCompletedEventArgs.cs
- SerialPort.cs
- MiniCustomAttributeInfo.cs
- PolygonHotSpot.cs
- IisTraceListener.cs
- DetailsViewUpdatedEventArgs.cs
- ModelItemCollection.cs
- SuppressMessageAttribute.cs
- AesManaged.cs
- HuffmanTree.cs
- DiagnosticTraceRecords.cs
- _LocalDataStore.cs
- ProgressBarBrushConverter.cs
- TextOutput.cs
- AttachmentCollection.cs
- Codec.cs
- HwndAppCommandInputProvider.cs
- ListViewUpdateEventArgs.cs
- ButtonDesigner.cs
- Positioning.cs
- GradientStop.cs
- RoleGroupCollection.cs
- HitTestWithGeometryDrawingContextWalker.cs
- WebPartVerb.cs
- AnnotationHelper.cs
- Panel.cs
- XmlAnyAttributeAttribute.cs
- ImagingCache.cs
- ReturnType.cs
- StringResourceManager.cs
- DomainUpDown.cs
- DiscoveryMessageSequence11.cs
- ThreadStateException.cs
- IgnoreDataMemberAttribute.cs
- AlphabeticalEnumConverter.cs
- DataGrid.cs
- WmlMobileTextWriter.cs
- Composition.cs
- FragmentQuery.cs
- CatchDesigner.xaml.cs
- TraceUtils.cs
- ZipIOExtraFieldZip64Element.cs
- ValidatingReaderNodeData.cs
- AnnotationResourceCollection.cs
- WebScriptServiceHostFactory.cs
- SafeCertificateContext.cs
- DomainUpDown.cs
- ExpressionVisitor.cs
- InstanceDataCollection.cs
- TraceContextRecord.cs
- SerializationSectionGroup.cs
- ProcessRequestArgs.cs
- InfoCardBaseException.cs
- httpapplicationstate.cs
- ApplicationProxyInternal.cs
- WinFormsSecurity.cs
- GroupBox.cs
- MasterPageCodeDomTreeGenerator.cs
- EncodingInfo.cs
- BaseDataBoundControl.cs
- StreamResourceInfo.cs
- FixedElement.cs
- DateTimeUtil.cs
- SQLDoubleStorage.cs
- ImageButton.cs
- ContentPlaceHolder.cs
- ListViewCancelEventArgs.cs
- TemplateColumn.cs
- XmlNotation.cs
- X509ChainElement.cs
- OutputScopeManager.cs
- DataServiceResponse.cs
- DbProviderFactoriesConfigurationHandler.cs
- SafeHandles.cs
- NetCodeGroup.cs
- EpmCustomContentSerializer.cs
- ObjectHandle.cs
- HttpGetProtocolReflector.cs
- WebPartDescription.cs
- Mappings.cs
- Root.cs
- PresentationSource.cs
- Decoder.cs
- Identity.cs
- TrackingQueryElement.cs
- ActionMessageFilterTable.cs
- GetParentChain.cs
- LoginAutoFormat.cs
- NamespaceCollection.cs
- TextTreeDeleteContentUndoUnit.cs
- SiteMapProvider.cs
- TextElementCollectionHelper.cs
- Rectangle.cs
- StringUtil.cs
- GeometryHitTestParameters.cs
- UpdateException.cs
- HtmlFormWrapper.cs
- ControlIdConverter.cs
- DocumentViewerAutomationPeer.cs