This commit is contained in:
2026-01-04 16:00:35 +03:30
parent 3c26c9c418
commit 9fc8892c5d
5 changed files with 1181 additions and 278 deletions
@@ -2379,6 +2379,127 @@ struct XPatternAnalysis
return result;
}
/**
* Extract All Exists Patterns Pivots ...
*
* @param dest: XBoxZone, collection reference to holds Extracted Patterns ...
* @param forDir: ENUM_X_DIRECTION, Specified Direction of Extractions ...
*
* @return ( int )
*/
int GetPatterns(
XBoxZone &dest[],
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE //
)
{
//
int result = 0;
//
// Prepare ...
XClean(dest);
//
// Validate ...
bool has = IsValid() &&
HasChild(patterns);
if (!has)
{
return result;
}
//
// Do ...
XOHCL iBar;
XPivot iPivot;
XBoxZone iZone;
int count = ArraySize(patterns);
for (int i = 0; i < count; i++)
{
//
has = GetPattern(iBar, iPivot, iZone, patterns[i], forDir);
if (has)
{
AddIfNotExists(iZone, dest);
}
}
//
result = ArraySize(dest);
//
// Cleanup ...
iBar.Clean();
iZone.Clean();
iPivot.Clean();
//
return result;
}
/**
* Extract All Exists Patterns Pivots ...
*
* @param dest: XPivot, collection reference to holds Extracted Patterns ...
* @param zones: XBoxZone, collection reference to holds Extracted Patterns ...
* @param forDir: ENUM_X_DIRECTION, Specified Direction of Extractions ...
*
* @return ( int )
*/
int GetPatterns(
XPivot &dest[],
XBoxZone &zones[],
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE //
)
{
//
int result = 0;
//
// Prepare ...
XClean(dest);
XClean(zones);
//
// Validate ...
bool has = IsValid() &&
HasChild(patterns);
if (!has)
{
return result;
}
//
// Do ...
XOHCL iBar;
XPivot iPivot;
XBoxZone iZone;
int count = ArraySize(patterns);
for (int i = 0; i < count; i++)
{
//
has = GetPattern(iBar, iPivot, iZone, patterns[i], forDir);
if (has)
{
//
AddIfNotExists(iPivot, dest);
AddIfNotExists(iZone, zones);
}
}
//
result = ArraySize(dest);
//
// Cleanup ...
iBar.Clean();
iZone.Clean();
iPivot.Clean();
//
return result;
}
//
};