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 * Side Effects Software Inc. 00008 * 477 Richmond Street West 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 * 00013 * NAME: GR_ShadedOffset.h (GR library, C++) 00014 * 00015 * COMMENTS: Attribute offsets specifically for GR 00016 * 00017 */ 00018 00019 #ifndef __GR_AttribOffset_h__ 00020 #define __GR_AttribOffset_h__ 00021 00022 #include "GR_API.h" 00023 #include <UT/UT_IntArray.h> 00024 #include <GU/GU_DisplayAttribs.h> 00025 00026 class RE_Material; 00027 class GR_DisplayOption; 00028 00029 class GR_API GR_AttribOffset : public GU_DisplayAttribs 00030 { 00031 public: 00032 typedef const float *(*ColorLookupFunc)(const void *data); 00033 00034 GR_AttribOffset(); 00035 00036 GR_AttribOffset(const GR_AttribOffset ©); 00037 GR_AttribOffset &operator=(const GR_AttribOffset ©); 00038 00039 // This function overrides the base class version. 00040 // It's non-virtual for efficiency as we don't use this class in a 00041 // polymorphic fashion. 00042 void resetOffsets(); 00043 00044 void getShaderAttribOffsets(const GU_Detail *gdp, 00045 const RE_Material *mat); 00046 00047 void getLookups(const GU_Detail *gdp, const GR_DisplayOption &dopt); 00048 00049 // Query whether we have vertex level colors. This includes both point 00050 // and vertex attributes. 00051 inline bool hasVertexColors() const 00052 { return ptCd >= 0 || vtxCd >= 0 || 00053 ptColorLookupOffset >= 0 || vtxColorLookupOffset >= 0; } 00054 00055 // OpenGL shaders. 00056 UT_IntArray ptLocations; // OpenGL shader attribute offsets 00057 UT_IntArray ptOffsets; // Corresponding gdp attribute offsets 00058 UT_IntArray ptSizes; // Corresponding gdp attribute sizes 00059 UT_IntArray vtxLocations; // OpenGL shader (vertex) attribute offsets 00060 UT_IntArray vtxOffsets; // Corresponding gdp (vertex) attribute offsets 00061 UT_IntArray vtxSizes; // Corresponding gdp (vertex) attribute sizes 00062 00063 ColorLookupFunc colorLookup; 00064 int ptColorLookupOffset; 00065 int vtxColorLookupOffset; 00066 00067 private: 00068 }; 00069 00070 #endif // __GR_AttribOffset_h__ 00071
1.5.9