LVectorGroup::EnumObjects

#include "ltwrappr.h"

virtual L_INT LVectorGroup::EnumObjects (dwFlags)

L_UINT32 dwFlags;

/* flags */

Enumerates all objects inside the vector group object.

Parameter

Description

dwFlags

Flag that indicates which objects to enumerate. Possible values are:

 

Value

Meaning

 

0

Enumerate all objects in the group.

 

VECTOR_FLAGS_SELECTED_ONLY

Enumerate only selected objects in the group.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Note: In DirectX and OpenGL engines, you cannot enumerate objects, therefore this function will do nothing.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorGroup::EnumObjectsCallBack, LVectorBase::EnumVertices

Topics:

Working with Vector Groups

Example

//Example139
// This example displays the total number of objects in each group in a vector.
class LMyVectorGroup1: public LVectorGroup
{
public:
   L_INT          m_nObjectCount ;

public:
   LMyVectorGroup1() {m_nObjectCount=0;};
   virtual ~LMyVectorGroup1(){};
   virtual L_INT  EnumObjectsCallBack( pVECTORHANDLE pVector, pVECTOROBJECT pObject);
};

L_INT LMyVectorGroup1::EnumObjectsCallBack( pVECTORHANDLE pVector, pVECTOROBJECT pObject)
{
   m_nObjectCount++;
   return SUCCESS;
}

L_VOID Example139(HWND hWnd, LVectorBase *pVector)
{
   L_INT i;

   for (i=0; i<pVector->GetGroupCount(); i++)
   {
      LMyVectorGroup1 VectorGroup;
      L_TCHAR szMsg[200];

      pVector->GetGroupByIndex(i, &VectorGroup);

      VectorGroup.m_nObjectCount = 0;
      VectorGroup.EnableCallBack(TRUE);
      VectorGroup.EnumObjects();
      wsprintf(szMsg, TEXT("Group[%d]: Total Objects[%d]"), i, VectorGroup.m_nObjectCount);
      MessageBox(hWnd, szMsg, TEXT(""), MB_OK);
   }
}