Set Commands


Functions

Set_pa TecUtilSetAlloc (Boolean_t ShowErr)
  Allocate a new empty set.
void TecUtilSetDealloc (Set_pa *Set)
  Free all memory associated with the specified set and assign the set to be NULL.
Boolean_t TecUtilSetCopy (Set_pa DstSet, Set_pa SrcSet, Boolean_t ShowErr)
  Copy one set to another.
void TecUtilSetClear (Set_pa Set)
  Empties the specified set.
Boolean_t TecUtilSetAddMember (Set_pa Set, SetIndex_t Member, Boolean_t ShowErr)
  Add the specified member to the specified set.
void TecUtilSetRemoveMember (Set_pa Set, SetIndex_t Member)
  Remove a member from a set.
Boolean_t TecUtilSetIsMember (Set_pa Set, SetIndex_t Member)
  Determine if the specified member is in the specified set.
Boolean_t TecUtilSetIsEmpty (Set_pa Set)
  Determine if the specified set is NULL or contains no members.
SetIndex_t TecUtilSetGetMemberCount (Set_pa Set)
  Get the count of the number of members in a set.
Boolean_t TecUtilSetIsEqual (Set_pa Set1, Set_pa Set2)
  Determines if the specified sets are equal (have the same members).
SetIndex_t TecUtilSetGetMember (Set_pa Set, SetIndex_t Position)
 
SetIndex_t TecUtilSetGetPosition (Set_pa Set, SetIndex_t Member)
 
SetIndex_t TecUtilSetGetNextMember (Set_pa Set, SetIndex_t Member)
  Get the next member in the specified set which is located after the specified member.
SetIndex_t TecUtilSetGetPrevMember (Set_pa Set, SetIndex_t Member)
  Get the previous member in the specified set which is located before the specified member.


Function Documentation

Boolean_t TecUtilSetAddMember ( Set_pa  Set,
SetIndex_t  Member,
Boolean_t  ShowErr 
)

Add the specified member to the specified set.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set to which to add the specified member.
Member The item to add to the specified set. Members start at one.
ShowErr TRUE to display an error message if the function's return value is FALSE; FALSE to display no error message
Returns:
TRUE if successful, FALSE if not. A FALSE value is highly unlikely and only occurs if the set cannot be expanded to accomodate the new member.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetAddMember(
   &                   SetPtr,
   &                   Member,
   &                   ShowErr)
    POINTER         (SetPtr, Set)
    INTEGER*4       Member
    INTEGER*4       ShowErr

Python Syntax:

    This function is not supported in Python.

Create a set called ZonesToDelete and add zones 2 and 4 to it:

   Set_pa ZonesToDelete = TecUtilSetAlloc(TRUE);
   TecUtilSetAddMember(ZonesToDelete, 2, TRUE);
   TecUtilSetAddMember(ZonesToDelete, 4, TRUE);

Set_pa TecUtilSetAlloc ( Boolean_t  ShowErr  ) 

Allocate a new empty set.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
ShowErr TRUE to display an error message if the function's return value is FALSE; FALSE to display no error message
Returns:
The new set if successful, NULL if not. An unsuccessful return value indicates that there was not enough memory to create a new set.
Fortran Syntax:
    SUBROUTINE TecUtilSetAlloc(
   &           ShowErr,
   &           ResultPtr)
    INTEGER*4       ShowErr
    POINTER         (ResultPtr, Result)

Python Syntax:

    This function is not supported in Python.

Create two sets, A and B:

   Set_pa A, B;
   A = TecUtilSetAlloc(TRUE);
   B = TecUtilSetAlloc(TRUE);

void TecUtilSetClear ( Set_pa  Set  ) 

Empties the specified set.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set to empty
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    SUBROUTINE TecUtilSetClear(SetPtr)
    POINTER (SetPtr, Set)

Python Syntax:

    This function is not supported in Python.

Get the set of active zones, then clear the set so it can be used again:

   Set_pa Zones = NULL;
   TecUtilZoneGetActive(&Zones);
   .
   . // Use the set of active zones
   .
   TecUtilSetClear(Zones);
   .
   . // Use the set for something else

Boolean_t TecUtilSetCopy ( Set_pa  DstSet,
Set_pa  SrcSet,
Boolean_t  ShowErr 
)

