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_CHART_ 00025 #define _PO_CHART_ 00026 00027 #include <MeshViz/graph/PoGraphMaster.h> 00028 00029 #include <Inventor/fields/SoSFEnum.h> 00030 #include <Inventor/fields/SoSFInt32.h> 00031 #include <Inventor/fields/SoSFNode.h> 00032 00044 class PoChart : public PoGraphMaster { 00045 00046 SO_KIT_ABSTRACT_HEADER(PoChart) ; 00047 00048 00049 public: 00050 00054 enum ColorBinding { 00055 INHERITED, 00056 PER_VERTEX, 00057 PER_PART 00058 } ; 00059 00060 00061 00062 /* Fields */ 00063 00079 SoSFEnum colorBinding ; 00080 00085 SoSFInt32 yValuesIndex ; 00086 00095 SoSFInt32 colorValuesIndex ; 00096 00104 SoSFNode material ; 00105 00106 /*----------------------------------------------------------------------------*/ 00107 00108 00109 private: 00110 static void initClass() ; 00111 static void exitClass() ; 00112 00113 enum ColorSource { 00114 DATA_MAPPING, 00115 COLOR_LIST, 00116 INHERITED_SOURCE 00117 } ; 00118 00119 // Retreives the color source. 00120 ColorSource getColorSource() const ; 00121 00122 private: 00123 PoChart() ; 00124 // Constructor. 00125 00126 virtual ~PoChart() ; 00127 // Destructor. 00128 00129 // Overloaded methods 00130 virtual void addElementsAllCaches() ; 00131 virtual void preRebuild() ; 00132 00133 // Compute the step angle for circular shape according to 00134 // the current complexity. 00135 virtual float computeStepAngle(SoState *state, float radius) const ; 00136 00137 // Decompose a SoMaterial in N SoMaterial. 00138 // N is the max number of components of the material source. 00139 static SoNodeList* decomposeSoMaterial(SoMaterial *matSrc) ; 00140 00141 // Methods 00142 virtual void setDefaultOnNonWritingFields() ; 00143 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ; 00144 00145 private: 00146 // Sensors 00147 FieldSensorList fieldSensorList ; 00148 00149 // List of fields defined in this class 00150 SoFieldList fieldList ; 00151 } ; 00152 00153 /*----------------------------------------------------------------------------*/ 00154 00155 #endif /* _PO_CHART_ */ 00156 00157