1 /**************************************************************************\
2  * Copyright (c) Kongsberg Oil & Gas Technologies AS
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holder nor the names of its
17  * contributors may be used to endorse or promote products derived from
18  * this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 \**************************************************************************/
32 
33 /*!
34   \class SoCylinderDetail SoCylinderDetail.h Inventor/details/SoCylinderDetail.h
35   \brief The SoCylinderDetail class contains information about the parts of a SoCylinder shape.
36 
37   \ingroup details
38 
39   Instances of this class are used for storing information about hit
40   points on cylinder geometry after pick operations, and for storing
41   information returned to tessellation callbacks.
42 
43   \sa SoCylinder, SoRayPickAction, SoCallbackAction
44 */
45 
46 #include <Inventor/details/SoCylinderDetail.h>
47 #include <Inventor/SbName.h>
48 
49 /*!
50   \var int SoCylinderDetail::part
51   \COININTERNAL
52 */
53 
54 
55 SO_DETAIL_SOURCE(SoCylinderDetail);
56 
57 /*!
58   Constructor.
59  */
SoCylinderDetail(void)60 SoCylinderDetail::SoCylinderDetail(void)
61   : part(0)
62 {
63 }
64 
65 /*!
66   Destructor.
67  */
~SoCylinderDetail()68 SoCylinderDetail::~SoCylinderDetail()
69 {
70 }
71 
72 // doc in super
73 void
initClass(void)74 SoCylinderDetail::initClass(void)
75 {
76   SO_DETAIL_INIT_CLASS(SoCylinderDetail, SoDetail);
77 }
78 
79 // doc in super
80 SoDetail *
copy(void) const81 SoCylinderDetail::copy(void) const
82 {
83   SoCylinderDetail * copy = new SoCylinderDetail();
84   copy->part = this->part;
85   return copy;
86 }
87 
88 /*!
89   Set the part of a cylinder which was selected. A cylinder has
90   three different conceptual parts; SoCylinder::SIDES, SoCylinder::TOP
91   or SoCylinder::BOTTOM.
92   */
93 void
setPart(const int partarg)94 SoCylinderDetail::setPart(const int partarg)
95 {
96   this->part = partarg;
97 }
98 
99 /*!
100   Returns selected cylinder part.
101  */
102 int
getPart(void) const103 SoCylinderDetail::getPart(void) const
104 {
105   return this->part;
106 }
107