Coin: SoPickedPoint.h Source File

| Coin3D is Free Software, published under the BSD 3-clause license. | https://coin3d.github.io https://www.kongsberg.com/en/kogt/

SoPickedPoint.h
1#ifndef COIN_SOPICKEDPOINT_H
2#define COIN_SOPICKEDPOINT_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/SbBasic.h>
37#include <Inventor/SbVec3f.h>
38#include <Inventor/SbVec4f.h>
39#include <Inventor/lists/SoDetailList.h>
40#include <Inventor/SbViewportRegion.h>
41
42class SoPath;
43class SoDetail;
44class SoNode;
45class SoState;
46class SbMatrix;
47
48 class COIN_DLL_API SoPickedPoint {
49public:
50 SoPickedPoint(const SoPickedPoint & pp);
51 SoPickedPoint(const SoPath * const path, SoState * const state,
52 const SbVec3f & objSpacePoint);
53 ~SoPickedPoint();
54 SoPickedPoint *copy() const;
55 const SbVec3f &getPoint() const;
56 const SbVec3f &getNormal() const;
57 const SbVec4f &getTextureCoords() const;
58 int getMaterialIndex() const;
59 SoPath *getPath() const;
60 SbBool isOnGeometry() const;
61 const SoDetail *getDetail(const SoNode * const node = NULL) const;
62 const SbMatrix &getObjectToWorld(const SoNode * const node = NULL) const;
63 const SbMatrix &getWorldToObject(const SoNode * const node = NULL) const;
64 const SbMatrix &getObjectToImage(const SoNode * const node = NULL) const;
65 const SbMatrix &getImageToObject(const SoNode * const node = NULL) const;
66 SbVec3f getObjectPoint(const SoNode * const node = NULL) const;
67 SbVec3f getObjectNormal(const SoNode * const node = NULL) const;
68 SbVec4f getObjectTextureCoords(const SoNode * const node = NULL) const;
69
70 void setObjectNormal(const SbVec3f &normal);
71 void setObjectTextureCoords(const SbVec4f &texCoords);
72 void setMaterialIndex(const int index);
73 void setDetail(SoDetail * detail, SoNode * node);
74
75private:
76
77 SbVec3f point, objPoint;
78 SbVec3f normal, objNormal;
79 SbVec4f texCoords, objTexCoords;
80 int materialIndex;
81 SoPath *path;
82 SbBool onGeometry;
83 SoDetailList detailList;
84 SoState *state;
85 SbViewportRegion viewport;
86
87 class SoGetMatrixAction *getMatrixAction() const;
88 void applyMatrixAction(const SoNode * const node) const;
89};
90
91#endif // !COIN_SOPICKEDPOINT_H
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition SbMatrix.h:47
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:51
SbVec4f
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition SbVec4f.h:49
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition SbViewportRegion.h:40
SoDetailList
The SoDetailList class is a container for pointers to SoDetail objects.
Definition SoDetailList.h:40
SoDetail
The SoDetail class is the superclass for all classes storing detailed information about particular sh...
Definition SoDetail.h:39
SoGetMatrixAction
The SoGetMatrixAction class is an action for accumulating the transformation matrix of a subgraph.
Definition SoGetMatrixAction.h:46
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition SoPath.h:52
SoPickedPoint::getObjectToWorld
const SbMatrix & getObjectToWorld(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:225
SoPickedPoint::getPoint
const SbVec3f & getPoint() const
Definition SoPickedPoint.cpp:155
SoPickedPoint::getTextureCoords
const SbVec4f & getTextureCoords() const
Definition SoPickedPoint.cpp:173
SoPickedPoint::getNormal
const SbVec3f & getNormal() const
Definition SoPickedPoint.cpp:164
SoPickedPoint::setObjectTextureCoords
void setObjectTextureCoords(const SbVec4f &texCoords)
Definition SoPickedPoint.cpp:331
SoPickedPoint::getObjectNormal
SbVec3f getObjectNormal(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:292
SoPickedPoint::getObjectTextureCoords
SbVec4f getObjectTextureCoords(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:307
SoPickedPoint::setMaterialIndex
void setMaterialIndex(const int index)
Definition SoPickedPoint.cpp:341
SoPickedPoint::getObjectToImage
const SbMatrix & getObjectToImage(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:249
SoPickedPoint::setObjectNormal
void setObjectNormal(const SbVec3f &normal)
Definition SoPickedPoint.cpp:321
SoPickedPoint::getDetail
const SoDetail * getDetail(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:212
SoPickedPoint::getObjectPoint
SbVec3f getObjectPoint(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:276
SoPickedPoint::getMaterialIndex
int getMaterialIndex() const
Definition SoPickedPoint.cpp:182
SoPickedPoint::isOnGeometry
SbBool isOnGeometry() const
Definition SoPickedPoint.cpp:202
SoPickedPoint::copy
SoPickedPoint * copy() const
Definition SoPickedPoint.cpp:146
SoPickedPoint::getWorldToObject
const SbMatrix & getWorldToObject(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:237
SoPickedPoint::getPath
SoPath * getPath() const
Definition SoPickedPoint.cpp:191
SoPickedPoint::setDetail
void setDetail(SoDetail *detail, SoNode *node)
Definition SoPickedPoint.cpp:352
SoPickedPoint::SoPickedPoint
SoPickedPoint(const SoPickedPoint &pp)
Definition SoPickedPoint.cpp:80
SoPickedPoint::getImageToObject
const SbMatrix & getImageToObject(const SoNode *const node=NULL) const
Definition SoPickedPoint.cpp:261
SoState
The SoState class manages the Coin scene graph traversal state data.
Definition SoState.h:44