]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkGlyphPolyDataNormals.cxx
#3513 CleanMeshWithPatch
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkGlyphPolyDataNormals.cxx
index 1234236b7f780319e73cab4f3399c5ee335365d1..55d8fe58e14d148ca2ffd197cfc6dc039d87cfd0 100644 (file)
@@ -38,17 +38,26 @@ void GlyphPolyDataNormals::Process()
        //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();
@@ -77,19 +86,20 @@ void GlyphPolyDataNormals::Process()
                                                        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
   
 }
 //===== 
@@ -102,14 +112,14 @@ void GlyphPolyDataNormals::bbUserSetDefaultValues()
 //    Here we initialize the input 'In' to 0
    bbSetInputIn(NULL);
    bbSetInputOpacity(1);
-   bbSetInputActive(false);
+   bbSetInputActive(true);
    bbSetInputMaskRatio(10);
    std::vector<double> color;
    color.push_back(0.0);
    color.push_back(0.0);
    color.push_back(0.5);
    bbSetInputColor(color);
-   bbSetInputSize(10);
+   bbSetInputSize(5);
    bbSetInputGlyphType(1);
    bbSetInputRenderer(NULL);
    bbSetOutputOut(NULL);