00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __GB_PointRef_H__
00023 #define __GB_PointRef_H__
00024
00025 #include "GB_API.h"
00026 #include "GB_Detail.h"
00027
00028 class UT_BitArray;
00029 class GB_Primitive;
00030 class GB_Vertex;
00031 class GB_Group;
00032
00033 typedef struct GB_PointRef GB_PointRef;
00034
00035 struct GB_PointRef {
00036 GB_Primitive *prim;
00037 GB_Vertex *vtx;
00038 GB_PointRef *next;
00039 GB_PointRef *prev;
00040 };
00041
00042 class GB_API GB_PointRefArray {
00043 public:
00044 GB_PointRefArray(const GB_Detail *gdp, const GB_Group *group);
00045 GB_PointRefArray(const GB_Detail *gdp, const UT_BitArray &points);
00046 GB_PointRefArray(int size = 0);
00047 virtual ~GB_PointRefArray();
00048
00049 unsigned entries() const { return size; }
00050 const GB_PointRef *operator()(unsigned idx) const
00051 {
00052 return (idx < size) ? array[idx] : 0;
00053 }
00054
00055
00056
00057 void destroyReference(GB_PointRef *ref);
00058
00059
00060
00061 void moveReference(GB_PointRef *ref, GB_PointRefArray &d);
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 int changeVertexRef(const GB_Element &fromPt,
00072 GB_Element &toPt,
00073 const GB_Primitive *prim = 0);
00074 int changeVertexRef(GB_Vertex &vtx, GB_Element &toPt);
00075
00076 protected:
00077 GB_PointRef **array;
00078 unsigned size;
00079
00080 private:
00081 void removeReference(GB_PointRef *ref);
00082 };
00083
00084
00085
00086
00087
00088
00089
00090 GB_API extern void GBgetPrimitiveClosure(const GB_Detail &gdp,
00091 const GB_PointGroup *pt_group,
00092 GB_PrimitiveGroup *prim_group,
00093 GB_PrimitiveGroup *restrict_group = 0,
00094 bool restrict_if_contains = true);
00095
00096
00097 GB_API extern void GBgetPrimitiveClosure(const GB_Detail &gdp,
00098 const UT_BitArray &pt_array,
00099 GB_PrimitiveGroup *prim_group,
00100 GB_PrimitiveGroup *restrict_group = 0,
00101 bool restrict_if_contains = true);
00102
00103 #endif