00001 #ifndef SO_ALGEBRAIC_SHAPE_H
00002 #define SO_ALGEBRAIC_SHAPE_H
00003
00004 #include <Inventor/nodes/SoShape.h>
00005 #include <Inventor/nodes/SoShaderObject.h>
00006 #include <Inventor/nodes/SoVertexShader.h>
00007 #include <Inventor/nodes/SoFragmentShader.h>
00008 #include <Inventor/SbBox.h>
00009 #include <Inventor/SbVec.h>
00010
00011
00012 class SoBufferedShape;
00013
00014 SO_PIMPL_PUBLIC_DECLARATION(SoAlgebraicShape)
00015
00016
00147 class SoAlgebraicShape : public SoShape
00148 {
00149 SO_NODE_HEADER(SoAlgebraicShape);
00150 SO_PIMPL_PUBLIC_HEADER(SoAlgebraicShape)
00151
00152 public:
00153
00173 SoSFNode rayIntersection;
00174
00178 enum ASWorkSpace {
00179 BOX,
00180 CAMERA,
00181 WORLD,
00182 MAX_WORK_SPACE
00183 };
00184
00198 SoSFEnum workspace;
00199
00203 enum ASShaderSlot {
00204 COMPUTE_COLOR,
00205 VERTEX_SHADER_ENTRY,
00206 MAX_SHADER_SLOT
00207 };
00208
00241 SoMFNode shaderSlots;
00242
00254 SoSFBool generateTransparency;
00255
00259 enum ASClippingPolicy
00260 {
00261 STANDARD,
00262 FULL_SHAPE,
00263 };
00264
00269 SoSFEnum clippingPolicy;
00270
00271 private:
00272
00276 SoAlgebraicShape ();
00277
00281 virtual ~SoAlgebraicShape ();
00282
00288 virtual void computeBBox ( SbBox3f &box, SbVec3f ¢er ) = 0;
00289
00296 bool solveQuadric ( const SbVec3f& abc, SbVec2f& roots ) const;
00297
00303 static SoFragmentShader* fragmentShaderFromFile ( const SbString& filename );
00304
00309 virtual void generatePrimitives(SoAction *action);
00310
00312
00315 void setCustomTransformationShaderObject( SoVertexShader* vso );
00316 void setCustomRayParametersShaderObject ( SoVertexShader* vso );
00317 void setCustomGeometryBufferedShape ( SoBufferedShape* shape );
00319
00320 private:
00321
00323
00326 virtual void GLRender ( SoGLRenderAction *action );
00327 virtual void computeBBox ( SoAction *action, SbBox3f &box, SbVec3f ¢er );
00329
00330 private:
00331
00333
00336 static void initClass ();
00337 static void exitClass ();
00339
00343 virtual void notify ( SoNotList *list );
00344
00345 private:
00346
00347
00348 void initialize ();
00349
00350
00351 void updateBBox ();
00352
00353 };
00354
00355 #endif // SO_QUADRIC_SHAPE_H
00356