00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SBTVIZDATA_H
00025 #define SBTVIZDATA_H
00026
00027 #include <Inventor/SbLinear.h>
00028 #include <Inventor/SbString.h>
00029
00030 typedef float ZType;
00031
00032 class SoDEPRECATED SbTVizData {
00061
00062 public:
00063
00064 enum OpenMode {
00068 TVIZ_UNKNOWN = 0,
00072 TVIZ_ASCII,
00076 TVIZ_BINARY
00077 };
00078
00079 enum DataType {
00083 TVIZ_UCHAR = 0,
00087 TVIZ_USHORT,
00091 TVIZ_UINT32,
00095 TVIZ_FLOAT,
00099 TVIZ_CHAR,
00103 TVIZ_SHORT,
00107 TVIZ_INT32
00108 };
00109
00110 enum Encoding {
00114 TVIZ_BIG_ENDIAN = 0,
00118 TVIZ_LITTLE_ENDIAN
00119 };
00120
00121
00122 enum Condition {
00126 TVIZ_LOWER = 0,
00130 TVIZ_LOWER_OR_EQUAL,
00134 TVIZ_EQUAL,
00138 TVIZ_GREATER,
00142 TVIZ_GREATER_OR_EQUAL
00143 };
00144
00145
00146
00150 virtual ~SbTVizData(){};
00154 virtual float getValue(const SbVec2d& point) const = 0;
00158 virtual float getAvgValue() const = 0;
00162 virtual float getMaxValue() const = 0;
00166 virtual float getMinValue() const = 0;
00170 const SbString& getFileName() const;
00174 const SbVec3d& getSize() const;
00179 const SbVec3d& getOffset() const;
00180
00184 void setHoleValue(float value, Condition cond);
00188 float getHoleValue(Condition& cond) const;
00189
00195 void setHoleEdgePrecision(float holeRez);
00201 float getHoleEdgePrecision() const;
00202
00206 DataType getDataType() const;
00210 OpenMode getOpenMode() const;
00214 Encoding getEncoding() const;
00218 virtual SbBool writeDataFile(const SbString& filename, OpenMode mode) = 0;
00219
00220 private:
00221 float getRange() const;
00222 float getTypicalRange() const;
00223 float getTypicalMinHeight() const;
00224 float getTypicalMaxHeight() const;
00225 float getTypeRange() const;
00226
00227 virtual SbBool isOfType(SbString& className) const = 0;
00228
00229 virtual ZType getZValue(SbVec2i32 coord) const = 0;
00230 virtual float getModellingZValue(SbVec2i32 coord) const = 0;
00231
00232
00233 enum holeStatus {
00234 HOLE_OUT,
00235 HOLE_INTERSECT,
00236 HOLE_IN
00237 };
00238
00239 SbBool hasHoles() const {return holeFlag;}
00240
00241 SbBool isInHole(ZType v0) const;
00242 holeStatus isInHole(ZType v0, ZType v1, ZType v2) const;
00243
00244 SbVec2s& getStretchedSize() { return stretchedSize; }
00245
00246 private:
00247 SbTVizData(){};
00248
00249 SbBool holeFlag;
00250 float avgValue;
00251 float maxValue;
00252 float minValue;
00253 SbString fileName;
00254 SbVec3d offset;
00255 Encoding encoding;
00256 OpenMode openMode;
00257 DataType dataType;
00258 float range;
00259 SbVec3d size;
00260 float holeValue;
00261 float holeRez;
00262 Condition holeCondition;
00263 SbVec2s stretchedSize;
00264
00265
00266 float typicalRange;
00267 float typicalMinHeight;
00268 float typicalMaxHeight;
00269
00270
00271
00272 float typeRange;
00273
00274 };
00275
00276 #endif
00277
00278
00279