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 : 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 00080 class PoDataMapping : public PoNode { 00081 SO_NODE_ABSTRACT_HEADER(PoDataMapping) ; 00082 00083 00084 public: 00085 00086 /* Fields */ 00087 00092 SoSFBool minThresholdEnabled ; 00093 00098 SoSFFloat minThreshold ; 00099 00104 SoSFColor minThresholdColor ; 00105 00110 SoSFFloat minThresholdTransparency ; 00111 00116 SoSFBool maxThresholdEnabled ; 00117 00122 SoSFFloat maxThreshold ; 00123 00128 SoSFColor maxThresholdColor ; 00129 00134 SoSFFloat maxThresholdTransparency ; 00135 00143 SoSFBool transparencyEnabled ; 00144 00149 SoSFFloat transparencyValueDeletedParts ; 00150 00151 /* Methods */ 00152 00157 virtual const SbColor* getColor(float value)=0 ; 00158 00164 virtual const SbColor* getColor(float value, float &transparency)=0 ; 00165 00166 /*----------------------------------------------------------------------------*/ 00167 private: 00168 static void initClass() ; 00169 static void exitClass() ; 00170 const PbDataMapping *getDataMapping() { updateDataMapping(); return m_dataMapping;}; 00171 00172 private: 00173 PbDataMapping *m_dataMapping ; 00174 00175 PoDataMapping() ; 00176 // Constructor. 00177 00178 virtual ~PoDataMapping() ; 00179 virtual void updateDataMapping() ; 00180 00181 private: 00182 static void minThresholdChangedCB(void *data, SoSensor *) ; 00183 static void maxThresholdChangedCB(void *data, SoSensor *) ; 00184 static void transparencyChangedCB(void *data, SoSensor *) ; 00185 00186 SbBool m_minThresholdChanged ; 00187 SoFieldSensor *m_minThresholdEnabledSensor ; 00188 SoFieldSensor *m_minThresholdSensor ; 00189 SoFieldSensor *m_minThresholdColorSensor ; 00190 SoFieldSensor *m_minThresholdTransSensor ; 00191 00192 SbBool m_maxThresholdChanged ; 00193 SoFieldSensor *m_maxThresholdEnabledSensor ; 00194 SoFieldSensor *m_maxThresholdSensor ; 00195 SoFieldSensor *m_maxThresholdColorSensor ; 00196 SoFieldSensor *m_maxThresholdTransSensor ; 00197 00198 SbBool m_transparencyChanged ; 00199 SoFieldSensor *m_transEnabledSensor ; 00200 SoFieldSensor *m_transValueDeletedPartsSensor ; 00201 } ; 00202 /*----------------------------------------------------------------------------*/ 00203 00204 #endif /* _PO_DATA_MAPPING_ */ 00205 00206