// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- std::map<int, std::vector<double> > mapX;
- std::map<int, std::vector<double> > mapY;
- std::map<int, std::vector<double> > mapZ;
+ std::map<int, std::vector<double> > mapX;
+ std::map<int, std::vector<double> > mapY;
+ std::map<int, std::vector<double> > mapZ;
+ std::map<int, int > mapTypeModel;
if (bbGetInputFileNameRoi().compare("")==0)
{
fscanf(ff,"%s",tmp); //
fscanf(ff,"%s",tmp); // TypeModel
fscanf(ff,"%d",&TypeModel); //
- if ((TypeModel==1) || (TypeModel==6) )
+ if ((TypeModel==1) || (TypeModel==6)|| (TypeModel==14) ) // 1:Slice 6:Line 14:SliceForceOpen
{
fscanf(ff,"%s",tmp); // NumberOfControlPoints
fscanf(ff,"%d",&NumberOfControlPoints); //
{
LstX.push_back(zz);
LstY.push_back(x);
- LstZ.push_back(y);
+// LstZ.push_back(y);
+ LstZ.push_back( (y*(-1)) + (dimY-1) );
} // if FromDirection
if (bbGetInputFromDirection()==2) // XZ
{
LstZ.push_back( (y*(-1)) + (dimY-1) );
} // if FromDirection
} // for iControlPoint
- mapX[zz] = LstX;
- mapY[zz] = LstY;
- mapZ[zz] = LstZ;
+ mapX[zz] = LstX;
+ mapY[zz] = LstY;
+ mapZ[zz] = LstZ;
+ mapTypeModel[zz]= TypeModel;
} // TypeModel
fscanf(ff,"%s",tmp); // TypeView
fscanf(ff,"%s",tmp); //
std::vector<double> LstY;
std::vector<double> LstZ;
std::vector<int> LstIndexs;
+ std::vector<int> LstTypeModel;
// Order block by zz
for( std::map<int, std::vector<double> >::iterator iter = mapX.begin();
LstZ.push_back( iter->second[i] );
} // for i
} // for mapZ
-
+
+ for( std::map<int, int >::iterator iter = mapTypeModel.begin();
+ iter != mapTypeModel.end();
+ ++iter )
+ {
+ LstTypeModel.push_back( iter->second );
+
+ //int i,size = iter->second.size();
+ //for (i=0;i<size;i++)
+ //{
+ // LstTypeModel.push_back( iter->second[i] );
+ //} // for i
+ } // for mapTypeModel
+
bbSetOutputLstX( LstX );
bbSetOutputLstY( LstY );
bbSetOutputLstZ( LstZ );
bbSetOutputLstIndexs( LstIndexs );
+ bbSetOutputLstTypeModel( LstTypeModel );
}
//=====
// 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)
//=====
- BBTK_DECLARE_INPUT(FileNameRoi,std::string);
- BBTK_DECLARE_INPUT(FromDirection,int);
-
- BBTK_DECLARE_OUTPUT(LstX,std::vector<double>);
- BBTK_DECLARE_OUTPUT(LstY,std::vector<double>);
- BBTK_DECLARE_OUTPUT(LstZ,std::vector<double>);
- BBTK_DECLARE_OUTPUT(LstIndexs,std::vector<int>);
- BBTK_PROCESS(Process);
- void Process();
-//=====
+ BBTK_DECLARE_INPUT(FileNameRoi,std::string);
+ BBTK_DECLARE_INPUT(FromDirection,int);
+
+ BBTK_DECLARE_OUTPUT(LstX,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(LstY,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(LstZ,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(LstIndexs,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstTypeModel,std::vector<int>);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
// 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)
//=====
};
BBTK_OUTPUT(ReadCreaContourFile,LstY,"Vetor Y",std::vector<double>,"");
BBTK_OUTPUT(ReadCreaContourFile,LstZ,"Vetor Z",std::vector<double>,"");
BBTK_OUTPUT(ReadCreaContourFile,LstIndexs,"List of : number of elements by segments",std::vector<int>,"");
+ BBTK_OUTPUT(ReadCreaContourFile,LstTypeModel,"List of : Type Model ( 1:Slice 6:Line 14:SliceForceOpen)",std::vector<int>,"");
BBTK_END_DESCRIBE_BLACK_BOX(ReadCreaContourFile);
//=====
#include "bbcreaMaracasVisuTubeFilter.h"
#include "bbcreaMaracasVisuPackage.h"
-
-#include <vtkPolyData.h>
-#include <vtkPoints.h>
-#include <vtkCellArray.h>
-#include <vtkDoubleArray.h>
-#include <vtkPolyData.h>
-#include <vtkPointData.h>
-
-#include <vtkCell.h>
-#include <vtkCellData.h>
-#include <vtkDataSet.h>
-#include <vtkDataSetAttributes.h>
-#include <vtkProperty.h>
-#include <vtkTubeFilter.h>
-
-#include <vtkDataSetMapper.h>
-#include <vtkPolyDataMapper.h>
-
-
namespace bbcreaMaracasVisu
{
-
MaracasTubeFilter::MaracasTubeFilter()
{
+ points = NULL;
+ lines = NULL;
+ polyData = NULL;
+ tubeRadius = NULL;
+ colors = NULL;
+ tube = NULL;
+ mapper = NULL;
}
MaracasTubeFilter::~MaracasTubeFilter()
{
renderer->RemoveActor(actor);
}
-
}
-
void MaracasTubeFilter::SetvtkRenderer(vtkRenderer *render)
{
this->renderer = render;
}
-
-
void MaracasTubeFilter::SetlstPoints( std::vector<double> lstPointX , std::vector<double> lstPointY , std::vector<double> lstPointZ )
{
this->lstPointX = lstPointX;
this->lstPointZ = lstPointZ;
}
-
void MaracasTubeFilter::SetlstColour( std::vector<double> lstColour )
{
this->lstColour=lstColour;
}
-
void MaracasTubeFilter::SetlstRadius( std::vector<double> lstRadius )
{
this->lstRadius = lstRadius;
this->transform = transform;
}
- vtkActor *MaracasTubeFilter::GetActor()
- {
- return actor;
- }
-
+ vtkActor* MaracasTubeFilter::GetActor()
+ {
+ return actor;
+ }
+
+ vtkPolyData* MaracasTubeFilter::GetPolyDataTube()
+ {
+ return polydataTube;
+ }
+
+
+void MaracasTubeFilter::Run()
+{
+ unsigned int i;
+ unsigned int nTv = 32; // No. of surface elements for each tube vertex
+
+ if (points!=NULL) points->Delete();
+ if (lines!=NULL) lines->Delete();
+ if (polyData!=NULL) polyData->Delete();
+ if (tubeRadius!=NULL) tubeRadius->Delete();
+ if (colors!=NULL) colors->Delete();
+ if (tube!=NULL) tube->Delete();
+ if (mapper!=NULL) mapper->Delete();
+
+ // Create points and cells
+//EED1 vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
+ points = vtkPoints::New();
+
+ for(i = 0; i < lstPointX.size(); i++)
+ {
+ points->InsertPoint(i, lstPointX[i], lstPointY[i], lstPointZ[i]);
+ }
+
+ //EED1 vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
+ lines = vtkCellArray::New();
+
+ lines->InsertNextCell( lstPointX.size() );
+ for (i = 0; i < lstPointX.size(); i++)
+ {
+ lines->InsertCellPoint(i);
+ }
+
+ //EED1 vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
+ polyData = vtkPolyData::New();
+
+ polyData->SetPoints(points);
+ polyData->SetLines(lines);
+
+ double radio;
+ // Varying tube radius using sine-function
+
+ //EED1 vtkSmartPointer<vtkDoubleArray> tubeRadius = vtkSmartPointer<vtkDoubleArray>::New();
+ tubeRadius = vtkDoubleArray::New();
+
+ tubeRadius->SetName("TubeRadius");
+ tubeRadius->SetNumberOfTuples( lstPointX.size() );
+ for (i=0 ;i<lstPointX.size() ; i++)
+ {
+ if (lstRadius.size()==0)
+ {
+ radio=1;
+ } else if (i<lstRadius.size()) {
+ radio = lstRadius[i];
+ } else if (i>=lstRadius.size()) {
+ radio= lstRadius[ lstRadius.size()-1 ];
+ }
+ tubeRadius->SetTuple1(i, radio );
+ }
+ polyData->GetPointData()->AddArray(tubeRadius);
+ polyData->GetPointData()->SetActiveScalars("TubeRadius");
+
+ // RBG array (could add Alpha channel too I guess...)
+ // Varying from blue to red
+
+ //EED1 vtkSmartPointer<vtkUnsignedCharArray> colors = vtkSmartPointer<vtkUnsignedCharArray>::New();
+ colors = vtkUnsignedCharArray::New();
+
+ colors->SetName("Colors");
+ colors->SetNumberOfComponents(3);
+ colors->SetNumberOfTuples( lstPointX.size() );
+ int numberOfColours = lstColour.size()/3;
+ int indexcolour;
+ for (i = 0; i < lstPointX.size() ;i++)
+ {
+ if (numberOfColours==0){
+ colors->InsertTuple3(i, 1 , 1 , 1 );
+ } else {
+ if (i<numberOfColours){
+ indexcolour=i*3;
+ } else {
+ indexcolour=(numberOfColours-1)*3;
+ }
+ colors->InsertTuple3(i, 255*lstColour[indexcolour+0] , 255*lstColour[indexcolour+1] , 255*lstColour[indexcolour+2] );
+ }
+ } // for
+ polyData->GetPointData()->AddArray(colors);
+
+ //EED1 vtkSmartPointer<vtkTubeFilter> tube = vtkSmartPointer<vtkTubeFilter>::New();
+ tube = vtkTubeFilter::New();
+
+ tube->CappingOn();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ tube->SetInput(polyData);
+#else
+ tube->SetInputData(polyData);
+#endif
+
+ tube->SetNumberOfSides(nTv);
+ tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
+ tube->Update();
+
+ //EED1 vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
+ mapper = vtkPolyDataMapper::New();
+
+//EED1 mapper->SetInputConnection( tube->GetOutputPort() );
+ mapper->SetInputDataObject( tube->GetOutput() );
+ polydataTube = tube->GetOutput();
+
+// mapper->ScalarVisibilityOn();
+// mapper->SetScalarModeToUsePointFieldData();
+
+ mapper->ScalarVisibilityOn();
+
+// mapper->SetScalarModeToUseCellData();
+// mapper->SetScalarModeToUseCellFieldData();
+// mapper->SetScalarModeToUseFieldData();
+// mapper->SetScalarModeToUsePointData();
+ mapper->SetScalarModeToUsePointFieldData();
+
+ mapper->SetColorModeToDefault();
+// mapper->SetColorModeToMapScalars();
+
+ mapper->SelectColorArray("Colors");
+
+ //EED1 vtkSmartPointer<vtkActor> actor =vtkSmartPointer<vtkActor>::New();
+ actor = vtkActor::New();
+
+ actor->SetMapper(mapper);
+ actor->GetProperty()->SetOpacity( opacity );
+
+ if ( transform!=NULL )
+ {
+ actor->SetUserTransform( transform );
+ } // if transform NULL
+
+ // Interface Update
+ if (renderer!=NULL )
+ {
+ renderer->AddActor(actor);
+ } // if render NULL
+}
+
+
+
+/*
void MaracasTubeFilter::Run()
{
unsigned int i;
- unsigned int nTv = 8; // No. of surface elements for each tube vertex
+ unsigned int nTv = 32; // No. of surface elements for each tube vertex
// Create points and cells
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
lines->InsertCellPoint(i);
}
- vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
+ vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
polyData->SetPoints(points);
polyData->SetLines(lines);
tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
- mapper->SetInputConnection(tube->GetOutputPort());
+ mapper->SetInputConnection( tube->GetOutputPort() );
+
+ polydataTube = vtkPolyData::New();
+ polydataTube->ShallowCopy ( tube->GetOutput() );
+ // polydataTube = tube->GetOutput();
+
// mapper->ScalarVisibilityOn();
// mapper->SetScalarModeToUsePointFieldData();
mapper->SetColorModeToDefault();
// mapper->SetColorModeToMapScalars();
-
-
+
mapper->SelectColorArray("Colors");
// vtkSmartPointer<vtkActor> actor =vtkSmartPointer<vtkActor>::New();
if ( transform!=NULL )
{
actor->SetUserTransform( transform );
- }
+ } // if transform NULL
// Interface Update
if (renderer!=NULL )
{
renderer->AddActor(actor);
- }
-
+ } // if render NULL
}
-
-
-
-
+*/
+
+
+
BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,TubeFilter)
BBTK_BLACK_BOX_IMPLEMENTATION(TubeFilter,bbtk::AtomicBlackBox);
//=====
//=====
void TubeFilter::Process()
{
-
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
{
delete tubefilter;
}
-
tubefilter = new MaracasTubeFilter();
tubefilter->SetvtkRenderer( bbGetInputRenderer() );
tubefilter->SetlstPoints( bbGetInputlstPointX(), bbGetInputlstPointY(), bbGetInputlstPointZ() );
// Sets the default value for radius to 1 everywhere, if the radius input vevctor is empty.
if (bbGetInputlstRadio().size() == 0)
- {
+ {
std::vector<double> radio;
radio.resize(bbGetInputlstPointX().size(), 1.);
bbSetInputlstRadio(radio);
- }
+ }
tubefilter->SetlstRadius( bbGetInputlstRadio() );
tubefilter->SetOpacity( bbGetInputOpacity() );
tubefilter->SetTransform( bbGetInputTransform() );
tubefilter->SetlstColour( bbGetInputColour() );
tubefilter->Run();
- bbSetOutputOutAxis( tubefilter->GetActor() );
+ bbSetOutputOutMesh( tubefilter->GetPolyDataTube() );
+ bbSetOutputOutAxis( tubefilter->GetActor() );
}
//=====
// Here we initialize the input 'In' to 0
bbSetInputOpacity(1);
bbSetInputTransform(NULL);
-
std::vector<double> colour;
// 0- gray
colour.push_back(1.0);
colour.push_back(0.0);
colour.push_back(0.0);
bbSetInputColour(colour);
-
std::vector<double> lstRadius;
lstRadius.push_back(1);
- bbSetInputColour(lstRadius);
+ bbSetInputColour(lstRadius);
}
//=====
// if any
}
-}
-// EO namespace bbcreaMaracasVisu
+}// EO namespace bbcreaMaracasVisu
#include <vtkRenderer.h>
#include <vtkTransform.h>
#include <vtkActor.h>
+#include <vtkPolyData.h>
#include <vtkLinearTransform.h>
-#include <vtkSmartPointer.h>
+// #include <vtkSmartPointer.h>
+
+#include <vtkPolyData.h>
+#include <vtkPoints.h>
+#include <vtkCellArray.h>
+#include <vtkDoubleArray.h>
+#include <vtkPolyData.h>
+#include <vtkPointData.h>
+
+#include <vtkCell.h>
+#include <vtkCellData.h>
+#include <vtkDataSet.h>
+#include <vtkDataSetAttributes.h>
+#include <vtkProperty.h>
+#include <vtkTubeFilter.h>
+
+#include <vtkDataSetMapper.h>
+#include <vtkPolyDataMapper.h>
+
+
+
namespace bbcreaMaracasVisu
{
public:
MaracasTubeFilter();
~MaracasTubeFilter();
-
void SetvtkRenderer( vtkRenderer *render);
void SetlstPoints( std::vector<double> lstPointX , std::vector<double> lstPointY , std::vector<double> lstPointZ );
void SetlstRadius( std::vector<double> lstRadius );
void SetlstColour( std::vector<double> lstColour );
void SetOpacity(double opacity);
void SetTransform( vtkLinearTransform* transform );
- vtkActor *GetActor();
- void Run();
-
- vtkRenderer *renderer;
- vtkSmartPointer<vtkActor> actor;
-
+ vtkActor *GetActor();
+ vtkPolyData *GetPolyDataTube();
+ void Run();
+ vtkRenderer *renderer;
+ vtkSmartPointer<vtkActor> actor;
+
+// vtkSmartPointer<vtkPolyData> polyData;
+ vtkSmartPointer<vtkPolyData> polydataTube;
+
+
+ vtkPoints *points;
+ vtkCellArray *lines;
+ vtkPolyData *polyData;
+ vtkDoubleArray *tubeRadius;
+ vtkUnsignedCharArray *colors;
+ vtkTubeFilter *tube;
+ vtkPolyDataMapper *mapper;
+
+
double opacity;
vtkLinearTransform *transform;
std::vector<double> lstPointX;
std::vector<double> lstPointZ;
std::vector<double> lstRadius;
std::vector<double> lstColour;
-
};
class bbcreaMaracasVisu_EXPORT TubeFilter
BBTK_DECLARE_INPUT(Transform, vtkLinearTransform *);
BBTK_DECLARE_OUTPUT(OutAxis,vtkProp3D *);
+ BBTK_DECLARE_OUTPUT(OutMesh,vtkPolyData *);
BBTK_PROCESS(Process);
void Process();
BBTK_INPUT(TubeFilter,Transform,"vtkTransform", vtkLinearTransform *,"");
BBTK_INPUT(TubeFilter,Opacity,"Opacity (default 1)",double,"");
BBTK_OUTPUT(TubeFilter,OutAxis,"Tube Actor",vtkProp3D *,"");
+ BBTK_OUTPUT(TubeFilter,OutMesh,"PolyData output tube",vtkPolyData *,"");
BBTK_END_DESCRIBE_BLACK_BOX(TubeFilter);
//=====
// 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)
#else
lstSourceSphere[id]->Update();
#endif
- lstActorsText[id]->SetInput( label.c_str() );
- lstActorsText[id]->SetPosition( radio+spc[0]*x , spc[1]*y , spc[2]*z );
+ if (id < lstActorsText.size() )
+ {
+ lstActorsText[id]->SetInput( label.c_str() );
+ lstActorsText[id]->SetPosition( radio+spc[0]*x , spc[1]*y , spc[2]*z );
+ } // if id < lstActorsText.size
}
//------------------------------------------------------------------------
renderer->RemoveActor( lstActorsText[id] );
} // if lstActorAdded true
} else { // try to add actor to render
- if (lstActorAdded[id]==false)
- {
- lstActorAdded[id]=true;
- renderer->AddActor( lstActorsSphere[id] );
- renderer->AddActor( lstActorsText[id] );
- } // if lstActorAdded false
+ if (id<lstActorAdded.size() ) {
+ if (lstActorAdded[id]==false)
+ {
+ lstActorAdded[id]=true;
+ renderer->AddActor( lstActorsSphere[id] );
+ renderer->AddActor( lstActorsText[id] );
+ } // if lstActorAdded false
+ } // if id<lstActorAdded.size
} // if show
}
colourActualGroup.push_back(0.8);
colourActualGroup.push_back(0.4);
colourActualGroup.push_back(0.4);
-
-
// For all collections
SetColour( colourAll );
int sizeLstPoints;
lstViewShowNPoints[mActualCollection] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0;
lstViewShowNPoints[mActualCollection] -> ratioRadio = 1.2;
lstViewShowNPoints[mActualCollection] -> RefreshEachPoint();
-
//Actual Point
int curPnt = lstModelShowNPoints[mActualCollection]->GetIdCurrentPoint();
sizeLstPoints = lstModelShowNPoints[mActualCollection]->GetLstPointsSize();
lstViewShowNPoints[iCollection]->TryToShowActorsInRender(true);
// lstViewShowNPoints[i] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0;
}
+
lstViewShowNPoints[iCollection]->RefreshEachPoint();
}// if mActualCollection
} // for i
if (lstModelShowNPoints.size()==1)
{
if (GetModelShowNPoints()->GetLstPointsSize()==0) { okEraseFirstGroup=true; }
- }
+ } // if lstModelShowNPoints.size()==1
FILE *ff = fopen( filename.c_str() , "r+" );
if (ff!=NULL)
{
StopTrackPoint();
}
-
//------------------------------------------------------------------------
void WidgetShowNPoints::OnLoadCollectionsIdsCurrent_( std::string filename )
{
#include "manualContourModelRotationTool.h"
#include "manualViewRotationTool.h"
#include "manualContourModelPolygon.h"
+#include "manualContourModelSplineForceOpen.h"
#include "manualView3DContour.h"
#include "manualContour3DControler.h"
#include "manualContour3V3DControler.h"
-
creaContoursFactory::creaContoursFactory()
{
-
}
-
creaContoursFactory::~creaContoursFactory()
{
-
}
manualContourBaseControler* creaContoursFactory::getContourControler(int typeContour)
manContourControl = new manualContourControler();
}
-
//JPReyes 13/04/2010
//Spline 3D
if(typeContour==12)
manContourControl = new manualContour3V3DControler();
}
+ //EED 2026-04
+ //spline Force Open
+ if (typeContour==14)
+ {
+ manContourControl = new manualContourControler();
+ }
+
return manContourControl;
}
{
manContourControl = getContourControler(12);
}
+
+ //EED 2026-04
+ if (typeContour.compare("splineforceopen")==0)
+ {
+ manContourControl = getContourControler(14);
+ }
+
+
return manContourControl;
}
{
manViewerContour = new manualView3DContour();
}
+
+ //EED 2026-04
+ //spline force open
+ if (typeContour==14)
+ {
+ manViewerContour = new manualViewContour();
+ }
+
return manViewerContour;
}
manViewerContour = getCountourView(12);
}
+ // EED 2026-04
+ // spine force open
+ if (typeContour.compare("splineforceopen")==0)
+ {
+ manViewerContour = getCountourView(14);
+ }
+
+
return manViewerContour;
}
}
- //JPReyes 13/04/2010
- //Spline 3D
- if(typeContour==12)
- {
- manModelContour = new manualContourModel();
- }
+ //JPReyes 13/04/2010
+ //Spline 3D
+ if(typeContour==12)
+ {
+ manModelContour = new manualContourModel();
+ }
+
+ //EED 2026-04
+ //spline force open
+ if(typeContour==14)
+ {
+ manModelContour = new manualContourModelSplineForceOpen();
+// manModelContour->SetForceOpenContour(true);
+ }
return manModelContour;
}
manModelContour = getContourModel(10);
}
-
//JPReyes 13/04/2010
//Spline 3D
if (typeContour.compare("spline3D")==0)
manModelContour = getContourModel(12);
}
+ // EED 2026-04
+ // spline force open
+ if (typeContour.compare("splineforceopen")==0)
+ {
+ manModelContour = getContourModel(14);
+ }
+
return manModelContour;
}
{
return 0.0;
}
+
void manualBaseModel::GetNearestPointAndNormal(double *p, double *rp, double *rn)
{
}
+
+// virtual
+void manualBaseModel::SetForceOpenContour(bool forceOpenContour)
+{
+}
+
+// virtual
void manualBaseModel::SetCloseContour(bool closeContour)
{
}
+
bool manualBaseModel::IfCloseContour()
{
return false;
virtual void GetNearestPointAndNormal(double *p, double *rp, double *rn);
virtual void SetCloseContour(bool closeContour);
+ virtual void SetForceOpenContour(bool closeContour);
virtual bool IfCloseContour();
// RaC 27-09-09 ----
* Assigns the parameter value to the label
* @param newLabel New label of the contour
*/
- void SetLabel(std::string newLabel);
+ void SetLabel(std::string newLabel);
std::string GetLabel();
- void SetLabel2(std::string newLabel);
+ void SetLabel2(std::string newLabel);
std::string GetLabel2();
/*
_cntSplineX = vtkKochanekSpline::New( );
_cntSplineY = vtkKochanekSpline::New( );
_cntSplineZ = vtkKochanekSpline::New( );
+//EED2026 this->SetForceOpenContour(false);
this->SetCloseContour(true);
_cntSplineX->SetDefaultTension( 0 );
_cntSplineX->SetDefaultBias( 0 );
// ----------------------------------------------------------------------------
+/*EED2026
+//EED 2026-04
+// ----------------------------------------------------------------------------
+void manualContourModel::SetForceOpenContour(bool forceOpenContour)
+{
+ _forceOpenContour = forceOpenContour;
+}
+*/
+
+//Virtual
void manualContourModel::SetCloseContour(bool closeContour)
{
- _closeContour = closeContour;
- if (_closeContour==true)
- {
- _cntSplineX->ClosedOn();
- _cntSplineY->ClosedOn();
- _cntSplineZ->ClosedOn();
- } else {
- _cntSplineX->ClosedOff();
- _cntSplineY->ClosedOff();
- _cntSplineZ->ClosedOff();
- }
+//EED2026
+//EED 2026-04
+// if (_forceOpenContour==true)
+// {
+// _closeContour = false;
+// } else {
+// _closeContour = closeContour;
+// }
+ _closeContour = closeContour;
+ if (_closeContour==true)
+ {
+ _cntSplineX->ClosedOn();
+ _cntSplineY->ClosedOn();
+ _cntSplineZ->ClosedOn();
+ } else {
+ _cntSplineX->ClosedOff();
+ _cntSplineY->ClosedOff();
+ _cntSplineZ->ClosedOff();
+ }
}
// ----------------------------------------------------------------------------
SetRealSize(atof(tmp));
}
-//------------------------------------------------------------------------------------------------------------
-
// ---------------------------------------------------------------------------
-
void manualContourModel::CopyAttributesTo( manualContourModel * cloneObject)
{
// Fathers object
cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
}
cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
- cloneObject->SetCloseContour( _closeContour );
+ cloneObject->SetCloseContour( _closeContour );
+//EED2026
+// cloneObject->SetForceOpenContour( _forceOpenContour );
cloneObject->UpdateSpline();
}
-
// ---------------------------------------------------------------------------
void manualContourModel::AddManualPoint( manualPoint* theManualPoint )//private
{
return lstTmp;
}
-
// ----------------------------------------------------------------------------
void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
{
virtual void SetNumberOfPointsSpline(int size);
virtual void UpdateSpline();
- void SetCloseContour(bool closeContour);
+ virtual void SetCloseContour(bool closeContour);
+
+//EED2026
+// void SetForceOpenContour(bool forceOpenContour);
+
bool IfCloseContour();
//JSTG 25-02-08 -----------------------------------------------------------------
//void GetSplinePoint(double t, double &x, double &y, double &z); //Method Original
//int _sizePointsContour;
//std::vector<manualPoint*> _lstPoints;
bool _closeContour;
+
+//EED2026
+// bool _forceOpenContour;
+
vtkKochanekSpline *_cntSplineX;
vtkKochanekSpline *_cntSplineY;
vtkKochanekSpline *_cntSplineZ;
--- /dev/null
+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
+#include "manualContourModelSplineForceOpen.h"
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+
+manualContourModelSplineForceOpen::manualContourModelSplineForceOpen()
+: manualContourModel()
+{
+//EED2026
+// SetForceOpenContour(true);
+ SetCloseContour(false); // This is just for init the parameter
+}
+
+manualContourModelSplineForceOpen::~manualContourModelSplineForceOpen()
+{
+}
+
+//----------------------------------------------------------------
+int manualContourModelSplineForceOpen::GetTypeModel() //virtual
+{
+ return 14;
+}
+
+void manualContourModelSplineForceOpen::SetCloseContour(bool closeContour)
+{
+ manualContourModel::SetCloseContour(false); // This for open contour always for this manualContour
+}
--- /dev/null
+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
+#ifndef manualContourModelSplineForceOpen_h
+#define manualContourModelSplineForceOpen_h
+
+#include "manualContourModel.h"
+
+//--------------------------------------------------------
+
+class creaMaracasVisu_EXPORT manualContourModelSplineForceOpen : public manualContourModel
+{
+public:
+ manualContourModelSplineForceOpen();
+ virtual ~manualContourModelSplineForceOpen();
+// virtual manualContourModelSplineForceOpen *Clone();
+// void CopyAttributesTo( manualContourModelSplineForceOpen *cloneObject);
+// virtual void GetSpline_i_Point(int i, double *x, double *y, double *z);
+ virtual int GetTypeModel();
+ virtual void SetCloseContour(bool closeContour);
+
+// virtual void UpdateSpline();
+};
+
+#endif // manualContourModelSplineForceOpen_h