00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_BEVEL_ACTION
00024 #define _SO_BEVEL_ACTION
00025
00026 #include <Inventor/actions/SoCallbackAction.h>
00027 #include <Inventor/SbBasic.h>
00028
00029 class IntArray;
00030 class VertexArray;
00031 class GroupArray;
00032
00033 class SoGroup;
00034 class SoNode;
00035 class SoPrimitiveVertex;
00036 class SoBevelData;
00037
00038 class SoFaceSet;
00039 class SoIndexedFaceSet;
00040 class SoTriangleStripSet;
00041 class SoIndexedTriangleStripSet;
00042 class SoQuadMesh;
00043 class SoCube;
00044 class SoCone;
00045 class SoCylinder;
00046
00047 class BevelMaterial;
00048
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00062
00094 class SoBevelAction : public SoAction
00095 {
00096 SO_ACTION_HEADER(SoBevelAction);
00097
00098 public:
00102 SoBevelAction();
00106 virtual ~SoBevelAction();
00107
00112 void setAngle(float angle);
00117 float getAngle() const;
00121 void setRadius(float radius);
00125 float getRadius() const;
00132 void enableAbsoluteRadius(SbBool flag = TRUE);
00136 SbBool isAbsoluteRadiusEnabled() const;
00140 SbBool isCoplanarTestEnabled() const;
00145 SbBool isDuplicateTestEnabled() const;
00149 SbBool isOrderingTestEnabled() const;
00161 void enableCoplanarTest(SbBool flag = TRUE);
00169 void enableDuplicateTest(SbBool flag = TRUE);
00175 void enableOrderingTest(SbBool flag = TRUE);
00176
00177
00178 virtual void apply(SoNode *node);
00179 virtual void apply(SoPath *path);
00180 virtual void apply(const SoPathList &pathList,
00181 SbBool obeysRules = FALSE);
00182
00187 SoGroup * getSceneGraph();
00188
00189 private:
00190 static void initClass();
00191 static void exitClass();
00192
00193 private:
00194
00195 SoCallbackAction callbackAction;
00196
00197
00198 float angle;
00199 float radius;
00200 SbBool absoluteRadius;
00201 int _tests_to_do;
00202
00203 private:
00204
00205 BevelMaterial* m_material;
00206
00207 VertexArray *_generatedPoints;
00208 IntArray *_generatedTriangles;
00209
00210 GroupArray *_groups;
00211 SoNode* _modifiedNode;
00212 SoGroup* _beveledObject;
00213
00214 void _bevel(SoBevelData *);
00215 SoBevelData* _getData(SoNode *) {return NULL;}
00216
00217 static SoCallbackAction::Response _beforeGroup(void *, SoCallbackAction *action, const SoNode *node);
00218 static SoCallbackAction::Response _afterNode(void *, SoCallbackAction *action, const SoNode *node);
00219 static SoCallbackAction::Response _afterGroup(void *, SoCallbackAction *action, const SoNode *node);
00220
00221 SoBevelData* _getData(SoFaceSet *);
00222 SoBevelData* _getData(SoIndexedFaceSet *);
00223 SoBevelData* _getData(SoTriangleStripSet *);
00224 SoBevelData* _getData(SoIndexedTriangleStripSet *);
00225 SoBevelData* _getData(SoQuadMesh *);
00226 SoBevelData* _getData(SoCube *);
00227 SoBevelData* _getData(SoCone *);
00228 SoBevelData* _getData(SoCylinder *);
00229 static SoCallbackAction::Response _afterFS(void *, SoCallbackAction *, const SoNode *);
00230 static SoCallbackAction::Response _afterIFS(void *, SoCallbackAction *, const SoNode *);
00231 static SoCallbackAction::Response _afterTSS(void *, SoCallbackAction *, const SoNode *);
00232 static SoCallbackAction::Response _afterITSS(void *, SoCallbackAction *, const SoNode *);
00233 static SoCallbackAction::Response _afterQM(void *, SoCallbackAction *, const SoNode *);
00234 static SoCallbackAction::Response _afterCube(void *, SoCallbackAction *, const SoNode *);
00235 static SoCallbackAction::Response _afterCone(void *, SoCallbackAction *, const SoNode *);
00236 static SoCallbackAction::Response _afterCylinder(void *, SoCallbackAction *, const SoNode *);
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249 void getCoords(const SoNode &, SbVec3f *&, int &) const;
00250
00251 static SoCallbackAction::Response _setColors(void *, SoCallbackAction *action, const SoNode *node);
00252
00253 };
00254
00255 #endif
00256