From 8995edbc8752e4cc4835db0543180ae467101b5b Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 21 Jul 2023 16:23:15 +0200 Subject: [PATCH] #3526 Select segments --- packages/std/src/bbstdVectorFilterDouble.cxx | 42 ++++++++++++++++++-- packages/std/src/bbstdVectorFilterDouble.h | 4 +- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/packages/std/src/bbstdVectorFilterDouble.cxx b/packages/std/src/bbstdVectorFilterDouble.cxx index 2258e81..c132e91 100644 --- a/packages/std/src/bbstdVectorFilterDouble.cxx +++ b/packages/std/src/bbstdVectorFilterDouble.cxx @@ -381,9 +381,9 @@ void VectorFilterDouble::Process() if (bbGetInputType()==12) // Nearest point in vector { int i; - int sizeLstX = In0.size(); // lstX - int sizeLstY = In1.size(); // lstY - int sizeLstZ = In2.size(); // lstZ + int sizeLstX = In0.size(); // lstX + int sizeLstY = In1.size(); // lstY + int sizeLstZ = In2.size(); // lstZ std::vector spc = bbGetInputk1(); if (spc.size()>=1) { @@ -432,6 +432,42 @@ void VectorFilterDouble::Process() Out0.push_back( sqrt( x*x +y*y +z*z ) ); } } // Type 13 + if (bbGetInputType()==14) // Select segments + { + if ( (In0.size()==In1.size()) && (In0.size()==In2.size() ) ) + { + if (bbGetInputk1().size()==0) // not filter , just passing all segmentes + { + Out0 = In0; + Out1 = In1; + Out2 = In2; + Out3 = In3; + } else { + std::vector k1 =bbGetInputk1(); + int iSeg, sizeLstIndex = In3.size(); + int iGeneral=0; + int i, size; + for (iSeg = 0; iSeg,""); + BBTK_INPUT(VectorFilterDouble,Type,"default (0) 0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1, 14=Select specific segments In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) ",int,""); + BBTK_INPUT(VectorFilterDouble,k1,"(default [0]) nothing (Type0), k1[0]=new size vectors (Type 1) , nothing (Type2), k1[0] = Addition const. (Type 3), k1[0] = Substraction const. (Type 4), k1[0] = Multiplication const. (Type 5) , k1[0] = Division const. (Type 6) , k1[spcX,spcY,spcZ] MulSpc In0_X,In1_Y,In2_Z (type 11), k1[spcX,spcY,spcZ] DivSpc In0_X,In1_Y,In2_Z (type 12) , k1[segment1, segment2,..] (type 14) ",std::vector,""); BBTK_INPUT(VectorFilterDouble,In0,"Input vector",std::vector,""); BBTK_INPUT(VectorFilterDouble,In1,"Input vector",std::vector,""); BBTK_INPUT(VectorFilterDouble,In2,"Input vector",std::vector,""); -- 2.47.1