CloseOpenContourSurface(lstIndexs);
}
}
-
-
+
// vtkPolyData *polydata = vtkPolyData::New();
if (polydata!=NULL) polydata->Delete();
polydata = vtkPolyData::New();
triangle = vtkTriangleFilter::New();
triangle->SetInputData( clean->GetOutput() );
triangle->Update();
- bbSetOutputOut( clean->GetOutput() );
+ bbSetOutputOut( triangle->GetOutput() );
+ // bbSetOutputOut( clean->GetOutput() );
}// if listXYZ size
//printf("PG CreateMeshFromPoints::Process: End\n");
}
double lastPoint[3] = {};
bool validCentroid = CalcValidCentroid(centroid, firstIndex, end, increment, numPointsFace);
if(validCentroid){
- bool normalOrder = isPointingCorrectly(firstIndex, firstIndex+increment, centroid, contraryId);
- centroidId = points->InsertNextPoint(centroid[0], centroid[1], centroid[2]);
+ bool normalOrder = isPointingCorrectly(firstIndex, firstIndex+increment, centroid, contraryId);
+ centroidId = points->InsertNextPoint(centroid[0], centroid[1], centroid[2]);
vtkSmartPointer<vtkTriangleStrip> triangleStrip1 = vtkSmartPointer<vtkTriangleStrip>::New();
triangleStrip1->GetPointIds()->SetNumberOfIds(numPointsFace*2+1);
- if(normalOrder){ //(facesIdx == 0 && uPointOrder) || (facesIdx == 1 && !uPointOrder)){
+ if( !normalOrder )
+ { //(facesIdx == 0 && uPointOrder) || (facesIdx == 1 && !uPointOrder)){
int initial = firstIndex;
int triangleIndex = 0;
for(int index = initial; index < end; index+=increment){
triangleIndex+=2;
}
cells->InsertNextCell(triangleStrip1);
- }
- else{
+ } else {
int initial = firstIndex-1;
int triangleIndex = 0;
int triangleStripStart = end-1;
//Type of Glyph 1-Arrow 2-Line
//size of glyph Done
- if(bbGetInputIn() == NULL){
+ if(bbGetInputIn() == NULL)
+ {
printf("Warnning! GlyphPolyDataNormals::Process: Missing input PolyData\n");
bbSetOutputOut( NULL );
- }
- else if(bbGetInputRenderer() == NULL){
+
+ if(bbGetInputRenderer() != NULL)
+ {
+ if( (actorAdded==true) && (bbGetInputActive()==true) )
+ {
+ bbGetInputRenderer()->RemoveActor(normalsActor);
+ actorAdded = false;
+ }
+ } // if Renderer
+
+ } else if(bbGetInputRenderer() == NULL) {
printf("Warnning! GlyphPolyDataNormals::Process: Missing Renderer\n");
bbSetOutputOut( NULL );
- }
- else{
+ } else {
//Arrow Source
- arrow->SetTipResolution(16);
+ arrow->SetTipResolution(4);
arrow->SetTipLength(0.5);
arrow->SetTipRadius(0.2 * bbGetInputGlyphType());
arrow->Update();
bbGetInputColor()[1],
bbGetInputColor()[2]);
- if(bbGetInputRenderer() != NULL){
- if(actorAdded && !bbGetInputActive()){
+ if(bbGetInputRenderer() != NULL)
+ {
+ if( (actorAdded==true) && !(bbGetInputActive()==true) )
+ {
bbGetInputRenderer()->RemoveActor(normalsActor);
actorAdded = false;
- }
- else if(bbGetInputActive() && !actorAdded){
+ } else if(bbGetInputActive() && !actorAdded) {
bbGetInputRenderer()->AddActor(normalsActor);
actorAdded = true;
}
- }
+ } // if Renderer
bbSetOutputOut( normalsActor );
- }
+ } // if InputIn
}
//=====
if (bbGetInputIn()!=NULL)
{
vtkPolyDataNormals* normal = vtkPolyDataNormals::New();
+ normal->SetAutoOrientNormals(false);
+ normal->SetConsistency(false);
normal->SetInputData( bbGetInputIn() );
if (bbGetInputComputeType()==0)
{
{
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
+ bbSetInputType(0);
+ bbSetInputComputeType(0);
bbSetInputIn(NULL);
bbSetOutputOut( NULL );
}
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
BBTK_INPUT(PolyDataNormals,In,"Mesh input",vtkPolyData*,"");
- BBTK_INPUT(PolyDataNormals,ComputeType,"(0 default) 0:points 1:Cells",int,"");
+ BBTK_INPUT(PolyDataNormals,ComputeType,"(0 default) 0:Cells 1:Points",int,"");
BBTK_INPUT(PolyDataNormals,Type,"(0 default) 0:Normal Action 1:Apply correction direction (try param=1)",int,"");
- BBTK_INPUT(PolyDataNormals,Param,"(0 default) For Type=1 [-2 2] 0:parallel 1:NormalState -1:OpositState",double ,"");
+ BBTK_INPUT(PolyDataNormals,Param,"(0 default) For Type=1 (Normaly for open meshs) [-2 2] 0:parallel 1:NormalState -1:OpositState",double ,"");
BBTK_OUTPUT(PolyDataNormals,Out,"Mesh output",vtkPolyData*,"");
BBTK_OUTPUT(PolyDataNormals,MeanNormal,"Mean Normal",std::vector<double>,"");
BBTK_END_DESCRIBE_BLACK_BOX(PolyDataNormals);