//===== // 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) //===== #include "bbcreaMaracasVisuManualContourModel_Box.h" #include "bbcreaMaracasVisuPackage.h" #include namespace bbcreaMaracasVisu { BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ManualContourModel_Box) BBTK_BLACK_BOX_IMPLEMENTATION(ManualContourModel_Box,bbtk::AtomicBlackBox); //===== // 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) //===== void ManualContourModel_Box::ProcessBySegment( int Type, int &iGeneral, int sizeSegment, std::vector *lstInX,std::vector *lstInY, std::vector *lstInZ, std::vector *lstOutX,std::vector *lstOutY, std::vector *lstOutZ, std::vector *lstIndexsOut ) { creaContoursFactory f; manualContourModel *m; int i,size=iGeneral+sizeSegment; double x,y,z; m = (manualContourModel*)f.getContourModel( bbGetInputType() ); m->SetNumberOfPointsSpline( bbGetInputNbPoints() ); m->SetCloseContour( bbGetInputOpenClose() ); for (i=iGeneral;iAddPoint( (*lstInX)[i] , (*lstInY)[i] , (*lstInZ)[i] ); } // for m->UpdateSpline(); int sizeContour = bbGetInputNbPoints(); for (i=0;iGetSpline_i_Point(i,&x,&y,&z); lstOutX->push_back(x); lstOutY->push_back(y); lstOutZ->push_back(z); } // for iGeneral=iGeneral+sizeSegment; lstIndexsOut->push_back( sizeContour ); delete m; } void ManualContourModel_Box::Process() { // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value // INPUT/OUTPUT ACCESSORS ARE OF THE FORM : // void bbSet{Input|Output}NAME(const TYPE&) // const TYPE& bbGet{Input|Output}NAME() const // Where : // * NAME is the name of the input/output // (the one provided in the attribute 'name' of the tag 'input') // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < lstInX=bbGetInputLstControlPointsX(); std::vector lstInY=bbGetInputLstControlPointsY(); std::vector lstInZ=bbGetInputLstControlPointsZ(); if ( (lstInX.size()!=lstInY.size()) || (lstInY.size()!=lstInZ.size()) ) { printf("Warnning !! .. ManualContourModel_Box: The list X Y Z, no have the same number of elements \n"); return; } std::vector lstIndexsIn=bbGetInputLstIndexsIn(); std::vector lstIndexsOut; std::vector lstOutX; std::vector lstOutY; std::vector lstOutZ; if (bbGetInputLstIndexsIn().size()==0) { lstIndexsIn.push_back( lstInX.size() ); } int i,size=lstIndexsIn.size(); int iGeneral=0; for (i=0;i