RenderNodeAction OnFaceBegin( FaceNode node )
/// <summary> /// This code demonstrates how to process face geometry /// </summary> /// <remarks> /// This method is invoked only if the custom exporter was set to include faces. /// </remarks> public RenderNodeAction OnFaceBegin(FaceNode node) { // Get the get the actual geometric face and all information about it // and its edges by using standard API for Face and Edge Face theFace = node.GetFace(); double area = theFace.Area; if (theFace.HasRegions) { IList<Face> regionedFaces = theFace.GetRegions(); } // We can either skip this face or proceed with rendering it depending on // whether our export process can handle face geometry or not. If we choose // to proceed, we get calls to export tessellated meshes for this face. if (true == ExportAFace(theFace)) { return RenderNodeAction.Skip; } return RenderNodeAction.Proceed; } /// <summary> /// This code marks the end of processing a face /// </summary> /// <remarks> /// This method is invoked only if the custom exporter was set to include faces. /// </remarks> public void OnFaceEnd(FaceNode node) { // Note: This method is invoked even for faces that were skipped. } /// <summary> /// Assuming this would be the method that processes faces and exports them in our proprietary format. /// </summary> /// <remarks> /// For example, we can decide that our format supports planar faces only, but no curved surfaces. /// Or we can support basic surfaces only (planar, spherical, cylindrical), but not complex faces. /// This is, naturally, depending on what a particular custom exporter is designed to output. /// </remarks> /// <returns> /// Should return True if the face could be handled (exported), False otherwise. /// </returns> private bool ExportAFace(Face face) { return false; // in this case, }
' <summary> ' This code demonstrates how to process face geometry ' </summary> ' <remarks> ' This method is invoked only if the custom exporter was set to include faces. ' </remarks> Public Function OnFaceBegin(node As FaceNode) As RenderNodeAction Implements IExportContext.OnFaceBegin ' Get the get the actual geometric face and all information about it ' and its edges by using standard API for Face and Edge Dim theFace As Face = node.GetFace() Dim area As Double = theFace.Area If theFace.HasRegions Then Dim regionedFaces As IList(Of Face) = theFace.GetRegions() End If ' We can either skip this face or proceed with rendering it depending on ' whether our export process can handle face geometry or not. If we choose ' to proceed, we get calls to export tessellated meshes for this face. If True = ExportAFace(theFace) Then Return RenderNodeAction.Skip End If Return RenderNodeAction.Proceed End Function ' <summary> ' This code marks the end of processing a face ' </summary> ' <remarks> ' This method is invoked only if the custom exporter was set to include faces. ' </remarks> Public Sub OnFaceEnd(node As FaceNode) Implements IExportContext.OnFaceEnd ' Note: This method is invoked even for faces that were skipped. End Sub ' <summary> ' Assuming this would be the method that processes faces and exports them in our proprietary format. ' </summary> ' <remarks> ' For example, we can decide that our format supports planar faces only, but no curved surfaces. ' Or we can support basic surfaces only (planar, spherical, cylindrical), but not complex faces. ' This is, naturally, depending on what a particular custom exporter is designed to output. ' </remarks> ' <returns> ' Should return True if the face could be handled (exported), False otherwise. ' </returns> Private Function ExportAFace(face As Face) As Boolean Return False ' in this case, End Function