Header to include: iobj.h
Iobj *imodObjectNew()
Iobj *imodObjectsNew(int size)
void imodObjectDefault(Iobj *obj)
int imodObjectDelete(Iobj *obj)
int imodObjectsDelete(Iobj *obj, int size)
double imodObjectChecksum(Iobj *obj, int obNum)
int imodObjectCopy(Iobj *from, Iobj *to)
int imodObjectCopyClear(Iobj *from, Iobj *to)
Iobj *imodObjectDup(Iobj *obj)
Icont *imodObjectGetContour(Iobj *inObject, int inIndex)
Imesh *imodObjectGetMesh(Iobj *inObject, int inIndex)
int imodObjectAddMesh(Iobj *inObject, Imesh *inMesh)
int imodObjectSort(Iobj *obj)
int imodObjectSortBySurf(Iobj *obj, int ifBySurf)
float imodObjectVolume(Iobj *obj)
int imodel_object_centroid(Iobj *obj, Ipoint *rcp)
int imodObjectAddContour(Iobj *obj, Icont *ncont)
int imodObjectInsertContour(Iobj *obj, Icont *ncont, int index)
int imodObjectRemoveContour(Iobj *obj, int index)
void imodObjectCleanSurf(Iobj *obj)
int imodObjectSortSurf(Iobj *obj)
int imodObjectGetBBox(Iobj *obj, Ipoint *ll, Ipoint *ur)
void imodObjectGetColor(Iobj *inObject,
float *outRed, float *outGreen, float *outBlue)
void imodObjectSetColor(Iobj *inObject,
float inRed, float inGreen, float inBlue)
int imodObjectGetMaxContour(Iobj *inObject)
int imodObjectGetMaxPoints(Iobj *inObject)
char *imodObjectGetName(Iobj *inObject)
int imodObjectSetName(Iobj *obj, const char *inName)
Ilabel *imodObjectGetLabel(Iobj *obj)
Ilabel *imodObjectNewLabel(Iobj *obj)
int imodObjectGetValue(Iobj *inObject, int inValueType)
void imodObjectSetValue(Iobj *inObject, int inValueType, int inValue)
Allocates one new object initialized to default values; returns NULL if error.
Allocates an array of objects of length size, initialized to default values; returns NULL if error.
Initializes the object obj to default values.
Deletes the object obj, freeing all contour, mesh, and label data and the object structure itself. Returns -1 if error.
Deletes the array of objects of length size in obj, freeing all contour, mesh, and label data and the object array itself. It cannot be used on part of an array. Returns -1 if error.
Computes a checksum from the coordinates, properties, and general storage information for object obj and its contours.
Copies object structure from object from to object to. Returns -1 if error.
Copies object structure from object from to object to then sets pointers to NULL and contour and mesh sizes to 0. Returns -1 if error.
Duplicates object obj, including all contour, mesh, and label data, and returns pointer to copy, or NULL if error.
Returns pointer to the contour at inIndex in object inObject, or NULL if error.
Returns pointer to the mesh at inIndex in the mesh array of object inObject, or NULL if error.
Adds the mesh pointed to by inMesh to the mesh array of object inObject. All pointers are transferred to the new mesh array element and no data are duplicated. If inMesh was allocated, such as with imodMeshNew , it should be freed with free. Returns index of new array element or -1 if error.
Sorts the contours in object obj by their z values. If the object contains time-dependent data, then the contours are sorted first by time then by z. Returns non-zero for error.
Sorts the contours in object obj by their z values, first sorting by surface number if ifBySurf is nonzero. If the object contains time-dependent data, then the contours are sorted first by time, then optionally by surface number, then by z. Returns non-zero for error.
Returns volume of object obj,computed from contour areas, or zero for a non-closed contour object
Returns centroid of object obj into the point rcp. For closed-contour objects, computes centroid of area enclosed by each contour and forms the overall centroid from that. For open-contour objects, computes the centroid of each contour line from the segments along the line, then forms an overall centroid from that. Does not work for scattered point objects. Does not account for Z-scaling. Returns 1 for error computing a contour centroid or if there are no contours.
Adds contour ncont to the end of the contour array of object obj. Pointers are copied so no data are duplicated. If ncont was allocated, such as with imodContourNew , it should be freed with free. Returns index of new contour or -1 if error.
Inserts contour ncont at position index into the contour array of object obj. Pointers are copied so no data are duplicated. If ncont was allocated, such as with imodContourNew , it should be freed with free. Returns index of new contour or -1 if error.
Removes the contour at index from object obj without deleting the contour data; this is thus appropriate after adding the contour to another object with imodObjectAddContour. Returns 1 if error.
Updates surface information for object obj by removing labels for surfaces that no longer exist and recomputing the maximum surface number.
Analyzes the mesh of object obj to determine which contours are connected by the mesh and assigns a separate surface number to each set of separately connected contours. Returns 1 if there is no mesh information, 2 for memory error, or 3 for an unsupported feature in a contourless mesh (see imeshSortSurfaces.)
Finds the minimum and maximum coordinates of all contours in object obj and returns them in points ll and ur, respectively. If there are no contours but there are meshes, it finds the bounding box from all meshes instead. Returns -1 for an error (including no non-empty contours or meshes), 0 for values from contours, or 1 for values from meshes.
Returns color values of object inObject, which are between 0 and 1.
Sets the color of object inObject to the given values, which should be between 0 and 1.
Returns number of contours in object inObject (not the maximum contour index).
Returns maximum number of points in the contours of object inObject.
Returns pointer to object name.
Sets name of object obj to inName. Returns 1 if the string is truncated to IOBJ_STRSIZE - 1 (63).
Returns a pointer to the label element of object obj, or NULL if the label or obj is NULL.
Makes a new, empty label element in ojbect obj, deleting an existing one if any, and returns a pointer to the new label. Returns NULL if label allocation failed or obj is NULL.
Returns one value for inObject; possible values for inValueType are IobjMaxContour, IobjLineWidth, IobjLineWidth2, IobjPointSize, IobjMaxMesh, IobjMaxSurface, IobjSymType, IobjSymSize, IobjSymFlags, IobjFlagClosed, IobjFlagConnected, IobjFlagFilled, IobjFlagDraw, IobjFlagMesh, IobjFlagLine, IobjFlagTime, IobjFlagExtraInModv, IobjFlagPntOnSec, and IobjFlagPlanar. IobjFlagConnected is 0 for scattered point objects. IobjFlagPlanar is non-zero for closed objects and open objects with the flag set to start a new contour on each section.
Sets one value for inObject to inValue; possible values for inValueType are IobjLineWidth, IobjLineWidth2, IobjPointSize, IobjSymType, IobjSymSize, IobjSymFlags, IobjFlagClosed, IobjFlagConnected, IobjFlagFilled, IobjFlagDraw, IobjFlagMesh, IobjFlagLine, IobjFlagExtraInModv (for drawing an extra object in model view window), IobjFlagPntOnSec, and IobjFlagExtraInSlicer.