mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support 'use' action for selections in vtkWrite, ensightWrite (#926)
- have 'use' as the action appears more intuitive as the first entry instead of 'add'. Was previously also added to vtkCloud.
This commit is contained in:
@ -35,6 +35,7 @@ namespace Foam
|
||||
// A limited selection of actions
|
||||
const Enum<topoSetSource::setAction> actionNames
|
||||
({
|
||||
{ topoSetSource::NEW, "use" },
|
||||
{ topoSetSource::ADD, "add" },
|
||||
{ topoSetSource::SUBTRACT, "subtract" },
|
||||
{ topoSetSource::SUBSET, "subset" },
|
||||
@ -73,7 +74,7 @@ bool Foam::functionObjects::ensightWrite::updateSubset
|
||||
|
||||
const dictionary& dict = dEntry.dict();
|
||||
|
||||
const auto action = actionNames.get("action", dict);
|
||||
auto action = actionNames.get("action", dict);
|
||||
|
||||
// Handle manually
|
||||
if (action == topoSetSource::INVERT)
|
||||
@ -92,7 +93,17 @@ bool Foam::functionObjects::ensightWrite::updateSubset
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case topoSetSource::NEW: // "use"
|
||||
case topoSetSource::ADD:
|
||||
if (topoSetSource::NEW == action)
|
||||
{
|
||||
// NEW (use) = CLEAR + ADD (ie, only use this selection)
|
||||
cellsToSelect.reset();
|
||||
action = topoSetSource::ADD;
|
||||
}
|
||||
source->applyToSet(action, cellsToSelect);
|
||||
break;
|
||||
|
||||
case topoSetSource::SUBTRACT:
|
||||
source->applyToSet(action, cellsToSelect);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user