meshmanagermodel
-150.374274:130.740991:-900.000000
FIN_COMPLEX_PORT
-BOXES:149
+BOXES:147
BOX
creaMaracasVisu:ShowNPoints:showNpoints
ISEXEC:FALSE
BOX
creaMaracasVisu:ManualContourModel_Box:Box29
ISEXEC:FALSE
-76.240145:29.637449:-900.000000
-100.760145:27.137449:-900.000000
+75.865053:27.949535:-900.000000
+100.385053:25.449535:-900.000000
PORT
NbPoints:"40"
PORT
-OpenClose:"true"
-PORT
OpenClose2:"false"
FIN_BOX
BOX
BOX
wx:ComboBox:Box49
ISEXEC:FALSE
--182.639251:-13.479145:-900.000000
--156.359251:-15.979145:-900.000000
+-188.003067:-15.129550:-900.000000
+-161.723067:-17.629550:-900.000000
PORT
In:"25 50 100 150"
PORT
BOX
std:StringSelect:Box185
ISEXEC:FALSE
-55.412920:-71.682057:-900.000000
-79.932920:-74.182057:-900.000000
+51.782029:38.833179:-900.000000
+76.302029:36.333179:-900.000000
PORT
In0:"true"
PORT
In:"Move center point"
FIN_BOX
BOX
-std:ConcatStrings:Box189
-ISEXEC:FALSE
-295.297065:33.852305:-900.000000
-318.057065:31.352305:-900.000000
-PORT
-In2:" -1"
-FIN_BOX
-BOX
-std:ConcatStrings:Box190
-ISEXEC:FALSE
-323.450465:34.200004:-900.000000
-346.210465:31.700004:-900.000000
-PORT
-In2:" 1"
-FIN_BOX
-BOX
wx:CommandButton:Box191
ISEXEC:FALSE
293.254354:19.078682:-900.000000
PORT
BoxProcessMode:"Manual"
PORT
+Params:"-1"
+PORT
Type:"220"
FIN_BOX
BOX
PORT
BoxProcessMode:"Manual"
PORT
+Params:"1"
+PORT
Type:"220"
FIN_BOX
BOX
Orientation:"H"
FIN_BOX
BOX
-std:GetVectorDoubleSubVector:Box197
-ISEXEC:FALSE
-303.690218:44.001858:-900.000000
-327.150218:41.501858:-900.000000
-PORT
-ErrorValue:"0"
-PORT
-I:"3"
-PORT
-Size:"3"
-FIN_BOX
-BOX
wx:OutputText:Box198
ISEXEC:FALSE
351.406905:-7.681984:-900.000000
-214.516357:-72.312285:-900.000000
-192.736357:-74.812285:-900.000000
FIN_BOX
+BOX
+creaMaracasVisu:ShowNPoints_Tools:Box238
+ISEXEC:FALSE
+137.369261:-67.733158:-900.000000
+159.914261:-70.233158:-900.000000
+PORT
+BoxProcessMode:"Manual"
+PORT
+Params:"0"
+PORT
+Type:"250"
+FIN_BOX
CONNECTIONS:256
CONNECTION
Box06:LstContourPointsX:Box04:LstX
Box191:BoxChange:Box193:BoxExecute
NumberOfControlPoints:0
CONNECTION
-Box189:Out:Box193:Params
-NumberOfControlPoints:0
-CONNECTION
-Box190:Out:Box194:Params
-NumberOfControlPoints:0
-CONNECTION
Box195:Widget:Box187:Widget8
NumberOfControlPoints:0
CONNECTION
showNpoints:WidgetShowNPoints:Box193:WidgetShowNPoints
NumberOfControlPoints:0
CONNECTION
-Box197:Out:Box189:In1
-NumberOfControlPoints:0
-CONNECTION
-Box197:Out:Box190:In1
-NumberOfControlPoints:0
-CONNECTION
Box202:BoxChange:Box204:BoxExecute
NumberOfControlPoints:0
CONNECTION
Box207:BoxChange:Box208:BoxExecute
NumberOfControlPoints:0
CONNECTION
-Box208:Out:Box197:In
-NumberOfControlPoints:0
-CONNECTION
Box208:Out:Box206:In
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box37:widgetB:Box236:Widget4
NumberOfControlPoints:0
+CONNECTION
+Box105:Out:Box238:Mesh
+NumberOfControlPoints:0
+CONNECTION
+Box04:BoxChange:Box238:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+showNpoints:WidgetShowNPoints:Box238:WidgetShowNPoints
+NumberOfControlPoints:0
+CONNECTION
+Box68:Spacing:Box238:Spacing
+NumberOfControlPoints:0
+CONNECTION
+Box185:Out:Box29:OpenClose
+NumberOfControlPoints:0
APP_END
new creaMaracasVisu:ManualContourModel_Box Box29
set Box29.NbPoints "40"
- set Box29.OpenClose "true"
set Box29.OpenClose2 "false"
new creaMaracasVisu:wxPopupMenu Box57
new wx:OutputText Box188
set Box188.In "Move center point"
-new std:ConcatStrings Box189
- set Box189.In2 " -1"
-
-new std:ConcatStrings Box190
- set Box190.In2 " 1"
-
new wx:CommandButton Box191
set Box191.Label "-"
new creaMaracasVisu:ShowNPoints_Tools Box193
set Box193.BoxProcessMode "Manual"
+ set Box193.Params "-1"
set Box193.Type "220"
new creaMaracasVisu:ShowNPoints_Tools Box194
set Box194.BoxProcessMode "Manual"
+ set Box194.Params "1"
set Box194.Type "220"
new wx:LayoutLine Box195
set Box195.Orientation "H"
-new std:GetVectorDoubleSubVector Box197
- set Box197.ErrorValue "0"
- set Box197.I "3"
- set Box197.Size "3"
-
new wx:OutputText Box198
set Box198.In "Expand"
new wx:OutputText Box237
+new creaMaracasVisu:ShowNPoints_Tools Box238
+ set Box238.BoxProcessMode "Manual"
+ set Box238.Params "0"
+ set Box238.Type "250"
+
connect Box06.LstContourPointsX Box04.LstX
connect showNpoints.lstIndexs Box06.LstIndexsIn
connect Box147.Out Box146.In
connect Box192.BoxChange Box194.BoxExecute
connect Box191.BoxChange Box193.BoxExecute
-connect Box189.Out Box193.Params
-connect Box190.Out Box194.Params
connect Box195.Widget Box187.Widget8
connect Box188.Widget Box187.Widget7
connect Box191.Widget Box195.Widget3
connect Box187.Widget Box184.Widget6
connect showNpoints.WidgetShowNPoints Box194.WidgetShowNPoints
connect showNpoints.WidgetShowNPoints Box193.WidgetShowNPoints
-connect Box197.Out Box189.In1
-connect Box197.Out Box190.In1
connect Box202.BoxChange Box204.BoxExecute
connect Box201.BoxChange Box203.BoxExecute
connect Box199.Out Box203.Params
connect showNpoints.WidgetShowNPoints Box203.WidgetShowNPoints
connect Box159.Out Box169.In
connect Box207.BoxChange Box208.BoxExecute
-connect Box208.Out Box197.In
connect Box208.Out Box206.In
connect Box214.BoxChange Box216.BoxExecute
connect Box213.BoxChange Box215.BoxExecute
connect Box37.widgetA Box222.Widget4
connect Box72._widgetB Box236.Widget2
connect Box37.widgetB Box236.Widget4
+connect Box105.Out Box238.Mesh
+connect Box04.BoxChange Box238.BoxExecute
+connect showNpoints.WidgetShowNPoints Box238.WidgetShowNPoints
+connect Box68.Spacing Box238.Spacing
+connect Box185.Out Box29.OpenClose
# Complex input ports
input point showNpoints.In " "
meshmanagermodel
-150.374274:130.740991:-900.000000
FIN_COMPLEX_PORT
-BOXES:94
+BOXES:92
BOX
creaMaracasVisu:ShowNPoints:showNpoints
ISEXEC:FALSE
PORT
BoxProcessMode:"Manual"
PORT
+Params:"1"
+PORT
Type:"220"
FIN_BOX
BOX
PORT
BoxProcessMode:"Manual"
PORT
-Type:"220"
-FIN_BOX
-BOX
-std:ConcatStrings:Box130
-ISEXEC:FALSE
--377.646633:23.880476:-900.000000
--354.886633:21.380476:-900.000000
-PORT
-In2:" 1"
-FIN_BOX
-BOX
-std:ConcatStrings:Box131
-ISEXEC:FALSE
--336.496984:24.204237:-900.000000
--313.736984:21.704237:-900.000000
+Params:"-1"
PORT
-In2:" -1"
+Type:"220"
FIN_BOX
BOX
std:MultipleInputs:Box126
Orientation:"H"
FIN_BOX
BOX
-std:GetVectorDoubleSubVector:Box132
-ISEXEC:FALSE
--346.082243:44.049611:-900.000000
--322.622243:41.549611:-900.000000
-PORT
-ErrorValue:"0"
-PORT
-I:"3"
-PORT
-Size:"3"
-FIN_BOX
-BOX
creaVtk:CleanPolyData:Box133
ISEXEC:FALSE
-99.940321:-63.576453:-900.000000
139.158642:-65.682934:-900.000000
160.938642:-68.182934:-900.000000
FIN_BOX
-CONNECTIONS:178
+BOX
+creaMaracasVisu:ShowNPoints_Tools:Box149
+ISEXEC:FALSE
+149.256523:-26.382417:-900.000000
+171.801523:-28.882417:-900.000000
+PORT
+Params:"0"
+PORT
+Type:"250"
+FIN_BOX
+CONNECTIONS:177
CONNECTION
Box06:LstContourPointsX:Box04:LstX
NumberOfControlPoints:0
showNpoints:WidgetShowNPoints:Box128:WidgetShowNPoints
NumberOfControlPoints:0
CONNECTION
-Box130:Out:Box120:Params
-NumberOfControlPoints:0
-CONNECTION
-Box131:Out:Box128:Params
-NumberOfControlPoints:0
-CONNECTION
Box120:BoxChange:Box31:In3
NumberOfControlPoints:0
CONNECTION
Box129:Widget:Box101:Widget1
NumberOfControlPoints:0
CONNECTION
-Box60:Out:Box132:In
-NumberOfControlPoints:0
-CONNECTION
-Box132:Out:Box131:In1
-NumberOfControlPoints:0
-CONNECTION
-Box132:Out:Box130:In1
-NumberOfControlPoints:0
-CONNECTION
Box77:Out:Box133:In
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box148:Widget:Box140:Widget9
NumberOfControlPoints:0
+CONNECTION
+Box95:Out:Box149:Mesh
+NumberOfControlPoints:0
+CONNECTION
+showNpoints:WidgetShowNPoints:Box149:WidgetShowNPoints
+NumberOfControlPoints:0
+CONNECTION
+Box68:Spacing:Box149:Spacing
+NumberOfControlPoints:0
+CONNECTION
+Box04:BoxChange:Box149:BoxExecute
+NumberOfControlPoints:0
APP_END
new creaMaracasVisu:ShowNPoints_Tools Box120
set Box120.BoxProcessMode "Manual"
+ set Box120.Params "1"
set Box120.Type "220"
new wx:CommandButton Box121
new creaMaracasVisu:ShowNPoints_Tools Box128
set Box128.BoxProcessMode "Manual"
+ set Box128.Params "-1"
set Box128.Type "220"
-new std:ConcatStrings Box130
- set Box130.In2 " 1"
-
-new std:ConcatStrings Box131
- set Box131.In2 " -1"
-
new std:MultipleInputs Box126
new wx:LayoutLine Box129
set Box129.Orientation "H"
-new std:GetVectorDoubleSubVector Box132
- set Box132.ErrorValue "0"
- set Box132.I "3"
- set Box132.Size "3"
-
new creaVtk:CleanPolyData Box133
new wx:LayoutLine Box134
new wx:OutputText Box148
+new creaMaracasVisu:ShowNPoints_Tools Box149
+ set Box149.Params "0"
+ set Box149.Type "250"
+
connect Box06.LstContourPointsX Box04.LstX
connect showNpoints.lstIndexs Box06.LstIndexsIn
connect Box127.BoxChange Box128.BoxExecute
connect Box68.Spacing Box128.Spacing
connect showNpoints.WidgetShowNPoints Box128.WidgetShowNPoints
-connect Box130.Out Box120.Params
-connect Box131.Out Box128.Params
connect Box120.BoxChange Box31.In3
connect Box128.BoxChange Box31.In5
connect showNpoints.BoxChange Box126.In4
connect Box99.Widget Box101.Widget7
connect Box118.Widget Box101.Widget4
connect Box129.Widget Box101.Widget1
-connect Box60.Out Box132.In
-connect Box132.Out Box131.In1
-connect Box132.Out Box130.In1
connect Box77.Out Box133.In
connect Box133.Out Box115.In
connect Box42.Widget Box134.Widget3
connect Box143.Widget Box138.Widget9
connect Box144.Widget Box145.Widget9
connect Box148.Widget Box140.Widget9
+connect Box95.Out Box149.Mesh
+connect showNpoints.WidgetShowNPoints Box149.WidgetShowNPoints
+connect Box68.Spacing Box149.Spacing
+connect Box04.BoxChange Box149.BoxExecute
# Complex input ports
input point showNpoints.In " "
meshmanagermodel
-150.374274:130.740991:-900.000000
FIN_COMPLEX_PORT
-BOXES:86
+BOXES:85
BOX
creaMaracasVisu:ShowNPoints:showNpoints
ISEXEC:FALSE
BOX
creaVtk:CreateMeshFromPoints:Box04
ISEXEC:FALSE
-36.572951:11.779111:-900.000000
-59.427951:9.279111:-900.000000
+38.615327:13.367626:-900.000000
+61.470327:10.867626:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ManualContourModel_Box:Box06
Type:"220"
FIN_BOX
BOX
-std:ConcatStrings:Box130
-ISEXEC:FALSE
--389.900889:26.376713:-900.000000
--367.140889:23.876713:-900.000000
-PORT
-In2:" 1"
-FIN_BOX
-BOX
-std:ConcatStrings:Box131
-ISEXEC:FALSE
--359.416982:25.792752:-900.000000
--336.656982:23.292752:-900.000000
-PORT
-In2:" -1"
-FIN_BOX
-BOX
std:MultipleInputs:Box126
ISEXEC:FALSE
-262.331700:-55.177234:-900.000000
WinTitle:"1.2 Curvature"
FIN_BOX
BOX
-std:GetVectorDoubleSubVector:Box132
-ISEXEC:FALSE
--377.171745:33.383870:-900.000000
--353.711745:30.883870:-900.000000
-PORT
-ErrorValue:"0"
-PORT
-I:"3"
-PORT
-Size:"3"
-FIN_BOX
-BOX
wx:LayoutLine:Box134
ISEXEC:FALSE
-114.127728:-42.965229:-900.000000
BOX
creaVtk:MeshReduction_DecimatePro:Box143
ISEXEC:FALSE
-40.721236:-119.806931:-900.000000
-64.326236:-122.306931:-900.000000
+42.736193:-120.891908:-900.000000
+66.341193:-123.391908:-900.000000
PORT
BoxProcessMode:"Manual"
PORT
BOX
std:MagicBox:Box157
ISEXEC:FALSE
-38.119377:-128.210032:-900.000000
-59.829377:-130.710032:-900.000000
+40.444328:-128.210032:-900.000000
+62.154328:-130.710032:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ShowNPoints_Tools:Box158
+ISEXEC:FALSE
+45.552020:-23.065434:-900.000000
+68.097020:-25.565434:-900.000000
PORT
-BoxProcessMode:"Manual"
+Params:"0"
+PORT
+Type:"250"
FIN_BOX
-CONNECTIONS:173
+BOX
+creaVtk:PolyDataNormals:Box159
+ISEXEC:FALSE
+64.038173:-10.778224:-900.000000
+86.443173:-13.278224:-900.000000
+FIN_BOX
+CONNECTIONS:174
CONNECTION
Box06:LstContourPointsX:Box04:LstX
NumberOfControlPoints:0
Box121:Widget:Box129:Widget6
NumberOfControlPoints:0
CONNECTION
-Box60:Out:Box132:In
-NumberOfControlPoints:0
-CONNECTION
-Box132:Out:Box131:In1
-NumberOfControlPoints:0
-CONNECTION
-Box132:Out:Box130:In1
-NumberOfControlPoints:0
-CONNECTION
Box42:Widget:Box134:Widget3
NumberOfControlPoints:0
CONNECTION
Box157:Out:Box93:Mesh
NumberOfControlPoints:0
CONNECTION
-Box135:Out:Box157:In
+showNpoints:WidgetShowNPoints:Box158:WidgetShowNPoints
+NumberOfControlPoints:0
+CONNECTION
+Box04:BoxChange:Box158:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box68:Spacing:Box158:Spacing
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box159:In
+NumberOfControlPoints:0
+CONNECTION
+Box159:Out:Box158:Mesh
NumberOfControlPoints:0
CONNECTION
-Box135:BoxChange:Box157:BoxExecute
+Box143:Out:Box157:In
NumberOfControlPoints:0
APP_END
set Box128.Params "-1"
set Box128.Type "220"
-new std:ConcatStrings Box130
- set Box130.In2 " 1"
-
-new std:ConcatStrings Box131
- set Box131.In2 " -1"
-
new std:MultipleInputs Box126
new wx:LayoutLine Box129
set Box129.Orientation "H"
set Box129.WinTitle "1.2 Curvature"
-new std:GetVectorDoubleSubVector Box132
- set Box132.ErrorValue "0"
- set Box132.I "3"
- set Box132.Size "3"
-
new wx:LayoutLine Box134
set Box134.Orientation "V"
set Box134.WinTitle "1.4 Apply Changes"
new wx:OutputText Box156
new std:MagicBox Box157
- set Box157.BoxProcessMode "Manual"
+
+new creaMaracasVisu:ShowNPoints_Tools Box158
+ set Box158.Params "0"
+ set Box158.Type "250"
+
+new creaVtk:PolyDataNormals Box159
connect Box06.LstContourPointsX Box04.LstX
connect Box126.BoxChange Box31.BoxExecute
connect Box127.Widget Box129.Widget4
connect Box121.Widget Box129.Widget6
-connect Box60.Out Box132.In
-connect Box132.Out Box131.In1
-connect Box132.Out Box130.In1
connect Box42.Widget Box134.Widget3
connect Box67.Out Box135.Mesh
connect Box04.Out Box135.Patch
connect Box156.Widget Box138.Widget9
connect Box157.Out Box45.Mesh
connect Box157.Out Box93.Mesh
-connect Box135.Out Box157.In
-connect Box135.BoxChange Box157.BoxExecute
+connect showNpoints.WidgetShowNPoints Box158.WidgetShowNPoints
+connect Box04.BoxChange Box158.BoxExecute
+connect Box68.Spacing Box158.Spacing
+connect Box04.Out Box159.In
+connect Box159.Out Box158.Mesh
+connect Box143.Out Box157.In
# Complex input ports
input point showNpoints.In " "
}
// --- Group 1 ---
-//EED double centroid[3];
+ double centroid[3];
wsp->InsertCollectionAfter_();
p[0] = (lstX[0]+lstX[3])/2;
wsp->InsertPoint(pM[0] ,pM[1], pM[2],"");
p[0] = (lstX[0]+lstX[1]+lstX[2]+lstX[3])/4; p[1] = (lstY[0]+lstY[1]+lstY[2]+lstY[3])/4; p[2] = (lstZ[0]+lstZ[1]+lstZ[2]+lstZ[3])/4;
wsp->InsertPoint(p[0] ,p[1], p[2],"");
-//EED std::copy(std::begin(p), std::end(p), std::begin(centroid));
+ std::copy(std::begin(p), std::end(p), std::begin(centroid));
// --- Group 2 ---
wsp->InsertCollectionAfter_();
dx = lstX[2]-lstX[3];
wsp->InvertLstPoints_();
} // if angle
-//EED 2023 07 12
- //EED std::vector<double> normalOut(n2, n2 + 3);
- //EED double norm = vtkMath::Norm(n2);
- //EED normalOut[0] = normalOut[0]/norm;
- //EED normalOut[1] = normalOut[1]/norm;
- //EED normalOut[2] = normalOut[2]/norm;
+ // You need this for expand tool
+ std::vector<double> normalOut(n2, n2 + 3);
+ double norm = vtkMath::Norm(n2);
+ normalOut[0] = normalOut[0]/norm;
+ normalOut[1] = normalOut[1]/norm;
+ normalOut[2] = normalOut[2]/norm;
+ std::vector<double> outputData;
+ outputData.insert(outputData.end(), ¢roid[0], ¢roid[3]);
+ outputData.insert(outputData.end(), &normalOut[0], &normalOut[3]);
- //EED std::vector<double> outputData;
- //EED outputData.insert(outputData.end(), ¢roid[0], ¢roid[3]);
- //EED outputData.insert(outputData.end(), &normalOut[0], &normalOut[3]);
-
-//EED bbSetOutputOut(outputData);
+bbSetOutputOut(outputData);
//bbSetOutputOut(normalOut);
// --- Finish ---
}
*/
-
- double step = bbGetInputParams()[0];
- WidgetShowNPoints *wsp = bbGetInputWidgetShowNPoints();
- wsp->SetActualCollection( wsp->GetLstModelShowNPointsSize()/2 );
- ModelShowNPoints *modelSNP = wsp->GetModelShowNPoints( );
- modelSNP->SetIdCurrentPoint( modelSNP->GetLstPointsSize()/2 );
- wsp->MovePoint_( step );
+ std::vector<double> params = bbGetInputParams();
+ if(params.size() == 1)
+ {
+ double step = bbGetInputParams()[0];
+ WidgetShowNPoints *wsp = bbGetInputWidgetShowNPoints();
+ wsp->SetActualCollection( wsp->GetLstModelShowNPointsSize()/2 );
+ ModelShowNPoints *modelSNP = wsp->GetModelShowNPoints( );
+ modelSNP->SetIdCurrentPoint( modelSNP->GetLstPointsSize()/2 );
+ wsp->MovePoint_( step );
+ } else {
+ printf("Error! ShowNPoints_Tools::MovePatchCenter() Warning params are wrong. Need 1 element (step ex -1 or 1)\n");
+ } // if param size
}
/**
BBTK_INPUT(ShowNPoints_Tools,WidgetShowNPoints,"WidgetShowNPoints",WidgetShowNPoints*,"");
BBTK_INPUT(ShowNPoints_Tools,Spacing,"(default [1,1,1] )Spacing",std::vector<double>,"");
BBTK_INPUT(ShowNPoints_Tools,Mesh,"Mesh en format vtkPolyData ",vtkPolyData*,"");
- BBTK_INPUT(ShowNPoints_Tools,Type,"(default 0) 0:Nothing 1:Auto add poits 5:Add Point 10:Insert Point 20:TrackPoint 30:Set nearest point 40:Erase point 50:Deleta all points 100:Insert group after 110:Delete group 120:Reset colletion 200:Tool 3 or 4 points to patch surface - Create Mesh (based on 1 group and 3 or 4 points) 205:Tool 3 or 4 points to volume surface - Create Mesh (based on 1 group and 3 or 4 points) 210: Invert points 220: Move patch center 230: Move point in normal of surface (Params [-1] or [1]) 235: ChangeCurrentPoint (Params [-1] or [1]) 240: Join all start-end points to the start-end points on selected spline 250: Set Mesh SPC (Params: [0]:Patch [1]:CloseSpline1 [2]:CloseSpline2) 300: Create expanded surface 310: Create wide expanded surface 320: Expand Surface, 330: Widen surface, 340: Expand patch",int,"");
+ BBTK_INPUT(ShowNPoints_Tools,Type,"(default 0) 0:Nothing 1:Auto add poits 5:Add Point 10:Insert Point 20:TrackPoint 30:Set nearest point 40:Erase point 50:Deleta all points 100:Insert group after 110:Delete group 120:Reset colletion 200:Tool 3 or 4 points to patch surface - Create Mesh (based on 1 group and 3 or 4 points) 205:Tool 3 or 4 points to volume surface - Create Mesh (based on 1 group and 3 or 4 points) 210: Invert points 220: Move patch center (param is the step ex [-1] or [1]) 230: Move point in normal of surface (Params [-1] or [1]) 235: ChangeCurrentPoint (Params [-1] or [1]) 240: Join all start-end points to the start-end points on selected spline 250: Set Mesh SPC (Params: [0]:Patch [1]:CloseSpline1 [2]:CloseSpline2) 300: Create expanded surface 310: Create wide expanded surface 320: Expand Surface, 330: Widen surface, 340: Expand patch",int,"");
BBTK_INPUT(ShowNPoints_Tools, Params,"Optional params for the tools, required for 200: normal and direction, 320: centroid and direction, 330: normal and direction, 340: centroid and direction", std::vector<double>,"");
BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
void WidgetShowNPoints::MovePoint_(double step)
{
step=step;
-
StopAutoAddPoints();
StopTrackPoint();
-
int id=GetModelShowNPoints()->GetIdCurrentPoint();
if (aux_mesh!=NULL)
{
{
double x,y,z;
double p[3];
- double normal[3];; // point to modify and normal
- std::vector<double> pN(3); // new point
+ double normal[3]; // point to modify and normal
+ std::vector<double> pN(3); // new point
vtkStaticPointLocator *pointLocator = vtkStaticPointLocator::New();
pointLocator->SetDataSet( aux_mesh );
pointLocator->BuildLocator();
// int idControlPoint = wsp->GetModelShowNPoints()->GetNearestPoint();
int idControlPoint = GetModelShowNPoints()->GetIdCurrentPoint();
-
if(idControlPoint >= 0)
{
GetModelShowNPoints()->GetIdPoint(idControlPoint, &x, &y, &z);
p[1] = y * aux_mesh_spc[1];
p[2] = z * aux_mesh_spc[2];
long int idMeshPoint = pointLocator->FindClosestPoint(p);
- aux_mesh->GetPointData()->GetNormals()->GetTuple(idMeshPoint, normal);
- int direction = step;
-// pN[0] = p[0] / spc[0] + direction*normal[0];
-// pN[1] = p[1] / spc[1] + direction*normal[1];
-// pN[2] = p[2] / spc[2] + direction*normal[2];
- pN[0] = x + direction*normal[0];
- pN[1] = y + direction*normal[1];
- pN[2] = z + direction*normal[2];
-
- GetModelShowNPoints()->SetPointById(idControlPoint, pN);
- // GetViewShowNPoints()->RefreshPoint(idControlPoint);
-// RefreshCollectionText();
-// RefreshColourCollection();
-// SetOutputBox();
- UndoRedo_SaveCollection();
+ vtkDataArray *dataArrayNormals = aux_mesh->GetPointData()->GetNormals();
+ if (dataArrayNormals!=NULL)
+ {
+ dataArrayNormals->GetTuple(idMeshPoint, normal);
+
+ int direction = step;
+ // pN[0] = p[0] / spc[0] + direction*normal[0];
+ // pN[1] = p[1] / spc[1] + direction*normal[1];
+ // pN[2] = p[2] / spc[2] + direction*normal[2];
+ pN[0] = x + (direction * normal[0]);
+ pN[1] = y + (direction * normal[1]);
+ pN[2] = z + (direction * normal[2]);
+ GetModelShowNPoints()->SetPointById(idControlPoint, pN);
+ // GetViewShowNPoints()->RefreshPoint(idControlPoint);
+ // RefreshCollectionText();
+ // RefreshColourCollection();
+ // SetOutputBox();
+ UndoRedo_SaveCollection();
+ } else {
+ printf("Error! WidgetShowNPoints::MovePoint_ Missing normals in aux_mesh \n");
+ }
} // if idControlPoint
} // if wsp->GetLstModelShowNPointsSiz->size()>=2
-
} else {
- printf("EED WidgetShowNPoints::MovePoint_ BB \n" );
if (id>=0) {
int i,j,sizeG,sizeP;
double max=100000;
v[1] = p[1]-pc[1];
v[2] = p[2]-pc[2];
double mag=sqrt ( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] );
-
std::vector<double> point;
if (mag!=0)
{
point.push_back( p[2] + step*v[2] );
GetModelShowNPoints()->SetPointById(id,point);
UndoRedo_SaveCollection();
-
} // if id
-
} // if aux_mesh
-
RefreshCollectionText();
RefreshColourCollection();
}