Operation Principles of Change Flags of Topological Objects

All topological objects (MbTopologyItem) have change flags. Before each operation, the flags are set to the tct_Unchanged state, which means that there are no changes.

There are the following change flags for topological objects:

tct_Unchanged — the object was not changed during an operation;

tct_Modified — any object modification sets this flag;

tct_Created — the object was created. The solid did not have this object, and then it was added (for example, when creating an elementary solid by the ElementarySolid() function);

tct_Transformed — the object was moved (for example, when applying the move MbSolid::Move() to the solid geometry, all objects also move);

tct_Reoriented — the face was created as a copy of another face, with the direction of the normal vector changed to the opposite, that is, the face “turned inside out”. Example: during a Boolean operation, a new face in the original solid was created from a copy of the cutting solid face whose normal direction was changed;

tct_Deleted — when deleting child elements of an object or marking the object itself for deletion (for example, when deleting an edge cycle (when it is replaced in an operation) or a face surface);

tct_Truncated — an object (face, edge) was truncated in the operation;

tct_Merged — the flag is relevant for edges (MbEdge), an edge was merged or stitched;

tct_Replaced — a face surface or the face edge cycle was replaced during the operation;

tct_Added — a child element was added;

tct_Renamed — an object was renamed during an operation.

Let us consider the use of flags by the example of performing the SolidCutting operation (see Fig. 1). The large cube is cut by the small parallelepiped:

../../../../_images/O.7.11.1.png

Fig. 1

Let us consider the lower face of the groove in the resulting solid (highlighted in red).

After the operation, it has the following flags:

tct_Modified, tct_Created, tct_Reoriented, tct_Deleted, tct_Truncated, tct_Added

This means the following:

  1. The face was modified in some way in the performed operation (tct_Modified).

  2. The solid did not have this face previously, and then the face was created (tct_Created).

  3. In fact, the face was created from the cutting solid face (highlighted in green), but the normal vector was reversed (tct_Reoriented). The full name of this face completely coincides with the name of the cutting solid face.

  4. The face was truncated (tct_Truncated) by removing (tct_Deleted) and adding (tct_Added) the face edge cycle.

Next, let us perform another cutting with the same cutting solid. Before the operation, we change the position of the cutting parallelepiped (Fig. 2):

../../../../_images/O.7.11.2.png

Fig. 2

Let us consider the next face resulting from this cutting (highlighted in green in Fig. 3):

../../../../_images/O.7.11.3.png

Fig. 3

After the operation, the new face has the following flags:

tct_Modified, tct_Created, tct_Transformed, tct_Reoriented, tct_Deleted, tct_Truncated, tct_Added, tct_Replaced

This means:

  1. The face was modified in some way in the performed operation (tct_Modified).

  2. The solid did not have this face previously, and then the face was created (tct_Created).

  3. In fact, the face was created from the cutting solid face (Fig. 2), but the normal vector was reversed (tct_Reoriented). The cutting solid was moved before the operation (tct_Transformed).

  4. The face was truncated (tct_Truncated) by removing (tct_Deleted) and adding (tct_Added) the face edge cycle.

  5. The surface or edge cycle of the face was replaced during the operation (tct_Replaced).

The MbTopologyItem class defines (in file topology_i_item.h) the following methods for reading/writing flags:

Method

bool GetOwnChanged() const

returns the flag indicating that the object was (was not) modified.

Method

bool GetOwnChanged( MbeChangedType n ) const

returns the flag indicating that the object was (was not) modified.

Method

void SetOwnChanged( MbeChangedType )

sets the flag indicating that the object was (was not) modified.

Method

void CopyOwnChanged( const MbTopologyItem & ti )

copies the flag indicating that the object was (was not) modified.

Method

uint16 GetOwnChangedFlag() const

returns the flag indicating that the object was (was not) modified.

Method

template<class Uint> void SetOwnChangedFlag( Uint n )

sets the flag indicating that the object was (was not) modified.

Method

bool IsOwnRenamedOnly() const

returns the flag indicating that the object was only renamed.

Method

bool IsOwnTransformedOnly() const

returns the flag indicating that the object was only transformed.

Method

bool IsOwnReorientedOnly() const

returns the flag indicating that the object was only reoriented.

Method

bool IsOwnChangedWeakly() const

returns the flag indicating that the object was only created and/or only “weak” changes not modifying the object geometry structure (renaming, transformation, reorientation) were applied to it. If there are any other changes, the method returns false.