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_NURBS_BREP_ACTION_
00024 #define _SO_NURBS_BREP_ACTION_
00025
00026 #include <Inventor/nodes/SoNurbsGroup.h>
00027
00028 #include <Inventor/actions/SoSubAction.h>
00029 #include <Inventor/STL/vector>
00030
00031 #ifdef _WIN32
00032 #pragma warning(push)
00033 #pragma warning(disable:4251)
00034 #endif
00035
00036 class SoNurbsSurface;
00037 class SoNurbsBoundary;
00038 class SoBrep;
00039 #ifndef HIDDEN_FROM_DOC
00040 namespace A3DPhigsCrackFreeTess
00041 {
00042 class Pid_polyline_data;
00043 class Pid_polygon_data;
00044 class Pid_quad_data;
00045 }
00046 #endif
00047
00048 class SoNurbsBREPAction : public SoAction {
00049
00050 SO_ACTION_HEADER(SoNurbsBREPAction);
00051
00052 public:
00053 SoNurbsBREPAction();
00054 virtual ~SoNurbsBREPAction();
00055
00056 private:
00057 virtual void beginTraversal(SoNode *node);
00058
00059 private:
00060 static void initClass() ;
00061 static void exitClass() ;
00062
00063 SbBool needUpdateBREP() { return m_needUpdateBREP; }
00064 void setBREP(SoBrep *brep) { m_brep = brep; }
00065
00066 void setNeedupdatedBREP(SbBool flag) { m_needUpdateBREP = flag; }
00067 const std::vector<SoNurbsSurface *> &getNurbsSurfaces();
00068 const std::vector<SoNurbsBoundary *> &getNurbsBoundary();
00069 void resetNurbsBoundaryID();
00070
00071 void setCurrPass(int n) { m_currPass = n; }
00072
00073 int getNextProfileID() { return m_nurbsProfileID++; }
00074
00075 int getMaxProfileID() { return m_nurbsProfileID; }
00076
00077 void setNurbsProperty(SoNurbsGroup::NurbsProperty &prop) { m_nurbsProperty = prop; }
00078
00079 private:
00080 static void doNurbsBREPAction(SoAction *action, SoNode *node);
00081 static void callDoAction(SoAction *action, SoNode *node);
00082 static void updateProfileID(SoAction *action, SoNode *node);
00083
00084 void updateBREP(SoNurbsSurface *nurbsSurf);
00085 void checkCache(SoNurbsSurface *nurbsSurf);
00086
00087 int m_currPass;
00088
00089 SbBool m_needUpdateBREP;
00090 SoBrep *m_brep;
00091
00092 int m_nurbsProfileID;
00093 std::vector<SoNurbsSurface *> m_nurbsSurfaces;
00094 std::vector<SoNurbsBoundary *> m_nurbsBoundary;
00095
00096 SoNurbsGroup::NurbsProperty m_nurbsProperty;
00097 };
00098
00099 #ifdef _WIN32
00100 #pragma warning(pop)
00101 #endif
00102
00103 #endif
00104
00105