00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _GEOM_ELEM_
00024 #define _GEOM_ELEM_
00025
00026 #ifdef _MSC_VER
00027 #pragma warning( push )
00028 #pragma warning(disable:4251)
00029 #endif
00030
00031 #include <LDM/SoLDMLargeDataManagement.h>
00032 #include <Inventor/SbBox.h>
00033 #include <Inventor/SbViewVolume.h>
00034 #include <Inventor/STL/map>
00035 #include <Inventor/helpers/SbGlContextHelper.h>
00036 #include <Inventor/misc/SoRef.h>
00037 #include <Inventor/nodes/SoShape.h>
00038 #include <LDM/SoLDMTileID.h>
00039
00040 class SoAction;
00041 class SoShape;
00042 class SoROI;
00043 class SoState;
00044 class SoNodeSensor;
00045
00062 SoEXTENDER_Documented class SoDEPRECATED SoLDMGeomElement{
00063
00064 public:
00065
00069 SoLDMGeomElement(SoLDMGeometry*);
00070
00074 virtual ~SoLDMGeomElement();
00075
00076 private:
00086 virtual SbBool setGeometry( SoAction *action, SoNode *node, SbBool& userInteracts) = 0;
00087
00095 virtual float getGeomToTileDist(SbBox3i32& tileBox, SbBox3f &tileGeomPos, SbVec3f &tileGeomCenter) = 0;
00096
00100 inline SoNode* getNode();
00105 inline float getWeight();
00109 inline SbMatrix& getMatrix();
00113 inline SbBox3f getBBox();
00117 inline SoROI* getROI();
00118
00119 virtual bool isSkin(){return false;};
00120 virtual bool isFullyTransparent(double min, double max);
00121
00128 int getROIToTileDist(SbBox3i32& tileBox);
00129
00130
00131 virtual bool isVolume(){return false;};
00132
00133 private:
00134 void setNumTiles(int numTiles){m_numTiles=numTiles;};
00135 int getNumTiles(){return m_numTiles;};
00136
00137 inline void setCurrentTileId(const SoLDMTileID& tile);
00138
00139
00140 SbBox3i32 dataBox;
00141 SbBox3i32 dataDimension;
00142 bool m_toUpdate;
00143
00144 private:
00145 static const float s_tolerance;
00146
00147 SbBool setCommonGeometry( SoAction *action, SoShape *node, SbBool& userInteracts);
00148
00149 typedef std::map<SbGlContextHelper::GLContext, SbBox3i32> CtxBBoxMap;
00150 typedef std::map<SbGlContextHelper::GLContext, SoShape*> CtxShapeMap;
00151 typedef std::map<SbGlContextHelper::GLContext, SbViewVolume> CtxViewVolumeMap;
00152 typedef std::map<SbGlContextHelper::GLContext, SbMatrix> CtxMatrixMap;
00153 CtxShapeMap m_ctxShape;
00154 CtxBBoxMap m_ctxBBox;
00155 CtxViewVolumeMap m_ctxViewVolume;
00156 CtxMatrixMap m_ctxModelMatrix;
00157
00158 float m_weight;
00159 SbMatrix m_matrix;
00160
00161 SbMatrix m_modelMatrix;
00162 SbViewVolume m_viewVolume;
00163
00164 SbBox3f m_bbox;
00165 SbBox3i32 m_dataBox;
00166 int m_ROIflag;
00167
00168 SbBox3i32 m_ROISubVolume;
00169 SbBox3i32 m_ROIBox;
00170 SoLDMGeometry* m_vvizGeom;
00171 int m_numTiles;
00172
00174 SoLDMTileID m_curTileId;
00175
00176 private:
00177
00178
00179 SoROI* m_ROINode;
00180 SoNodeSensor* m_roiNodeSensor;
00181 static void roiChangedSensorCB(void* data, SoSensor *sensor);
00182 static void roiRemovedSensorCB(void* data, SoSensor *sensor);
00183
00184
00185
00186 SoShape* m_shape;
00187 SoNodeSensor* m_shapeNodeSensor;
00188 static void shapeRemovedSensorCB(void* data, SoSensor *sensor);
00189 };
00190
00191
00192
00193 inline float
00194 SoLDMGeomElement::getWeight()
00195 {
00196 #if defined(_DEBUG)
00197 if(m_weight == 0)
00198 SoError::post("SoLDMGeomElement returns a null weight");
00199 #endif
00200 return m_weight;
00201 }
00202
00203
00204 inline bool
00205 SoLDMGeomElement::isFullyTransparent(double , double )
00206 {
00207 return false;
00208 }
00209
00210
00211 inline void
00212 SoLDMGeomElement::setCurrentTileId(const SoLDMTileID& tile)
00213 {
00214 m_curTileId = tile;
00215 }
00216
00217
00218 SoROI*
00219 SoLDMGeomElement::getROI()
00220 {
00221 return m_ROINode;
00222 }
00223
00224
00225 SoNode*
00226 SoLDMGeomElement::getNode()
00227 {
00228 return m_shape;
00229 }
00230
00231
00232 SbMatrix&
00233 SoLDMGeomElement::getMatrix()
00234 {
00235 return m_matrix;
00236 }
00237
00238
00239 SbBox3f
00240 SoLDMGeomElement::getBBox()
00241 {
00242 return m_bbox;
00243 }
00244
00245 #ifdef _MSC_VER
00246 #pragma warning( pop )
00247 #endif
00248
00249 #endif
00250
00251
00252