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-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Damien DALLA ROSA (Apr 2011) 00022 **=======================================================================*/ 00023 00024 #if !defined(SO_VERTEXATTRIBFEEDBACK_H) 00025 #define SO_VERTEXATTRIBFEEDBACK_H 00026 00027 #include <Inventor/fields/SoSFBool.h> 00028 #include <Inventor/fields/SoSFEnum.h> 00029 #include <Inventor/nodes/SoSeparator.h> 00030 00031 class SoGLBufferObject; 00032 class SoVertexAttribFeedbackImpl; 00033 00034 00091 class SoVertexAttribFeedback : public SoSeparator 00092 { 00093 SO_NODE_HEADER( SoVertexAttribFeedback ); 00094 00095 // ----------------------- Public usage -------------------------------------- 00096 00097 public: 00098 00103 enum BufferMode 00104 { 00108 INTERLEAVED, 00109 00111 SEPARATE 00112 }; 00113 00117 enum PrimitiveType 00118 { 00120 LINES, 00122 POINTS, 00124 TRIANGLES 00125 }; 00126 00136 SoSFBool disableFragmentProcessing; 00137 00149 SoSFBool autoResizeBuffers; 00150 00158 SoSFBool queryGeneratedPrimitivesCount; 00159 00164 SoSFEnum buffersMode; 00165 00170 SoSFEnum primitiveType; 00171 00175 SoVertexAttribFeedback(); 00176 00197 void registerFeedback(const SbString& varyingName, SoGLBufferObject* bufferObject, int primitiveSize = -1); 00198 00204 void unregisterFeedback(const SbString& varyingName); 00205 00213 int getGeneratedPrimitivesCount() const; 00214 00223 static SbBool isSupported(SoState* state); 00224 00225 private: 00226 00227 virtual void callback(SoCallbackAction *action); 00228 virtual void getBoundingBox(SoGetBoundingBoxAction *action); 00229 virtual void getMatrix(SoGetMatrixAction *action); 00230 virtual void handleEvent(SoHandleEventAction *action); 00231 virtual void rayPick(SoRayPickAction *action); 00232 virtual void search(SoSearchAction *action); 00233 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00234 virtual void distribute(SoDistributeAction* action); 00235 virtual void GLRenderInPath(SoGLRenderAction *action); 00236 virtual void GLRenderOffPath(SoGLRenderAction *action); 00237 virtual void GLRenderBelowPath(SoGLRenderAction*); 00238 00239 private: 00240 00242 static void initClass(); 00243 00245 static void exitClass(); 00246 00247 private: 00248 00250 virtual ~SoVertexAttribFeedback(); 00251 00252 private: 00253 00254 SoVertexAttribFeedbackImpl* m_impl; 00255 }; 00256 00257 #endif // SO_VERTEXATTRIBFEEDBACK_H 00258 00259 00260