00001 /**************************************************************************\ 00002 * 00003 * This file is part of the Coin 3D visualization library. 00004 * Copyright (C) 1998-2002 by Systems in Motion. All rights reserved. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public License 00008 * version 2.1 as published by the Free Software Foundation. See the 00009 * file LICENSE.LGPL at the root directory of the distribution for 00010 * more details. 00011 * 00012 * If you want to use Coin for applications not compatible with the 00013 * LGPL, please contact SIM to acquire a Professional Edition license. 00014 * 00015 * Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY 00016 * http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097 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