BBTK_BLACK_BOX_IMPLEMENTATION(TubeTreeFilter,bbtk::AtomicBlackBox);
+void TubeTreeFilter::SetRadioTube(int iGeneral,int numPoints, int iTube)
+{
+ int i;
+ double radiotmp=1;
+ int size=iGeneral+numPoints;
+ vtkDoubleArray *tubeRadius = vecTubeRadiosArray[iTube];
+
+ if (bbGetInputlstRadio().size()>=1)
+ {
+ if (bbGetInputlstRadioLaw()==0) // for All
+ {
+ radiotmp=bbGetInputlstRadio()[0];
+ } // Law 0 for All
+
+ if (bbGetInputlstRadioLaw()==1) // by segment
+ {
+ if (bbGetInputlstRadio().size()>=iTube)
+ {
+ radiotmp=bbGetInputlstRadio()[iTube];
+ } else {
+ radiotmp=bbGetInputlstRadio()[ bbGetInputlstRadio().size()-1 ];
+ }
+ } // Law 1 by segment
+
+ for (i=iGeneral;i<size;i++)
+ {
+ if (bbGetInputlstRadioLaw()==2) // by point
+ {
+ if (bbGetInputlstRadio().size()>=i)
+ {
+ radiotmp=bbGetInputlstRadio()[i];
+ } else {
+ radiotmp=bbGetInputlstRadio()[ bbGetInputlstRadio().size()-1 ];
+ }
+ } // Law 2 by points
+ tubeRadius->SetTuple1(i-iGeneral, radiotmp );
+ } // for
+ tubeRadius->Modified();
+ } // bbGetInputlstRadio().size()>=1
+
+
+}
+
void TubeTreeFilter::DrawOneTube(int iGeneral,int numPoints, int iTube)
{
//EED vtkDoubleArray *tubeRadius = vtkDoubleArray::New();
tubeRadius->SetName("TubeRadius");
tubeRadius->SetNumberOfTuples( numPoints );
- for (i=iGeneral;i<size;i++)
- {
- tubeRadius->SetTuple1(i-iGeneral, bbGetInputlstRadio()[i] );
- }
+ vecTubeRadiosArray.push_back( tubeRadius );
+
+
polyData->GetPointData()->AddArray(tubeRadius);
polyData->GetPointData()->SetActiveScalars("TubeRadius");
void TubeTreeFilter::SetGraphicProperties()
{
- int iTube,sizeLstAxis=bbGetInputlstIndexs().size();
+ int iTube,sizeLstAxis=bbGetInputlstIndexs().size();
+
+ int iGeneral=0;
+ int numPoints;
vtkActor *actorTube;
vtkActor *actorSpherEnd;
actorSpherEnd->GetProperty()->SetOpacity( bbGetInputOpacity() );
actorSpherStart->GetProperty()->SetOpacity( bbGetInputOpacity() );
- //Set Colour
+ // Set Transform
if ( bbGetInputTransform()!=NULL )
{
actorTube->SetUserTransform( bbGetInputTransform() );
actorSpherStart->SetUserTransform( bbGetInputTransform() );
}
+ //Set Colour
if (bbGetInputColourLaw()==1) // One solide colour
{
//
actorTube->GetProperty()->SetColor( r,g,b );
actorSpherEnd->GetProperty()->SetColor( r,g,b );
actorSpherStart->GetProperty()->SetColor( r,g,b );
+
+
+// Setting radio
+ numPoints = bbGetInputlstIndexs()[iTube];
+ SetRadioTube(iGeneral,numPoints,iTube);
+ iGeneral = iGeneral+numPoints;
+
} // for
}
//EED vecVtkPolyData.clear();
//EED vecVtkPolyDataMaper.clear();
vecVtkActors.clear();
+ vecTubeRadiosArray.clear();
for ( iTube=0 ; iTube<sizeLstAxis ; iTube++)
{
} else {
printf("TubeTreeFilter .ERROR. missing index vector...\n");
}// vector Actor size
- }
+ } // oldLstSize
SetGraphicProperties();
printf("EED TubeTreeFilter::Process end \n");
bbSetInputColourLaw(1);
bbSetInputOpacity(1);
+ std::vector<double> radio;
+ radio.push_back(1);
+ bbSetInputlstRadio( radio );
+ bbSetInputlstRadioLaw( 0 ); // for all
+
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)