MQDocument class manages objects, materials and so on.
Object | |
GetObjectCount | Get a number of object in this document. |
GetObject | Get a pointer of the object class. |
GetCurrentObjectIndex | Get an index of the current object. |
AddObject | Add an object to this document. |
InsertObject | Add an object after the specified object. |
DeleteObject | Remove the object from the document and delete it. |
GetObjectIndex | Get an index of the specified object. |
GetParentObject | Get a parent object of the specified object. |
GetChildObjectCount | Get a number of children object of the specified object. |
GetChildObject | Get a child object of the specified object. |
GetGlobalMatrix | Get a global transformation matrix of the specified object. |
GetGlobalInverseMatrix | Get an inverse global transformation matrix of the specified object. |
Material | |
GetMaterialCount | Get a number of materials in this document. |
GetMaterial | Get a pointer of the material class. |
GetCurrentMaterialIndex | Get an index of the current material. |
SetCurrentMaterialIndex | Set an index of the current material. |
AddMaterial | Add a material to this document. |
DeleteMaterial | Remove the material from this document, and delete it. |
Memory | |
Compact | Shorten arrays in the document by removing NULLs |
Selection | |
ClearSelect | Clear all the selection of the vertices, lines and faces. |
AddSelectVertex | Select a vertex. |
DeleteSelectVertex | Deselect a vertex. |
IsSelectVertex | Check if the vertex is selected. |
AddSelectLine | Select a line. |
DeleteSelectLine | Deselect a line. |
IsSelectLine | Check if the line is selected. |
AddSelectFace | Select a face. |
DeleteSelectFace | Deselect a face. |
IsSelectFace | Check if the face is selected. |
AddSelectUVVertex | Select a UV vertex. |
DeleteSelectUVVertex | Deselect a UV vertex. |
IsSelectUVVertex | Check if the UV vertex is selected. |
Mapping | |
FindMappingFile | Convert a filename to an absolute path |
Scene | |
GetScene | Get a scene. |
int MQDocument::GetObjectCount(void);
It gets a number of objects contained in this document.
This function returns not a number of objects exist actually but a size of array of the objects. So, it contains NULL
objects deleted by MQDocument::DeleteObject(). To get an actual number, you must count
non-NULL objects by
MQDocument::GetObject().
MQObject MQDocument::GetObject(int index);
Get a pointer of the specified indexed object. It returns NULL if the object at the specified index does not exist.
int MQDocument::GetCurrentObjectIndex(void);
It gets an index of the current object.
void MQDocument::SetCurrentObjectIndex(int index);
It specifies a current object with an index.
int MQDocument::AddObject(MQObject obj);
It adds an object to this document.
Since the object is managed by the document after adding, you must not delete the object by MQObject::DeleteThis().
int MQDocument::InsertObject(MQObject obj, MQObject before);
(new in Rev2.41)
It registers an object to the document after the specified object. The object will be registered in the head of the list if 'before' is NULL. An index of an object behind the inserted object in a list will be changed.
The material is managed by this document. So, you must not delete the material by MQObject::DeleteThis().
void MQDocument::DeleteObject(int index);
It remove the specified object from this document, and delete the object.
MQDocument::GetObject() with the deleted index will return NULL.
int MQDocument::GetObjectIndex(MQObject obj);
It gets an index of the specified object in this document.
It returns -1 if the object does not exist in this document.
MQObject MQDocument::GetParentObject(MQObject obj);
(new in Rev2.40)
It gets a parent object of the specified object in this document.
It returns NULL if the specified object exists at the root.
int MQDocument::GetChildObjectCount(MQObject obj);
(new in Rev2.40)
It gets a number of child objects of the specified parent object in this document.
Only the objects in directly under are counted as child objects, and below it does not count grandchildren.
MQObject MQDocument::GetChildObject(MQObject obj, int index);
(new in Rev2.40)
It gets a child object of the specified parent object in this document.
An index must be smaller value than the number returned by MQDocument::GetChildObjectCount().
void MQDocument::GetGlobalMatrix(MQObject obj, MQMatrix& mtx);
(new in Rev2.40)
It gets a global transformation matrix of the specified object in this document.
void MQDocument::GetGlobalInverseMatrix(MQObject obj, MQMatrix& mtx);
(new in Rev2.40)
It gets an inverse global transformation matrix of the specified object in this document.
int MQDocument::GetMaterialCount(void);
It gets a number of an array for material.
It is not a number of material exist in document but a length of an array for material. It contains NULL material deleted by MQDocument::DeleteMaterial(). You must count non-NULL materials if you want to an actual number of material in the document.
MQMaterial MQDocument::GetMaterial(int material);
It gets a pointer of the material at the specified index.
It returns NULL if a material at the specified index does not exist.
int MQDocument::GetCurrentMaterialIndex(void);
It gets an index of the current material. No material is selected when it returns -1.
void MQDocument::SetCurrentMaterialIndex(int index);
It specifies a current material by the index.
int MQDocument::AddMaterial(MQMaterial mat);
It adds a material into the document.
Since the material is managed by the document after adding, you must not delete the material MQMaterial::DeleteThis().
void MQDocument::DeleteMaterial(int index);
It removes the material from the document, and delete the material.
MQDocument::GetMaterial() with the deleted index will return NULL.
void MQDocument::Compact(void);
It shortens arrays for objects or material in this document by removing NULLs in the arrays. The size of the array will be same as the number of the objects or materials actually exist in the document. And the arrays for the vertices or faces in objects are also shortened. Please be careful that the indices of vertices and faces will be changed.
Since data volume becomes small, it is desirable to perform this API after performing large operation to a document or objects. And this function is automatically called at the time of saving a file.
void MQDocument::ClearSelect(DWORD flag);
It clears all the selection of the specified element(s).
BOOL MQDocument::AddSelectVertex(int objindex, int vertindex);
BOOL MQDocument::AddSelectVertex(MQSelectVertex sel);
It selects the specified vertex.
BOOL MQDocument::DeleteSelectVertex(int objindex, int vertindex);
BOOL MQDocument::DeleteSelectVertex(MQSelectVertex sel);
It deselects the specified vertex.
BOOL MQDocument::IsSelectVertex(int objindex, int vertindex);
BOOL MQDocument::IsSelectVertex(MQSelectVertex sel);
It checks if the specified vertex is selected.
BOOL MQDocument::AddSelectLine(int objindex, int faceindex, int lineindex);
BOOL MQDocument::AddSelectLine(MQSelectLine sel);
It selects the specified line.
BOOL MQDocument::DeleteSelectLine(int objindex, int faceindex, int linelidex);
BOOL MQDocument::DeleteSelectLine(MQSelectLine sel);
It deselects the specified line.
BOOL MQDocument::IsSelectLine(int objindex, int faceindex, int lineindex);
BOOL MQDocument::IsSelectLine(MQSelectLine sel);
It checks if the specified line is selected.
BOOL MQDocument::AddSelectFace(int objindex, int faceindex);
BOOL MQDocument::AddSelectFace(MQSelectFace sel);
It selects the specified face.
BOOL MQDocument::DeleteSelectFace(int objindex, int faceindex);
BOOL MQDocument::DeleteSelectFace(MQSelectFace sel);
It deselects the specified face.
BOOL MQDocument::IsSelectFace(int objindex, int faceindex);
BOOL MQDocument::IsSelectFace(MQSelectFace sel);
It checks if the specified face is selected.
BOOL MQDocument::AddSelectUVVertex(int objindex, int faceindex, int vertindex);
(new in Rev2.30)
It selects the specified UV vertex.
BOOL MQDocument::DeleteSelectUVVertex(int objindex, int faceindex, int vertindex);
(new in Rev2.30)
It deselects the specified UV vertex.
BOOL MQDocument::IsSelectUVVertex(int objindex, int faceindex, int vertindex);
(new in Rev2.30)
It checks if the specified UV vertex is selected.
BOOL MQDocument::FindMappingFile(char *out_path, const char *filename, DWORD map_type);
(new in Rev2.10)
It converts a filename get by MQMaterial::GetTextureName(), GetAlphaName() or GetBumpName() to an absolute path.
The size of 'outpath' must be equal to or larger than MAX_PATH.
MQScene MQDocument::GetScene(int index);
(new in Rev2.10)
It gets the specified scene contained in this document.
It returns a perspective view by specifying 0 to 'index'. The 'index' must be 0 in the current version.