Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoObliqueSlice.h
1 #ifndef SIMVOLEON_SOOBLIQUESLICE_H
2 #define SIMVOLEON_SOOBLIQUESLICE_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <Inventor/fields/SoSFEnum.h>
37 #include <Inventor/fields/SoSFNode.h>
38 #include <Inventor/fields/SoSFPlane.h>
39 #include <Inventor/nodes/SoShape.h>
40 
41 #include <VolumeViz/C/basic.h>
42 
43 // *************************************************************************
44 
45 class SIMVOLEON_DLL_API SoObliqueSlice : public SoShape {
46  typedef SoShape inherited;
47 
49 
50 public:
51  static void initClass(void);
52  SoObliqueSlice(void);
53 
54  enum Interpolation { NEAREST, LINEAR };
55  enum AlphaUse { ALPHA_AS_IS, ALPHA_OPAQUE, ALPHA_BINARY };
56 
61 
62 protected:
63  ~SoObliqueSlice();
64 
65  virtual void GLRender(SoGLRenderAction * action);
66  virtual void rayPick(SoRayPickAction * action);
67  virtual void generatePrimitives(SoAction * action);
68  virtual void computeBBox(SoAction * action, SbBox3f & box, SbVec3f & center);
69  virtual void write(SoWriteAction * action);
70 
71  virtual SbBool readInstance(SoInput * in, unsigned short flags);
72 
73 private:
74  friend class SoObliqueSliceP;
75  class SoObliqueSliceP * pimpl;
76 };
77 
78 #endif // !SIMVOLEON_SOOBLIQUESLICE_H
SoType::badType
static SoType badType(void)
SoState
SoObliqueSlice::ALPHA_AS_IS
@ ALPHA_AS_IS
Definition: SoObliqueSlice.h:55
SoShape::GLRender
virtual void GLRender(SoGLRenderAction *action)
SoTransferFunction
Contains the transfer function definition.
Definition: SoTransferFunction.h:44
SoShape::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)=0
SoOrthoSlice::axis
SoSFEnum axis
Definition: SoOrthoSlice.h:62
SbRotation::identity
static SbRotation identity(void)
SoDetail::getClassTypeId
static SoType getClassTypeId(void)
SoState::pop
void pop(void)
SoShape
SbMatrix
SoObliqueSliceDetail::getValueObjectPos
const SbVec3f & getValueObjectPos(void) const
Definition: ObliqueSliceDetail.cpp:92
SoModelMatrixElement::mult
static void mult(SoState *const state, SoNode *const node, const SbMatrix &matrix)
SbBox3f::getCenter
SbVec3f getCenter(void) const
SoDebugError::post
static void post(const char *const source, const char *const format,...)
SoWriteAction
SoObliqueSlice::alphaUse
SoSFEnum alphaUse
Definition: SoObliqueSlice.h:59
SoModelMatrixElement
SbMatrix::setTransform
void setTransform(const SbVec3f &t, const SbRotation &r, const SbVec3f &s)
SoOrthoSliceDetail::getValueObjectPos
const SbVec3f & getValueObjectPos(void) const
Definition: OrthoSliceDetail.cpp:90
SoState::push
void push(void)
SO_NODE_DEFINE_ENUM_VALUE
#define SO_NODE_DEFINE_ENUM_VALUE(enumname, enumvalue)
SbBox3f::getBounds
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
SoGLRenderAction::addDelayedPath
void addDelayedPath(SoPath *path)
SbBox3f::getMin
const SbVec3f & getMin(void) const
SO_NODE_INIT_CLASS
#define SO_NODE_INIT_CLASS(classname, parentclass, parentname)
SoRayPickAction::addIntersection
SoPickedPoint * addIntersection(const SbVec3f &objectspacepoint, SbBool frontpick=TRUE)
SoObliqueSlice::AlphaUse
AlphaUse
Definition: SoObliqueSlice.h:55
SoGLRenderAction::getCacheContext
uint32_t getCacheContext(void) const
SbBox3f
SoAction::getCurPath
const SoPath * getCurPath(void)
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
SoAction
SoNode::readInstance
virtual SbBool readInstance(SoInput *in, unsigned short flags)
SoSFPlane
SO_NODE_SOURCE
#define SO_NODE_SOURCE(classname)
SO_NODE_HEADER
#define SO_NODE_HEADER(classname)
SoOrthoSlice::alternateRep
SoSFNode alternateRep
Definition: SoOrthoSlice.h:67
SoClipPlaneElement
SbBox3f::setBounds
SbBox3f & setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
SoGLClipPlaneElement
SoShape::shouldGLRender
virtual SbBool shouldGLRender(SoGLRenderAction *action)
SbBox3s
SbVec2s
SoObliqueSliceDetail
The SoObliqueSliceDetail contains details of a pick operation on SoObliqueSlice geometry.
Definition: SoObliqueSliceDetail.h:43
SoOrthoSlice::alphaUse
SoSFEnum alphaUse
Definition: SoOrthoSlice.h:64
SbBox3f::extendBy
void extendBy(const SbVec3f &pt)
SbList< CachedPage * >
SbPlane::getNormal
const SbVec3f & getNormal(void) const
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
SbBox3f::getMax
const SbVec3f & getMax(void) const
SoObliqueSliceDetail::getValueDataPos
const SbVec3s & getValueDataPos(void) const
Definition: ObliqueSliceDetail.cpp:104
SoObliqueSlice::plane
SoSFPlane plane
Definition: SoObliqueSlice.h:57
SoLazyElement
SoSFEnum
SoRayPickAction::getLine
const SbLine & getLine(void)
SbColor
SoDetail
SoAction::getState
SoState * getState(void) const
SoOrthoSliceDetail::getValueDataPos
const SbVec3s & getValueDataPos(void) const
Definition: OrthoSliceDetail.cpp:102
SoCacheElement::invalidate
static void invalidate(SoState *const state)
SoObliqueSlice::LINEAR
@ LINEAR
Definition: SoObliqueSlice.h:54
SoShape::generatePrimitives
virtual void generatePrimitives(SoAction *action)=0
SbVec3f
SbPlane::intersect
SbBool intersect(const SbLine &l, SbVec3f &intersection) const
SoOrthoSliceDetail::getValue
unsigned int getValue(void) const
Definition: OrthoSliceDetail.cpp:111
SoGLRenderAction::isRenderingDelayedPaths
SbBool isRenderingDelayedPaths(void) const
SoPath::copy
SoPath * copy(const int startfromnodeindex=0, int numnodes=0) const
SoObliqueSlice::interpolation
SoSFEnum interpolation
Definition: SoObliqueSlice.h:58
SoShape::computeObjectSpaceRay
void computeObjectSpaceRay(SoRayPickAction *const action)
SoClipPlaneElement::add
static void add(SoState *const state, SoNode *const node, const SbPlane &plane)
SO_NODE_ADD_FIELD
#define SO_NODE_ADD_FIELD(field, defaultvalue)
SoShape::shouldRayPick
SbBool shouldRayPick(SoRayPickAction *const action)
SoPickedPoint
SoShape::rayPick
virtual void rayPick(SoRayPickAction *action)
SoSFNode
SoObliqueSliceDetail::getValue
unsigned int getValue(void) const
Definition: ObliqueSliceDetail.cpp:113
SbLine
SoObliqueSlice::ALPHA_BINARY
@ ALPHA_BINARY
Definition: SoObliqueSlice.h:55
SbVec3s
SoGLRenderAction.h
SoGLLazyElement::getInstance
static SoGLLazyElement * getInstance(const SoState *state)
SoNode::write
virtual void write(SoWriteAction *action)
SoObliqueSlice::NEAREST
@ NEAREST
Definition: SoObliqueSlice.h:54
SoInput
SoGLLazyElement::send
void send(const SoState *state, uint32_t mask) const
SoObliqueSlice::ALPHA_OPAQUE
@ ALPHA_OPAQUE
Definition: SoObliqueSlice.h:55
SoPickedPoint::setObjectNormal
void setObjectNormal(const SbVec3f &normal)
SoBase::initClass
static void initClass(void)
SoOrthoSlice
Render one orthogonal slice of the volume data.
Definition: SoOrthoSlice.h:46
SO_NODE_CONSTRUCTOR
#define SO_NODE_CONSTRUCTOR(classname)
SoRayPickAction
SoObliqueSlice::alternateRep
SoSFNode alternateRep
Definition: SoObliqueSlice.h:60
SoPickedPoint::setDetail
void setDetail(SoDetail *detail, SoNode *node)
SoOrthoSlice::sliceNumber
SoSFUInt32 sliceNumber
Definition: SoOrthoSlice.h:61
SoObliqueSlice::Interpolation
Interpolation
Definition: SoObliqueSlice.h:54
SoNode::doAction
virtual void doAction(SoAction *action)
SbPlane
SoOrthoSliceDetail
The SoOrthoSliceDetail contains details of a pick operation on SoOrthoSlice geometry.
Definition: SoOrthoSliceDetail.h:43
SoGLRenderAction
SoColorPacker
SoPickAction
SoRayPickAction::isBetweenPlanes
SbBool isBetweenPlanes(const SbVec3f &intersection) const
SoObliqueSlice
Render a slice of the volume data, with any orientation.
Definition: SoObliqueSlice.h:45
tidbits.h