Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoLOD.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 : Gavin Bell (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50#ifndef _SO_LOD_
51#define _SO_LOD_
52
53#include <Inventor/fields/SoMFFloat.h>
54#include <Inventor/fields/SoSFVec3f.h>
55#include <Inventor/nodes/SoGroup.h>
56
58//
59// Class: SoLOD
60//
61// Level-of-detail group node. The children of this node typically
62// represent the same object or objects at varying levels of detail,
63// from highest detail to lowest. The world-space distance of the
64// eye from the transformed center of the LOD is computed, and one
65// child is drawn, based on the values in the ranges field.
66//
67// More precisely, if the distance from the eyepoint to the
68// transformed center is D and the ranges array contains LAST_RANGE+1
69// values (numbered 0...LAST_RANGE), then:
70//
71// D < ranges[0] : Child 0 is drawn
72// ranges[i-1] < D < ranges[i] : Child i is drawn
73// D > ranges[LAST_RANGE] : Child LAST_RANGE+1 is drawn
74//
75// So, you should specify N ranges and N+1 children. If you specify
76// too few children, the last child will be used for the extra
77// ranges. If you specify too few ranges, the extra children will
78// never be used.
79//
80// Add an SoInfo node as a child if you want a level of detail
81// that doesn't draw anything.
82//
84
141class SoLOD : public SoGroup {
142
143 SO_NODE_HEADER(SoLOD);
144
145 public:
146 // Fields
157
162
166 SoLOD(int nChildren);
167
168 private:
169 // Implement actions:
170 virtual void doAction(SoAction *action);
171 virtual void callback(SoCallbackAction *action);
172 virtual void GLRender(SoGLRenderAction *action);
173 virtual void rayPick(SoRayPickAction *action);
174 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
175 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
176
177 // These methods make render traversal faster by implementing
178 // different rendering paths corresponding to different action
179 // path codes.
180 virtual void GLRenderBelowPath(SoGLRenderAction *action);
181 virtual void GLRenderInPath(SoGLRenderAction *action);
182 virtual void GLRenderOffPath(SoGLRenderAction *action);
183
184 private:
185 static void initClass();
186 static void exitClass();
187
188 private:
189 virtual ~SoLOD();
190
191 virtual int whichToTraverse(SoAction *);
192};
193
194#endif /* _SO_LOD_ */
195
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Base class for all group nodes.
Definition SoGroup.h:122
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Distance-based l...
Definition SoLOD.h:141
SoSFVec3f center
Object-space center of the model.
Definition SoLOD.h:156
SoLOD()
Creates a distance-based level-of-detail node with default settings.
SoLOD(int nChildren)
Constructor that takes approximate number of children.
SoMFFloat range
World-space distances to use as switching criteria.
Definition SoLOD.h:151
Multiple-value field containing any number of floating point values.
Definition SoMFFloat.h:90
Intersects objects with a ray cast into scene.
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:80