Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoRayPickAction.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul S. Strauss (MMM yyyy)
25** Modified by : Nick Thompson (MMM yyyy)
26**=======================================================================*/
27/*=======================================================================
28 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
29 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
30 *** ***
31 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
32 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
33 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
34 *** ***
35 *** RESTRICTED RIGHTS LEGEND ***
36 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
37 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
38 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
39 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
40 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
41 *** ***
42 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
43 *** BORDEAUX, FRANCE ***
44 *** ALL RIGHTS RESERVED ***
45**=======================================================================*/
46/*=======================================================================
47** Modified by : VSG (MMM YYYY)
48**=======================================================================*/
49
50
51#ifndef _SO_RAY_PICK_ACTION_
52#define _SO_RAY_PICK_ACTION_
53
54#include <Inventor/SoLists.h>
55#include <Inventor/nodes/SoCamera.h>
56#include <Inventor/actions/SoPickAction.h>
57#include <Inventor/SbBox.h>
58#include <Inventor/lists/SoPickedPointList.h>
59
60class PickedPointListImpl;
61class HomTransfData;
62class SoDeviceContext;
63
65//
66// Class: SoRayPickAction
67//
68// Picking action that intersects a ray with objects in the scene
69// graph. The ray can be specified by calling setPoint() with a point
70// in a viewport in a rendering window or by calling setRay() with a
71// world-space ray. In the setPoint() case, a valid camera must be
72// encountered in the graph to set up the mapping to world space.
73//
74// The "pickAll" flag indicates whether all intersections along the
75// ray should be returned (sorted by distance from the starting point
76// of the ray), or just the closest one. In either case, the
77// intersections are returned as an SoPickedPointList. Each
78// intersection can be examined by accessing the appropriate
79// SoPickedPoint in the list. The SoPickedPoint class provides
80// methods to get the intersection point, normal, and other info.
81//
83
362
363 SO_ACTION_HEADER(SoRayPickAction);
364
365 public:
366
373 static void setStereoMode(SoCamera::StereoMode stereoMode);
374
378
384 SoRayPickAction(const SbViewportRegion &viewportRegion);
385
394 virtual void clearApplyResult();
395
396 // Destructor
397#ifndef HIDDEN_FROM_DOC
398 virtual ~SoRayPickAction();
399#endif // HIDDEN_FROM_DOC
400
402 //
403 // Setting up the action before it is applied:
404 //
405
414
430
431 // EDGE_PICKING,
432 // FACE_PICKING
433 };
434
440 void setPickingMode(PickingMode pickingMode);
441
446
455 virtual void setPoint(const SbVec2s &viewportPoint);
456
465 virtual void setPoint(const SbVec2f &viewportPoint);
466
471 const SbVec2s& getPoint() const { return VPPoint; }
472
478 const SbVec2f& getPointFloat() const { return VPPointFloat; }
479
487 virtual void setNormalizedPoint(const SbVec2f &normPoint);
488
499 { return normVPPoint; }
500
521 void setRadius(float radius);
522
526 float getRadius() const
527 { return VPRadius; }
528
546 virtual void setRay(const SbVec3f &start, const SbVec3f &direction,
547 float nearDistance = -1.0,
548 float farDistance = -1.0);
549
569 virtual void setRay(float fovy, const SbVec3f &start, const SbVec3f &direction,
570 float nearDistance = -1.0,
571 float farDistance = -1.0);
572
577 void setPickAll(SbBool flag)
578 { pickAll = flag; }
579
585 { return pickAll; }
586
588 //
589 // Examining results after the action is applied:
590 //
591
600
618 SoPickedPoint *getPickedPoint(int index = 0) const;
619SoDEPRECATED
630
641
647
654 static void enableTriangleCulling(SbBool flag) ;
655
656
661 { return s_triangleCullingEnabled; }
662
669
674 void enableNormalsGeneration(const SbBool enable);
675
681
687
702
707 { return m_conicPickVolume; }
708
710 virtual void apply( SoNode* node );
711
713 virtual void apply( SoPath* path );
714
716 virtual void apply(const SoPathList &pathList, SbBool obeysRules = FALSE) { SoAction::apply(pathList, obeysRules); }
717
718
719 private:
720
721 // If a ray was not defined with setRay(), this causes the world
722 // space pick ray to be computed from the screen space point and
723 // radius, using the current view specification from the state.
724 // This is typically done when a camera is encountered during
725 // traversal.
726 void computeWorldSpaceRay();
727
728 // This returns TRUE if the action has had a world space ray set
729 // or computed
730 SbBool hasWorldSpaceRay() const;
731
732 // This is called by shapes to set up object space picking. It
733 // uses the current state matrices to determine how to map between
734 // world and object spaces. It should be called before calling any
735 // of the intersection methods.
736 // The second form takes a matrix to concatenate with the current
737 // objToWorld matrix. It can be used, for example, if a shape has
738 // sizing or positioning info built into it.
739 //
740 // These methods are also in charge of resetting the cached picked point
741 // shape path, so the application must call the appropriate one once for
742 // any shape that redefines the rayPick method before calling addIntersection().
743 void setObjectSpace();
744 void setObjectSpace(const SbMatrix &matrix);
745
746 // These intersect the current object-space ray with a variety of
747 // primitives: triangle, line, point, bounding-box. Intersection
748 // with a triangle uses only the ray, while intersection with a
749 // line or point uses the cone or cylinder around the ray. The
750 // intersection with a bounding-box uses the cone/cylinder also,
751 // since the contents of the box may be lines or points. NOTE: you
752 // must call setObjectSpace() before calling any of these.
753
754 // Triangle: returns intersection point, barycentric coordinates,
755 // and whether the front side (defined by right-hand-rule) was hit.
756 SbBool intersect(const SbVec3f &v0,
757 const SbVec3f &v1,
758 const SbVec3f &v2,
759 SbVec3f &intersection, SbVec3f &barycentric,
760 SbBool &front) ;
761
762 // Line:
763 SbBool intersect(const SbVec3f &v0, const SbVec3f &v1,
764 SbVec3f &intersection) const;
765
766 // Point:
767 SbBool intersect(const SbVec3f &point) const;
768
775 inline SbBool intersect(const SbBox3f &box, SbBool useFullViewVolume = TRUE)
776 {
777 SbXfBox3f xbox(box);
778 return intersect(xbox, useFullViewVolume);
779 }
780
787 SbBool intersect(const SbXfBox3f &box, SbBool useFullViewVolume = TRUE);
788
789
790 // Returns an SbViewVolume that represents the object-space ray to
791 // pick along. The projection point of the view volume is the
792 // starting point of the ray. The projection direction is the
793 // direction of the ray. The distance to the near plane is the
794 // same as the distance to the near plane for the ray. The
795 // distance to the far plane is the sum of the near distance and
796 // the depth of the view volume.
797 const SbViewVolume &getViewVolume() const
798 { return objVol; }
799
800 // Returns SbLine that can be used for other intersection tests.
801 // The line's position is the starting point and the direction is
802 // the direction of the ray. Given an intersection with this ray,
803 // you can call isBetweenPlanes() to see if the intersection is
804 // between the near and far clipping planes.
805 const SbLine &getLine() const
806 { return objLine; }
807
808 // Returns TRUE if the given object-space intersection point is
809 // between the near and far planes of the object-space view
810 // volume, as well as any clipping planes that have been defined.
811 // This test can be used to determine whether the point of
812 // intersection of the ray with an object is valid with respect to
813 // the clipping planes.
814 SbBool isBetweenPlanes(const SbVec3f &intersection) const;
815
825 SoPickedPoint *addIntersection(const SbVec3f &objectSpacePoint);
826
827 // Adds an SoPickedPoint instance representing the given object
828 // space point to the current list and returns a pointer to it. If
829 // pickAll is TRUE, this inserts the instance in correct sorted
830 // order. If it is FALSE, it replaces the one instance in the list
831 // only if the new one is closer; if the new one is farther away,
832 // no instance is created and NULL is returned, meaning that no
833 // more work has to be done to set up the SoPickedPoint.
834 SoPickedPoint *addIntersection_ ( const SbVec3f &objectSpacePoint, PickedPointListImpl* ppimplptr );
835 SoPickedPoint *addIntersection_( SoPickedPoint *pp, PickedPointListImpl* ppimplptr );
836 SoPickedPoint *addIntersection_( SoPickedPoint *pp );
837
838
839 // Get PickedPoints during a traversal without sorting them by distance
840 // this method must be used instead of the getPickedPointList
841 // that should be used instead only AFTER the rayPick traversal is completed
842 SoPickedPoint *getUnsortedPickedPoint( int i ) const;
843
844 // Use preferably this method to get just the number of picked points
845 // instead of getPickedPointList()->getLenght(), for performance reason
846 int getPickedPointsListLength() const;
847
848 private:
849 // Initiates action on graph
850 virtual void beginTraversal(SoNode *node);
851
852 private:
853 static void initClass();
854 static void exitClass();
855
856 // return whether OIV_PICK_OPTIM is set to TRUE
857 static SbBool isPickOptimSet()
858 { return s_useAlternateIntersection; }
859
860 // utility method to test if culling occurs because of clipping planes
861 // worldCoord is used to use world coordinates instead of object space coordinates
862 static bool isPtCulledByClippingPlanes( const SbVec3f &worldPt, SoState *state, bool worldCoord = true );
863
864 // utility method to test if culling occurs because of clipping planes
865 // worldCoord is used to use world coordinates instead of object space coordinates
866 static bool isBboxCompletelyCulledByClippingPlanes( const SbBox3d& worldBBox, SoState* state, bool worldCoord = true );
867 // worldCoord is used to use world coordinates instead of object space coordinates
868 static bool isBboxCompletelyCulledByClippingPlanes( const SbBox3f& worldBBox, SoState* state, bool worldCoord = true );
869 // worldCoord is used to use world coordinates instead of object space coordinates
870 static bool arePointsCulledByAClippingPlane( const std::vector< SbVec3f>& pointVector, SoState* state, bool worldCoord = true );
871
877 enum PickedProperties
878 {
880 NORMALS = 1 << 0,
882 TEXCOORDS = 1 << 1,
883
885 ALL = ~0
886 };
887
891 void enablePickedProperties(const enum PickedProperties pickedProperty, const SbBool enable);
892
896 SbBool isPickedPropertiesEnabled(const enum PickedProperties pickedProperty) const;
897
898 // Returns TRUE if the two SoPickedPoint are the same.
899 SbBool isEqual(const SoPickedPoint *pp0, const SoPickedPoint *pp1) const;
900
901 // Returns TRUE if the first intersection point is closer to the
902 // starting point of the ray than the second.
903 SbBool isCloser(const SoPickedPoint *pp0, const SoPickedPoint *pp1) const;
904 SbBool isCloser(const SbVec3f& p0, const SbVec3f& p1) const;
905
906 // get depth for ray picking sorting
907 double getDepth(const SbVec3f& p0) const;
908
909 //interface exposed to share SoPath among SoPickedPoints
910 void resetCurrPathCache();
911
912 enum PointPositionClassification
913 {
914 INSIDE = 0,
915 BEHIND_FAR = 1,
916 BEFORE_NEAR = 2,
917 BESIDE_LEFT = 3,
918 BESIDE_RIGHT = 4,
919 UNDER_BOTTOM = 5,
920 ABOVE_TOP = 6
921 };
922
923 PointPositionClassification homogeneSpaceIntersection( const SbVec3f &point, SbVec4f &pPoint ) const;
924 SoPath *getClonedCurrPath();
925
926 static bool isMTPickingActive();
927
928 // get VPradius in pixels (even if it was provided in world coords)
929 float getVPRadiusPixel() const ;
930
931 /* Because picking points should take care of pointSize without modifying
932 * the internal projection matrix,
933 * a distosion depending of the size of viewPortRegion is introduced
934 * This distorsion can be computed from pointSize
935 * By default pointSize is (0, 0)
936 * Normal usage should be setPointSizeForPicking( WidthInPixels, HeightInPixels)
937 * WARNING: Don't forget to restore previous pointSize after your traversal to avoid side effect
938 */
939 void setPointSizeForPicking( float pointWidth, float pointHeight);
940
941 // Same as previous with an SbVec2f
942 void setPointSizeForPicking( const SbVec2f & pointSize)
943 { setPointSizeForPicking(pointSize[0], pointSize[1]); }
944
945 // Return current pointSize for picking points
946 SbVec2f getPointSizeForPicking()
947 { return SbVec2f( m_pointWidthForPicking, m_pointHeightForPicking ); }
948
949 struct GPUPickInfo
950 {
951 bool isValid = false;
952 SbVec3f modelPosition;
953 uint32_t shapeId = 0;
954 uint32_t faceId = 0;
955 float distToPickCenter = 0.f;
956 };
957
958 bool canGPUPick() const;
959
963 void collectGPUPickingPath();
964
965 // Return the picking informations (faceId, shapeId, Position)
966 // for the selected point.
967 const std::vector<GPUPickInfo>& getGPUPickInfo() const;
968
969 private:
970 SbBool lineWasSet; // TRUE if a world-space line was set
971 SbBool rayWasComputed; // TRUE if ray computed by camera
972 SbBool pickAll; // Pick all objects or just closest
973 SbVec2s VPPoint; // Point in viewport coordinates
974 SbVec2f VPPointFloat; // Point in viewport coordinates
975 SbVec2f normVPPoint; // Point in normalized vp coordinates
976 SbBool normPointSet; // TRUE if setNormalizedPoint called
977 float VPRadius; // Radius in viewport space pixels
978 SbMatrix objToWorld; // Object-to-world space matrix
979 SbMatrix worldToObj; // World-to-object space matrix
980
981 // The ray is defined as an SbViewVolume as in the
982 // SoPickRayElement, and is usually stored in an instance of the
983 // element. This stores the ray if it is set using setRay().
984 SbViewVolume worldVol;
985
986 // Users can specify negative near and far distances to indicate
987 // that picks should not be clipped to those planes. These flags
988 // store that info, since the distances in the view volume can't
989 // be negative.
990 SbBool clipToNear, clipToFar;
991
992 // These store the object-space ray info as a view volume and a
993 // line. See the comments on getViewVolume() and getLine().
994 SbLine objLine; // Line representing ray
995 SbLined objLineD;
996 SbViewVolume objVol; // View volume representing ray
997
998 // If the caller passes a matrix to setObjectSpace(), the inverse
999 // of it is stored here so the object-space angle can be computed
1000 // correctly later. The extraMatrixSet flag is set to TRUE in this
1001 // case.
1002 SbBool extraMatrixSet;
1003 SbMatrix extraMatrix;
1004
1005 // Computes matrices to go between object and world space
1006 void computeMatrices();
1007
1008 // Computes object-space view volume and line
1009 void computeObjVolAndLine();
1010
1011 // updates RayBBox and WMat
1012 void setUpRayBBoxAndWMat( const SbVec3f &centerPt );
1013
1014 void evalCenterPts( SbVec3f &centerPt, SbVec3d &centerPtD, SbVec3d &projPtD );
1015
1016 // get VPRadius in world coordinates (even if it was provided in pixels)
1017 float getVPRadiusWorld() const ;
1018
1019 // Computes distance t of a point along a ray: point = start + t * direction.
1020 // The point has to be on the ray for this to work
1021 static float rayDistance(const SbVec3f &start,
1022 const SbVec3f &direction,
1023 const SbVec3f &point);
1024
1025 // Set commons properties of the action (called by the setRay method)
1026 void setRayCommonProperties (const SbVec3f &start, const SbVec3f &direction,
1027 float fovy, float aspectRatio = 1.0f, float nearDistance=-1.0f, float farDistance=-1.0f);
1028
1029 // Initialize some members variable when a new point in viewport has been set
1030 void initializeMembersAfterVPPointSet(bool normalizedPointSet);
1031
1032
1033
1034 // check if the intersection is inside conic picking volume
1035 inline SbBool isInConicPickingVolume( const SbVec3f &intersection ) const;
1036
1037 void initSetRayData ( const SbVec3f &start, const SbVec3f &direction,
1038 float fovy, float aspectRatio = 1.0f,
1039 float nearDistance = -1.0f, float farDistance = -1.0f );
1040
1041 // Store the current ray bounding box for triangle culling
1042 SbBool m_canUseTriangleCulling;
1043 SbBox3f m_rayBBox ;
1044
1045
1046 // store the current viewvolume matrix and near far in homogene space
1047 // to optimize intersection computation
1048 SbMatrixd m_wmat;
1049 double m_wnear;
1050 double m_wfar;
1051 HomTransfData *m_htdta;
1052
1053 // Indicate if triangle are culled by ray frustum.
1054 SbBool canUseTriangleCulling() const
1055 { return (s_triangleCullingEnabled && m_canUseTriangleCulling); }
1056
1057 static SbBool s_triangleCullingEnabled ;
1058
1059 // generate all picked point properties? (OIV_PICK_GENERATE_ALL_PROPERTIES)
1060 static SbBool s_generateAllPickedProperties;
1061
1062 //
1063 static SoCamera::StereoMode s_stereoMode;
1064
1065 // Use faster intersection method (OIV_PICK_OPTIM)
1066 static SbBool s_useAlternateIntersection;
1067
1068 // Force the raypick action to take ray radius in account
1069 SbBool m_bEnableRadiusForTriangles;
1070
1071 // Store ray properties
1072 SbVec3f m_direction;
1073 SbVec3f m_start;
1074
1075private:
1079 template<typename SO_NODE_OR_SO_PATH> void commonApply(SO_NODE_OR_SO_PATH* nodeOrPath);
1080
1081 float getCorrectedVPRadius() const;
1082
1083 int m_pickedPropertiesMask;
1084 PickingMode m_pickingMode;
1085
1086 int m_VPRadiusState; // how VPRadius has been initialized
1087
1088 // data buffered for the lineWasSet case
1089 float m_fovy;
1090 float m_nearDistance;
1091 float m_farDistance;
1092 float m_aspectRatio;
1093
1094 // to force pick volume to be a cone (perspective pick) or a cylinder (orthogonal pick)
1095 SbBool m_conicPickVolume;
1096
1097 PickedPointListImpl *m_pickedPointListlImpl;
1098
1099 // Only computed by setPointSizeForPicking()
1100 // Only used in homogeneSpaceIntersection()
1101 // Store picking error depending of viewPort
1102 float m_pointPickingErrorX;
1103 float m_pointPickingErrorY;
1104 // Store extended pick trap depending of pointSize
1105 float m_projSpaceWidth;
1106 float m_projSpaceHeight;
1107 // Store pointSize for picking point
1108 float m_pointWidthForPicking;
1109 float m_pointHeightForPicking;
1110
1112 SoPathList m_gpuPickingCollectionPaths;
1113 std::vector<SoRayPickAction::GPUPickInfo> m_gpuPickingInfos;
1114
1115 // Render the scene with GPU Picking data attached and
1116 // retrieve the picking data from the GPU
1117 // The data can be accessed via getGPUPickingInfo()
1118 void renderGPUPickingScene();
1119
1123 void fillGPUPickInfos();
1124};
1125
1126inline
1128{
1129 m_bEnableRadiusForTriangles = flag;
1130}
1131
1132inline
1134{
1135 return m_bEnableRadiusForTriangles;
1136}
1137#endif /* _SO_RAY_PICK_ACTION_ */
1138
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:972
3D box class.
Definition SbBox.h:649
Directed line in 3D.
Definition SbLine.h:57
Directed line in 3D (double precision).
Definition SbLine.h:182
4x4 matrix class.
Definition SbMatrix.h:309
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 4x4 matrix class...
Definition SbMatrix.h:756
2D vector class.
Definition SbVec.h:76
2D vector class.
Definition SbVec.h:700
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class ...
Definition SbVec.h:1214
3D vector class.
Definition SbVec.h:932
4D vector class.
Definition SbVec.h:2214
3D viewing volume class.
Class for representing a viewport.
3D box with an associated transformation matrix.
Definition SbBox.h:1250
virtual void apply(SoNode *node)
Initiates an action on the graph defined by a node.
StereoMode
Stereo mode.
Definition SoCamera.h:518
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Abstract base class for all database nodes.
Definition SoNode.h:145
Path that points to a list of hierarchical nodes.
Definition SoPath.h:187
Maintains a list of pointers to paths.
Definition SoPathList.h:81
Abstract base class for picking objects in a scene.
Represents point on surface of picked object.
Maintains a list of pointers to SoPickedPoint instances.
Intersects objects with a ray cast into scene.
virtual void setPoint(const SbVec2f &viewportPoint)
Float version of setPoint.
virtual void apply(SoNode *node)
Initiates an action on the graph defined by a node.
SbBool isConicPickVolume()
Returns TRUE if the picking volume is a conic shape (not a frustum).
void enableNormalsGeneration(const SbBool enable)
Enables generation of normal vectors for picked points.
void setPickingMode(PickingMode pickingMode)
Sets the picking mode.
const SbVec2f & getPointFloat() const
Float version of getPoint().
static SoCamera::StereoMode getStereoMode()
Returns the view used to perform pick when stereo is active.
virtual void apply(const SoPathList &pathList, SbBool obeysRules=FALSE)
Initiates an action on the graph defined by a list of paths.
void setPickAll(SbBool flag)
Sets whether the action will return all objects intersected or just the closest one.
virtual void setPoint(const SbVec2s &viewportPoint)
Sets the viewport point through which the ray passes, starting at the camera position.
SbBool isRadiusEnableForTriangles()
Returns whether the pick radius specified by setRadius is taken into account for picking on triangle-...
static void setStereoMode(SoCamera::StereoMode stereoMode)
Tells ray pick action in which view the pick occurs.
SbBool isPickAll() const
Returns whether the action will return all objects intersected or just the closest one.
virtual void clearApplyResult()
Clears the picked point list.
SoRayPickAction(const SbViewportRegion &viewportRegion)
Constructor takes viewport region to use for picking.
static SbBool isTriangleCulling()
Returns whether triangle culling is enabled.
void enableConicPickVolume(SbBool flag)
Controls the pick volume shape for picking with setRay().
const SbVec2s & getPoint() const
Gets the viewport point in pixels (returns the last value passed to setPoint).
static void enableTriangleCulling(SbBool flag)
Enables culling of triangles relative to the ray frustum.
void setRadius(float radius)
Sets the radius around the point.
void enableTexCoordsGeneration(const SbBool enable)
Enables generation of texture coordinates for picked points.
PickingMode getPickingMode() const
Returns the PickingMode used for the ray pick action.
virtual void apply(SoPath *path)
Initiates an action on the graph defined by a path.
virtual void setRay(float fovy, const SbVec3f &start, const SbVec3f &direction, float nearDistance=-1.0, float farDistance=-1.0)
Sets a world-space ray along which to pick in the the same way as the other version of setRay(),...
SbBool isNormalsGenerationEnabled() const
Returns whether generation of normal vectors is enabled for picked points.
SoPickedPoint * getPickedPoint(int index=0) const
Returns the indexed picked point from the list.
void enableRadiusForTriangles(SbBool flag)
Enable radius for triangle-based shape.
virtual void setRay(const SbVec3f &start, const SbVec3f &direction, float nearDistance=-1.0, float farDistance=-1.0)
Sets a world-space ray along which to pick.
SoDEPRECATED void clearPickedPointList()
Clears the picked point list.
@ POINT_PICKING
In this mode, Inventor finds all the vertices inside the pick radius.
@ DEFAULT
In the default mode, Inventor computes the intersection of the pick ray with geometry nodes (face,...
const SbVec2f getNormalizedPoint() const
Gets the viewport point in normalized coordinates [0..1] (returns the last value passed to setNormali...
SbBool isTexCoordsGenerationEnabled() const
Returns whether texture coordinate generation is enabled for picked points.
float getRadius() const
Gets the radius (in pixels) around the point.
const SoPickedPointList & getPickedPointList() const
Returns list of picked points.
virtual void setNormalizedPoint(const SbVec2f &normPoint)
Sets the viewport point in normalized coordinates, which range from (0,0) at the lower left to (1,...
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87