nearp = distA;
_posn = _posA;
- }
- else
- {
+ } else {
nearp = distB;
_posn = _posB;
- }
- }
+ } // if dist
+ } // if interpointsX
}
//-----------------------------------------------------------------------------------------------------------------------------------------
void AutoControlPoints::MoveControlPointInContour(std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ)
_controlpointsX.push_back( (*InX)[_contIncontpos[_posn]] );
_controlpointsY.push_back( (*InY)[_contIncontpos[_posn]] );
_controlpointsZ.push_back( (*InZ)[_contIncontpos[_posn]] );
- }
- else
- {
+ } else {
_controlpointsX.push_back( tempX[i] );
_controlpointsY.push_back( tempY[i] );
_controlpointsZ.push_back( tempZ[i] );
- }
- }
+ } // if i
+ } // for
fixBetweenPoints(5.0);
PossibleIntersections(InX,InY,InZ);
_controlpointsX.push_back( (*InX)[_contIncontpos[posact]] );
_controlpointsY.push_back( (*InY)[_contIncontpos[posact]] );
_controlpointsZ.push_back( (*InZ)[_contIncontpos[posact]] );
- }
- else
- {
+ } else {
_controlpointsX.push_back( tempX[i] );
_controlpointsY.push_back( tempY[i] );
_controlpointsZ.push_back( tempZ[i] );
- }
- }
+ } // if i
+ } // for i
if(direction == 1)
{
posact = posact+1;
ErrorBetweenContours();
promactual1 = vf->promVector(&_errorvector,false);
j--;
- }
- }
+ } // if j
+ }// for i
delete vf;
}
return 99999;
int inicontrolpoints = cpX.size();
double inipercentage = (inicontrolpoints*100)/InX->size();
int h=0;
+
if(inicontrolpoints<10)
{
int points = (int)((inipercentage*3*InX->size())/100);
_controlpointsY.push_back( (*InY)[i] );
_controlpointsZ.push_back( (*InZ)[i] );
h = 0;
- }
- }
- }
+ } // if h
+ } // for i
+ } // if initontrolpoints
+
if(inicontrolpoints>=10)
{
int points = (int)((inipercentage*2*InX->size())/100);
_controlpointsY.push_back( (*InY)[i] );
_controlpointsZ.push_back( (*InZ)[i] );
h = 0;
- }
- }
- }
+ } // if h
+ } // for int i
+ } // if inicontrolpoints
}
/*
fixBetweenPoints(5.0);
//-----------------------------------------------------------------------------------------------------------------------------------------
void AutoControlPoints::CalculeInitialControlPoints(std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ)
{
-
_controlpointsX.clear();
_controlpointsY.clear();
_controlpointsZ.clear();
//-----------------------------------------------------------------------------------------
void ExtractControlPoints2D::SetContour(std::vector<double>*InX, std::vector<double>*InY,std::vector<double>*InZ)
{
+ int i;
_InX.clear();
_InY.clear();
_InZ.clear();
int sizeZ = InZ->size();
if( (sizeX == sizeY) && (sizeY==sizeZ) )
{
- for(int i=0; i<sizeX; i++)
+ for(i=0; i<sizeX; i++)
{
_InX.push_back( (*InX)[i] );
_InY.push_back( (*InY)[i] );
_InZ.push_back( (*InZ)[i] );
- }
- }
- else
- {
+ } // for i
+ } else {
printf("\n The lists Of vectors have diferents sizes");
}
}
{
//EED2017
_sizePointsContour = 100; //JSTG 25-02-08 The change in the inisialization of these variable is critical.
-
+ _label = "";
+ _label2 = "UU";
}
// ----------------------------------------------------------------------------
return false;
}
//CMRU 17-08-09----------------------------------------------------------------------------
-void manualBaseModel::SetLabel(std::string newLabel)
-{
-}
void manualBaseModel::SetRealSize(double newRealSize)
{
return -1;
}
+void manualBaseModel::OpenData(FILE *ff)
+{
+}
+
+void manualBaseModel::SetLabel(std::string newLabel)
+{
+ _label = newLabel;
+}
+
std::string manualBaseModel::GetLabel()
{
- return "";
+ return _label;
}
-void manualBaseModel::OpenData(FILE *ff)
+
+void manualBaseModel::SetLabel2(std::string newLabel)
+{
+ _label2 = newLabel;
+}
+
+std::string manualBaseModel::GetLabel2()
{
+ return _label2;
}
+
+
+
//----------------------------------------------------------------------------
* Assigns the parameter value to the label
* @param newLabel New label of the contour
*/
- virtual void SetLabel(std::string newLabel);
+ void SetLabel(std::string newLabel);
+ std::string GetLabel();
+ void SetLabel2(std::string newLabel);
+ std::string GetLabel2();
/*
* Assigns the parameter value to the real size
*/
virtual void SetRealSize(double newRealSize);
- /**
- * Returns the label of the contour
- */
- virtual std::string GetLabel();
/**
* Returns the real size in milimeters of the contour
int _sizePointsContour;
std::vector<manualPoint*> _lstPoints;
+ /**
+ * Represents the label associated with the contour
+ */
+ std::string _label;
+ std::string _label2;
+
};
//---------------------------------------------------------------------------------------------------------------
//CMRU 17-08-09 -------------------------------------------------------------------------------------------------
_realSize = 0.0;
- _label = "";
//---------------------------------------------------------------------------------------------------------------
}
{
std::string etiqueta = GetLabel();
if(etiqueta.empty())
+ {
fprintf(ff,"Label: NO_LABEL\n");
- else
+ } else {
fprintf(ff,"Label: %s\n",etiqueta.c_str());
+ } // if etiqueta
fprintf(ff,"Real_Size: %f\n",GetRealSize());
}
std::cout<<tmp<<std::endl;
//if(strcmp(tmp != "NO_LABEL") // JPR
if(strcmp(tmp,"NO_LABEL") != 0)
+ {
SetLabel(tmp);
-
+ }
fscanf(ff,"%s",tmp); // Real_size
fscanf(ff,"%s",tmp);// #
//CMRU 17-08-09----------------------------------------------------------------------------
-void manualContourModel::SetLabel(std::string newLabel)
-{
- _label = newLabel;
-}
-
void manualContourModel::SetRealSize(double newRealSize)
{
_realSize = newRealSize;
return _realSize;
}
-std::string manualContourModel::GetLabel()
-{
- return _label;
-}
//----------------------------------------------------------------------------
// CMRU 17-08-09 -----------------------------------------------------------------
- /*
- * Assigns the parameter value to the label
- * @param newLabel New label of the contour
- */
- void SetLabel(std::string newLabel);
/*
* Assigns the parameter value to the real size
*/
void SetRealSize(double newRealSize);
- /**
- * Returns the label of the contour
- */
- std::string GetLabel();
-
/**
* Returns the real size in milimeters of the contour
*/
vtkKochanekSpline *_cntSplineZ;
//JSTG 25-02-08 ----------------------------------------
- double _delta_JSTG;
+ double _delta_JSTG;
//------------------------------------------------------
//CMRU 17-08-09 -----------------------------------------------------------------
/**
* Represents the real size in milimeters of the contour
*/
- double _realSize;
+ double _realSize;
- /**
- * Represents the label associated with the contour
- */
- std::string _label;
//--------------------------------------------------------------------------------
};
// _textActor->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
vtkTextProperty *tprop = _textActor->GetTextProperty();
- tprop->SetFontSize(14);
+ tprop->SetFontSize(12);
tprop->SetFontFamilyToArial();
tprop->SetColor(1, 1, 0);
// _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
vtkTextProperty *tprop2 = _textActor2->GetTextProperty();
- tprop2->SetFontSize(14);
+ tprop2->SetFontSize(12);
tprop2->SetFontFamilyToArial();
tprop2->SetColor(1, 1, 0);
// ----------------------------------------------------------------------------
void manualViewContour::RefreshText() // virtual
{
-
if ((_textActor!=NULL) && ( _textActor->GetProperty()->GetOpacity()!=0 )){
int size = GetNumberOfPoints();
char text[50];
char resultText2[250];
strcpy(resultText2, "000");
double spcP[3];
- spcP[0]=1;
- spcP[1]=1;
- spcP[2]=1;
+ spcP[0] = 1;
+ spcP[1] = 1;
+ spcP[2] = 1;
//CMRU 19-08-09 ----------------------------------
- std::string label;
- label = _manContModel->GetLabel();
+ std::string label = _manContModel->GetLabel();
+ std::string label2 = " (" + _manContModel->GetLabel2() + "z) ";
// ------------------------------------
if (size==2)
gcvt ( this->_manContModel->GetPathSize( _spc ), 5, text );
strcat(resultText2,text);
strcat(resultText2,"u");
-
}
//CMRU 19-08-09 ----------------------------------
+ strcat(resultText,label2.c_str());
strcat(resultText,label.c_str());
//------------------------------------------------
}
_textActor->SetInput(resultText);
_textActor2->SetInput(resultText2);
- if (size>=1){
-
+ if (size>=1)
+ {
int i;
for (i=0; i<size; i++)
{
if (_lstViewPoints[i]->GetPosibleSelected()==true)
{
_id_viewPoint_for_text = i;
- }
- }
-
+ } // if
+ } // for
if (_id_viewPoint_for_text>=size)
{
- _id_viewPoint_for_text=0;
- }
-
+ _id_viewPoint_for_text = 0;
+ }// if
double px = _manContModel->GetManualPoint(_id_viewPoint_for_text)->GetX();
double py = _manContModel->GetManualPoint(_id_viewPoint_for_text)->GetY();
-
//EED 27 sep 2006
- px=px*_spc[0];
- py=py*_spc[1];
-
+ px = px*_spc[0];
+ py = py*_spc[1];
_textActor->SetPosition(px+GetRange()+1,py);
_textActor2->SetPosition(px+GetRange()+1,py+2);
- }
+ } // if size
}
}