Coin Logo http://www.sim.no
http://www.coin3d.org

SoPickedPoint.h
1 #ifndef COIN_SOPICKEDPOINT_H
2 #define COIN_SOPICKEDPOINT_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/SbBasic.h>
28 #include <Inventor/SbVec3f.h>
29 #include <Inventor/SbVec4f.h>
30 #include <Inventor/lists/SoDetailList.h>
31 #include <Inventor/SbViewportRegion.h>
32 
33 class SoPath;
34 class SoDetail;
35 class SoNode;
36 class SoState;
37 class SbMatrix;
38 
39 class COIN_DLL_API SoPickedPoint {
40 public:
41  SoPickedPoint(const SoPickedPoint & pp);
42  SoPickedPoint(const SoPath * const path, SoState * const state,
43  const SbVec3f & objSpacePoint);
44  ~SoPickedPoint();
45  SoPickedPoint *copy() const;
46  const SbVec3f &getPoint() const;
47  const SbVec3f &getNormal() const;
48  const SbVec4f &getTextureCoords() const;
49  int getMaterialIndex() const;
50  SoPath *getPath() const;
51  SbBool isOnGeometry() const;
52  const SoDetail *getDetail(const SoNode * const node = NULL) const;
53  const SbMatrix &getObjectToWorld(const SoNode * const node = NULL) const;
54  const SbMatrix &getWorldToObject(const SoNode * const node = NULL) const;
55  const SbMatrix &getObjectToImage(const SoNode * const node = NULL) const;
56  const SbMatrix &getImageToObject(const SoNode * const node = NULL) const;
57  SbVec3f getObjectPoint(const SoNode * const node = NULL) const;
58  SbVec3f getObjectNormal(const SoNode * const node = NULL) const;
59  SbVec4f getObjectTextureCoords(const SoNode * const node = NULL) const;
60 
61  void setObjectNormal(const SbVec3f &normal);
62  void setObjectTextureCoords(const SbVec4f &texCoords);
63  void setMaterialIndex(const int index);
64  void setDetail(SoDetail * detail, SoNode * node);
65 
66 private:
67 
68  SbVec3f point, objPoint;
69  SbVec3f normal, objNormal;
70  SbVec4f texCoords, objTexCoords;
71  int materialIndex;
72  SoPath *path;
73  SbBool onGeometry;
74  SoDetailList detailList;
75  SoState *state;
76  SbViewportRegion viewport;
77 
78  class SoGetMatrixAction *getMatrixAction() const;
79  void applyMatrixAction(const SoNode * const node) const;
80 };
81 
82 #endif // !COIN_SOPICKEDPOINT_H
SbPList::getLength
int getLength(void) const
Definition: SbPList.h:94
SoPickedPoint::getObjectNormal
SbVec3f getObjectNormal(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:279
SoState
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:35
SoPickedPoint::getNormal
const SbVec3f & getNormal() const
Definition: SoPickedPoint.cpp:151
SoPickedPoint::setMaterialIndex
void setMaterialIndex(const int index)
Definition: SoPickedPoint.cpp:328
SoAction::apply
virtual void apply(SoNode *root)
Definition: SoAction.cpp:476
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoPickedPoint::~SoPickedPoint
~SoPickedPoint()
Definition: SoPickedPoint.cpp:118
SoGetMatrixAction::getTextureInverse
SbMatrix & getTextureInverse(void)
Definition: SoGetMatrixAction.cpp:178
SoPickedPoint::getDetail
const SoDetail * getDetail(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:199
SoPickedPoint::getObjectToImage
const SbMatrix & getObjectToImage(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:236
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SoPickedPoint::getMaterialIndex
int getMaterialIndex() const
Definition: SoPickedPoint.cpp:169
SoGetMatrixAction::getInverse
SbMatrix & getInverse(void)
Definition: SoGetMatrixAction.cpp:160
SoGetMatrixAction::setViewportRegion
void setViewportRegion(const SbViewportRegion &region)
Definition: SoGetMatrixAction.cpp:128
SoFullPath
The SoFullPath class allows examination of hidden children in paths.
Definition: SoFullPath.h:29
SoGetMatrixAction::getTextureMatrix
SbMatrix & getTextureMatrix(void)
Definition: SoGetMatrixAction.cpp:169
SoPickedPoint::setObjectTextureCoords
void setObjectTextureCoords(const SbVec4f &texCoords)
Definition: SoPickedPoint.cpp:318
SoDetailList::set
void set(const int index, SoDetail *item)
Definition: SoDetailList.cpp:115
SoPickedPoint::getImageToObject
const SbMatrix & getImageToObject(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:248
SoPickedPoint::SoPickedPoint
SoPickedPoint(const SoPickedPoint &pp)
Definition: SoPickedPoint.cpp:67
SoBase::unref
void unref(void) const
Definition: SoBase.cpp:627
SoPath::findNode
int findNode(const SoNode *const node) const
Definition: SoPath.cpp:587
SoPickedPoint::isOnGeometry
SbBool isOnGeometry() const
Definition: SoPickedPoint.cpp:189
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SoGetMatrixAction
The SoGetMatrixAction class is an action for accumulating the transformation matrix of a subgraph.
Definition: SoGetMatrixAction.h:35
SoGetMatrixAction::getMatrix
SbMatrix & getMatrix(void)
Definition: SoGetMatrixAction.cpp:151
SoPickedPoint::getObjectPoint
SbVec3f getObjectPoint(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:263
SoDetail
The SoDetail class is the superclass for all classes storing detailed information about particular sh...
Definition: SoDetail.h:30
SoPickedPoint::getPoint
const SbVec3f & getPoint() const
Definition: SoPickedPoint.cpp:142
SoPickedPoint::getWorldToObject
const SbMatrix & getWorldToObject(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:224
SoDetailList
The SoDetailList class is a container for pointers to SoDetail objects.
Definition: SoDetailList.h:31
SbMatrix::multDirMatrix
void multDirMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1411
SoBase::ref
void ref(void) const
Definition: SoBase.cpp:574
SoPickedPoint::getObjectToWorld
const SbMatrix & getObjectToWorld(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:212
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoPath::copy
SoPath * copy(const int startfromnodeindex=0, int numnodes=0) const
Definition: SoPath.cpp:673
SoPickedPoint::getObjectTextureCoords
SbVec4f getObjectTextureCoords(const SoNode *const node=NULL) const
Definition: SoPickedPoint.cpp:294
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:31
SoPickedPoint::getTextureCoords
const SbVec4f & getTextureCoords() const
Definition: SoPickedPoint.cpp:160
SoPickedPoint
The SoPickedPoint class is used for specifying picked points.
Definition: SoPickedPoint.h:39
SoDetailList::copy
void copy(const SoDetailList &l)
Definition: SoDetailList.cpp:103
SoPath::getNode
SoNode * getNode(const int index) const
Definition: SoPath.cpp:402
SoPickedPoint::copy
SoPickedPoint * copy() const
Definition: SoPickedPoint.cpp:133
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoPickedPoint::setObjectNormal
void setObjectNormal(const SbVec3f &normal)
Definition: SoPickedPoint.cpp:308
SoPickedPoint::setDetail
void setDetail(SoDetail *detail, SoNode *node)
Definition: SoPickedPoint.cpp:339
SoPickedPoint::getPath
SoPath * getPath() const
Definition: SoPickedPoint.cpp:178
SbVec4f
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition: SbVec4f.h:34

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Mon Jul 27 2020 for Coin by Doxygen. 1.8.18