#ifndef shaveItHair_h #define shaveItHair_h // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 #include #include #include "shaveAPI.h" class LIBSHAVEAPI_API shaveItHair { public: // // Clear the iterator and free up its resources. // // Status Value: // // Currently always returns MS::kSuccess // static MStatus clear(); // // Set the iterator to iterate over all the hairs in the scene. // // If 'instances' is true then only shaveNodes with instancing will be // included in the iteration. If false, then only non-instanced // shaveNodes will be included. // // If 'renderable' is true then only hairs from renderable shaveNodes // will be included in the iteration. // // Status Value: // // MS::kSuccess Success. // // MS::kNotFound The scene contains no shaveNodes, or only // contains shaveNodes which do not match the // restrictions implied by the 'instances' and // 'renderableOnly' parameters. // static MStatus init(bool instances, bool renderableOnly); // // Set the iterator to iterate over all the hairs from the shaveNodes // in the 'shaveNodes' array. // // If 'instances' is true then only those shaveNodes in the array which // have instance geometry will be included in the iteration. If false // then only those shaveNodes which are *not* instanced will be // included. // // Status Value: // // MS::kSuccess Success. // // MS::kNotFound The 'shaveNodes' array is empty or only // contains node which do not correspond to // the 'instances' parameter. // // MS::kInvalidParameter // One or more of the objects in the // 'shaveNodes' array is not a shaveNode. // static MStatus init(bool instances, MObjectArray& shaveNodes); // // Returns a HairInfo structure for all of the next hair's strands. // // The vertex lists will contain either a single curve for each strand, // or a set of polys for each strand. This is determined as follows: // // If the current iterator is operating on instanced shaveNodes, or if // it is operating on non-instanced nodes but the render mode in Shave // Globals is set to 'Geometry', then polys will be returned. // // Otherwise the current iterator must be operating on non-instanced // nodes with a render mode of 'Buffer' which case curves will be returned. // static MStatus nextHair(shaveAPI::HairInfo* hairInfo); // // Returns a HairInfo structure for the next hair which contains the // counts for all of the hair's strands. The only fields in 'hairInfo' // which will be valid are 'numHairs', 'numVertices' and // 'numHairVertices', with 'numHairs' containing the number of strands // in the hair, as determined by the shaveNode's multistrand setting. // // While this method does not return as much information as // nextHairCurves(), it is must faster, so use it if you only need a // hair's counts. // // Note that the vertex counts given are only correct for hairs // returned as curves, not as polys. // static MStatus nextHairCounts(shaveAPI::HairInfo* hairInfo); // // Resets the iterator back to the very first hair of the very first // shaveNode. // static MStatus reset(); }; #endif