Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SbCylinder.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#ifndef _SB_CYLINDER_
24#define _SB_CYLINDER_
25
26#include <Inventor/SbBase.h>
27#include <Inventor/SbLine.h>
28
30//
31// Class: SbCylinder
32//
33// Represents a cylinder in 3D space.
34//
36
37
57public:
63
67 SbCylinder(const SbLine &a, float r);
68
72 void setValue(const SbLine &a, float r);
73
77 void setAxis(const SbLine &a);
81 void setRadius(float r);
82
86 const SbLine &getAxis() const { return axis; }
90 float getRadius() const { return radius; }
91
96 SbBool intersect(const SbLine &l, SbVec3f &intersection) const;
101 SbVec3f &enter, SbVec3f &exit) const;
102
103private:
104 SbLine axis;
105 float radius;
106
107 static SbBool unitCylinderIntersect(const SbLine &l,
108 SbVec3f &in, SbVec3f &out);
109
110};
111
112
113#endif /* _SB_CYLINDER_ */
114
115
Class for representing a cylinder.
Definition SbCylinder.h:56
SbBool intersect(const SbLine &l, SbVec3f &intersection) const
Intersect line and cylinder, returning TRUE if there is an intersection.
SbCylinder(const SbLine &a, float r)
Constructor that takes an axis and radius.
SbBool intersect(const SbLine &l, SbVec3f &enter, SbVec3f &exit) const
Intersect line and cylinder, returning TRUE if there is an intersection.
void setAxis(const SbLine &a)
Set the axis.
void setRadius(float r)
Set the radius.
void setValue(const SbLine &a, float r)
Change the axis and radius.
SbCylinder()
Default constructor.
const SbLine & getAxis() const
Return the axis.
Definition SbCylinder.h:86
float getRadius() const
Return the radius.
Definition SbCylinder.h:90
Directed line in 3D.
Definition SbLine.h:57
3D vector class.
Definition SbVec.h:932
int SbBool
Boolean type.
Definition SbBase.h:87