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 * Ondrej Kos 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 Library (C++) 00015 * 00016 * COMMENTS: Texture coordinate unwrapping code. 00017 * 00018 */ 00019 #ifndef __GU_TextureUnwrap_h__ 00020 #define __GU_TextureUnwrap_h__ 00021 00022 #include "GU_API.h" 00023 #include <UT/UT_Matrix3.h> 00024 #include <UT/UT_Vector3Array.h> 00025 00026 class GB_PrimitiveGroup; 00027 class GU_Detail; 00028 00029 class GU_API GU_TextureUnwrapParms 00030 { 00031 public: 00032 enum LayoutType { 00033 LAYOUT_STRIP = 0, 00034 LAYOUT_SQUARE = 1 00035 }; 00036 00037 enum ScaleType { 00038 SCALE_NONE = 0, 00039 SCALE_UNIFORM = 1, 00040 SCALE_STRETCH = 2 00041 }; 00042 00043 GU_TextureUnwrapParms(); 00044 00045 void initializeTetrahedron(); 00046 void initialize5(); 00047 void initializeCube(); 00048 void initialize8(); 00049 00050 void initializeGeometry(const GU_Detail *gdp, 00051 const GB_PrimitiveGroup *group); 00052 00053 // Build polygon geometry representation of the planes being 00054 // projected onto. 00055 static void buildGeometry4(GU_Detail *gdp); 00056 static void buildGeometry5(GU_Detail *gdp); 00057 static void buildGeometry6(GU_Detail *gdp); 00058 static void buildGeometry8(GU_Detail *gdp); 00059 00060 const GB_PrimitiveGroup *myGroup; 00061 00062 UT_Vector3Array myPlaneNormals; 00063 UT_Vector3Array myPlaneXAxes; 00064 00065 ScaleType myScaleType; 00066 LayoutType myLayoutType; 00067 00068 float mySpacing; 00069 }; 00070 00071 00072 class GU_API GU_TextureUnwrap 00073 { 00074 public: 00075 00076 GU_TextureUnwrap(GU_Detail *gdp); 00077 ~GU_TextureUnwrap(); 00078 00079 00080 // Performs the extrusion 00081 void unwrap(const GU_TextureUnwrapParms &parms); 00082 00083 private: 00084 GU_Detail *myGdp; 00085 }; 00086 00087 #endif
1.5.9