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 : FEI (Mar 2015) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_BILLBOARD_H_ 00026 #define _SO_BILLBOARD_H_ 00027 00028 #include <Inventor/fields/SoSFBool.h> 00029 #include <Inventor/fields/SoSFEnum.h> 00030 #include <Inventor/fields/SoSFVec3f.h> 00031 #include <Inventor/fields/SoSFNode.h> 00032 #include <Inventor/fields/SoSFBitMask.h> 00033 #include <Inventor/nodes/SoSeparator.h> 00034 00107 class SoBillboard : public SoSeparator 00108 { 00109 SO_NODE_HEADER(SoBillboard); 00110 00111 public: 00115 SoSFVec3f axisOfRotation; 00116 00127 SoSFBool useSphereBBox; 00128 00132 SoBillboard(); 00133 00135 SoBillboard(int nChildren); 00136 00137 private: 00138 // Implement actions 00139 virtual void doAction(SoAction *action); 00140 virtual void callback(SoCallbackAction *action); 00141 virtual void GLRender(SoGLRenderAction *action); 00142 virtual void getBoundingBox(SoGetBoundingBoxAction *action); 00143 virtual void rayPick(SoRayPickAction *action); 00144 00145 // These methods make render traversal faster by implementing 00146 // different rendering paths corresponding to different action 00147 // path codes. 00148 virtual void GLRenderBelowPath(SoGLRenderAction *action); 00149 virtual void GLRenderInPath(SoGLRenderAction *action); 00150 virtual void GLRenderOffPath(SoGLRenderAction *action); 00151 00152 private: 00153 static void initClass(); 00154 static void exitClass(); 00155 00156 private: 00157 00158 // Destructor. 00159 virtual ~SoBillboard(); 00160 00162 virtual void notify( SoNotList *list ); 00163 00164 private: 00165 // call by constructor 00166 void commonConstructor(const int nChildren); 00167 00168 void align(SoState *state, const bool flag=true); 00169 00170 enum BillboardComputation 00171 { 00172 UNDEFINED, 00173 CPU, 00174 GPU 00175 }; 00176 BillboardComputation m_computationType; 00177 00178 // OIV_BILLBOARD_EXTRA_BBOX environment variable status 00179 static bool s_extraBboxActivated; 00180 }; 00181 00182 #endif /* _SO_BILLBOARD_H_ */ 00183