00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2018 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : David Beilloin (Aug 2013) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_INSTANCE_PARAMETER_H_ 00026 #define _SO_INSTANCE_PARAMETER_H_ 00027 00028 #include <Inventor/SbBasic.h> 00029 #include <Inventor/nodes/SoNode.h> 00030 00031 #include <Inventor/nodes/SoShaderParameter.h> 00032 00033 #include <Inventor/fields/SoSFBufferObject.h> 00034 #include <Inventor/fields/SoSFInt32.h> 00035 #include <Inventor/fields/SoSFUInt32.h> 00036 #include <Inventor/fields/SoSFBool.h> 00037 #include <Inventor/fields/SoSFEnum.h> 00038 00039 00080 class SoInstanceParameter : public SoVertexShaderParameterBufferObject 00081 { 00082 SO_NODE_HEADER(SoInstanceParameter); 00083 00084 public: 00085 00089 SoInstanceParameter(); 00090 00096 SoSFUInt32 divisor; 00097 00136 enum PredefinedParameters 00137 { 00138 TRANSLATION = 0, 00139 ROTATION, 00140 SCALE, 00141 VISIBILITY, 00142 COLOR, 00143 TRANSPARENCY, 00144 NUM_PREDEFINED_PARAMETERS 00145 }; 00146 00192 static SoInstanceParameter* createPredefinedParameter( SoInstanceParameter::PredefinedParameters paramKey, 00193 const SoBufferObject* values, uint32_t divisor = 1 ); 00194 00196 static SbString getPredefinedParameterName( SoInstanceParameter::PredefinedParameters paramKey ); 00197 00199 void setPredefinedParameterName( SoInstanceParameter::PredefinedParameters paramKey ); 00200 00201 private: 00203 static void initClass(); 00204 00206 static void exitClass(); 00207 00209 virtual void notify(SoNotList *list); 00210 00211 // Attrib divisor is set by a field 00212 virtual unsigned int getVertexAttribDivisor() { return divisor.getValue(); } 00213 00214 private: 00215 // Destructor 00216 virtual ~SoInstanceParameter(); 00217 00218 }; 00219 00220 /*----------------------------------------------------------------------------*/ 00221 00222 #endif /* _SO_INSTANCE_PARAMETER_H_ */ 00223 00224