diff --git a/Cassiopee/CPlot/CPlot/Display/displaySMeshZone.cpp b/Cassiopee/CPlot/CPlot/Display/displaySMeshZone.cpp index 653ce7c4c..e37b1e474 100644 --- a/Cassiopee/CPlot/CPlot/Display/displaySMeshZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displaySMeshZone.cpp @@ -88,7 +88,6 @@ void Data::displaySMeshZone(StructZone* zonep, E_Int zone) double pt1[3]; double pt2[3]; double pt3[3]; double pt4[3]; E_Float nz = 1./_numberOfStructZones; - #include "meshStyles.h" // Grid dimensions E_Int ni = zonep->ni; @@ -96,12 +95,10 @@ void Data::displaySMeshZone(StructZone* zonep, E_Int zone) E_Int nk = zonep->nk; if (ptrState->dim == 2) nk = 1; E_Int nij = ni*nj; - bool is1D = false; if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1) is1D = true; - if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; } - + #include "meshStyles.h" #include "selection.h" d = dist2BB(_view.xcam, _view.ycam, _view.zcam, diff --git a/Cassiopee/CPlot/CPlot/Display/displaySSolidZone.cpp b/Cassiopee/CPlot/CPlot/Display/displaySSolidZone.cpp index a696924f1..fa433606a 100644 --- a/Cassiopee/CPlot/CPlot/Display/displaySSolidZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displaySSolidZone.cpp @@ -38,16 +38,12 @@ void Data::displaySSolidZone(StructZone* zonep, E_Int zone) getrgb = _plugins.zoneColorMap->f; E_Float nz = 1./_numberOfStructZones; + bool is1D = ((zonep->ni*zonep->nj == 1) | (zonep->ni*zonep->nk == 1) | (zonep->nj*zonep->nk == 1)); + #include "solidStyles.h" - #include "selection.h" - bool is1D = ((zonep->ni*zonep->nj == 1) | (zonep->ni*zonep->nk == 1) | (zonep->nj*zonep->nk == 1)); - if (is1D == true && ptrState->mode == RENDER) glLineWidth(1.+5*zonep->shaderParam1); - else if (is1D == true) glLineWidth(3.); - else glLineWidth(1.); - - if (is1D == true && ptrState->mode == MESH) return; // already drawn in mesh + if (is1D && ptrState->mode == MESH) return; // already drawn in mesh // scale E_Float s = MAX(zonep->xmax-zonep->xmin, zonep->ymax-zonep->ymin); diff --git a/Cassiopee/CPlot/CPlot/Display/displayUMeshHOZone.cpp b/Cassiopee/CPlot/CPlot/Display/displayUMeshHOZone.cpp index 67ce5b68e..ef1a1f8ea 100644 --- a/Cassiopee/CPlot/CPlot/Display/displayUMeshHOZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displayUMeshHOZone.cpp @@ -95,13 +95,13 @@ void Data::displayUMeshZone_ho(UnstructZone* zonep, E_Int zone, E_Int zonet) double pt1[3]; double pt2[3]; double pt3[3]; double pt4[3]; E_Float nz = 1./_numberOfUnstructZones; - #include "meshStyles.h" - #include "selection.h" - E_Int eltType0 = zonep->eltType[0]; bool is1D = false; if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true; - if (is1D) glLineWidth(3.); + + #include "meshStyles.h" + #include "selection.h" + int ishader = 3; this->_shaders.set_tesselation(ishader); this->_shaders.activate((short unsigned int)this->_shaders.shader_id(shader::None)); @@ -115,7 +115,11 @@ void Data::displayUMeshZone_ho(UnstructZone* zonep, E_Int zone, E_Int zonet) // For BARS or NODES or 1D NGONS: display nodes if (is1D) - { + { + if (zonep->colorR > -0.5) + {color1[0] = zonep->colorR; color1[1] = zonep->colorG; color1[2] = zonep->colorB;} + #include "selection.h" + glBegin(GL_QUADS); if (zonep->blank == 0) { diff --git a/Cassiopee/CPlot/CPlot/Display/displayUMeshZone.cpp b/Cassiopee/CPlot/CPlot/Display/displayUMeshZone.cpp index cfc7af40c..2f8e771de 100644 --- a/Cassiopee/CPlot/CPlot/Display/displayUMeshZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displayUMeshZone.cpp @@ -89,21 +89,18 @@ void Data::displayUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet) double pt1[3]; double pt2[3]; double pt3[3]; double pt4[3]; E_Float nz = 1./_numberOfUnstructZones; - #include "meshStyles.h" - E_Int eltType0 = zonep->eltType[0]; bool is1D = false; if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true; - if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; } - + #include "meshStyles.h" #include "selection.h" #include "displayUMeshZone.h" // For BARS or NODES or 1D NGONS: display node if (is1D) - { + { glBegin(GL_QUADS); if (zonep->blank == 0) { diff --git a/Cassiopee/CPlot/CPlot/Display/displayUSolidHOZone.cpp b/Cassiopee/CPlot/CPlot/Display/displayUSolidHOZone.cpp index 33feda319..9dfa4d8fe 100644 --- a/Cassiopee/CPlot/CPlot/Display/displayUSolidHOZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displayUSolidHOZone.cpp @@ -38,15 +38,11 @@ void Data::displayUSolidHOZone(UnstructZone *zonep, E_Int zone, E_Int zonet) getrgb = _plugins.zoneColorMap->f; E_Float nz = 1. / _numberOfUnstructZones; - #include "solidStyles.h" - - #include "selection.h" - E_Int eltType0 = zonep->eltType[0]; bool is1D = ( (eltType0 == 1) | (eltType0 == 10 && zonep->nelts1D > 0) ); - if (is1D == true && ptrState->mode == RENDER) glLineWidth(1. + 5 * zonep->shaderParam1); - else if (is1D == true) glLineWidth(3.); - else glLineWidth(1.); + + #include "solidStyles.h" + #include "selection.h" // scale E_Float s = MAX(zonep->xmax - zonep->xmin, zonep->ymax - zonep->ymin); diff --git a/Cassiopee/CPlot/CPlot/Display/displayUSolidZone.cpp b/Cassiopee/CPlot/CPlot/Display/displayUSolidZone.cpp index 86d60118d..2509ead10 100644 --- a/Cassiopee/CPlot/CPlot/Display/displayUSolidZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displayUSolidZone.cpp @@ -25,75 +25,71 @@ //============================================================================= void Data::displayUSolidZone(UnstructZone *zonep, E_Int zone, E_Int zonet) { - E_Int i, n1, n2, n3, n4, n5, n6, n7, n8; - E_Int ret1, ret2, ret3, ret4, f; + E_Int i, n1, n2, n3, n4, n5, n6, n7, n8; + E_Int ret1, ret2, ret3, ret4, f; - // Style - float color1[3]; float color2[3]; + // Style + float color1[3]; float color2[3]; - // Colormap - float r, g, b; - void (*getrgb)(Data* data, double, float*, float*, float*); - getrgb = _plugins.zoneColorMap->f; + // Colormap + float r, g, b; + void (*getrgb)(Data* data, double, float*, float*, float*); + getrgb = _plugins.zoneColorMap->f; - E_Float nz = 1. / _numberOfUnstructZones; -#include "solidStyles.h" + E_Float nz = 1. / _numberOfUnstructZones; + E_Int eltType0 = zonep->eltType[0]; + bool is1D = ( (eltType0 == 1) | (eltType0 == 10 && zonep->nelts1D > 0) ); -#include "selection.h" + #include "solidStyles.h" + #include "selection.h" - E_Int eltType0 = zonep->eltType[0]; - bool is1D = ( (eltType0 == 1) | (eltType0 == 10 && zonep->nelts1D > 0) ); - if (is1D == true && ptrState->mode == RENDER) glLineWidth(1. + 5 * zonep->shaderParam1); - else if (is1D == true) glLineWidth(3.); - else glLineWidth(1.); + if (is1D && ptrState->mode == MESH) return; // already drawn in mesh - if (is1D == true && ptrState->mode == MESH) return; // already drawn in mesh + // scale + E_Float s = MAX(zonep->xmax - zonep->xmin, zonep->ymax - zonep->ymin); + s = MAX(s, zonep->zmax - zonep->zmin); + s = 100. / (s + 1.e-12); - // scale - E_Float s = MAX(zonep->xmax - zonep->xmin, zonep->ymax - zonep->ymin); - s = MAX(s, zonep->zmax - zonep->zmin); - s = 100. / (s + 1.e-12); - - // Only for textured rendering, we use vect display ======================= - if (ptrState->mode == RENDER && zonep->material == 14 && zonep->texu != NULL) // Textured rendering - { + // Only for textured rendering, we use vect display ======================= + if (ptrState->mode == RENDER && zonep->material == 14 && zonep->texu != NULL) // Textured rendering + { #ifdef __SHADERS__ - triggerShader(*zonep, zonep->material, s, color1); + triggerShader(*zonep, zonep->material, s, color1); #endif - E_Int ff = 0; - double offb = 0.; + E_Int ff = 0; + double offb = 0.; #undef PLOT - double* f1 = zonep->texu; - double* f2 = zonep->texv; - double* f3 = zonep->texw; - double fmin1, fmax1, fmin2, fmax2, fmin3, fmax3; - fmax1 = 0.; fmin1 = 1.; - fmax2 = 0.; fmin2 = 1.; - fmax3 = 0.; fmin3 = 1.; + double* f1 = zonep->texu; + double* f2 = zonep->texv; + double* f3 = zonep->texw; + double fmin1, fmax1, fmin2, fmax2, fmin3, fmax3; + fmax1 = 0.; fmin1 = 1.; + fmax2 = 0.; fmin2 = 1.; + fmax3 = 0.; fmin3 = 1.; #define GL_QUADS_ARE GL_QUADS #define PLOTQUAD PLOTQUADQ #define PLOTQUAD2 PLOTQUADQ2 #include "displayUVectSolidZone.h" - glLineWidth(1.); - return; - } + glLineWidth(1.); + return; + } // END Textured rendering ============================================ #ifdef __SHADERS__ - if (ptrState->mode == RENDER) - { - if (zonep->selected == 1 && zonep->active == 1) - triggerShader(*zonep, zonep->material, s, color2); - else - triggerShader(*zonep, zonep->material, s, color1); - } - else - { - if (zonep->selected == 1 && zonep->active == 1) - triggerShader(*zonep, 0, s, color2); - else - triggerShader(*zonep, 0, s, color1); - } + if (ptrState->mode == RENDER) + { + if (zonep->selected == 1 && zonep->active == 1) + triggerShader(*zonep, zonep->material, s, color2); + else + triggerShader(*zonep, zonep->material, s, color1); + } + else + { + if (zonep->selected == 1 && zonep->active == 1) + triggerShader(*zonep, 0, s, color2); + else + triggerShader(*zonep, 0, s, color1); + } #endif #undef PLOT @@ -102,5 +98,5 @@ void Data::displayUSolidZone(UnstructZone *zonep, E_Int zone, E_Int zonet) #undef PLOTQUAD #undef PLOTQUAD2 #include "displayUSolidZone.h" - glLineWidth( 1. ); + glLineWidth( 1. ); } diff --git a/Cassiopee/CPlot/CPlot/Display/meshStyles.h b/Cassiopee/CPlot/CPlot/Display/meshStyles.h index f10450c31..d8b556949 100644 --- a/Cassiopee/CPlot/CPlot/Display/meshStyles.h +++ b/Cassiopee/CPlot/CPlot/Display/meshStyles.h @@ -66,3 +66,13 @@ glLineWidth(1.*resf); break; } + + // 1D specific + if (is1D) + { + if (zonep->colorR != -1.) + { color1[0] = zonep->colorR; color1[1] = zonep->colorG; color1[2] = zonep->colorB; } + color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; + glLineWidth(3.); + } + \ No newline at end of file diff --git a/Cassiopee/CPlot/CPlot/Display/renderDLSMeshZone.cpp b/Cassiopee/CPlot/CPlot/Display/renderDLSMeshZone.cpp index 1ed8da6d5..e13669a83 100644 --- a/Cassiopee/CPlot/CPlot/Display/renderDLSMeshZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/renderDLSMeshZone.cpp @@ -88,8 +88,6 @@ void DataDL::renderGPUSMeshZone(StructZone* zonep, E_Int zone) double pt1[3]; double pt2[3]; double pt3[3]; double pt4[3]; E_Float nz = 1./_numberOfStructZones; - #include "meshStyles.h" - double* x = zonep->x; double* y = zonep->y; double* z = zonep->z; @@ -101,7 +99,8 @@ void DataDL::renderGPUSMeshZone(StructZone* zonep, E_Int zone) if (ptrState->dim == 2) nk = 1; bool is1D = false; if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1) is1D = true; - if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; } + + #include "meshStyles.h" #include "selection.h" d = dist2BB(_view.xcam, _view.ycam, _view.zcam, diff --git a/Cassiopee/CPlot/CPlot/Display/renderDLSSolidZone.cpp b/Cassiopee/CPlot/CPlot/Display/renderDLSSolidZone.cpp index da95c2917..69c5bbbed 100644 --- a/Cassiopee/CPlot/CPlot/Display/renderDLSSolidZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/renderDLSSolidZone.cpp @@ -35,14 +35,11 @@ void DataDL::renderGPUSSolidZone(StructZone* zonep, E_Int zone) getrgb = _plugins.zoneColorMap->f; E_Float nz = 1./_numberOfStructZones; -#include "solidStyles.h" - -#include "selection.h" bool is1D = ((zonep->ni*zonep->nj == 1) | (zonep->ni*zonep->nk == 1) | (zonep->nj*zonep->nk == 1)); - if (is1D == true && ptrState->mode == RENDER) glLineWidth(1.+5*zonep->shaderParam1); - else if (is1D == true) glLineWidth(3.); - else glLineWidth(1.); + + #include "solidStyles.h" + #include "selection.h" if (is1D == true && ptrState->mode == MESH) return; // already drawn in mesh diff --git a/Cassiopee/CPlot/CPlot/Display/renderDLUMeshZone.cpp b/Cassiopee/CPlot/CPlot/Display/renderDLUMeshZone.cpp index 8805224bc..e5972c02c 100644 --- a/Cassiopee/CPlot/CPlot/Display/renderDLUMeshZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/renderDLUMeshZone.cpp @@ -103,15 +103,14 @@ void DataDL::renderGPUUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet) double pt4[3]; E_Float nz = 1. / _numberOfUnstructZones; - #include "meshStyles.h" - double* x = zonep->x; double* y = zonep->y; double* z = zonep->z; E_Int eltType0 = zonep->eltType[0]; bool is1D = false; if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true; - if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; } + + #include "meshStyles.h" #include "selection.h" if (zonep->_is_high_order == true) @@ -129,7 +128,7 @@ void DataDL::renderGPUUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet) // For BARS, NODE, 1D NGONS: display node if (is1D) - { + { glBegin(GL_QUADS); if (zonep->blank == 0) { diff --git a/Cassiopee/CPlot/CPlot/Display/renderDLUSolidHOZone.cpp b/Cassiopee/CPlot/CPlot/Display/renderDLUSolidHOZone.cpp index 4ed096524..8fc24ed66 100644 --- a/Cassiopee/CPlot/CPlot/Display/renderDLUSolidHOZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/renderDLUSolidHOZone.cpp @@ -36,15 +36,12 @@ void DataDL::renderGPUUSolidHOZone(UnstructZone *zonep, E_Int zone, E_Int zonet) getrgb = _plugins.zoneColorMap->f; E_Float nz = 1. / _numberOfUnstructZones; - #include "solidStyles.h" - - #include "selection.h" E_Int eltType0 = zonep->eltType[0]; bool is1D = ( (eltType0 == 1) | (eltType0 == 10 && zonep->nelts1D > 0) ); - if (is1D == true && ptrState->mode == RENDER) glLineWidth( 1. + 5 * zonep->shaderParam1); - else if (is1D == true) glLineWidth(3.); - else glLineWidth(1.); + + #include "solidStyles.h" + #include "selection.h" // scale E_Float s = MAX(zonep->xmax - zonep->xmin, zonep->ymax - zonep->ymin); diff --git a/Cassiopee/CPlot/CPlot/Display/renderDLUSolidZone.cpp b/Cassiopee/CPlot/CPlot/Display/renderDLUSolidZone.cpp index deddeb4f1..11a51cb07 100644 --- a/Cassiopee/CPlot/CPlot/Display/renderDLUSolidZone.cpp +++ b/Cassiopee/CPlot/CPlot/Display/renderDLUSolidZone.cpp @@ -35,15 +35,12 @@ void DataDL::renderGPUUSolidZone(UnstructZone* zonep, E_Int zone, E_Int zonet) getrgb = _plugins.zoneColorMap->f; E_Float nz = 1./_numberOfUnstructZones; -#include "solidStyles.h" - -#include "selection.h" E_Int eltType0 = zonep->eltType[0]; bool is1D = ((eltType0 == 1) | (eltType0 == 10 && zonep->nelts1D>0)); - if (is1D == true && ptrState->mode == RENDER) glLineWidth(1.+5*zonep->shaderParam1); - else if (is1D == true) glLineWidth(3.); - else glLineWidth(1.); + + #include "solidStyles.h" + #include "selection.h" if (is1D == true && ptrState->mode == MESH) return; // already drawn in mesh diff --git a/Cassiopee/CPlot/CPlot/Display/solidStyles.h b/Cassiopee/CPlot/CPlot/Display/solidStyles.h index 33a5f8cb7..19f5e0792 100644 --- a/Cassiopee/CPlot/CPlot/Display/solidStyles.h +++ b/Cassiopee/CPlot/CPlot/Display/solidStyles.h @@ -46,3 +46,7 @@ if (zonep->colorR > -0.5) {color1[0] = zonep->colorR; color1[1] = zonep->colorG; color1[2] = zonep->colorB;} + // specifique aux zones 1D + if (is1D && ptrState->mode == RENDER) glLineWidth(1.+5*zonep->shaderParam1); + else if (is1D) glLineWidth(3.); + else glLineWidth(1.); diff --git a/Cassiopee/CPlot/apps/tkMapEdge.py b/Cassiopee/CPlot/apps/tkMapEdge.py index 41343ef5a..b8a188d30 100644 --- a/Cassiopee/CPlot/apps/tkMapEdge.py +++ b/Cassiopee/CPlot/apps/tkMapEdge.py @@ -1306,16 +1306,15 @@ def createApp(win): B.bind('', refine) # - Copy distribution - - B = TTK.Button(Frame, command=setSourceEdge, - image=iconics.PHOTO[8], padx=0, pady=0) - B.grid(row=2, column=3, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Set source edge defining distribution to copy.') + B = TTK.Button(Frame, command=setSourceEdge, text='Copy') + B.grid(row=2, column=0, sticky=TK.EW) + BB = CTK.infoBulle(parent=B, text='Get source edge defining distribution for copy.') B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=10) - B.grid(row=2, column=1, columnspan=2, sticky=TK.EW) + B.grid(row=2, column=2, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Source edge for distribution copy.') - B = TTK.Button(Frame, text="Copy", command=copyDistrib) - B.grid(row=2, column=0, columnspan=1, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Copy distribution from source edge.') + B = TTK.Button(Frame, text="Paste", command=copyDistrib) + B.grid(row=2, column=1, columnspan=1, sticky=TK.EW) + BB = CTK.infoBulle(parent=B, text='Paste distribution from source edge.') # - Smooth edge - B = TTK.Button(Frame, text="Smooth", command=smooth) @@ -1330,30 +1329,30 @@ def createApp(win): B.bind('', smooth) # - Enforce - - B = TTK.Button(Frame, text="Set", command=setEnforce) - B.grid(row=4, column=0, columnspan=1, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Set step on curve.') - B = TTK.OptionMenu(Frame, VARS[8], 'HFactor', 'H') - B.grid(row=4, column=1, sticky=TK.EW) - B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7) - B.grid(row=4, column=2, columnspan=1, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Enforced spacing.') - B.bind('', setEnforce) - B = TTK.Button(Frame, command=setEnforceMode, - image=iconics.PHOTO[8], padx=0, pady=0) - B.grid(row=4, column=3, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Set size mode.') - WIDGETS['enforceMode'] = B - - B = TTK.Button(Frame, text="Enforce", command=enforceH) - B.grid(row=5, column=0, columnspan=1, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Enforce all given spacing.') - B = TTK.OptionMenu(Frame, VARS[9], 'NFactor', 'Npts') - B.grid(row=5, column=1, sticky=TK.EW) - B = TTK.Entry(Frame, textvariable=VARS[10], background='White', width=7) - B.grid(row=5, column=2, columnspan=2, sticky=TK.EW) - BB = CTK.infoBulle(parent=B, text='Enforced number of points.') - B.bind('', enforceH) + #B = TTK.Button(Frame, text="Set", command=setEnforce) + #B.grid(row=4, column=0, columnspan=1, sticky=TK.EW) + #BB = CTK.infoBulle(parent=B, text='Set step on curve.') + #B = TTK.OptionMenu(Frame, VARS[8], 'HFactor', 'H') + #B.grid(row=4, column=1, sticky=TK.EW) + #B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7) + #B.grid(row=4, column=2, columnspan=1, sticky=TK.EW) + #BB = CTK.infoBulle(parent=B, text='Enforced spacing.') + #B.bind('', setEnforce) + #B = TTK.Button(Frame, command=setEnforceMode, + # image=iconics.PHOTO[8], padx=0, pady=0) + #B.grid(row=4, column=3, sticky=TK.EW) + #BB = CTK.infoBulle(parent=B, text='Set size mode.') + #WIDGETS['enforceMode'] = B + + #B = TTK.Button(Frame, text="Enforce", command=enforceH) + #B.grid(row=5, column=0, columnspan=1, sticky=TK.EW) + #BB = CTK.infoBulle(parent=B, text='Enforce all given spacing.') + #B = TTK.OptionMenu(Frame, VARS[9], 'NFactor', 'Npts') + #B.grid(row=5, column=1, sticky=TK.EW) + #B = TTK.Entry(Frame, textvariable=VARS[10], background='White', width=7) + #B.grid(row=5, column=2, columnspan=2, sticky=TK.EW) + #BB = CTK.infoBulle(parent=B, text='Enforced number of points.') + #B.bind('', enforceH) # - Enforce local - B = TTK.Button(Frame, text="Enforce", command=enforceLocal) diff --git a/Cassiopee/OCC/OCC/PyTree.py b/Cassiopee/OCC/OCC/PyTree.py index 6de2d43d8..c134d7c7f 100644 --- a/Cassiopee/OCC/OCC/PyTree.py +++ b/Cassiopee/OCC/OCC/PyTree.py @@ -389,6 +389,7 @@ def getTree(hook, N=11, hmax=-1, hausd=-1.): b[2].append(z) _updateEdgesFaceList__(t) + _setLonelyEdgesColor(t) return t @@ -548,7 +549,8 @@ def getFirstTree(hook, hmax=-1., hausd=-1., faceList=None): b[2].append(z) _updateEdgesFaceList__(t) - + _setLonelyEdgesColor(t) + return t # the first version of parallel CAD split and TRI meshing @@ -814,6 +816,7 @@ def _meshAllFacesTri(hook, t, metric=True, faceList=None, hList=[], hmax=-1, hau b[2].append(z) _updateEdgesFaceList__(t) + _setLonelyEdgesColor(t) return None @@ -862,7 +865,27 @@ def _meshAllFacesStruct(hook, t, faceList=None): b[2].append(z) _updateEdgesFaceList__(t) + _setLonelyEdgesColor(t) + + return None +# set color red to lonelyEdges +def _setLonelyEdgesColor(t): + import CPlot.PyTree as CPlot + b = Internal.getNodeFromName1(t, 'EDGES') + if b is None: return None + zones = Internal.getZones(b) + for ze in zones: + CAD = Internal.getNodeFromName1(ze, 'CAD') + faceList = Internal.getNodeFromName1(CAD, 'faceList') + if faceList is not None: + size = faceList[1].size + if size == 2: # ok: blue + CPlot._addRender2Zone(ze, color='Green') + elif size == 1: # lonely: red + CPlot._addRender2Zone(ze, color='Red') + else: # strange!! + CPlot._addRender2Zone(ze, color='Red') return None #=========================================================================================== @@ -1075,11 +1098,3 @@ def _updateConnectivityTree(tc, name, nameDonor, ptList, ptListDonor): Internal.createNode('InterpolantsType', 'DataArray_t', value=data, parent=zsr) return None -# External stitcher -# Look to edges and replace identical edges (may join) -# IN: t: CAD+Mesh tree -def stitch(t): - edges = Internal.getNodeFromName1(t, 'EDGES') - faces = Internal.getNodeFromName1(t, 'FACES') - # identify identical edges - return None \ No newline at end of file