]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbcreaMaracasVisuChangeInformationPoint3Dto2D.cxx
#2516 creaMaracasVisu Feature New Normal - creaPanelButtonContainer ListPanel with...
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuChangeInformationPoint3Dto2D.cxx
index f60814bb826dcfb8921911b361fb34e55b0149a3..3f66509cb76826c0430958d80016c047709567cf 100644 (file)
@@ -29,7 +29,51 @@ void ChangeInformationPoint3Dto2D::Process()
 
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-  
+
+       std::vector<double> normal;
+       std::vector<double> outpoint;
+
+       if ( bbGetInputInPoint().size()==3 )
+       {
+
+               if (bbGetInputDirection() == 0) 
+               {
+                       normal.push_back(1);
+                       normal.push_back(0);
+                       normal.push_back(0);
+                       bbSetOutputNormalVector(normal);
+                       outpoint.push_back( bbGetInputInPoint()[1] );
+                       outpoint.push_back( bbGetInputInPoint()[2] );
+                       outpoint.push_back( bbGetInputInPoint()[0] );
+                       bbSetOutputOutPoint(outpoint);
+               } // if direction 0
+
+               if (bbGetInputDirection() == 1) 
+               {
+                       normal.push_back(0);
+                       normal.push_back(1);
+                       normal.push_back(0);
+                       bbSetOutputNormalVector(normal);
+                       outpoint.push_back( bbGetInputInPoint()[0] );
+                       outpoint.push_back( bbGetInputInPoint()[2] );
+                       outpoint.push_back( bbGetInputInPoint()[1] );
+                       bbSetOutputOutPoint(outpoint);
+               } // if direction 0
+
+               if (bbGetInputDirection() == 2) 
+               {
+                       normal.push_back(0);
+                       normal.push_back(0);
+                       normal.push_back(1);
+                       bbSetOutputNormalVector(normal);
+                       outpoint.push_back( bbGetInputInPoint()[0] );
+                       outpoint.push_back( bbGetInputInPoint()[1] );
+                       outpoint.push_back( bbGetInputInPoint()[2] );
+                       bbSetOutputOutPoint(outpoint);
+               } // if direction 0
+
+       } // if bbGetInputInPoint  Size
+
 }
 //===== 
 // 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)
@@ -40,7 +84,7 @@ void ChangeInformationPoint3Dto2D::bbUserSetDefaultValues()
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
 
-//   bbSetInputIn(0);
+    bbSetInputDirection(2);
   
 }
 //=====