Copy one set to another.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
DstSet The destination set, which must already be allocated with TecUtilSetAlloc().
SrcSet The source set
ShowErr Set to TRUE to display an error message if an error occurs during the call
Returns:
TRUE if successful, FALSE if not. FALSE indicates that SrcSet contains elements that cannot be added to DstSet.
Precondition:
DstSet Pointer must be a valid address and non-NULL.

SrcSet Pointer must be a valid address and non-NULL.

Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetCopy(
   &                   DstSetPtr,
   &                   SrcSetPtr,
   &                   ShowErr)
    POINTER         (DstSetPtr, DstSet)
    POINTER         (SrcSetPtr, SrcSet)
    INTEGER*4       ShowErr

Python Syntax:

    This function is not supported in Python.

Make a copy of the set of active Line-maps:

   Set_pa MySet, LineMaps = NULL;
   MySet = TecUtilSetAlloc(TRUE);
   TecUtilLineMapGetActive(&LineMaps);
   TecUtilSetCopy(MySet, LineMaps, TRUE);
   .
   .
   .
   TecUtilSetDealloc(&MySet);
   TecUtilSetDealloc(&LineMaps);

void TecUtilSetDealloc ( Set_pa Set  ) 

Free all memory associated with the specified set and assign the set to be NULL.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set to deallocate.
Precondition:
Set Pointer must be a valid address and non-NULL.

Set Pointer must be a valid address or NULL.

Fortran Syntax:
    SUBROUTINE TecUtilSetDealloc(SetPtr)
    POINTER (SetPtr, Set)

Python Syntax:

    This function is not supported in Python.

SetIndex_t TecUtilSetGetMember ( Set_pa  Set,
SetIndex_t  Position 
)

Get the member of the specified set at the specified position. See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set from which to get the member.
Position The position in the set.
Returns:
The member of the specified set at the specified position. Members start at one. If the set does not contain a member at the specified position, the return value is TECUTILSETNOTMEMBER.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetGetMember(
   &                   SetPtr,
   &                   Position)
    POINTER         (SetPtr, Set)
    INTEGER*4       Position

Python Syntax:

    This function is not supported in Python.

Get each member from the set MySet:

   Set_pa MySet;
   .
   .
   SetIndex_t Member;
   SetIndex_t Count;
   SetIndex_t Position;

   Count = TecUtilSetGetMemberCount(MySet);
   for (Position = 1; Position <= Count; Position++)
     {
       Member = TecUtilSetGetMember(MySet, Position);
       .
       .
     }

SetIndex_t TecUtilSetGetMemberCount ( Set_pa  Set  ) 

Get the count of the number of members in a set.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set for which to get the count
Returns:
The count of the number of members in the set Set.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetGetMemberCount(SetPtr)
    POINTER (SetPtr, Set)

Python Syntax:

    This function is not supported in Python.

SetIndex_t TecUtilSetGetNextMember ( Set_pa  Set,
SetIndex_t  Member 
)

Get the next member in the specified set which is located after the specified member.

See Chapter 20, "Using Sets," in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set from which to get the member
Member The member after which to return the next member. Members start at one. Use TECUTILSETNOTMEMBER to get the first member of the set
Returns:
The next member of the specified set after the specified member. Members start at one. If the specified member is not found or if it is the last member in the set, the return value is TECUTILSETNOTMEMBER.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetGetNextMember(
   &                   SetPtr,
   &                   Member)
    POINTER         (SetPtr, Set)
    INTEGER*4       Member

Python Syntax:

    This function is not supported in Python.

Loop through all members of the set MySet:

   Set_pa MySet;
   .
   .
   SetIndex_t Member = TecUtilSetGetNextMember(MySet,
                                               TECUTILSETNOTMEMBER);

   while (Member != TECUTILSETNOTMEMBER)
      {
        .
        .
        Member = TecUtilSetGetNextMember(MySet, Member);
      }

SetIndex_t TecUtilSetGetPosition ( Set_pa  Set,
SetIndex_t  Member 
)

Get the position in the specified set at which the specified member is located. See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set from which to get the member
Member The member after which to get the position. Members start at one.
Returns:
The position in the specified set at which the specified member is located. If the specified member is not found, the return value is TECUTILSETNOTMEMBER.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetGetPosition(
   &                   SetPtr,
   &                   Member)
    POINTER         (SetPtr, Set)
    INTEGER*4       Member

