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 : Martial Bonaventure (Nov 2010) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _MO_MESHDETAIL_ 00026 #define _MO_MESHDETAIL_ 00027 00028 #include <Inventor/details/SoSubDetail.h> 00029 #include <Inventor/STL/vector> 00030 00031 #include <MeshVizXLM/mapping/MoMeshVizDataMapping.h> 00032 #include <MeshVizXLM/mesh/data/MiDataSet.h> 00033 00034 class MiMesh; 00035 00036 class MoFaceDetail; 00037 class MoLineDetail; 00038 00039 #ifdef _WIN32 00040 #pragma warning(push) 00041 #pragma warning(disable:4251) 00042 #endif 00043 00045 // 00046 // Class: MoMeshDetail 00047 // 00048 // Detail information about a mesh. 00049 // 00050 // 00052 00074 class MESHIVIZDM_API MoMeshDetail : public SoDetail { 00075 00076 SO_DETAIL_HEADER(MoMeshDetail); 00077 00078 public: 00082 MoMeshDetail(); 00086 virtual ~MoMeshDetail(); 00087 00088 /* 00089 * Returns the type of the mesh 00090 */ 00091 MeshType getMeshType() const { return m_meshType; } 00092 00093 /* 00094 * Returns the mesh 00095 */ 00096 const MiMesh* getMesh() const { return m_mesh; } 00097 00098 /* 00099 * Returns the first associated color scalarset, NULL if none. 00100 */ 00101 const MiScalardSet* getColorScalarSet() const; 00102 00103 /* 00104 * Returns the list of associated color scalarsets, empty if none. 00105 */ 00106 const std::vector<const MiScalardSet*>& getColorScalarSets() const { return m_colorScalarsets; } 00107 00108 // Returns an instance that is a copy of this instance. The caller 00109 // is responsible for deleting the copy when done. 00110 virtual MoMeshDetail * copy() const; 00111 00112 private: 00113 MoMeshDetail(const MiMesh* mesh, MeshType meshType); 00114 00115 // set the associated scalarsets 00116 void setColorScalarSets(const std::vector< const MiBoundedDataSet<double>*>& colorScalarsets); 00117 // creates a new specialized face detail from the generic given one. 00118 // returns either a MoFaceDetailI, MoFaceDetailIj or a MoFaceDetailIjk depending on 00119 // the mesh type stored in this. 00120 MoFaceDetail* specilizeFaceDetail(const MoFaceDetail* faceDetail) const; 00121 // creates a new specialized line detail from the generic given one. 00122 // returns either a MoLineDetailI, MoLineDetailIj or a MoLineDetailIjk depending on 00123 // the mesh type stored in this. 00124 MoLineDetail* specilizeLineDetail(const MoLineDetail* lineDetail) const; 00125 00126 private: 00127 static void initClass(); 00128 static void exitClass(); 00129 00130 // temporary methods that convert a flat id into I/J/K indices until 00131 // the MeXTopologyI is proprely implementated in all extractors for IJK meshes 00132 void computeIj(size_t id, size_t& i, size_t &j) const ; 00133 void computeIjk(size_t id, size_t& i, size_t &j, size_t &k) const; 00134 00135 private: 00136 00137 MeshType m_meshType; 00138 const MiMesh* m_mesh; 00139 std::vector<const MiScalardSet*> m_colorScalarsets; 00140 00141 }; 00142 00143 #ifdef _WIN32 00144 #pragma warning(pop) 00145 #endif 00146 00147 #endif /* _MO_MESHDETAIL_ */ 00148