![]() |
http://www.sim.no http://www.coin3d.org |
The SoDetail class is the superclass for all classes storing detailed information about particular shapes.Detail information about shapes is used in relation to picking actions in Coin. They typically contain the relevant information about what particular part of the shape a pick ray intersected with. More...
#include <Inventor/details/SoDetail.h>
Public Member Functions | |
virtual | ~SoDetail () |
virtual SoDetail * | copy (void) const =0 |
virtual SoType | getTypeId (void) const =0 |
SbBool | isOfType (const SoType type) const |
Static Public Member Functions | |
static void | initClass (void) |
static void | initClasses (void) |
static SoType | getClassTypeId (void) |
Protected Member Functions | |
SoDetail (void) |
The SoDetail class is the superclass for all classes storing detailed information about particular shapes.
Detail information about shapes is used in relation to picking actions in Coin. They typically contain the relevant information about what particular part of the shape a pick ray intersected with.
SoDetail::~SoDetail | ( | ) | [virtual] |
Destructor.
SoDetail::SoDetail | ( | void | ) | [protected] |
Default constructor.
void SoDetail::initClass | ( | void | ) | [static] |
Initialize relevant common data for all instances, like the type system.
Reimplemented in SoConeDetail, SoCubeDetail, SoCylinderDetail, SoFaceDetail, SoLineDetail, SoNodeKitDetail, SoPointDetail, and SoTextDetail.
References SoType::badType(), SoType::createType(), and initClasses().
Referenced by SoDB::init(), and initClasses().
void SoDetail::initClasses | ( | void | ) | [static] |
Call the initClass() methods of all built-in detail classes.
(The initClass() method of user extension detail classes -- if any -- must be called explicitly by the application programmer in the application initialization code.)
References initClass().
Referenced by initClass().
SoDetail * SoDetail::copy | ( | void | ) | const [pure virtual] |
Return a deep copy of ourself.
Note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes.
Implemented in SoConeDetail, SoCubeDetail, SoCylinderDetail, SoFaceDetail, SoLineDetail, SoNodeKitDetail, SoPointDetail, and SoTextDetail.
Referenced by SoShape::createPointDetail(), SoText3::createTriangleDetail(), and SoAsciiText::createTriangleDetail().
SoType SoDetail::getTypeId | ( | void | ) | const [pure virtual] |
Returns the type identification of a detail derived from a class inheriting SoDetail. This is used for run-time type checking and "downward" casting.
Usage example:
void fuhbear(SoDetail * detail) { if (detail->getTypeId() == SoFaceDetail::getClassTypeId()) { // safe downward cast, know the type SoFaceDetail * facedetail = (SoFaceDetail *)detail; } return; // ignore if not a SoFaceDetail }
For application programmers wanting to extend the library with new detail classes: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubDetail.h: SO_DETAIL_SOURCE and SO_DETAIL_INIT_CLASS.
Referenced by isOfType().
SbBool SoDetail::isOfType | ( | const SoType | type | ) | const |
Returns TRUE
if type is derived from (or is) this class.
References getTypeId(), and SoType::isDerivedFrom().
SoType SoDetail::getClassTypeId | ( | void | ) | [static] |
Returns the type for this class.
Referenced by SoNodeKitDetail::initClass().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Feb 28 2011 10:12:07 for Coin by Doxygen. 1.7.3