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_POLAR_AXIS_ 00025 #define _PO_POLAR_AXIS_ 00026 00027 #include <MeshViz/graph/PoAxis.h> 00028 #include <Inventor/fields/SoSFEnum.h> 00029 #include <Inventor/fields/SoSFFloat.h> 00030 00043 class PoPolarAxis : public PoAxis { 00044 00045 SO_KIT_HEADER(PoPolarAxis) ; 00046 00047 /* Define fields for new parts */ 00048 SO_KIT_CATALOG_ENTRY_HEADER(multFactorSep) ; 00049 SO_KIT_CATALOG_ENTRY_HEADER(multFactorApp) ; 00050 SO_KIT_CATALOG_ENTRY_HEADER(multFactor) ; 00051 00052 00053 00054 public: 00055 00059 enum MultFactorPosition { 00063 MULT_FACTOR_START, 00067 MULT_FACTOR_END, 00071 MULT_FACTOR_EXTR, 00075 MULT_FACTOR_GRAD 00076 } ; 00077 00078 /* Fields */ 00079 00083 SoSFFloat offset ; 00084 00088 SoSFFloat startRadius ; 00089 00093 SoSFFloat endRadius ; 00094 00098 SoSFFloat theta ; 00099 00100 /* Ten power attributes */ 00101 00105 SoSFEnum multFactorPosition ; 00106 00113 SoSFFloat multFactorDistAxis ; 00114 00120 void getMultFactor(MultFactorPosition &position, float &distAxis) const ; 00121 00122 /*----------------------------------------------------------------------------*/ 00123 private: 00124 static void initClass() ; 00125 static void exitClass() ; 00126 00127 struct MultFactor { 00128 MultFactorPosition position ; 00129 float distAxis ; 00130 } ; 00131 00132 private: 00133 struct PolarAxisAttr { 00134 MultFactor multFactor ; 00135 } ; 00136 // Polar axis attr 00137 00138 // Constructor 00139 PoPolarAxis(float offset = 0., float startRadius = 0., float endRadius = 1., 00140 float theta = 0.) ; 00141 // Destructor 00142 virtual ~PoPolarAxis() ; 00143 00144 // Methods 00145 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ; 00146 virtual void setDefaultOnNonWritingFields() ; 00147 00148 // Build tick - The ticks are built under the node "group" 00149 virtual void buildGridLines(const std::vector<float>& xGrad, SoGroup *group) ; 00150 00151 // Save all axis attributes which can be modified by MeshViz. 00152 virtual void saveAxisAttr() ; 00153 00154 // Computed polar axis attributes 00155 PolarAxisAttr polAxisAttr ; 00156 00157 private: 00158 // Sensors 00159 FieldSensorList fieldSensorList ; 00160 00161 // List of fields defined in this class 00162 SoFieldList fieldList ; 00163 } ; 00164 00165 /*----------------------------------------------------------------------------*/ 00166 00167 #endif /* _PO_POLAR_AXIS_ */ 00168 00169