Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoCone.h
Go to the documentation of this file.
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-2021 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_CONE_
52#define _SO_CONE_
53
54#include <Inventor/SbVec.h>
55#include <Inventor/SbBox.h>
59
61//
62// Class: SoCone
63//
64// Simple cone, aligned with y-axis. Default has apex point at y = 1,
65// bottom radius 1, and height 2, so that the size is -1 to +1 in all
66// 3 dimensions. There are two parts to the cone: the sides and the
67// bottom face (in that order).
68//
70
72
143class SoCone : public SoShape {
144
146 SO_PIMPL_PUBLIC_HEADER( SoCone );
147
148 public:
149
151 enum Part {
155 SIDES = 0x01,
159 BOTTOM = 0x02,
163 ALL = 0x03
164 };
165
166 // Fields
179
184
193
198
199 private:
200 // Implements actions
201 virtual void GLRender(SoGLRenderAction *action);
202 virtual void rayPick(SoRayPickAction *action);
203 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
204
205 // Computes bounding box of cone
206 virtual void computeBBox(SoAction *action, SbBox3f &box,
207 SbVec3f &center);
208
209 private:
210 static void initClass();
211 static void exitClass();
212
213 // Modified on 02-25-00: put from private to SoINTERNAL public for the bevel
214 // Computes number of sides and sections to use to represent
215 // cone (based on complexity), then computes ring of x,z
216 // coordinates around base of cone and stores in baseCoords. It
217 // computes and stores normals in sideNormals, too.
218 void computeBase( SoState *state,
219 int& numSides,
220 int& numSections,
221 std::vector<SbVec2f>& baseCoords,
222 std::vector<SbVec3f>& sideNormals ) const;
223
224 virtual SoChildList* getChildren() const;
225
226 private:
227 // Generates triangles representing a cone
228 virtual void generatePrimitives(SoAction *action);
229
230 virtual ~SoCone();
231};
232
233#endif /* _SO_CONE_ */
SO_PIMPL_PUBLIC_DECLARATION(SoCone)
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
3D box class.
Definition SbBox.h:649
3D vector class.
Definition SbVec.h:932
Abstract base class for all actions.
Definition SoAction.h:132
Cone shape node.
Definition SoCone.h:143
Part
Cone parts.
Definition SoCone.h:151
@ SIDES
The conical part.
Definition SoCone.h:155
@ BOTTOM
The bottom circular face.
Definition SoCone.h:159
@ ALL
All parts.
Definition SoCone.h:163
SoSFFloat height
Specifies the cone's height.
Definition SoCone.h:178
void addPart(SoCone::Part part)
Convenience function to turn on a part of the cone.
SoSFFloat bottomRadius
Specifies the radius of the base circle.
Definition SoCone.h:174
SbBool hasPart(SoCone::Part part) const
Convenience function that returns whether a given part is on or off.
SoCone()
Creates a cone node with default settings.
SoSFBitMask parts
Visible parts of cone.
Definition SoCone.h:170
void removePart(SoCone::Part part)
Convenience function to turn off a part of the cone.
Renders a scene graph using Open Inventor's Render Engine.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
friend class SoChildList
Definition SoNode.h:472
Intersects objects with a ray cast into scene.
Single-value field containing a set of bit flags.
Field containing a floating-point value.
Definition SoSFFloat.h:78
Abstract base class for all shape nodes.
Definition SoShape.h:115
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87