00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GEO_PrimConnector_h__
00022 #define __GEO_PrimConnector_h__
00023
00024 #include "GEO_API.h"
00025 #include <UT/UT_BitArray.h>
00026 #include <UT/UT_IntArray.h>
00027 #include <UT/UT_PtrArray.h>
00028 #include "GEO_Detail.h"
00029
00030
00031 typedef UT_PtrArray<GEO_Primitive *> geo_ConnectedPrimArray;
00032 typedef UT_PtrArray<GEO_Point *> geo_ConnectedPointArray;
00033
00034 class GEO_PrimClassifier;
00035
00036 class GEO_API GEO_PrimConnector
00037 {
00038 public:
00039 GEO_PrimConnector(GEO_Detail &gdp,
00040 const GEO_PrimClassifier &classifier,
00041 int build_connected_points = 0);
00042 virtual ~GEO_PrimConnector();
00043
00044
00045 int getTreeCount() const
00046 { return (int)myForest.entries(); }
00047 int getMaxTreeCount() const;
00048
00049
00050
00051
00052 const geo_ConnectedPointArray &connectedPoints(int i) const
00053 { return myForest((unsigned)i)->myConnectedPoints; }
00054
00055 const geo_ConnectedPrimArray &connectedPrims(int i) const
00056 { return myForest((unsigned)i)->myConnectedPrims; }
00057
00058
00059 virtual void clear();
00060
00061
00062
00063
00064 int getPrimTree(const GEO_Primitive &prim);
00065
00066 int buildTree(const GEO_Primitive &prim);
00067
00068
00069
00070
00071
00072 virtual int getPrimTrees(const GEO_Point &point,
00073 UT_IntArray &trees) = 0;
00074
00075 protected:
00076 int buildClassTree(int class_num);
00077
00078 class GEO_API geo_ConnectedTree
00079 {
00080 public:
00081 #ifdef INTEL_COMPILER
00082 geo_ConnectedTree() { }
00083 #endif
00084 geo_ConnectedPointArray myConnectedPoints;
00085 geo_ConnectedPrimArray myConnectedPrims;
00086 private:
00087 #ifdef INTEL_COMPILER
00088 geo_ConnectedTree(const geo_ConnectedTree& ) { }
00089 #endif
00090
00091 };
00092
00093
00094 GEO_Detail &myGdp;
00095 const GEO_PrimClassifier *myClassifier;
00096
00097
00098 UT_PtrArray<geo_ConnectedTree *> myForest;
00099 int myBuildConnectedPoints;
00100 UT_BitArray myVisitedPoints;
00101 };
00102
00103 class GEO_PointClassifier;
00104
00105 class GEO_API GEO_PrimConnector3D : public GEO_PrimConnector
00106 {
00107 public:
00108 GEO_PrimConnector3D(GEO_Detail &gdp,
00109 const GEO_PrimClassifier &classifier,
00110 const GEO_PointClassifier &ptclassifier,
00111 int build_connected_points = 0);
00112 virtual ~GEO_PrimConnector3D();
00113
00114
00115
00116
00117
00118 virtual int getPrimTrees(const GEO_Point &point,
00119 UT_IntArray &trees);
00120
00121 private:
00122 const GEO_PointClassifier *myPointClassifier;
00123 };
00124
00125 class GEO_PointRefArray;
00126
00127 class GEO_API GEO_PrimConnectorUV : public GEO_PrimConnector
00128 {
00129 public:
00130 GEO_PrimConnectorUV(GEO_Detail &gdp,
00131 const GEO_PrimClassifier &classifier,
00132 int build_connected_points = 0);
00133 virtual ~GEO_PrimConnectorUV();
00134
00135
00136
00137
00138
00139 virtual int getPrimTrees(const GEO_Point &point,
00140 UT_IntArray &trees);
00141
00142 GEO_PointRefArray &getPointRefArray();
00143
00144 private:
00145 GEO_PointRefArray *myPointRefArray;
00146 };
00147
00148 #endif