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-2021 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 ** Modified by : M. Bonaventure (Mar 2010) 00023 **=======================================================================*/ 00024 /*============================================================================== 00025 * File : MoDrawStyleElement.h 00026 * Classes : MoDrawStyleElement 00027 * Author(s) : Pascal Doux 00028 * Date : 8 9 2008 00029 *============================================================================== 00030 * 00031 * Description : Element that stores a data binding. 00032 * 00033 *============================================================================*/ 00034 00035 #ifndef _MO_DRAWSTYLE_ELEMENT_ 00036 #define _MO_DRAWSTYLE_ELEMENT_ 00037 00038 #include <Inventor/elements/SoReplacedElement.h> 00039 #include <MeshVizXLM/mapping/MoMeshVizDataMapping.h> 00040 #include <MeshVizXLM/mapping/nodes/MoDrawStyle.h> 00041 00042 class MoDataBinding; 00043 00054 class MESHVIZXLM_DMAP_API MoDrawStyleElement : public SoReplacedElement { 00055 00056 SO_ELEMENT_HEADER(MoDrawStyleElement); 00057 00058 public: 00059 00061 static void set(SoState *state, MoDrawStyle *node); 00062 00063 static void set( SoState* state, SoNode* node, bool displaySolid, bool displayEdges, bool displayPoints, float fadingThreshold ); 00064 00066 static bool getDrawStyle(SoState *state, bool& displaySolid, bool& displayEdges, bool& displayPoints); 00067 00068 static float getFadingThreshold(SoState *state); 00069 00071 static bool getDefault(bool& displaySolid, bool& displayEdges, bool& displayPoints, float& fadingThreshold); 00072 00076 virtual void print(FILE *fp) const; 00077 00078 private: 00079 00081 virtual void init(SoState *state); 00082 00086 virtual SbBool matches(const SoElement* elt) const; 00087 00091 virtual SoElement *copyMatchInfo() const; 00092 00093 private: 00094 // Initializes the class 00095 static void initClass(); 00096 static void exitClass() ; 00097 00098 private: 00099 bool m_displaySolid; 00100 bool m_displayEdges; 00101 bool m_displayPoints; 00102 float m_fadingThreshold; 00103 bool m_isSet; 00104 00105 virtual ~MoDrawStyleElement(); 00106 00107 }; 00108 /*----------------------------------------------------------------------------*/ 00109 00110 #endif // _MO_DRAWSTYLE_ELEMENT_ 00111 00112 00113