# SoPickedPoint.h

    00001 #ifndef COIN_SOPICKEDPOINT_H
    00002 #define COIN_SOPICKEDPOINT_H
    00003
    00004 /**************************************************************************\
    00005  *
    00006  *  This file is part of the Coin 3D visualization library.
    00007  *  Copyright (C) 1998-2003 by Systems in Motion.  All rights reserved.
    00008  *
    00009  *  This library is free software; you can redistribute it and/or
    00010  *  modify it under the terms of the GNU General Public License
    00011  *  ("GPL") version 2 as published by the Free Software Foundation.
    00012  *  See the file LICENSE.GPL at the root directory of this source
    00013  *  distribution for additional information about the GNU GPL.
    00014  *
    00015  *  For using Coin with software that can not be combined with the GNU
    00016  *  GPL, and for taking advantage of the additional benefits of our
    00017  *  support services, please contact Systems in Motion about acquiring
    00018  *  a Coin Professional Edition License.
    00019  *
    00020  *  See <URL:http://www.coin3d.org> for  more information.
    00021  *
    00022  *  Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY.
    00023  *  <URL:http://www.sim.no>.
    00024  *
    00025 \**************************************************************************/
    00026
    00027 #include <Inventor/SbBasic.h>
    00028 #include <Inventor/SbVec3f.h>
    00029 #include <Inventor/SbVec4f.h>
    00030 #include <Inventor/lists/SoDetailList.h>
    00031 #include <Inventor/SbViewportRegion.h>
    00032
    00033 class SoPath;
    00034 class SoDetail;
    00035 class SoNode;
    00036 class SoState;
    00037 class SbMatrix;
    00038
    00039 class COIN_DLL_API SoPickedPoint {
    00040 public:
    00041   SoPickedPoint(const SoPickedPoint & pp);
    00042   SoPickedPoint(const SoPath * const path, SoState * const state,
    00043                 const SbVec3f & objSpacePoint);
    00044   ~SoPickedPoint();
    00045   SoPickedPoint *copy() const;
    00046   const SbVec3f &getPoint() const;
    00047   const SbVec3f &getNormal() const;
    00048   const SbVec4f &getTextureCoords() const;
    00049   int getMaterialIndex() const;
    00050   SoPath *getPath() const;
    00051   SbBool isOnGeometry() const;
    00052   const SoDetail *getDetail(const SoNode * const node = NULL) const;
    00053   const SbMatrix &getObjectToWorld(const SoNode * const node = NULL) const;
    00054   const SbMatrix &getWorldToObject(const SoNode * const node = NULL) const;
    00055   const SbMatrix &getObjectToImage(const SoNode * const node = NULL) const;
    00056   const SbMatrix &getImageToObject(const SoNode * const node = NULL) const;
    00057   SbVec3f getObjectPoint(const SoNode * const node = NULL) const;
    00058   SbVec3f getObjectNormal(const SoNode * const node = NULL) const;
    00059   SbVec4f getObjectTextureCoords(const SoNode * const node = NULL) const;
    00060
    00061   void setObjectNormal(const SbVec3f &normal);
    00062   void setObjectTextureCoords(const SbVec4f &texCoords);
    00063   void setMaterialIndex(const int index);
    00064   void setDetail(SoDetail * detail, SoNode * node);
    00065
    00066 private:
    00067
    00068   SbVec3f point, objPoint;
    00069   SbVec3f normal, objNormal;
    00070   SbVec4f texCoords, objTexCoords;
    00071   int materialIndex;
    00072   SoPath *path;
    00073   SbBool onGeometry;
    00074   SoDetailList detailList;
    00075   SoState *state;
    00076   SbViewportRegion viewport;
    00077
    00078   class SoGetMatrixAction *getMatrixAction() const;
    00079   void applyMatrixAction(const SoNode * const node) const;
    00080 };
    00081
    00082 #endif // !COIN_SOPICKEDPOINT_H