00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Elendt 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: GU_Measure.h ( GU Library, C++) 00015 * 00016 * COMMENTS: Compute some measurements on geometry. 00017 */ 00018 00019 #ifndef __GU_Measure__ 00020 #define __GU_Measure__ 00021 00022 #include "GU_API.h" 00023 #include <UT/UT_Vector3.h> 00024 #include <SYS/SYS_Types.h> 00025 00026 class GU_Detail; 00027 class GB_PointGroup; 00028 class GB_PrimitiveGroup; 00029 class GEO_AttributeHandle; 00030 00031 class GU_API GU_Measure { 00032 public: 00033 //! Measure the perimeter of primitives 00034 /// The perimeter of each primitive will be computed and stored in the 00035 /// attribute handle passed in. The attribute handle MUST point to a 00036 /// primitive attribute. 00037 static void computePerimeter(GU_Detail &gdp, 00038 GEO_AttributeHandle &perimeter, 00039 const GB_PrimitiveGroup *group); 00040 00041 //! Measure the area of primitives 00042 /// The area of each primitive will be computed and stored in the 00043 /// attribute handle passed in. The attribute handle MUST point to a 00044 /// primitive attribute. 00045 static void computeArea(GU_Detail &gdp, 00046 GEO_AttributeHandle &area, 00047 const GB_PrimitiveGroup *group); 00048 00049 //! Measure the curvature of points 00050 /// The curvature of each point will be computed and stored in the 00051 /// attribute handle passed in. The normal attribute handle should point 00052 /// to an attribute containing the normal for each point (which does not 00053 /// have to be normalized). This is used in the curvature computations. 00054 /// The curvature computed is an approximation which is more accurate for 00055 /// polygon meshes. No special code is used to compute curvature on higher 00056 /// order surfaces. 00057 static void computeCurvature(GU_Detail &gdp, 00058 GEO_AttributeHandle &curvature, 00059 GEO_AttributeHandle &normal, 00060 const GB_PointGroup *pgroup, 00061 fpreal min, fpreal max); 00062 00063 static void computeVolume(GU_Detail &gdp, 00064 UT_Vector3 &refpt, 00065 GEO_AttributeHandle &volume, 00066 const GB_PrimitiveGroup *group); 00067 }; 00068 00069 #endif
1.5.9