packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/UtilitiesLibrary/MeshLoader/Texturizer.cs
/// <summary>
/// Builds a dictionary of parts to be emphasized if displaying wireframe.
/// </summary>
/// <remarks>
/// During rendering, as the mesh tree is traversed each part is checked to
/// see whether it should be displayed as wireframe or not. A part in the dictionary
/// built by this method will be rendered as a solid part, otherwise the part
/// will be rendered as wireframe.
/// This method traverses the mesh tree looking for the named part. Once that
/// named part is found, that part and all its children are added to the dictionary.
/// The traversal is terminated once the named part has been found and all of its
/// children have also been traversed (and added to the dictionary).
/// </remarks>
/// <param name="part">The current part to inspect</param>
/// <param name="partName">The name of the root part to emphasize during rendering</param>
/// <param name="fEmphasizeParent">True if the parent of this part will be emphasized, false otherwise</param>
/// <returns>True if this part has been emphasized, false otherwise</returns>
Builds a dictionary of parts to be emphasized if displaying wireframe.
Builds a dictionary of parts to be emphasized if displaying wireframe .
private bool BuildEmphasisDictionary(Part part, string partName, bool fEmphasizeParent)
        {
            if (fEmphasizeParent || (!string.IsNullOrEmpty(part.name) && part.name == partName))
            {
                partEmphasis.Add(part);
                fEmphasizeParent = true;
            }
            foreach (Part childPart in part.parts)
            {
                if (BuildEmphasisDictionary(childPart, partName, fEmphasizeParent) && !fEmphasizeParent)
                {
                    break;
                }
            }
            return fEmphasizeParent;
        }
private bool BuildEmphasisDictionary ( Part part , string partName , bool fEmphasizeParent ) { if ( fEmphasizeParent || ( ! string . IsNullOrEmpty ( part . name ) && part . name == partName ) ) { partEmphasis . Add ( part ) ; fEmphasizeParent = true ; } foreach ( Part childPart in part . parts ) { if ( BuildEmphasisDictionary ( childPart , partName , fEmphasizeParent ) && ! fEmphasizeParent ) { break ; } } return fEmphasizeParent ; }
Builds a dictionary of parts to be emphasized if displaying wireframe.
Builds a dictionary of parts to be emphasized if displaying wireframe .
True if this part has been emphasized, false otherwise
True if this part has been emphasized false otherwise
part
Part
The current part to inspect
The current part to inspect
partName
string
The name of the root part to emphasize during rendering
The name of the root part to emphasize during rendering
fEmphasizeParent
bool
True if the parent of this part will be emphasized, false otherwise
True if the parent of this part will be emphasized false otherwise
remarks
During rendering, as the mesh tree is traversed each part is checked to
see whether it should be displayed as wireframe or not. A part in the dictionary
built by this method will be rendered as a solid part, otherwise the part
will be rendered as wireframe.
This method traverses the mesh tree looking for the named part. Once that
named part is found, that part and all its children are added to the dictionary.
The traversal is terminated once the named part has been found and all of its
children have also been traversed (and added to the dictionary).
During rendering as the mesh tree is traversed each part is checked to see whether it should be displayed as wireframe or not . A part in the dictionary built by this method will be rendered as a solid part otherwise the part will be rendered as wireframe . This method traverses the mesh tree looking for the named part . Once that named part is found that part and all its children are added to the dictionary . The traversal is terminated once the named part has been found and all of its children have also been traversed ( and added to the dictionary ) .