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
00146 class SoAlgebraicShape : public SoShape
00147 {
00148 SO_NODE_HEADER(SoAlgebraicShape);
00149 SO_PIMPL_PUBLIC_HEADER(SoAlgebraicShape)
00150
00151 public:
00152
00172 SoSFNode rayIntersection;
00173
00177 enum ASWorkSpace {
00178 BOX,
00179 CAMERA,
00180 WORLD,
00181 MAX_WORK_SPACE
00182 };
00183
00197 SoSFEnum workspace;
00198
00202 enum ASShaderSlot {
00203 COMPUTE_COLOR,
00204 VERTEX_SHADER_ENTRY,
00205 MAX_SHADER_SLOT
00206 };
00207
00240 SoMFNode shaderSlots;
00241
00253 SoSFBool generateTransparency;
00254
00258 enum ASClippingPolicy
00259 {
00260 STANDARD,
00261 FULL_SHAPE,
00262 };
00263
00268 SoSFEnum clippingPolicy;
00269
00270 private:
00271
00275 SoAlgebraicShape ();
00276
00280 virtual ~SoAlgebraicShape ();
00281
00287 virtual void computeBBox ( SbBox3f &box, SbVec3f ¢er ) = 0;
00288
00295 bool solveQuadric ( const SbVec3f& abc, SbVec2f& roots ) const;
00296
00302 static SoFragmentShader* fragmentShaderFromFile ( const SbString& filename );
00303
00308 virtual void generatePrimitives(SoAction *action);
00309
00311
00314 void setCustomTransformationShaderObject( SoVertexShader* vso );
00315 void setCustomRayParametersShaderObject ( SoVertexShader* vso );
00316 void setCustomGeometryBufferedShape ( SoBufferedShape* shape );
00318
00319 private:
00320
00322
00325 virtual void GLRender ( SoGLRenderAction *action );
00326 virtual void computeBBox ( SoAction *action, SbBox3f &box, SbVec3f ¢er );
00328
00329 private:
00330
00332
00335 static void initClass ();
00336 static void exitClass ();
00338
00342 virtual void notify ( SoNotList *list );
00343
00344 private:
00345
00346
00347 void initialize ();
00348
00349
00350 void updateBBox ();
00351
00352 };
00353
00354 #endif // SO_QUADRIC_SHAPE_H
00355