00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GEO_Detail_h__
00021 #define __GEO_Detail_h__
00022
00023 #include "GEO_API.h"
00024 #include <UT/UT_Color.h>
00025 #include <UT/UT_Vector3.h>
00026 #include <UT/UT_Vector3Array.h>
00027 #include <UT/UT_PtrArray.h>
00028 #include <UT/UT_IntArray.h>
00029 #include <UT/UT_FloatArray.h>
00030 #include <GB/GB_Detail.h>
00031 #include "GEO_Point.h"
00032 #include "GEO_Primitive.h"
00033 #include "GEO_PointList.h"
00034 #include "GEO_PrimList.h"
00035 #include "GEO_AttribDict.h"
00036 #include "GEO_Macros.h"
00037 #include "GEO_AttributeOwner.h"
00038 #include "GEO_AttributeHandle.h"
00039 #include "GEO_PrimType.h"
00040
00041 #include <UT/UT_VectorTypes.h>
00042 class UT_HashTable;
00043 class UT_String;
00044 class UT_IStream;
00045 class UT_Ramp;
00046 class GB_Breakpoint;
00047 class GB_BreakpointGroup;
00048 class GB_Edge;
00049 class GB_EdgeGroup;
00050 class GB_VertexGroup;
00051 class GEO_Vertex;
00052 class GEO_MetaExpression;
00053 class GEO_AttributeHandle;
00054 class GEO_AttributeListHandle;
00055 class GEO_Rolloff;
00056 class GEO_Delta;
00057 class GEO_MirrorParms;
00058 class GEO_PointRedirectArray;
00059 class GEO_PointTree;
00060 class TS_MetaExpression;
00061 class GEO_TempVertexCache;
00062 class GEO_TempPointCache;
00063
00064
00065
00066
00067
00068 #define GEO_STD_ATTRIB_NORMAL "N"
00069 #define GEO_STD_ATTRIB_TEXTURE "uv"
00070 #define GEO_STD_ATTRIB_VELOCITY "v"
00071 #define GEO_STD_ATTRIB_MATERIAL "shop_materialpath"
00072 #define GEO_STD_ATTRIB_OGLSHOP "ogl_shop"
00073 #define GEO_STD_ATTRIB_DIFFUSE "Cd"
00074 #define GEO_STD_ATTRIB_ALPHA "Alpha"
00075 #define GEO_STD_ATTRIB_COM "com"
00076 #define GEO_STD_ATTRIB_DISTANCE "dist"
00077 #define GEO_STD_ATTRIB_LOD "lod"
00078 #define GEO_STD_ATTRIB_REST "rest"
00079 #define GEO_STD_ATTRIB_MASS "mass"
00080 #define GEO_STD_ATTRIB_DRAG "drag"
00081 #define GEO_STD_ATTRIB_TENSION "tension"
00082 #define GEO_STD_ATTRIB_SPRINGK "springk"
00083 #define GEO_STD_ATTRIB_LIFE "life"
00084 #define GEO_STD_ATTRIB_DIST "dist"
00085 #define GEO_STD_ATTRIB_UP "up"
00086 #define GEO_STD_ATTRIB_ID "id"
00087 #define GEO_STD_ATTRIB_PSCALE "pscale"
00088 #define GEO_STD_ATTRIB_CREASE "creaseweight"
00089 #define GEO_STD_ATTRIB_AREA "area"
00090 #define GEO_STD_ATTRIB_PERIMETER "perimeter"
00091 #define GEO_STD_ATTRIB_WIDTH "width"
00092 #define GEO_STD_ATTRIB_LAYERMERGE "layermerge"
00093 #define GEO_STD_ATTRIB_SEGS "segs"
00094 #define GEO_STD_ATTRIB_DIV "div"
00095 #define GEO_STD_ATTRIB_LAGE "lage"
00096 #define GEO_STD_ATTRIB_ARC "arc"
00097 #define GEO_STD_ATTRIB_GEN "gen"
00098 #define GEO_STD_ATTRIB_TUBECAPTURE "tubeCapt"
00099 #define GEO_STD_ATTRIB_PNT_CAPTURE "pCapt"
00100 #define GEO_STD_ATTRIB_PNT_CAPTURE_ALPHA "pCaptAlpha"
00101 #define GEO_STD_ATTRIB_PNT_CAPTURE_PATH "pCaptPath"
00102 #define GEO_STD_ATTRIB_PNT_CAPTURE_DATA "pCaptData"
00103 #define GEO_STD_ATTRIB_CAPTUREFRAME "pCaptFrame"
00104 #define GEO_STD_ATTRIB_CAPT_SKELROOT "pCaptSkelRoot"
00105 #define GEO_STD_ATTRIB_WIRE_CAPT "wireCapt"
00106 #define GEO_STD_ATTRIB_WIRE_CAPT_U "wireCaptU"
00107 #define GEO_STD_ATTRIB_WIRE_CAPT_V "wireCaptV"
00108 #define GEO_STD_ATTRIB_WIRE_CAPT_PRIMU "wireCaptPrimU"
00109 #define GEO_STD_ATTRIB_META_CAPT "metaCapt"
00110 #define GEO_STD_ATTRIB_META_CAPT_FRAME "metaCaptFrame"
00111 #define GEO_STD_ATTRIB_META_CAPT_GROUPS "metaCaptGroups"
00112 #define GEO_STD_ATTRIB_META_CAPT_ROOT "metaCaptRoot"
00113 #define GEO_STD_ATTRIB_META_CAPT_PATHS "metaCaptPaths"
00114 #define GEO_STD_ATTRIB_META_CAPT_DATA "metaCaptData"
00115 #define GEO_STD_ATTRIB_META_CAPT_GROUP_MAP "metaCaptGroupMap"
00116 #define GEO_STD_ATTRIB_META_SLIDE "slideModifier"
00117 #define GEO_STD_ATTRIB_INFLATE_MODIFIER "inflatemodifier"
00118 #define GEO_STD_ATTRIB_INTERNAL_CHANGED_POINTS "internalChangedPoints"
00119 #define GEO_STD_ATTRIB_MUSCLE_REST_ANCHOR "restAnchor"
00120 #define GEO_STD_ATTRIB_MUSCLE_REST_XFORMS "restTransforms"
00121 #define GEO_STD_ATTRIB_MUSCLE_INFLATE_NORM "muscleInflateNormal"
00122 #define GEO_STD_ATTRIB_MUSCLE_POSITION_BIAS "positionbiasvalues"
00123 #define GEO_STD_ATTRIB_RIXLATE "rixlate"
00124 #define GEO_STD_ATTRIB_MATERIAL_PATH "shop_materialpath"
00125
00126
00127
00128
00129 enum GEO_Standard_Attributes {
00130 GEO_ATTRIBUTE_NORMAL,
00131 GEO_ATTRIBUTE_TEXTURE,
00132 GEO_ATTRIBUTE_VELOCITY,
00133 GEO_ATTRIBUTE_MATERIAL,
00134 GEO_ATTRIBUTE_DIFFUSE,
00135 GEO_ATTRIBUTE_ALPHA,
00136 GEO_ATTRIBUTE_COM,
00137 GEO_ATTRIBUTE_DISTANCE,
00138 GEO_ATTRIBUTE_LOD,
00139 GEO_ATTRIBUTE_REST,
00140 GEO_ATTRIBUTE_MASS,
00141 GEO_ATTRIBUTE_DRAG,
00142 GEO_ATTRIBUTE_TENSION,
00143 GEO_ATTRIBUTE_SPRINGK,
00144 GEO_ATTRIBUTE_LIFE,
00145 GEO_ATTRIBUTE_DIST,
00146 GEO_ATTRIBUTE_UP,
00147 GEO_ATTRIBUTE_ID,
00148 GEO_ATTRIBUTE_PSCALE,
00149 GEO_ATTRIBUTE_CREASE,
00150 GEO_ATTRIBUTE_AREA,
00151 GEO_ATTRIBUTE_PERIMETER,
00152 GEO_ATTRIBUTE_WIDTH,
00153 GEO_ATTRIBUTE_OGLSHOP,
00154 GEO_ATTRIBUTE_LAYERMERGE,
00155 GEO_ATTRIBUTE_SEGS,
00156 GEO_ATTRIBUTE_DIV,
00157 GEO_ATTRIBUTE_LAGE,
00158 GEO_ATTRIBUTE_ARC,
00159 GEO_ATTRIBUTE_GEN,
00160 GEO_NUM_STANDARD_ATTRIBUTE
00161 };
00162
00163 class GEO_API GEO_Detail : public GB_Detail {
00164 public:
00165 GEO_Detail();
00166 virtual ~GEO_Detail();
00167
00168
00169 virtual void clearAndDestroy();
00170
00171
00172 virtual int save(const char *, int binary,
00173 const UT_Options *options) const = 0;
00174 virtual int save(ostream& os, int binary,
00175 const UT_Options *options) const;
00176 virtual int load(const char *, const UT_Options *options) = 0;
00177 virtual bool load(UT_IStream &is, const UT_Options *options);
00178
00179
00180
00181 virtual int saveVertex(ostream &os,const GB_Vertex &vtx,int b) const;
00182 virtual bool loadVertex(UT_IStream &is,GB_Vertex &vtx);
00183
00184 bool loadPoint(UT_IStream &is, GEO_Point &pt);
00185 int saveBinaryPoint(ostream &os, const GEO_Point &pt) const;
00186 int saveASCIIPoint (ostream &os, const GEO_Point &pt) const;
00187
00188
00189 void merge(GEO_Detail &src, const GB_PrimitiveGroup *primGrp = 0,
00190 int mergePrimGroup = 1, int insertPrimsAtHead= 0,
00191 GEO_PointRedirectArray *dest_to_src_ptarray=0,
00192 bool keep_internal_groups = true);
00193 void mergePoints(const GEO_Detail &src,
00194 const GB_PointGroup *ptGrp = 0,
00195 GEO_Point **ptredirect = 0,
00196 int merge_groups = 1,
00197 bool keep_internal_groups = true);
00198
00199 void merge(GEO_Primitive &sprim, int insertPrimAtHead = 0);
00200
00201 int copy(const GEO_Detail &src, int method = GB_COPY_ONCE,
00202 bool collapse_on_end = true,
00203 bool keep_internal_groups = true);
00204
00205 void collapseIndexAttributes();
00206
00207
00208 void mirror(GEO_MirrorParms &parms);
00209
00210
00211
00212
00213
00214 void transform(const UT_Matrix4 &mat,
00215 const GB_PrimitiveGroup *primGrp = 0,
00216 const GB_PointGroup *pointClosure = 0,
00217 int quickxform = 0,
00218 int keep_vector_lengths = 1,
00219 int check_pasting = 1,
00220 int neg_determinant_flipvector = 1,
00221 int update_ptnormals = 0,
00222 GEO_Delta *geodelta = 0);
00223
00224
00225 void transformRange(const UT_Matrix4 &mat,
00226 int min_ptnum, int max_ptnum,
00227 int min_primnum, int max_primnum,
00228 int quickxform = 0,
00229 int keep_vector_lengths = 1,
00230 int check_pasting = 1,
00231 int neg_determinant_flipvector = 1,
00232 int update_ptnormals = 0,
00233 GEO_Delta *geodelta = 0);
00234
00235 void translate(const UT_Vector3 &delta,
00236 const GB_PrimitiveGroup *primGrp = 0,
00237 const GB_PointGroup *pointClosure = 0,
00238 int check_pasting = 1,
00239 int update_ptnormals = 0,
00240 GEO_Delta *geodelta = 0);
00241
00242
00243 void transformPoints(const UT_Matrix4 &mat,
00244 const GB_PointGroup *pointGroup = 0,
00245 const GB_PrimitiveGroup *primClosure = 0,
00246 int quickxform = 0,
00247 int keep_vector_lengths = 1,
00248 int check_pasting = 1,
00249 int neg_determinant_flipvector = 1,
00250 int update_ptnormals = 0,
00251 GEO_Delta *geodelta = 0);
00252
00253 void translatePoints(const UT_Vector3 &delta,
00254 const GB_PointGroup *pointGroup = 0,
00255 int check_pasting = 1,
00256 int update_ptnormals = 0,
00257 GEO_Delta *geodelta = 0);
00258
00259
00260
00261 void transformEdges(const UT_Matrix4 &mat,
00262 const GB_EdgeGroup *edgegrp = 0,
00263 const GB_PrimitiveGroup *primclosure = 0,
00264 int quickxform = 0,
00265 int keep_vector_lengths = 1,
00266 int check_pasting = 1,
00267 int neg_determinant_flipvector = 1,
00268 int update_ptnormals = 0,
00269 GEO_Delta *geodelta = 0);
00270
00271 void translateEdges(const UT_Vector3 &delta,
00272 const GB_EdgeGroup *edgegrp = 0,
00273 int check_pasting = 1,
00274 int update_ptnormals = 0,
00275 GEO_Delta *geodelta = 0);
00276
00277
00278 void transformBreakpoints(const UT_Matrix4 &mat,
00279 const GB_BreakpointGroup *grp = 0,
00280 int quickxform = 0,
00281 int update_ptnormals = 0,
00282 GEO_Delta *geodelta = 0);
00283
00284 void translateBreakpoints(const UT_Vector3 &delta,
00285 const GB_BreakpointGroup *grp = 0,
00286 int update_ptnormals = 0,
00287 GEO_Delta *geodelta = 0);
00288
00289
00290
00291 void transformGroup(const UT_Matrix4 &mat, const GB_BaseGroup &grp,
00292 int quickxform = 0,
00293 int keep_vector_lengths = 1,
00294 int check_pasting = 1,
00295 int neg_determinant_flipvector = 1,
00296 const GB_PointGroup *ptclosure = 0,
00297 const GB_PrimitiveGroup *primclosure = 0,
00298 int update_ptnormals = 0,
00299 GEO_Delta *geodelta = 0);
00300
00301 void translateGroup(const UT_Vector3 &delta,
00302 const GB_BaseGroup &grp,
00303 int check_pasting = 1,
00304 const GB_PointGroup *ptclosure = 0,
00305 int update_ptnormals = 0,
00306 GEO_Delta *geodelta = 0);
00307
00308 void visualizeSoftPoints(const GEO_Rolloff &rolloff,
00309 const GB_PointGroup *ptgroup,
00310 UT_ColorRamp ramp);
00311
00312
00313
00314
00315 static void transformAttributes(GB_AttributeElem &obj,
00316 const UT_Matrix3 &matx3,
00317 const GB_VectorOffsets &foffsets,
00318 bool keep_length);
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343 void computeNormal(const GEO_Point &point, UT_Vector3 &nml) const;
00344
00345
00346
00347 void computeNormalInternal(const GEO_Point &point, UT_Vector3 &nml);
00348
00349
00350 void computeNormal(const GEO_Primitive &prim, UT_Vector3 &nml) const;
00351
00352
00353 void computeNormal(const GB_Edge &edge, UT_Vector3 &nml) const;
00354
00355
00356
00357 void computeNormalInternal(const GB_Edge &edge, UT_Vector3 &nml);
00358
00359
00360
00361 void computeNormal(const GB_Breakpoint &bkpt, UT_Vector3 &nml) const;
00362
00363
00364
00365 void normalTranslatePoints(float length = 1.0F,
00366 int check_pasting = 1,
00367 const GB_PointGroup *grp = 0,
00368 int update_ptnormals = 0,
00369 GEO_Delta *geodelta = 0);
00370 void normalTranslatePrimitives(float length = 1.0F,
00371 int check_pasting = 1,
00372 const GB_PrimitiveGroup *grp = 0,
00373 int update_ptnormals = 0,
00374 GEO_Delta *geodelta = 0);
00375 void normalTranslate(const GB_PointGroup &grp,
00376 float length = 1.0F, int check_pasting = 1,
00377 int update_ptnormals = 0,
00378 GEO_Delta *geodelta = 0);
00379 void normalTranslate(const GB_PrimitiveGroup &grp,
00380 float length = 1.0F, int check_pasting = 1,
00381 int update_ptnormals = 0,
00382 GEO_Delta *geodelta = 0);
00383 void normalTranslate(const GB_EdgeGroup &grp,
00384 float length = 1.0F, int check_pasting = 1,
00385 int update_ptnormals = 0,
00386 GEO_Delta *geodelta = 0);
00387 void normalTranslate(const GB_BreakpointGroup &grp,
00388 float length = 1.0F, int check_pasting = 1,
00389 int update_ptnormals = 0,
00390 GEO_Delta *geodelta = 0);
00391 void normalTranslateGroup(const GB_BaseGroup &grp,
00392 float length = 1.0F, int check_pasting = 1,
00393 int update_ptnormals = 0,
00394 GEO_Delta *geodelta = 0);
00395
00396
00397 void softTransformPoints(const UT_XformOrder &order,
00398 float tx, float ty, float tz,
00399 float rx, float ry, float rz,
00400 float sx, float sy, float sz,
00401 float s_xy, float s_xz, float s_yz,
00402 float px, float py, float pz,
00403 const GEO_Rolloff &rolloff,
00404 const GB_PointGroup *ptgroup = 0,
00405 int quickxform = 0,
00406 int keep_vector_lengths = 1,
00407 int check_pasting = 1,
00408 int neg_determinant_flipvector = 1,
00409 int update_ptnormals = 0,
00410 GEO_Delta *geodelta = 0);
00411 void softTransformEdges(const UT_XformOrder &order,
00412 float tx, float ty, float tz,
00413 float rx, float ry, float rz,
00414 float sx, float sy, float sz,
00415 float s_xy, float s_xz, float s_yz,
00416 float px, float py, float pz,
00417 const GEO_Rolloff &rolloff,
00418 const GB_EdgeGroup *edgegrp = 0,
00419 int quickxform = 0,
00420 int keep_vector_lengths = 1,
00421 int check_pasting = 1,
00422 int neg_determinant_flipvector = 1,
00423 int update_ptnormals = 0,
00424 GEO_Delta *geodelta = 0);
00425
00426
00427 void softTranslatePoints(const UT_Vector3 &delta,
00428 const GEO_Rolloff &rolloff,
00429 const GB_PointGroup *ptgroup = 0,
00430 int check_pasting = 1,
00431 int update_ptnormals = 0,
00432 GEO_Delta *geodelta = 0);
00433 void softTranslateEdges(const UT_Vector3 &delta,
00434 const GEO_Rolloff &rolloff,
00435 const GB_EdgeGroup *edgegrp = 0,
00436 int check_pasting = 1,
00437 int update_ptnormals = 0,
00438 GEO_Delta *geodelta = 0);
00439
00440
00441 void softNormalTranslatePoints(float distance,
00442 const GEO_Rolloff &rolloff,
00443 const GB_PointGroup *ptgroup = 0,
00444 int along_lead_normal = 1,
00445 int check_pasting = 1,
00446 int update_ptnormals = 0,
00447 GEO_Delta *geodelta = 0);
00448
00449
00450
00451
00452 virtual GB_AttributeRef normal(int internal=0,
00453 GB_PrimitiveGroup *primgroup = 0) = 0;
00454 virtual void normal(UT_Vector3Array &output, bool use_internaln = true) const = 0;
00455
00456
00457 enum CaptureType
00458 {
00459 CAPTURE_BONE = 0,
00460 CAPTURE_META,
00461 CAPTURE_WIRE
00462 };
00463
00464
00465
00466 static const char *getPointCaptureAttribName(CaptureType type);
00467
00468
00469
00470
00471 static const char *getPointCaptureIndexAttribName(CaptureType type);
00472
00473
00474
00475 static const char *getPointCaptureFrameAttribName(CaptureType type);
00476
00477
00478
00479 static const char *getPointCaptureRootAttribName(CaptureType type);
00480
00481
00482
00483
00484 static const char *getPointCaptureDataAttribName(CaptureType type);
00485
00486
00487
00488
00489
00490 static int getPointCaptureDataAttribEntrySize(CaptureType t);
00491
00492
00493
00494 bool getCaptureRegionRootPath(UT_String &root_path,
00495 CaptureType t = CAPTURE_BONE) const;
00496 bool setCaptureRegionRootPath(const UT_String &root_path,
00497 CaptureType t = CAPTURE_BONE);
00498
00499
00500
00501 int getCaptureRegionIndex(const UT_String &cregion_name,
00502 CaptureType t = CAPTURE_BONE);
00503
00504
00505
00506
00507 int addCaptureRegion(const UT_String &cregion_name,
00508 const UT_Matrix4 &parent_xform,
00509 const GEO_Detail *tube_gdp);
00510
00511
00512
00513 int addCaptureRegion(const UT_String &cregion_name,
00514 CaptureType type);
00515
00516
00517
00518 int removeCaptureRegion(const UT_String &cregion_name,
00519 CaptureType t = CAPTURE_BONE);
00520
00521
00522 void setCaptureWeight(int cregion_index, float weight,
00523 const GB_PointGroup *ptgroup = 0,
00524 GEO_Delta *geodelta = 0,
00525 int add_weight = 0,
00526 int clamp_negative = 0,
00527 int normalizeweight = 0,
00528 CaptureType t = CAPTURE_BONE);
00529
00530
00531 void setCaptureWeight(int cregion_index, float weight,
00532 GEO_Point *ppt,
00533 GEO_Delta *geodelta = 0,
00534 int add_weight = 0,
00535 int clamp_negative = 0,
00536 int normalizeweight = 0,
00537 CaptureType t = CAPTURE_BONE);
00538
00539
00540 float getCaptureWeight(int cregion_index, const GEO_Point *ppt,
00541 CaptureType t = CAPTURE_BONE) const;
00542
00543
00544 int addAverageCaptureWeight( const GB_PointGroup *ptgroup,
00545 const UT_String &root_path,
00546 UT_HashTable &averages ) const;
00547
00548 void getCaptureWeights(const GEO_Point *ppt, UT_IntArray ®ions,
00549 UT_FloatArray &weights,
00550 CaptureType t = CAPTURE_BONE) const;
00551 void clearCaptureWeights(GEO_Point *ppt,
00552 CaptureType t = CAPTURE_BONE);
00553
00554 enum VisualizationType
00555 {
00556 VISTYPE_SINGLE,
00557 VISTYPE_MULTIPLE
00558 };
00559
00560
00561 void colorPointsByCaptureWeight(
00562 const UT_PtrArray<const UT_Vector3 *> &colors,
00563 const UT_Vector3 &zero_weight_color,
00564 CaptureType t = CAPTURE_BONE,
00565 VisualizationType vistype = VISTYPE_MULTIPLE,
00566 UT_ColorRamp singlevismode = UT_COLORRAMP_FALSE);
00567
00568 void normalizeCaptureWeights(const GB_PointGroup *ptgroup = 0,
00569 CaptureType t = CAPTURE_BONE);
00570
00571
00572
00573
00574
00575 void clampCaptureWeights(const GB_PointGroup *ptgroup = 0,
00576 bool clamp_low_flag = true,
00577 float low_threshold = 0.0f, float low_val = 0.0f,
00578 bool clamp_hi_flag = false,
00579 float hi_threshold = 1.0f, float hi_val = 1.0f,
00580 CaptureType t = GEO_Detail::CAPTURE_BONE);
00581
00582
00583 void normalizeRelativeCaptureWeights(int idx, GEO_Point *pt,
00584 GEO_Delta *delta=0);
00585
00586
00587
00588
00589 GEO_Point *insertPoint(const GEO_Point *beforeWhich = 0);
00590 GEO_Point *appendPoint() { return insertPoint(0); }
00591
00592
00593
00594
00595
00596 GEO_Point *insertPoint(const GEO_Point &src,
00597 const GEO_Point *beforeWhich=0);
00598
00599 SYS_DEPRECATED GEO_Point *insertPoint(const UT_Vector4 &pos,
00600 GB_AttributeData &adata,
00601 short stealattrib = 0,
00602 const GEO_Point *beforeWhich = 0);
00603
00604
00605
00606
00607 GEO_Point *appendPoint(const GEO_Point &src)
00608 { return insertPoint(src); }
00609
00610 SYS_DEPRECATED GEO_Point *appendPoint(const UT_Vector4 &pos,
00611 GB_AttributeData &adata,
00612 short stealattrib = 0);
00613
00614
00615
00616
00617 GEO_Point *allocateTempPoint();
00618 void deleteTempPoint(GEO_Point *pt);
00619
00620
00621
00622
00623 GEO_Vertex *allocateTempVertex(GEO_Point *pt);
00624 void deleteTempVertex(GEO_Vertex *vtx);
00625
00626
00627
00628
00629
00630
00631
00632
00633 GEO_Primitive *insertPrimitive(unsigned type,
00634 const GEO_Primitive *beforeWhich = 0,
00635 const GEO_Primitive *src = 0,
00636 GEO_Point **ptredirect = 0);
00637 GEO_Primitive *appendPrimitive(unsigned type,
00638 const GEO_Primitive *src = 0,
00639 GEO_Point **ptredirect = 0)
00640 {
00641 return insertPrimitive(type, 0, src, ptredirect);
00642 }
00643
00644
00645 virtual void deletePrimitive(GB_Primitive &p,int andpoints=0)
00646 {
00647 deletePrimitive((unsigned)p.getNum(), andpoints);
00648 }
00649 virtual void deletePrimitive(unsigned int num, int andpoints = 0);
00650
00651
00652 virtual void deletePrimitives(const GB_PrimitiveGroup &primGrp,
00653 int andpoints = 0);
00654 virtual void deletePrimitives(UT_PtrArray<GEO_Primitive*>& prims_in,
00655 int andpoints = 0);
00656
00657
00658
00659 virtual GB_Breakpoint *allocBreakpoint() const;
00660
00661
00662 virtual void deleteBreakpoints(GB_BreakpointGroup &bkptgrp);
00663
00664
00665
00666 virtual int getPointBBox(UT_BoundingBox *bbox,
00667 const GB_PointGroup *g = 0) const;
00668 virtual int getPointBBox(UT_BoundingBox& bbox, const UT_Matrix4& transform,
00669 const GB_PointGroup *g=0) const;
00670 virtual int getPointBSphere(UT_BoundingSphere *bsphere,
00671 const GB_PointGroup *g = 0,
00672 int accuratebounds = 0) const;
00673 virtual int getVertexBBox(UT_BoundingBox *bbox,
00674 const GB_VertexGroup *g = 0) const;
00675 virtual int getVertexBBox(UT_BoundingBox& bbox, const UT_Matrix4& transform,
00676 const GB_VertexGroup *g = 0) const;
00677 virtual int getEdgeBBox(UT_BoundingBox &bbox,
00678 const GB_EdgeGroup &grp) const;
00679 virtual int getEdgeBBox(UT_BoundingBox &bbox, const UT_Matrix4& transform,
00680 const GB_EdgeGroup &grp) const;
00681 virtual int getEdgeBSphere(UT_BoundingSphere &bsphere,
00682 const GB_EdgeGroup &grp,
00683 int accuratebounds = 0) const;
00684 virtual int getBreakpointBBox(UT_BoundingBox &bbox,
00685 const GB_BreakpointGroup &grp) const;
00686 virtual int getBreakpointBBox(UT_BoundingBox &bbox, const UT_Matrix4& transform,
00687 const GB_BreakpointGroup &grp) const;
00688 virtual int getBreakpointBSphere(UT_BoundingSphere &bsphere,
00689 const GB_BreakpointGroup &grp,
00690 int accuratebounds = 0) const;
00691 virtual int getGroupBBox(UT_BoundingBox *bbox,
00692 const GB_BaseGroup *grp) const;
00693 virtual int getGroupBBox(UT_BoundingBox& bbox, const UT_Matrix4& transform,
00694 const GB_BaseGroup *grp) const;
00695 virtual int getGroupBSphere(UT_BoundingSphere *bsphere,
00696 const GB_BaseGroup *grp,
00697 int accuratebounds) const;
00698
00699
00700
00701 int getPointAttribBBox(const char *name,
00702 UT_BoundingBox *bbox,
00703 const GB_PointGroup *g = 0) const;
00704 int getPointAttribBBox(const char *name,
00705 UT_BoundingBox *bbox,
00706 const GB_PrimitiveGroup &g) const;
00707 int getPointAttribBBox(const char *name,
00708 UT_BoundingBox *bbox,
00709 const GB_EdgeGroup &g) const;
00710 int getPointAttribBBox(const char *name,
00711 UT_BoundingBox *bbox,
00712 const GB_VertexGroup &g) const;
00713
00714 int getPointAttribGroupBBox(const char *name,
00715 UT_BoundingBox *bbox,
00716 const GB_BaseGroup *grp) const;
00717
00718 int getVertexAttribBBox(const char *name,
00719 UT_BoundingBox *bbox,
00720 const GB_PointGroup *g = 0) const;
00721 int getVertexAttribBBox(const char *name,
00722 UT_BoundingBox *bbox,
00723 const GB_PrimitiveGroup &g) const;
00724 int getVertexAttribBBox(const char *name,
00725 UT_BoundingBox *bbox,
00726 const GB_EdgeGroup &g) const;
00727 int getVertexAttribBBox(const char *name,
00728 UT_BoundingBox *bbox,
00729 const GB_VertexGroup &g) const;
00730
00731 int getVertexAttribGroupBBox(const char *name,
00732 UT_BoundingBox *bbox,
00733 const GB_BaseGroup *grp) const;
00734
00735
00736 void copyPointAttributes(GEO_Point &dest,
00737 const GEO_Point &src) const;
00738
00739 void copyVertexAttributes(GEO_Vertex &dest,
00740 const GEO_Vertex &src) const;
00741
00742 void copyPointVertexAttributes(GEO_Vertex &dest,
00743 const GEO_Vertex &src) const;
00744
00745 void copyFullVertex(GEO_Vertex &dest,
00746 const GEO_Vertex &src) const;
00747
00748 void copyPrimitiveAttributes(GEO_Primitive &dest,
00749 const GEO_Primitive &src) const;
00750
00751 void copyPointGroups(GEO_Point &dest,
00752 const GEO_Point &src) const;
00753 void copyPrimitiveGroups(GEO_Primitive &dest,
00754 const GEO_Primitive &src) const;
00755
00756
00757
00758
00759
00760
00761 void copyVertex(GEO_Vertex &dest, const GEO_Vertex &src,
00762 int shallow = 0) const;
00763
00764
00765 void SYS_DEPRECATED blendVertex(GEO_Vertex &dest, const GEO_Vertex &src,
00766 float bias,
00767 GB_FloatOffsets *ptarray,
00768 GB_FloatOffsets *vtxarray) const;
00769
00770 #if 0
00771
00772 void blendVertex(GEO_Vertex &dest, const GEO_Vertex &src,
00773 fpreal bias,
00774 GEO_AttributeHandleList *pdata,
00775 GEO_AttributeHandleList *vdata) const;
00776 #endif
00777
00778
00779
00780
00781 void fixSplineWeights();
00782
00783
00784
00785
00786
00787
00788
00789 GB_AttributeRef addNormalAttribute(GEO_AttributeOwner who);
00790 GB_AttributeRef addTextureAttribute(GEO_AttributeOwner who);
00791 GB_AttributeRef addVelocityAttribute(GEO_AttributeOwner who);
00792 GB_AttributeRef addAlphaAttribute(GEO_AttributeOwner who);
00793 GB_AttributeRef addComAttribute(GEO_AttributeOwner who);
00794 GB_AttributeRef addDiffuseAttribute(GEO_AttributeOwner who);
00795 GB_AttributeRef addDistanceAttribute(GEO_AttributeOwner who);
00796 GB_AttributeRef addLODAttribute(GEO_AttributeOwner who);
00797 GB_AttributeRef addRestAttribute(GEO_AttributeOwner who);
00798 GB_AttributeRef addTubeCaptureAttribute();
00799
00800
00801 GB_AttributeRef addCaptureFrameAttribute(CaptureType t = CAPTURE_BONE);
00802
00803
00804 GB_AttributeRef addCaptureSkelRootAttribute(CaptureType t
00805 = CAPTURE_BONE);
00806
00807
00808 GB_AttributeRef addPtCapturePathAttribute(CaptureType t =CAPTURE_BONE);
00809
00810
00811
00812 GB_AttributeRef addPtCaptureAttribute(int num_xforms,
00813 CaptureType t = CAPTURE_BONE);
00814
00815
00816 GB_AttributeRef addPtIndexPairAttribute(const char *name,
00817 int size_bytes);
00818
00819
00820 GB_AttributeRef addPointCaptureAttribute(int size,
00821 CaptureType t = CAPTURE_BONE);
00822
00823
00824 GB_AttributeRef addPointCaptureAlphaAttribute(float dflt);
00825
00826
00827 GB_AttributeRef addMetaRestTransformsAttribute(int num_xforms);
00828
00829
00830
00831
00832
00833 GB_AttributeRef addInternalChangedPointsAttribute(
00834 const UT_IntArray &changed_points);
00835
00836 GB_AttributeRef findNormalAttribute(GEO_AttributeOwner who) const;
00837 GB_AttributeRef findTextureAttribute(GEO_AttributeOwner who) const;
00838 GB_AttributeRef findVelocityAttribute(GEO_AttributeOwner who) const;
00839 GB_AttributeRef findAlphaAttribute(GEO_AttributeOwner who) const;
00840 GB_AttributeRef findComAttribute(GEO_AttributeOwner who) const;
00841 GB_AttributeRef findDiffuseAttribute(GEO_AttributeOwner who) const;
00842 GB_AttributeRef findDistanceAttribute(GEO_AttributeOwner who) const;
00843 GB_AttributeRef findLODAttribute(GEO_AttributeOwner who) const;
00844 GB_AttributeRef findRestAttribute(GEO_AttributeOwner who) const;
00845 GB_AttributeRef findTubeCaptureAttribute() const;
00846
00847
00848
00849 GB_AttributeRef findCaptureFrameAttribute(CaptureType t = CAPTURE_BONE)
00850 const;
00851
00852
00853 GB_AttributeRef findCaptureSkelRootAttribute(CaptureType t
00854 = CAPTURE_BONE) const;
00855
00856
00857
00858 GB_AttributeRef findPtCapturePathAttribute(CaptureType t
00859 = CAPTURE_BONE) const;
00860
00861
00862 GB_AttributeRef findPtCaptureAttribute(CaptureType t = CAPTURE_BONE)
00863 const;
00864
00865
00866
00867 GB_AttributeRef findPointCaptureAttribute(CaptureType t = CAPTURE_BONE)
00868 const;
00869
00870 GB_AttributeRef findPointCaptureAlphaAttribute() const;
00871
00872
00873 GB_AttributeRef findPtIndexPairAttribute(const char *name) const;
00874
00875
00876 GB_Attribute * findInternalChangedPointsAttribute() const;
00877
00878
00879 GB_AttributeRef getInternalChangedPointsAttribute(
00880 UT_IntArray &changed_points) const;
00881
00882
00883 GB_AttributeRef findMetaRestTransformsAttribute() const;
00884
00885 void destroyNormalAttribute(GEO_AttributeOwner who);
00886 void destroyTextureAttribute(GEO_AttributeOwner who);
00887 void destroyVelocityAttribute(GEO_AttributeOwner who);
00888 void destroyAlphaAttribute(GEO_AttributeOwner who);
00889 void destroyComAttribute(GEO_AttributeOwner who);
00890 void destroyDiffuseAttribute(GEO_AttributeOwner who);
00891 void destroyDistanceAttribute(GEO_AttributeOwner who);
00892 void destroyLODAttribute(GEO_AttributeOwner who);
00893 void destroyRestAttribute(GEO_AttributeOwner who);
00894 void destroyTubeCaptureAttribute();
00895
00896
00897 void destroyCaptureFrameAttribute(CaptureType t
00898 = CAPTURE_BONE);
00899
00900
00901 void destroyCaptureSkelRootAttribute(CaptureType t
00902 = CAPTURE_BONE);
00903
00904
00905
00906 void destroyPtCapturePathAttribute(CaptureType t =
00907 CAPTURE_BONE);
00908
00909
00910 void destroyPtCaptureAttribute(CaptureType t =CAPTURE_BONE);
00911
00912
00913
00914 void destroyPointCaptureAttribute(CaptureType t =
00915 CAPTURE_BONE);
00916
00917
00918 void destroyPointCaptureAlphaAttribute();
00919
00920
00921 void destroyPtIndexPairAttribute(const char *name);
00922
00923
00924 void destroyInternalChangedPointsAttribute();
00925
00926
00927 void destroyMetaRestTransformsAttribute();
00928
00929
00930
00931 bool getMetaRestAnchorPath(UT_String &anchorPath);
00932
00933
00934
00935
00936
00937
00938
00939 const char *getStdAttributeName(GEO_Standard_Attributes name,
00940 int layer = -1) const;
00941 void setStdAttributeName(GEO_Standard_Attributes name,
00942 const char *newname);
00943 int getAttributeLayer(const char* attr_name) const;
00944
00945
00946 int getCurrentLayer() const;
00947 void setCurrentLayer(int layer);
00948 void setNumLayers(int numlayer);
00949 int getNumLayers() const;
00950
00951 void setLayerMerge(int preclear, int mask, int srcblend,
00952 int dstblend);
00953 void getLayerMerge(int &preclear, int &mask, int &srcblend,
00954 int &dstblend);
00955
00956 void addVariableName(const char *attr, const char *varname);
00957 void removeVariableName(const char *varname)
00958 { addVariableName(0, varname); }
00959
00960
00961 void getVariableNameMap(UT_String &result) const;
00962
00963
00964 void traverseVariableNames(int (*function)(const char *attr,
00965 const char *varname, void *data),
00966 void *data) const;
00967
00968
00969 GB_AttributeRef growPtCaptureAttribute(int num_added_xforms,
00970 CaptureType t = CAPTURE_BONE);
00971 GB_AttributeRef growPointCaptureAttribute(int added_size,
00972 CaptureType t = CAPTURE_BONE);
00973
00974
00975 GB_AttributeRef shrinkPtCaptureAttribute(int index, int offset,
00976 CaptureType t = CAPTURE_BONE);
00977
00978 GB_AttributeRef addIndexAttribute(const char *n, const char *dv,
00979 GEO_AttributeOwner who);
00980 GB_AttributeRef findIndexAttribute(const char *n,
00981 GEO_AttributeOwner who) const;
00982 void destroyIndexAttribute(const char *n,
00983 GEO_AttributeOwner who);
00984
00985 GB_AttributeRef addPointAttrib(const GB_Attribute *src)
00986 { return ptAttrib.appendClone(src); }
00987 GB_AttributeRef addPointAttrib(const char *n, int s,
00988 GB_AttribType t, GB_AttribTypeInfo f,
00989 const void *dv)
00990 { return ptAttrib.append(n, s, t, f, dv); }
00991 GB_AttributeRef addPointAttrib(const char *n, int s,
00992 GB_AttribType t, const void *dv)
00993 { return ptAttrib.append(n, s, t, dv); }
00994
00995 GB_AttributeRef findPointAttrib(const GB_Attribute *src) const
00996 { return ptAttrib.getOffset(src); }
00997 GB_AttributeRef findPointAttrib(const char *n, int s,
00998 GB_AttribType t) const
00999 { return ptAttrib.getOffset(n, s, t); }
01000
01001 GB_AttributeRef findPointAttrib(const char *n, GB_AttribType t) const
01002 { return ptAttrib.getOffset(n, t); }
01003
01004
01005
01006 GB_AttributeRef findPointVectorAttrib(const char *n) const
01007 { GB_AttributeRef ref = ptAttrib.getOffset(n, sizeof(UT_Vector3), GB_ATTRIB_FLOAT);
01008 if (ref.isValid()) return ref;
01009 return ptAttrib.getOffset(n, sizeof(UT_Vector3), GB_ATTRIB_VECTOR); }
01010
01011 void destroyPointAttrib(const char *n, int s,
01012 GB_AttribType t)
01013 { ptAttrib.destroy(n, s, t); }
01014
01015 GB_AttributeRef addVertexAttrib(const GB_Attribute *src)
01016 { return vtxAttrib.appendClone(src); }
01017 GB_AttributeRef addVertexAttrib(const char *n, int s,
01018 GB_AttribType t, GB_AttribTypeInfo f,
01019 const void *dv)
01020 { return vtxAttrib.append(n, s, t, f, dv); }
01021 GB_AttributeRef addVertexAttrib(const char *n, int s,
01022 GB_AttribType t, const void *dv)
01023 { return vtxAttrib.append(n, s, t, dv); }
01024
01025 GB_AttributeRef findVertexAttrib(const GB_Attribute *src) const
01026 { return vtxAttrib.getOffset(src); }
01027 GB_AttributeRef findVertexAttrib(const char *n, int s,
01028 GB_AttribType t) const
01029 { return vtxAttrib.getOffset(n, s, t); }
01030
01031 void destroyVertexAttrib(const char *n, int s,
01032 GB_AttribType t)
01033 { vtxAttrib.destroy(n, s, t); }
01034
01035 GB_AttributeRef addPrimAttrib(const GB_Attribute *src)
01036 { return primAttrib.appendClone(src); }
01037 GB_AttributeRef addPrimAttrib(const char *n, int s, GB_AttribType t,
01038 GB_AttribTypeInfo f, const void *dv)
01039 { return primAttrib.append(n, s, t, f, dv); }
01040 GB_AttributeRef addPrimAttrib(const char *n, int s, GB_AttribType t,
01041 const void *dv)
01042 { return primAttrib.append(n, s, t, dv); }
01043
01044 GB_AttributeRef findPrimAttrib(const GB_Attribute *src) const
01045 { return primAttrib.getOffset(src); }
01046 GB_AttributeRef findPrimAttrib(const char *n, int s,
01047 GB_AttribType t) const
01048 { return primAttrib.getOffset(n, s, t); }
01049
01050 void destroyPrimAttrib(const char *n, int s,
01051 GB_AttribType t)
01052 { primAttrib.destroy(n, s, t); }
01053
01054
01055
01056 GB_AttributeRef addAttrib(GB_Attribute *src)
01057 { return detailAttrib.appendClone(src); }
01058 GB_AttributeRef addAttrib(const char *n, int s, GB_AttribType t,
01059 const void *dv)
01060 { return addAttrib(n, s, t, GB_ATTRIB_INFO_NONE, dv); }
01061 GB_AttributeRef addAttrib(const char *n, int s, GB_AttribType t,
01062 GB_AttribTypeInfo f, const void *dv)
01063 { return detailAttrib.append(n, s, t, f, dv); }
01064
01065 GB_AttributeRef findAttrib(const GB_Attribute *src) const
01066 { return detailAttrib.getOffset(src); }
01067 GB_AttributeRef findAttrib(const char *n, int s,
01068 GB_AttribType t) const
01069 { return detailAttrib.getOffset(n, s, t); }
01070 GB_AttributeRef findAttrib(const char *n, GB_AttribType t) const
01071 { return detailAttrib.getOffset(n, t); }
01072
01073 void destroyAttrib(const char *n, int s, GB_AttribType t)
01074 { detailAttrib.destroy(n, s, t); }
01075 void destroyAttrib(const char *n, GB_AttribType t)
01076 { detailAttrib.destroy(n, t); }
01077
01078
01079
01080
01081
01082
01083
01084 void sortAllAttributes(const GEO_Detail &src);
01085
01086
01087 GEO_PointList &points()
01088 {
01089 return (GEO_PointList&)ptList;
01090 }
01091 GEO_PrimList &primitives()
01092 {
01093 return (GEO_PrimList&)primList;
01094 }
01095 GEO_PointAttribDict &pointAttribs() { return ptAttrib; }
01096 GEO_PrimAttribDict &primitiveAttribs() { return primAttrib; }
01097 GEO_VertexAttribDict &vertexAttribs() { return vtxAttrib; }
01098 GB_AttributeTable &attribs() { return detailAttrib; }
01099
01100 const GEO_PointList &points() const
01101 {
01102 return (const GEO_PointList&)ptList;
01103 }
01104 const GEO_PrimList &primitives() const
01105 {
01106 return (const GEO_PrimList&)primList;
01107 }
01108 const GEO_PointAttribDict &pointAttribs() const { return ptAttrib; }
01109 const GEO_PrimAttribDict &primitiveAttribs() const{ return primAttrib;}
01110 const GEO_VertexAttribDict &vertexAttribs() const { return vtxAttrib; }
01111 const GB_AttributeTable &attribs() const { return detailAttrib;}
01112
01113 void addMetaRef (void) { myMetaCount++; }
01114 void delMetaRef (void) { myMetaCount--; }
01115 void addPasteRef(void) { myPasteCount++; }
01116 void addParticleRef(void) { myParticleCount++; }
01117 void delPasteRef(void) { myPasteCount--; }
01118 void addQuadricRef(void) { myQuadricCount++; }
01119 void delQuadricRef(void) { myQuadricCount--; }
01120 void delParticleRef(void) { myParticleCount--; }
01121 void addVolumeRef() { myVolumeCount++; }
01122 void delVolumeRef() { myVolumeCount--; }
01123
01124
01125 int metaCount () const { return myMetaCount; }
01126 int pasteCount() const { return myPasteCount; }
01127 int quadricCount() const { return myQuadricCount;}
01128 int particleCount() const
01129 { return myParticleCount;}
01130 int volumeCount() const
01131 { return myVolumeCount; }
01132
01133
01134
01135 TS_MetaExpression *getMetaExpression(
01136 GB_PrimitiveGroup *primGroup = 0);
01137 GEO_MetaExpression *getGeoMetaExpression() { return metaExpr; }
01138
01139
01140
01141
01142 unsigned getStandardAttributes(const char *s,
01143 GEO_Standard_Attributes &a);
01144
01145
01146
01147
01148
01149
01150 void stashAll();
01151 void destroyStashed();
01152
01153 void mergeCapturePathAndData(
01154 const GEO_Detail &src,
01155 const GB_Attribute *src_path_atr,
01156 const GB_Attribute *my_path_atr,
01157 int src_size, int my_size,
01158 int *&new_indices);
01159
01160
01161
01162 GEO_AttributeHandle getPointAttribute (const char *attrib_name) const;
01163 GEO_AttributeHandle getPrimAttribute (const char *attrib_name) const;
01164 GEO_AttributeHandle getVertexAttribute(const char *attrib_name) const;
01165 GEO_AttributeHandle getDetailAttribute(const char *attrib_name) const;
01166 GEO_AttributeHandle getAttribute(GEO_AttributeOwner dict,
01167 const char *attrib_name) const;
01168
01169
01170
01171
01172
01173 bool changeAttributeStorage(GEO_AttributeOwner dict,
01174 const char *name,
01175 GB_AttribType new_type);
01176 bool changePointAttributeStorage(const char *nm, GB_AttribType t);
01177 bool changeVertexAttributeStorage(const char *nm, GB_AttribType t);
01178 bool changePrimAttributeStorage(const char *nm, GB_AttribType t);
01179 bool changeDetailAttributeStorage(const char *nm, GB_AttribType t);
01180
01181
01182
01183 bool setDetailAttributeS(const char *aname, const char *value);
01184 bool setDetailAttributeR(const char *aname, const UT_Ramp &ramp);
01185 bool setDetailAttributeF(const char *aname, float v);
01186 bool setDetailAttributeF(const char *aname, float v1, float v2);
01187 bool setDetailAttributeI(const char *aname, int v);
01188
01189 GEO_AttributeOwner getAttributeOwner(const GB_AttributeDict &dict) const;
01190 const GB_AttributeDict *getAttributeDict(GEO_AttributeOwner own) const;
01191
01192
01193
01194
01195 void buildPointTree();
01196 void buildPointTree(UT_DMatrix4 &xform);
01197
01198
01199 GEO_PointTree *getPointTree() { return myPointTree; }
01200
01201 void destroyPointTree();
01202
01203
01204
01205
01206
01207
01208 const GEO_Primitive *findPrimitiveByName(const char *nametomatch,
01209 unsigned primmask = GEOPRIMALL,
01210 const char *nameattrib="name") const;
01211 GEO_Primitive *findPrimitiveByName(const char *nametomatch,
01212 unsigned primmask = GEOPRIMALL,
01213 const char *nameattrib="name");
01214
01215
01216 void findAllPrimitivesByName(
01217 UT_PtrArray<const GEO_Primitive *> &primlist,
01218 const char *nametomatch,
01219 unsigned primmask = GEOPRIMALL,
01220 const char *nameattrib="name") const;
01221 void findAllPrimitivesByName(
01222 UT_PtrArray<GEO_Primitive *> &primlist,
01223 const char *nametomatch,
01224 unsigned primmask = GEOPRIMALL,
01225 const char *nameattrib="name");
01226
01227
01228
01229
01230 void mergeDetailAttributes( const GEO_Detail &src,
01231 int num_pts_prev );
01232
01233 protected:
01234 void transformInternal(const UT_Matrix4 &mat,
01235 const GB_PrimitiveGroup *primGrp,
01236 const GB_PointGroup *pointClosure,
01237 bool userange,
01238 int min_ptnum, int max_ptnum,
01239 int min_primnum, int max_primnum,
01240 int quickxform,
01241 int keep_vector_lengths,
01242 int check_pasting,
01243 int neg_determinant_flipvector,
01244 int update_ptnormals,
01245 GEO_Delta *geodelta);
01246
01247 virtual GEO_Primitive *newPrimitive(unsigned type) = 0;
01248
01249
01250 virtual GB_Primitive *appendNewPrimitive(unsigned type);
01251
01252
01253 virtual unsigned getPrimitiveType(const char *name) const;
01254 virtual const char *getPrimitiveName(unsigned type) const;
01255
01256
01257 UT_PtrArray<GEO_Point *> myStashedPoints;
01258 UT_PtrArray<GEO_Primitive *> myStashedPrims;
01259
01260 GEO_TempPointCache *myTemporaryPoints;
01261 GEO_TempVertexCache *myTemporaryVertices;
01262
01263 private:
01264 GEO_Primitive *insertPrimitive(GEO_Primitive *prim,
01265 const GEO_Primitive *beforeWhich = 0,
01266 const GEO_Primitive *src = 0,
01267 GEO_Point **ptredirect = 0);
01268 GEO_Primitive *appendPrimitive(GEO_Primitive *prim,
01269 const GEO_Primitive *src = 0,
01270 GEO_Point **ptredirect = 0)
01271 {
01272 return insertPrimitive(prim, 0, src, ptredirect);
01273 }
01274
01275 GEO_Primitive *replacePrimitive(unsigned type,
01276 GEO_Primitive *axeme,
01277 const GEO_Primitive *src,
01278 GEO_Point **ptredirect);
01279 GEO_Primitive *replacePrimitive(GEO_Primitive *prim,
01280 GEO_Primitive *axeme,
01281 const GEO_Primitive *src,
01282 GEO_Point **ptredirect);
01283
01284
01285
01286 void mergeCaptureAttributes(const GEO_Detail &src,
01287 int num_pts_before_merge);
01288 void mergeWireCaptureAttributes(const GEO_Detail &src,
01289 int num_pts_before_merge);
01290
01291 void fastMerge(const GEO_Detail &src, int mergegroups,
01292 int collapse = true,
01293 bool merge_internal_groups = true);
01294 void fastMergePoints(const GEO_Detail &src, int mergegroups,
01295 bool merge_internal_groups = true);
01296
01297
01298
01299
01300
01301 GEO_PointAttribDict ptAttrib;
01302 GEO_PrimAttribDict primAttrib;
01303 GEO_VertexAttribDict vtxAttrib;
01304 GB_AttributeTable detailAttrib;
01305
01306 GEO_MetaExpression *metaExpr;
01307
01308
01309
01310
01311 int myPasteCount;
01312 int myMetaCount;
01313 int myQuadricCount;
01314
01315
01316 int myParticleCount;
01317
01318
01319 int myVolumeCount;
01320
01321
01322
01323
01324 int myExpectedPoints;
01325 int myBasePoint;
01326 int myExpectedPrims;
01327 int myBasePrim;
01328
01329
01330
01331 GEO_PointTree *myPointTree;
01332
01333 public:
01334
01335 GB_AttributeRef addAttribute(const char *, int, GB_AttribType,
01336 const void *dv, GEO_AttributeOwner);
01337 GB_AttributeRef addAttribute(const char *, int, GB_AttribType,
01338 GB_AttribTypeInfo,
01339 const void *dv, GEO_AttributeOwner);
01340 GB_AttributeRef growAttribute(const char *name, int added_size,
01341 GB_AttribType type, GEO_AttributeOwner);
01342 GB_AttributeRef findAttribute(const char *, int, GB_AttribType,
01343 GEO_AttributeOwner) const;
01344 GB_AttributeRef findAttribute(const char *, GB_AttribType,
01345 GEO_AttributeOwner) const;
01346 void destroyAttribute(const char *, int size,
01347 GB_AttribType, GEO_AttributeOwner);
01348 void destroyAttribute(const char *,
01349 GB_AttribType, GEO_AttributeOwner);
01350
01351 private:
01352 GEO_AttributeHandle getAttributeHandle(const char *name,
01353 const GB_AttributeDict &dict) const;
01354 int saveExtra(ostream &os, int binary) const;
01355 bool loadExtra(UT_IStream &is);
01356 bool loadVersion(UT_IStream &is, int binary);
01357
01358
01359
01360 friend ostream &operator<<(ostream &os, const GEO_Detail &d)
01361 {
01362 d.save(os, 0, 0);
01363 return os;
01364 }
01365 };
01366
01367 #endif