28 #ifndef __vtkvmtkPolyDataNetworkExtraction_h    29 #define __vtkvmtkPolyDataNetworkExtraction_h    31 #include "vtkPolyDataAlgorithm.h"    32 #include "vtkvmtkWin32Header.h"    35 class vtkPolyDataCollection;
    44   void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE; 
    48   vtkSetStringMacro(MarksArrayName);
    49   vtkGetStringMacro(MarksArrayName);
    51   vtkSetStringMacro(RadiusArrayName);
    52   vtkGetStringMacro(RadiusArrayName);
    54   vtkSetStringMacro(TopologyArrayName);
    55   vtkGetStringMacro(TopologyArrayName);
    57   vtkSetMacro(AdvancementRatio,
double);
    58   vtkGetMacro(AdvancementRatio,
double);
    60   vtkGetMacro(TotalMarkedPoints,
int);
    62   vtkGetMacro(MinimumStep,
double);
    64   vtkGetObjectMacro(GraphLayout,vtkPolyData);
    73     STEP_ITERATION_STOP_CLOSED
    90   void BoundaryExtractor (vtkPolyData* polyInput, vtkPolyData* boundary);
    91   void BoundarySeparator(vtkPolyData* appendedBoundaries, vtkPolyDataCollection* boundaries);
    92   void InsertInEdgeTable(vtkIdTypeArray* edgeTable, vtkIdType pointId0, vtkIdType pointId1);
    93   bool InsertUniqueInEdgeTable(vtkIdTypeArray* edgeTable, vtkIdType pointId0, vtkIdType pointId1);
    94   void GetFromEdgeTable(vtkIdTypeArray* edgeTable, vtkIdType position, vtkIdType edge[2]);
    95   void UpdateEdgeTableCollectionReal(vtkPolyData* model,vtkPolyDataCollection* profiles,vtkCollection* edgeTables);
    96   double Distance(
double point1[3], 
double point2[3]);
    97   double GetFurthestDistance (vtkPolyDataCollection* polyDataCollection, 
double fromPoint[3]);
    98   void Barycenter (vtkPoints* points, 
double barycenter[3]);
    99   void ProfileBarycenter (vtkPoints* points, 
double barycenter[3]);
   100   void DefineVirtualSphere(vtkPolyDataCollection* baseProfiles, 
double center[3], 
double &radius, 
double ratio);
   101   vtkIdType CurrentPointId(vtkPolyData* model,vtkIdType currentEdge[2]);
   102   void InsertEdgeForNewProfiles(vtkPolyData* model, vtkIdType* edge, vtkIdTypeArray* edgeTable, vtkIdTypeArray* cellPairs, vtkIdList* pointIds);
   103   bool LookForNeighbors(vtkPolyData* model, vtkIdType pointId, vtkIdList* notVisitedIds, vtkIdTypeArray* edgeTableForIncludedGlobalProfiles);
   104   void PropagateFromBaseProfilePoint(vtkPolyData* model, vtkIdList* toVisitPointIds, 
double center[3], 
double radius, vtkIdTypeArray* edgeTableForNewProfiles, vtkIdTypeArray* cellPairsForNewProfiles, vtkIdList* pointIdsForNewProfiles, vtkPoints* markedPoints, vtkIdList* markedPointIds, vtkIdTypeArray* edgeTableForIncludedGlobalProfiles);
   105   void LocateVirtualPoint(vtkIdType edge[2], 
double center[3], 
double radius, vtkIdList* pointIdsForNewProfiles, vtkPoints* pointsForNewProfiles, vtkDoubleArray* pointDistancesForNewProfiles, 
double virtualPoint[3]);
   106   void ReconstructNewProfiles(vtkPoints* virtualPoints, vtkIdTypeArray* edgeTable, vtkIdTypeArray* cellPairs, vtkPolyDataCollection* newProfiles, vtkCollection* newProfilesEdgeTables);
   107   void GenerateNewProfiles(vtkPolyData* model, 
double center[3], 
double radius, vtkIdTypeArray* edgeTableForNewProfiles, vtkIdTypeArray* cellPairsForNewProfiles, vtkIdList* pointIdsForNewProfiles, vtkPolyDataCollection* newProfiles, vtkCollection* newProfilesEdgeTables);
   108   void UnmarkPoints(vtkPolyData* model, vtkIdList* markedPointIds);
   109   double ComputeStepRadius(vtkPoints* points, 
double point1[3], 
double point2[3]);
   110   double ComputeMeanRadius(vtkPoints* points, 
double point1[3]);
   111   void PointsForRadius(vtkPoints *markedPoints, vtkPolyDataCollection *baseProfiles, vtkPolyDataCollection *newProfiles, vtkPoints *pointsForRadius);
   112   void LookForIntersectingPoint(vtkPoints* segmentPoints, 
double center[3], 
double radius, vtkIdType &intersectingPointId);
   113   vtkIdType StepIteration(vtkPolyData* model, vtkPolyDataCollection* baseProfiles, vtkCollection* baseProfilesEdgeTables, vtkPolyDataCollection* globalProfiles, vtkCollection* globalProfilesEdgeTables, vtkPolyDataCollection* newProfiles, vtkCollection* newProfilesEdgeTables, vtkPoints* segmentPoints, vtkDoubleArray* segmentRadii, vtkPoints* bifurcationPoints, vtkDoubleArray* bifurcationRadii, 
double oldCenter[3], 
double &oldRadius, 
double advancementRatio);
   114   void MarkModelGlobalProfile(vtkPolyData* model, vtkIdTypeArray* newGlobalProfileEdgeTable);
   115   void SegmentTopology(vtkCollection* bifurcations, vtkCollection* bifurcationsRadii, 
double firstSegmentPoint[3], 
double lastSegmentPoint[3], 
double firstPoint[3], 
double &firstRadius, 
double lastPoint[3], 
double &lastRadius, vtkIdType segmentTopology[2]);
   116   void BuildSegment(vtkPoints* segmentPoints, vtkDoubleArray* segmentRadii, vtkIdType segmentTopology[2], 
double firstPoint[3], 
double firstRadius, 
double lastPoint[3], 
double lastRadius, 
const double* centralPoint, vtkPolyData* segment);
   117   void InsertNewBifurcation(vtkCollection* bifurcations, vtkCollection* bifurcationsRadii, vtkPoints* bifurcationPoints, vtkDoubleArray* bifurcationRadii, vtkPolyDataCollection* additionalSegments);
   118   void SegmentIteration(vtkPolyData* model, vtkPolyData* initialProfile, vtkIdTypeArray* initialProfileEdgeTable, vtkPolyDataCollection* globalProfiles, vtkCollection* globalProfilesEdgeTables, vtkCollection* bifurcations, vtkCollection* bifurcationsRadii, vtkPolyDataCollection* segments, 
double advancementRatio);
   119   void JoinSegments (vtkPolyData* segment0, vtkPolyData* segment1, 
bool first0, 
bool first1, vtkPolyData* segment);
   120   void RemoveDegenerateBifurcations(vtkPolyDataCollection* segments,vtkCollection* bifurcations);
   121   void GlobalIteration(vtkPolyData* model, vtkPolyDataCollection* globalProfiles, vtkPolyData* network, 
double advancementRatio);
   122   void MarkModelRealBoundary(vtkPolyData* model, vtkPolyData* modelBoundary);
   123   void Graph(vtkPolyData* network, vtkPolyData* graphLayout);
   125   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;