00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MO_MESHVECTORS_
00024 #define _MO_MESHVECTORS_
00025
00026 #include <MeshVizXLM/MbVec3.h>
00027
00028 #include <MeshVizXLM/mapping/nodes/MoMeshRepresentation.h>
00029 #include <MeshVizXLM/mapping/nodes/MoDataBinding.h>
00030
00031 #include <Inventor/fields/SoMFFloat.h>
00032
00033 #ifdef _WIN32
00034 #pragma warning(push)
00035 #pragma warning(disable:4251)
00036 #endif
00037
00038 class MiLineMeshUnstructured;
00039 class MiLineMeshCurvilinear;
00040 class MiLineMeshRegular;
00041 class MiVolumeMeshUnstructured;
00042 class MiVolumeMeshUnstructuredIjk;
00043 class MiVolumeMeshRegular;
00044 class MiVolumeMeshRectilinear;
00045 class MiVolumeMeshCurvilinear;
00046 class MiCellFilter;
00047 class MiCellFilterI;
00048 class MiMeshUnstructuredI;
00049 class SoLineSet;
00050 class SoVertexProperty;
00051 class MiGeometryI;
00052 class MxIndexDataSetI;
00053 class MiMeshUnstructuredI;
00054
00055
00085 class MESHIVIZDM_API MoMeshVector : public MoMeshRepresentation {
00086
00087 SO_NODE_HEADER(MoMeshVector) ;
00088
00089 public:
00090
00094 MoMeshVector() ;
00095
00102 SoSFInt32 vectorSetId;
00103
00109 SoSFFloat scaleFactor;
00110
00125 SoSFFloat shiftFactor;
00126
00131 SoSFBool arrow;
00132
00133
00134 private:
00135 static void initClass() ;
00136 static void exitClass() ;
00137
00138 private:
00139 virtual void doExtract(SoAction * action);
00140
00141
00142 virtual const MiMesh* getExtractedMesh(MeshType& SO_UNUSED_PARAM(meshType)) { return NULL;}
00143
00144 private:
00145 virtual ~MoMeshVector() ;
00146
00147 void clear();
00148
00149 void doExtract(SoState* state, const MiMeshUnstructuredI& realMesh);
00150
00151 template < typename _adaptorT, typename _MeshIjT>
00152 void doExtractSurfaceIj(SoState* state, _MeshIjT& realMesh);
00153
00154 template < typename _adaptorT, typename _MeshIjkT>
00155 void doExtractVolumeIjk(SoState* state, _MeshIjkT& realMesh, MoDataBinding::DataBinding* dataBinding = NULL);
00156
00157 void buildVectors(SoState* state, const MiMeshUnstructuredI& uMesh, const MiVec3dSetI& vec3,
00158 const MiScalardSetI* colorSet, const MiCellFilterI* filter=NULL);
00159
00160 bool initLineSet(size_t numVectors, SoLineSet*& ls, SoVertexProperty*& vp);
00161 void fillLineSet(SoLineSet*& ls, SoVertexProperty*& vp, MxIndexDataSetI& extract, const MiGeometryI& geom, const MiVec3dSetI& vec3);
00162 void fillShapeSet(SoLineSet*& ls, SoVertexProperty*& vp, MxIndexDataSetI& extract, const MiGeometryI& geom, const MiVec3dSetI& vec3);
00163 void fillColors(SoState* state, SoLineSet* fs, SoVertexProperty* vp, MxIndexDataSetI& extract, const MiScalardSetI* colorSet);
00164 bool haveValuesChanged(size_t topoTimeStamp, size_t geoTimeStamp, size_t vec3TimeStamp,
00165 SoState* state, const MiDataSet* colorSet, const MiCellFilter* filter=NULL);
00166
00167 size_t m_topoTimeStamp;
00168 size_t m_geoTimeStamp;
00169 size_t m_vec3TimeStamp;
00170 size_t m_colorTimeStamp;
00171 size_t m_colorMapTimeStamp;
00172 size_t m_cellFilterTimeStamp;
00173 float m_scaleFactor;
00174 float m_shiftFactor;
00175 bool m_arrow;
00176
00177 size_t m_numPointVec;
00178
00179 MxIndexDataSetI* m_extract;
00180
00181 bool m_cleared;
00182
00183 } ;
00184
00185 #ifdef _WIN32
00186 #pragma warning(pop)
00187 #endif
00188
00189 #endif
00190
00191
00192
00193