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_MESHREPRESENTATIONDETAIL_ 00026 #define _MO_MESHREPRESENTATIONDETAIL_ 00027 00028 #ifdef _WIN32 00029 # pragma warning( push ) 00030 # pragma warning(disable:4251) 00031 #endif 00032 00033 #include <Inventor/details/SoSubDetail.h> 00034 #include <Inventor/STL/vector> 00035 00036 #include <MeshVizXLM/extrmesh/data/MeXDataSetI.h> 00037 #include <MeshVizXLM/mapping/MoMeshVizDataMapping.h> 00038 00039 class MiMeshUnstructuredI; 00040 00042 // 00043 // Class: MoMeshRepresentationDetail 00044 // 00045 // Detail information about a mesh representation. 00046 // 00047 // 00049 00067 class MESHIVIZDM_API MoMeshRepresentationDetail : public SoDetail { 00068 00069 SO_DETAIL_HEADER(MoMeshRepresentationDetail); 00070 00071 public: 00075 MoMeshRepresentationDetail(); 00079 virtual ~MoMeshRepresentationDetail(); 00080 00081 /* 00082 * Returns the first mapped scalarset used for coloring the mesh representation 00083 */ 00084 const MeXScalardSetI* getExtractedColorScalarSet() const; 00085 00086 /* 00087 * Returns the list of mapped scalarsets used for coloring the mesh representation 00088 */ 00089 const std::vector<const MeXScalardSetI*>& getExtractedColorScalarSets() const { return m_extractedColorScalarsets; } 00090 00091 // Returns an instance that is a copy of this instance. The caller 00092 // is responsible for deleting the copy when done. 00093 virtual MoMeshRepresentationDetail * copy() const = 0; 00094 00095 private: 00096 MoMeshRepresentationDetail(const MiMeshUnstructuredI* mesh, const std::vector<const MeXScalardSetI*>& scalarsets); 00097 00098 // Computes the values of the scalarsets in the cell defined by the index at the given point. 00099 // Returns an empty vector if point is not inside the cell. 00100 std::vector<double> computeValues(const MbVec3d& point, int32_t index) const; 00101 00102 private: 00103 static void initClass(); 00104 static void exitClass(); 00105 00106 private: 00107 const MiMeshUnstructuredI* m_mesh; 00108 std::vector<const MeXScalardSetI*> m_extractedColorScalarsets; 00109 00110 }; 00111 00112 #ifdef _WIN32 00113 # pragma warning( pop ) 00114 #endif 00115 00116 #endif /* _MO_MESHREPRESENTATIONDETAIL_ */ 00117 00118