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 void enableTexture(SbBool flag) { m_doTexture = flag; }
00066
00067 void setNeedupdatedBREP(SbBool flag) { m_needUpdateBREP = flag; }
00068 const std::vector<SoNurbsSurface *> &getNurbsSurfaces();
00069 const std::vector<SoNurbsBoundary *> &getNurbsBoundary();
00070 void resetNurbsBoundaryID();
00071
00072 void setCurrPass(int n) { m_currPass = n; }
00073
00074 int getNextProfileID() { return m_nurbsProfileID++; }
00075
00076 int getMaxProfileID() { return m_nurbsProfileID; }
00077
00078 void setNurbsProperty(SoNurbsGroup::NurbsProperty &prop) { m_nurbsProperty = prop; }
00079
00080 private:
00081 static void doNurbsBREPAction(SoAction *action, SoNode *node);
00082 static void callDoAction(SoAction *action, SoNode *node);
00083 static void updateProfileID(SoAction *action, SoNode *node);
00084
00085 void updateBREP(SoNurbsSurface *nurbsSurf);
00086 void checkCache(SoNurbsSurface *nurbsSurf);
00087
00088 int m_currPass;
00089
00090 SbBool m_needUpdateBREP;
00091 SoBrep *m_brep;
00092 SbBool m_doTexture;
00093
00094 int m_nurbsProfileID;
00095 std::vector<SoNurbsSurface *> m_nurbsSurfaces;
00096 std::vector<SoNurbsBoundary *> m_nurbsBoundary;
00097
00098 SoNurbsGroup::NurbsProperty m_nurbsProperty;
00099 };
00100
00101 #ifdef _WIN32
00102 #pragma warning(pop)
00103 #endif
00104
00105 #endif
00106
00107