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-2014 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 00024 #ifndef _PO_DATA_MAPPING_ 00025 #define _PO_DATA_MAPPING_ 00026 00027 #include <Inventor/fields/SoSFBool.h> 00028 #include <Inventor/fields/SoSFFloat.h> 00029 #include <Inventor/fields/SoSFColor.h> 00030 00031 #include <MeshViz/nodes/PoNode.h> 00032 00033 class PbDataMapping ; 00034 class SoFieldSensor ; 00035 00079 class PoDataMapping : public PoNode { 00080 SO_NODE_ABSTRACT_HEADER(PoDataMapping) ; 00081 00082 00083 public: 00084 00085 /* Fields */ 00086 00091 SoSFBool minThresholdEnabled ; 00092 00097 SoSFFloat minThreshold ; 00098 00103 SoSFColor minThresholdColor ; 00104 00109 SoSFFloat minThresholdTransparency ; 00110 00115 SoSFBool maxThresholdEnabled ; 00116 00121 SoSFFloat maxThreshold ; 00122 00127 SoSFColor maxThresholdColor ; 00128 00133 SoSFFloat maxThresholdTransparency ; 00134 00142 SoSFBool transparencyEnabled ; 00143 00148 SoSFFloat transparencyValueDeletedParts ; 00149 00150 /* Methods */ 00151 00156 virtual const SbColor* getColor(float value)=0 ; 00157 00163 virtual const SbColor* getColor(float value, float &transparency)=0 ; 00164 00165 /*----------------------------------------------------------------------------*/ 00166 private: 00167 static void initClass() ; 00168 static void exitClass() ; 00169 const PbDataMapping *getDataMapping() { updateDataMapping(); return m_dataMapping;}; 00170 00171 private: 00172 PbDataMapping *m_dataMapping ; 00173 00174 PoDataMapping() ; 00175 // Constructor. 00176 00177 virtual ~PoDataMapping() ; 00178 virtual void updateDataMapping() ; 00179 00180 private: 00181 static void minThresholdChangedCB(void *data, SoSensor *) ; 00182 static void maxThresholdChangedCB(void *data, SoSensor *) ; 00183 static void transparencyChangedCB(void *data, SoSensor *) ; 00184 00185 SbBool m_minThresholdChanged ; 00186 SoFieldSensor *m_minThresholdEnabledSensor ; 00187 SoFieldSensor *m_minThresholdSensor ; 00188 SoFieldSensor *m_minThresholdColorSensor ; 00189 SoFieldSensor *m_minThresholdTransSensor ; 00190 00191 SbBool m_maxThresholdChanged ; 00192 SoFieldSensor *m_maxThresholdEnabledSensor ; 00193 SoFieldSensor *m_maxThresholdSensor ; 00194 SoFieldSensor *m_maxThresholdColorSensor ; 00195 SoFieldSensor *m_maxThresholdTransSensor ; 00196 00197 SbBool m_transparencyChanged ; 00198 SoFieldSensor *m_transEnabledSensor ; 00199 SoFieldSensor *m_transValueDeletedPartsSensor ; 00200 } ; 00201 /*----------------------------------------------------------------------------*/ 00202 00203 #endif /* _PO_DATA_MAPPING_ */ 00204 00205