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 #ifndef _MIDATASET_H 00024 #define _MIDATASET_H 00025 00026 #include <Inventor/STL/string> 00027 #include <Inventor/STL/iostream> 00028 00029 #include <MeshVizXLM/MxMeshIViz.h> 00030 #include <MeshVizXLM/MbVec3.h> 00031 00032 //----------------------------------------------------------------------------- 00042 class MiDataSet 00043 { 00044 public: 00045 virtual ~MiDataSet() {} 00046 00053 virtual size_t getTimeStamp() const = 0; 00054 00058 virtual std::string getName() const = 0; 00059 00061 enum DataBinding { 00062 PER_CELL, 00063 PER_NODE 00064 }; 00065 00069 virtual DataBinding getBinding() const = 0; 00070 00074 friend std::ostream& operator << (std::ostream& s, const MiDataSet& dataset) 00075 { 00076 return dataset.toStream(s); 00077 } 00078 00079 private: protected: 00083 virtual std::ostream& toStream(std::ostream& s) const 00084 { 00085 s << "# dataset name" << std::endl; 00086 s << getName() << std::endl; 00087 return s; 00088 } 00089 00090 }; 00091 00092 //----------------------------------------------------------------------------- 00102 template <typename _T>class SoDEPRECATED MiBoundedDataSet: virtual public MiDataSet 00104 { 00105 public: 00106 virtual ~MiBoundedDataSet() {} 00107 00111 virtual _T getMin() const { return (_T) 0.; } 00112 00116 virtual _T getMax() const { return (_T) 0.; } 00117 00118 private: protected: 00122 virtual std::ostream& toStream(std::ostream& s) const 00123 { 00124 MiDataSet::toStream(s); 00125 s << "# min " << std::endl; 00126 s << getMin() << std::endl; 00127 s << "# max " << std::endl; 00128 s << getMax() << std::endl; 00129 return s; 00130 } 00131 00132 }; 00133 00138 typedef MiBoundedDataSet<double> MiScalardSet; 00143 typedef MiBoundedDataSet<MbVec3d> MiVec3dSet; 00144 00145 00146 #endif 00147 00148 00149