take autoscale value on drawn regions only

This commit is contained in:
Christopher Lackner 2025-03-13 18:49:28 +01:00
parent 787c6043fa
commit 15bd6cbed0
2 changed files with 8 additions and 4 deletions

View File

@ -2667,6 +2667,8 @@ namespace netgen
for (int i=first; i<next; i++)
{
double val;
if(!VolumeElementActive(sol, *mesh, (*mesh)[ElementIndex(i)]))
continue;
bool considerElem = GetValue (sol, i, 0.333, 0.333, 0.333, comp, val);
if (considerElem)
{
@ -2698,6 +2700,8 @@ namespace netgen
// for (int i = 0; i < nse; i++)
for (SurfaceElementIndex i : mesh->SurfaceElements().Range())
{
if(!SurfaceElementActive(sol, *mesh, (*mesh)[i]))
continue;
ELEMENT_TYPE type = (*mesh)[i].GetType();
double val;
bool considerElem = (type == QUAD)
@ -4723,7 +4727,7 @@ namespace netgen
bool VisualSceneSolution ::
SurfaceElementActive(const SolData *data, const Mesh & mesh, const Element2d & el)
SurfaceElementActive(const SolData *data, const Mesh & mesh, const Element2d & el) const
{
if(data == nullptr) return true;
bool is_active = true;
@ -4749,7 +4753,7 @@ namespace netgen
}
bool VisualSceneSolution ::
VolumeElementActive(const SolData *data, const Mesh & mesh, const Element & el)
VolumeElementActive(const SolData *data, const Mesh & mesh, const Element & el) const
{
bool is_active = true;
if(data->draw_volumes)

View File

@ -253,8 +253,8 @@ private:
void DrawCone (const Point<3> & p1, const Point<3> & p2, double r);
void DrawCylinder (const Point<3> & p1, const Point<3> & p2, double r);
bool SurfaceElementActive(const SolData *data, const Mesh & mesh, const Element2d & sei);
bool VolumeElementActive(const SolData *data, const Mesh & mesh, const Element & ei);
bool SurfaceElementActive(const SolData *data, const Mesh & mesh, const Element2d & sei) const;
bool VolumeElementActive(const SolData *data, const Mesh & mesh, const Element & ei) const;
// Get Function Value, local coordinates lam1, lam2, lam3,
bool GetValue (const SolData * data, ElementIndex elnr,