Python Syntax:

    This function is not supported in Python.

Get the position of the member MyMember of the set MySet:

   Set_pa MySet;
   SetIndex_t Member;
   .
   .
   SetIndex_t Position =
     TecUtilSetGetPosition(MySet, MyMember);

SetIndex_t TecUtilSetGetPrevMember ( Set_pa  Set,
SetIndex_t  Member 
)

Get the previous member in the specified set which is located before the specified member.

See Chapter 20, "Using Sets," in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Since:
12.1.1.8018
Parameters:
Set The set from which to get the member
Member The member before which to return the previous member. Members start at one. Use TECUTILSETNOTMEMBER to get the last member of the set
Returns:
The previous member of the specified set before the specified member. Members start at one. If the specified member is not found or if it is the first member in the set, the return value is TECUTILSETNOTMEMBER.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetGetPrevMember(
   &                   SetPtr,
   &                   Member)
    POINTER         (SetPtr, Set)
    INTEGER*4       Member

Python Syntax:

    This function is not supported in Python.

Boolean_t TecUtilSetIsEmpty ( Set_pa  Set  ) 

Determine if the specified set is NULL or contains no members.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set to check for members
Returns:
TRUE if Set is NULL or contains no members, FALSE if not.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetIsEmpty(SetPtr)
    POINTER (SetPtr, Set)

Python Syntax:

    This function is not supported in Python.

Determine if the set MySet is empty or contains no members:

   Set_pa MySet;

   if (TecUtilSetIsEmpty(MySet))
     {
       .... take action based on the set being empty.
     }

Boolean_t TecUtilSetIsEqual ( Set_pa  Set1,
Set_pa  Set2 
)

Determines if the specified sets are equal (have the same members).

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set1 The set to compare with Set2.
Set2 The set to compare with Set1
Returns:
TRUE if the specified sets are equal, FALSE if they are not.
Precondition:
Set1 Pointer must be a valid address and non-NULL.

Set2 Pointer must be a valid address and non-NULL.

Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetIsEqual(
   &                   Set1Ptr,
   &                   Set2Ptr)
    POINTER         (Set1Ptr, Set1)
    POINTER         (Set2Ptr, Set2)

Python Syntax:

    This function is not supported in Python.

Determine if all enabled zones are active:

   Boolean_t AllEnabledZonesAreActive;
   Set_pa ActiveZones  = NULL;
   Set_pa EnabledZones = NULL;

   TecUtilZoneGetActive(&ActiveZones);
   TecUtilZoneGetEnabled(&EnabledZones);
   AllEnabledZonesAreActive = TecUtilSetIsEqual(ActiveZones, EnabledZones);

Boolean_t TecUtilSetIsMember ( Set_pa  Set,
SetIndex_t  Member 
)

Determine if the specified member is in the specified set.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set to check for the specified member.
Member The item for which to check the specified set. Members start at one
Returns:
TRUE if Member is a member of Set, FALSE if not.
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilSetIsMember(
   &                   SetPtr,
   &                   Member)
    POINTER         (SetPtr, Set)
    INTEGER*4       Member

Python Syntax:

    This function is not supported in Python.

Determine if the set MySet contains the member MyMember, and if so, remove MyMember from MySet:

   Set_pa MySet;
   SetIndex_t MyMember;
   .
   .
   if (TecUtilSetIsMember(MySet, MyMember))
     TecUtilSetRemoveMember(MySet, MyMember);

void TecUtilSetRemoveMember ( Set_pa  Set,
SetIndex_t  Member 
)

Remove a member from a set.

See the chapter "Using Sets" in the ADK User's Manual for a discussion of sets. This function is Thread Safe.

Parameters:
Set The set from which to remove the specified member.
Member The member to remove from the specified set. Members start at one
Precondition:
Set Pointer must be a valid address and non-NULL.
Fortran Syntax:
    SUBROUTINE TecUtilSetRemoveMember(
   &           SetPtr,
   &           Member)
    POINTER         (SetPtr, Set)
    INTEGER*4       Member

Python Syntax:

    This function is not supported in Python.


Generated on Tue Mar 12 02:24:43 2013 for Tecplot by  doxygen 1.5.5