00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef COIN_SO_PICKED_POINT_H
00021 #define COIN_SO_PICKED_POINT_H
00022
00023 #include <Inventor/SbBasic.h>
00024 #include <Inventor/SbVec3f.h>
00025 #include <Inventor/SbVec4f.h>
00026 #include <Inventor/lists/SoDetailList.h>
00027 #include <Inventor/SbViewportRegion.h>
00028
00029 class SoPath;
00030 class SoDetail;
00031 class SoNode;
00032 class SoState;
00033 class SbMatrix;
00034
00035 class COIN_DLL_API SoPickedPoint {
00036 public:
00037 SoPickedPoint(const SoPickedPoint & pp);
00038 SoPickedPoint(const SoPath * const path, SoState * const state,
00039 const SbVec3f & objSpacePoint);
00040 ~SoPickedPoint();
00041 SoPickedPoint *copy() const;
00042 const SbVec3f &getPoint() const;
00043 const SbVec3f &getNormal() const;
00044 const SbVec4f &getTextureCoords() const;
00045 int getMaterialIndex() const;
00046 SoPath *getPath() const;
00047 SbBool isOnGeometry() const;
00048 const SoDetail *getDetail(const SoNode * const node = NULL) const;
00049 const SbMatrix &getObjectToWorld(const SoNode * const node = NULL) const;
00050 const SbMatrix &getWorldToObject(const SoNode * const node = NULL) const;
00051 const SbMatrix &getObjectToImage(const SoNode * const node = NULL) const;
00052 const SbMatrix &getImageToObject(const SoNode * const node = NULL) const;
00053 SbVec3f getObjectPoint(const SoNode * const node = NULL) const;
00054 SbVec3f getObjectNormal(const SoNode * const node = NULL) const;
00055 SbVec4f getObjectTextureCoords(const SoNode * const node = NULL) const;
00056
00057 void setObjectNormal(const SbVec3f &normal);
00058 void setObjectTextureCoords(const SbVec4f &texCoords);
00059 void setMaterialIndex(const int index);
00060 void setDetail(SoDetail * detail, SoNode * node);
00061
00062 private:
00063
00064 SbVec3f point, objPoint;
00065 SbVec3f normal, objNormal;
00066 SbVec4f texCoords, objTexCoords;
00067 int materialIndex;
00068 SoPath *path;
00069 SbBool onGeometry;
00070 SoDetailList detailList;
00071 SoState *state;
00072 SbViewportRegion viewport;
00073
00074 class SoGetMatrixAction *getMatrixAction() const;
00075 void applyMatrixAction(const SoNode * const node) const;
00076 };
00077
00078 #endif // !COIN_SOPICKEDPOINT_H