}
//------------------------------------------------------------------------
- void ContourExtractData::SetLstManualContourModel( std::vector<manualContourModel*> lstManConMod)
+ void ContourExtractData::SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod)
{
this->lstManConMod = lstManConMod;
}
//------------------------------------------------------------------------
void ContourExtractData::GetMinMaxPoint(int *minPoint,
int *maxPoint,
- manualContourModel *manualcontourmodel
+ manualBaseModel *manualcontourmodel
)
{
int i;
//int np = manualcontourmodel->GetSizeLstPoints( ); // number of control points // JPRx
-
+
// JSTG 26-02-08 ---------------------------------------------------------------------------------------
//int nps = manualviewbaseecontour->GetNumberOfPointsSpline(); // number of points in the spline
int nps = manualcontourmodel->GetNumberOfPointsSpline(); // number of points in the spline
{
int i,size = lstManConMod.size();
+
for(i=0 ; i<size ; i++)
{
GetMinMaxPoint(minPoint,maxPoint,lstManConMod[i]);
{
for (i=0;i<size;i++)
{
- numberLeft = AnalisisContourInsideV2(x,y, i );
+ // To process the statistics of the Points contour the procedure is different
+ // RaC 19-09-09
+ manualBaseModel *mbm = lstManConMod[i];
+ if(mbm->GetTypeModel()==7)
+ {
+ if(mbm->IsPoint(x,y)==true)
+ {
+ numberLeft=1;
+ }
+ }//if
+ else
+ {
+ numberLeft = AnalisisContourInsideV2(x,y, i );
+ }//else
+
if ( (numberLeft % 2) ==1){ numberInside++; }
}
if ( numberInside == (size) ){ result=true; }
} // AND Intersection
+ numberLeft=0;
if (typeOperation==1) // OR All
{
for (i=0;i<size;i++)
{
- numberLeft = AnalisisContourInsideV2(x,y, i );
+ // To process the statistics of the Points contour the procedure is different
+ // RaC 19-09-09
+ manualBaseModel *mbm = lstManConMod[i];
+ if(mbm->GetTypeModel()==7)
+ {
+ if(mbm->IsPoint(x,y)==true)
+ {
+ numberLeft=1;
+ }
+ }//if
+ else
+ {
+ numberLeft = AnalisisContourInsideV2(x,y, i );
+ }//else
if ( (numberLeft % 2) ==1){ result=true; }
}
} // OR All
+ numberLeft=0;
+
if (typeOperation==2) // XOR crown
{
for (i=0;i<size;i++)
{
- numberLeft = numberLeft + AnalisisContourInsideV2(x,y, i );
+ // To process the statistics of the Points contour the procedure is different
+ // RaC 19-09-09
+ manualBaseModel *mbm = lstManConMod[i];
+ if(mbm->GetTypeModel()==7)
+ {
+ if(mbm->IsPoint(x,y)==true)
+ {
+ numberLeft=1;
+ }
+ }//if
+ else
+ {
+ numberLeft = numberLeft + AnalisisContourInsideV2(x,y, i );
+ }//else
+
}
if ( numberLeft % 2 ==1){ result = true; }
}// XOR crown
} // for
} // for
-
// Borrame
// if (this->okImagesResults==true){
// imagedataValueResult->Modified();
{
int i,y;
double x1,y1,z1,x2,y2,z2;
- manualContourModel *manualcontourmodel= lstManConMod[iContour];
+ manualBaseModel *manualcontourmodel= lstManConMod[iContour];
int nps = manualcontourmodel->GetNumberOfPointsSpline(); // number of points in the spline
manualcontourmodel->UpdateSpline();
//------------------------------------------------------------------------------------------------------
void SetImage( vtkImageData* imagedata);
void SetZtoBeAnalys( int z );
- void SetLstManualContourModel( std::vector<manualContourModel*> lstManConMod);
+ void SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod);
void GetValuesInsideCrown( std::vector<double> *pLstValue,
std::vector<double> *pLstValuePosX,
std::vector<double> *pLstValuePosY,
private:
bool okImagesResults;
- std::vector<manualContourModel*> lstManConMod;
+
+ //
+ // List of contours to obtain the respective statistics.
+ //
+ std::vector<manualBaseModel*> lstManConMod;
+
+ //
+ // Operation Type (AND,OR,XOR...)
+ //
int _typeOperation;
int zImage;
vtkImageData *imagedataMaskResult;
bool isInside(int x, int y, int typeOperation );
+
+ //
+ // Asigns the minimum and maximum points of the contour model in parameter.
+ // @param *minPoint - int
+ // @param *maxPoint - int
+ // @param *manualcontourmodel - manualBaseModel
+ //
void GetMinMaxPoint(int *minPoint,
int *maxPoint,
- manualContourModel *manualcontourmodel );
+ manualBaseModel *manualcontourmodel );
+ //
+ // Obtain the minimum and maximum point among the contours. The value is saved in the parameter
+ // pointers
+ // @param *minPoint - int pointer to the minPoint
+ // @param *maxPoint - int pointer to the maxPoint
+ //
void GetMinMaxPoint_Of_LstManConMod( int *minPoint,
int *maxPoint);
return true;
}
// ----------------------------------------------------------------------------
-void manualContourBaseControler::SetModelView(manualContourModel *manContModel, manualViewBaseContour *manViewBaseCont){
+void manualContourBaseControler::SetModelView(manualBaseModel *manContModel, manualViewBaseContour *manViewBaseCont){
_manContModel = manContModel;
_manViewBaseCont = manViewBaseCont;
_manViewBaseCont->SetEditable( &_editable );
}
// ----------------------------------------------------------------------------
-manualContourModel* manualContourBaseControler::GetManualContourModel()
+manualBaseModel* manualContourBaseControler::GetManualContourModel()
{
return _manContModel;
}
{
if (_state==0)
{
+
int z=GetZ();
- GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
- GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
- if ( GetManualViewBaseContour()->GetPosibleSelected() )
+ bool temp = _manViewBaseCont->SelectPosibleContour(x,y,z);
+
+ _manViewBaseCont->SelectPosiblePoint(x,y,z);
+
+ if ( _manViewBaseCont->GetPosibleSelected() )
{
_editable = true;
}
virtual bool OnRightButtonDown();
virtual bool OnRightButtonUp();
- void SetModelView(manualContourModel *manContModel, manualViewBaseContour *manViewBaseCont);
- manualContourModel * GetManualContourModel();
+ void SetModelView(manualBaseModel *manContModel, manualViewBaseContour *manViewBaseCont);
+ manualBaseModel * GetManualContourModel();
manualViewBaseContour * GetManualViewBaseContour();
void SetState(int state);
int GetState();
bool IsEditable();
- void SetEditable( bool condition );
+ virtual void SetEditable( bool condition );
bool GetPosibleToMove();
void SetPosibleToMove( bool condition );
bool IsMoving();
void SetZ(int z);
virtual int GetZ();
+ // VIRTUAL - Adds a point in an specified position
+ // @param x - int
+ // @param y - int
+ // @param z - int
virtual void AddPoint(int x, int y, int z);
virtual void InsertPoint(int x, int y, int z);
// virtual manualContourBaseControler * Clone( manualViewBaseContour * cloneView = NULL, manualContourModel * cloneModel = NULL );
-private:
+protected:
+
+ // Reference to the contour or element view
manualViewBaseContour *_manViewBaseCont;
- manualContourModel *_manContModel;
+
+ // Reference to the model contour or element model
+ manualBaseModel *_manContModel;
int _z;
int _state;
// ----------------------------------------------------------------------------
void manualContourControler::MouseClickLeft(int x, int y){
-
bool ok = false;
int z = GetZ();
int size= GetManualViewBaseContour()->GetNumberOfPoints();
manualContourBaseControler::MouseDLeft( x, y);
if ( IsEditable() )
{
+
GetManualViewBaseContour()->AddControlPoints();
GetManualViewBaseContour()->AddTextActor();
GetManualViewBaseContour()->Refresh();
_delta_JSTG = 0.0;
//---------------------------------------------------------------------------------------------------------------
+
+//CMRU 17-08-09 -------------------------------------------------------------------------------------------------
+ _realSize = 0.0;
+ _label = "";
+//---------------------------------------------------------------------------------------------------------------
+
}
// ----------------------------------------------------------------------------
fprintf(ff,"%f %f %f\n", mp->GetX(), mp->GetY(), mp->GetZ() );
}
}
+//CMRU 03-09-09-----------------------------------------------------------------------------------------------
+void manualContourModel::SaveData(FILE *ff)
+{
+ std::string etiqueta = GetLabel();
+ if(etiqueta.empty())
+ fprintf(ff,"Label: NO_LABEL\n");
+ else
+ fprintf(ff,"Label: %s\n",etiqueta.c_str());
+ fprintf(ff,"Real_Size: %f\n",GetRealSize());
+}
+
+void manualContourModel::OpenData(FILE *ff)
+{
+ char tmp[255];
+
+ fscanf(ff,"%s",tmp); // Label:
+ fscanf(ff,"%s",tmp); // value
+ std::cout<<tmp<<std::endl;
+ if(tmp != "NO_LABEL")
+ SetLabel(tmp);
+
+ fscanf(ff,"%s",tmp); // Real_size
+ fscanf(ff,"%s",tmp);// #
+
+ //tmp.ToDouble(&tmp);
+ SetRealSize(atof(tmp));
+}
+//------------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------
_lstPoints.push_back( theManualPoint );
}
-std::vector<manualContourModel*> manualContourModel::ExploseModel( )
+std::vector<manualBaseModel*> manualContourModel::ExploseModel( )
{
- std::vector<manualContourModel*> lstTmp;
+ std::vector<manualBaseModel*> lstTmp;
lstTmp.push_back(this);
return lstTmp;
}
mp->SetPointY( mp->GetY()*Ay + By );
}
}
+
+
+//CMRU 17-08-09----------------------------------------------------------------------------
+void manualContourModel::SetLabel(std::string newLabel)
+{
+ _label = newLabel;
+}
+
+void manualContourModel::SetRealSize(double newRealSize)
+{
+ _realSize = newRealSize;
+}
+
+double manualContourModel::GetRealSize()
+{
+ return _realSize;
+}
+
+std::string manualContourModel::GetLabel()
+{
+ return _label;
+}
+//----------------------------------------------------------------------------
#include "wxVtkBaseView.h"
#include "marTypes.h"
#include "manualPoint.h"
+#include "manualBaseModel.h"
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-class creaMaracasVisu_EXPORT manualContourModel
+class creaMaracasVisu_EXPORT manualContourModel : public manualBaseModel
{
public:
manualContourModel();
virtual manualContourModel * Clone();
void CopyAttributesTo( manualContourModel *cloneObject );
- virtual void Open(FILE *ff); // virtual
+ void Open(FILE *ff); // virtual
virtual void Save(FILE *ff); // virtual
virtual int GetTypeModel(); // virtual
- int AddPoint(double x,double y,double z);
- int InsertPoint(double x,double y,double z);
+ virtual int AddPoint(double x,double y,double z);
+ virtual int InsertPoint(double x,double y,double z);
//JSTG 25-04-08 -------------------------------------------------------
- void InsertPoint_id(int id, double x,double y,double z);
+ virtual void InsertPoint_id(int id, double x,double y,double z);
//---------------------------------------------------------------------
- void AddManualPoint( manualPoint* theManualPoint );
- void Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
+ virtual void AddManualPoint( manualPoint* theManualPoint );
+ virtual void Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
- void DeletePoint(int i);
- void DeleteAllPoints();
+ virtual void DeletePoint(int i);
+ virtual void DeleteAllPoints();
- void MovePoint(int i,double dx,double dy,double dz);
- void MoveLstPoints(double dx,double dy,double dz);
- void MoveAllPoints(double dx,double dy,double dz);
+ virtual void MovePoint(int i,double dx,double dy,double dz);
+ virtual void MoveLstPoints(double dx,double dy,double dz);
+ virtual void MoveAllPoints(double dx,double dy,double dz);
- int GetIdPoint(double x, double y, double z, int i_range,int type);
- manualPoint* GetManualPoint(int id);
- int GetSizeLstPoints();
+ virtual int GetIdPoint(double x, double y, double z, int i_range,int type);
+ virtual manualPoint* GetManualPoint(int id);
+ virtual int GetSizeLstPoints();
int GetNumberOfPointsSpline();
- void SetNumberOfPointsSpline(int size);
+ virtual void SetNumberOfPointsSpline(int size);
virtual void UpdateSpline();
void SetCloseContour(bool closeContour);
//void GetSplinePoint(double t, double &x, double &y, double &z); //Method Original
//void GetSplineiPoint(int i, double &x, double &y, double &z); //Method Original
//-------------------------------------------------------------------------------
- double GetPathSize();
- double GetPathArea();
+ virtual double GetPathSize();
+ virtual double GetPathArea();
void GetNearestPointAndNormal(double *p, double *rp, double *rn);
void GetSpline_t_Point(double t, double *x, double *y, double *z);
//--------------------------------------------------------------------------------
- virtual std::vector<manualContourModel*> ExploseModel( );
+ virtual std::vector<manualBaseModel*> ExploseModel( );
+
+// 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
+ * @param newRealSize New real size in milimeters of the contour
+ */
+ void SetRealSize(double newRealSize);
+
+ /**
+ * Returns the label of the contour
+ */
+ std::string GetLabel();
+
+ /**
+ * Returns the real size in milimeters of the contour
+ */
+ double GetRealSize();
+
+ /*
+ * Saves the label and the real size of the contour
+ * @param ff File where the information is stored
+ */
+ void SaveData(FILE *ff);
+
+ /*
+ * Reads and interprets the information of the label and the real size
+ * @param ff File where the information is readed
+ */
+ void OpenData(FILE *ff);
+//--------------------------------------------------------------------------------
private:
- int _sizePointsContour;
- std::vector<manualPoint*> _lstPoints;
+ //int _sizePointsContour;
+ //std::vector<manualPoint*> _lstPoints;
bool _closeContour;
vtkKochanekSpline *_cntSplineX;
vtkKochanekSpline *_cntSplineY;
double _delta_JSTG;
//------------------------------------------------------
+//CMRU 17-08-09 -----------------------------------------------------------------
+ /**
+ * Represents the real size in milimeters of the contour
+ */
+ double _realSize;
+
+ /**
+ * Represents the label associated with the contour
+ */
+ std::string _label;
+//--------------------------------------------------------------------------------
+
};
}
// ----------------------------------------------------------------------------
-std::vector<manualContourModel*> manualContourModelBullEye::ExploseModel( )
+std::vector<manualBaseModel*> manualContourModelBullEye::ExploseModel( )
{
//EED004
- std::vector<manualContourModel*> lstTmp;
+ std::vector<manualBaseModel*> lstTmp;
int i,iSize=_lstModelBullEyeSector.size();
for (i=0;i<iSize;i++)
{
void ResetSectors();
int GetSizeOfSectorLst();
virtual void UpdateSpline(); // virtual
- virtual std::vector<manualContourModel*> ExploseModel( );
+ virtual std::vector<manualBaseModel*> ExploseModel( );
//int manualViewCircle::GetType() 3;
//int manualViewStar::GetType() 4;
//int manualViewLine::GetType() 6;
+//int manualViewPoints::GetType() 7;
return 0;
// ----------------------------------------------------------------------------
void manualViewBaseContour::ConstructVTKObjects()
{
+
+
//JSTG 29-02-08 -----------------------------------------------
//int i , nps = _sizePointsContour;
int i;
int nps = _manContModel->GetNumberOfPointsSpline();
//-------------------------------------------------------------
+
DeleteVtkObjects();
_pts = vtkPoints::New();
_pts->SetNumberOfPoints(nps);
-
for (i=0 ; i<nps ; i++){
_pts->SetPoint(i, 0 , 0 , 0 );
}
// This is for the boundaring inicialisation
//EED 29Mars2009
- _pts->SetPoint(0, 0 , 0 , -1000 );
- _pts->SetPoint(1, 0 , 0 , 1000 );
-// _pts->SetPoint(0, -1000 , -1000 , -1000 );
-// _pts->SetPoint(1, 1000 , 1000 , 1000 );
-
+ //_pts->SetPoint(0, 0 , 0 , -1000 );
+ //_pts->SetPoint(1, 0 , 0 , 1000 );
+ _pts->SetPoint(0, -1000 , -1000 , -1000 );
+ _pts->SetPoint(1, 1000 , 1000 , 1000 );
vtkCellArray *lines = vtkCellArray::New();
lines->InsertNextCell( nps /* +1 */ );
for ( i=0 ; i<nps+1 ; i++ ){
lines->InsertCellPoint(i % nps );
}
-
_pd = vtkPolyData::New();
_pd->SetPoints( _pts );
_pd->SetLines( lines );
_bboxMapper = vtkPolyDataMapper::New();
_bboxMapper->ScalarVisibilityOff( );
+
_bboxMapper->SetInput(_pd);
_bboxMapper->ImmediateModeRenderingOn();
_contourVtkActor->SetMapper(_bboxMapper);
_contourVtkActor->GetProperty()->BackfaceCullingOff();
+
UpdateColorActor();
_pd->ComputeBounds();
+ InitTextActor();
+
+
+}
+
+void manualViewBaseContour::InitTextActor()
+{
// Text
_textActor = vtkTextActor::New();
// _textActor->SetDisplayPosition(200, 200);
tprop->SetFontFamilyToArial();
tprop->SetColor(0, 0, 1);
}
+
// ----------------------------------------------------------------------------
void manualViewBaseContour::CreateNewContour()
{
bool result=false;
SetPosibleSelected(result);
int id = GetIdPoint(x,y,z);
-
+
if( !GetEditable() && !_selected && id!= -1)
{
result=true;
- SetPosibleSelected(result);
+ _posibleSelected=true;
}
else
{
}
}
-
}
return result;
}
Refresh();
}
// ----------------------------------------------------------------------------
-void manualViewBaseContour::SetModel(manualContourModel *manContModel){
+void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
_manContModel=manContModel;
}
// ----------------------------------------------------------------------------
class creaMaracasVisu_EXPORT manualViewBaseContour{
+
+//---------------------------------------------------
+// PUBLIC METHODS & ATTS
+//---------------------------------------------------
+
public:
manualViewBaseContour();
virtual ~manualViewBaseContour();
virtual void Open(FILE *pFile);
void AddPoint();
- void AddPoint( manualViewPoint * manualViewPoint );
+ virtual void AddPoint( manualViewPoint * manualViewPoint );
void InsertPoint(int id);
void DeleteContour();
void DeletePoint(int x, int y,int z);
void UnSelectLstPoints();
void UnSelectAllPoints();
- void SetModel(manualContourModel *manContModel);
+ void SetModel(manualBaseModel *manContModel);
void SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview);
virtual void Refresh();
void RemoveCompleteContourActor();
virtual void AddSplineActor();
virtual void RemoveSplineActor();
- void AddControlPoints();
- void RemoveControlPoints();
+ virtual void AddControlPoints();
+ virtual void RemoveControlPoints();
void AddTextActor();
void RemoveTextActor();
+ void InitTextActor();
virtual manualViewBaseContour * Clone();
void CopyAttributesTo( manualViewBaseContour *cloneObject );
virtual void ConstructVTKObjects();
-private:
- double _range;
-
- wxVtkBaseView *_wxvtkbaseview;
- bool _selected;
- bool *_editable;
- bool _posibleSelected;
- bool _viewControlPoints;
+//---------------------------------------------------
+// PRIVATE METHODS & ATTS
+//---------------------------------------------------
+private:
vtkPolyData *_pd;
vtkActor *_contourVtkActor;
vtkPolyDataMapper *_bboxMapper;
+ void DeleteVtkObjects();
+
+
+//---------------------------------------------------
+// PROTECTED METHODS & ATTS
+//---------------------------------------------------
+
+protected:
+
+ double _range;
+
double _coulorEdit_r;
double _coulorEdit_g;
double _coulorEdit_b;
double _coulorSelection_b;
double _widthline;
- void DeleteVtkObjects();
- virtual void RefreshText();
-
+ //
+ // Reference to VTKBaseView
+ //
+ wxVtkBaseView *_wxvtkbaseview;
-protected:
+ //
+ // Is the contour selected
+ //
+ bool _selected;
+ bool *_editable;
+ bool _posibleSelected;
+ bool _viewControlPoints;
// text
bool _show_text;
int _id_viewPoint_for_text;
vtkTextActor *_textActor;
- manualContourModel *_manContModel;
+
+ //
+ // Contour model
+ //
+ manualBaseModel *_manContModel;
+
vtkPoints *_pts;
// JSTG 25-02-08 --------------------------------------------
int _sizePointsContour;
//-----------------------------------------------------------
+
+ //
+ // Control points list
+ //
std::vector<manualViewPoint*> _lstViewPoints;
+
+ //
+ // Spacing
+ //
double _spc[3];
+ virtual void RefreshText();
+
};
char text[50];
char resultText[50];
strcpy(resultText," ");
+
+//CMRU 19-08-09 ----------------------------------
+ std::string label;
+ label = _manContModel->GetLabel();
+// ------------------------------------
+
if (size==2)
{
strcpy(resultText,"L= ");
gcvt ( _mesureScale * this->_manContModel->GetPathSize() , 5, text );
strcat(resultText,text);
+
+//CMRU 19-08-09 ----------------------------------
+ strcat(resultText," ");
+ strcat(resultText,label.c_str());
+//------------------------------------------------
}
if (size>2)
{
gcvt ( _mesureScale * this->_manContModel->GetPathSize() , 5, text );
strcat(resultText,text);
}
+//CMRU 19-08-09 ----------------------------------
+ strcat(resultText,label.c_str());
+//------------------------------------------------
}
_textActor->SetInput(resultText);
// ----------------------------------------------------------------------------
bool manualViewContour::ifTouchContour(int x,int y,int z){
-
bool result=false;
double xx=x;
double yy=y;
d2= sqrt( (ppB[0]-xx)*(ppB[0]-xx) + (ppB[1]-yy)*(ppB[1]-yy) + (ppB[2]-zz)*(ppB[2]-zz));
d3= sqrt( (ppB[0]-ppA[0])*(ppB[0]-ppA[0]) + (ppB[1]-ppA[1])*(ppB[1]-ppA[1]) + (ppB[2]-ppA[2])*(ppB[2]-ppA[2]));
+
if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) )
- {
- result=true;
- i=nps;
- }
-
- //EED 25 Sep 2009
- if ((d1<=1) || (d2<=1))
{
result=true;
i=nps;
}
-
}
return result;
#include "manualViewPoint.h"
-
-// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-
-//int manualViewPoint::range=1;
-
-
manualViewPoint::manualViewPoint(wxVtkBaseView *wxvtkbaseview){
_selected = false;
_posibleSelected = false;
_spc[0] = 1;
_spc[1] = 1;
_spc[2] = 1;
-
_widthline = 1;
+
+ //Colors
+ _colorNormal_r = 1.0;
+ _colorNormal_g = 0.0;
+ _colorNormal_b = 0.0;
+
+ _colorPosibleSelected_r = 1.0;
+ _colorPosibleSelected_g = 1.0;
+ _colorPosibleSelected_b = 0.0;
}
// ----------------------------------------------------------------------------
DeleteVtkObjects();
}
+
+// ----------------------------------------------------------------------------
+manualViewPoint * manualViewPoint :: Clone()
+{
+ manualViewPoint * clone = new manualViewPoint(_wxvtkbaseview);
+ CopyAttributesTo(clone);
+ return clone;
+}
+
+// ---------------------------------------------------------------------------
+
+void manualViewPoint::CopyAttributesTo( manualViewPoint * cloneObject)
+{
+ // Fathers object
+ cloneObject->SetPosibleSelected(_posibleSelected);
+ cloneObject->SetSelected(_selected);
+ cloneObject->SetSpacing(_spc);
+ cloneObject->SetWidthLine(_widthline);
+}
+
+
// ----------------------------------------------------------------------------
void manualViewPoint::SetWidthLine( double width)
{
return _pointVtkActor;
}
+
+
// ----------------------------------------------------------------------------
vtkActor* manualViewPoint::GetVtkActor(){
return _pointVtkActor;
// ----------------------------------------------------------------------------
void manualViewPoint::SetPositionXY(double x, double y,double i_range,double posZ)
{
-// double range=0.2; // i_range;
-// double range=(double)manualViewPoint::range;
-
double range=i_range;
//EED 27 sep 2006
if (_pointVtkActor!=NULL){
//EED03
_pointVtkActor->GetProperty()->SetLineWidth( _widthline );
- _pointVtkActor->GetProperty()->SetDiffuseColor(1,0,0);
+ _pointVtkActor->GetProperty()->SetDiffuseColor(_colorNormal_r,_colorNormal_g,_colorNormal_b);
if (_posibleSelected==true){
- _pointVtkActor->GetProperty()->SetDiffuseColor(1,1,0);
+ _pointVtkActor->GetProperty()->SetDiffuseColor(_colorPosibleSelected_r,_colorPosibleSelected_g,_colorPosibleSelected_b);
}
}
}
+
+// ----------------------------------------------------------------------------
+void manualViewPoint::UpdateColorActor(double nR, double nG, double nB)
+{
+ _colorNormal_r = nR;
+ _colorNormal_g = nG;
+ _colorNormal_b = nB;
+ UpdateColorActor();
+}
+
// ----------------------------------------------------------------------------
void manualViewPoint::GetSpacing(double spc[3])
{
#include <vtkKochanekSpline.h>
#include <vtkCellPicker.h>
-
-
#include <vtkCamera.h>
#include <vtkPolyLine.h>
#include <vtkDataSetMapper.h>
#include "wxVTKRenderWindowInteractor.h"
-
-//--
-
#include <vector>
#include "wxVtkBaseView.h"
#include "marTypes.h"
class manualViewPoint{
public:
-// static int range;
-
manualViewPoint(wxVtkBaseView *wxvtkbaseview);
~manualViewPoint();
+
+ virtual manualViewPoint * Clone();
+ void CopyAttributesTo( manualViewPoint *cloneObject );
void SetSelected(bool selected);
void SetPosibleSelected(bool posibleSelected);
bool GetSelected();
bool GetPosibleSelected();
void DeleteVtkObjects();
vtkActor* CreateVtkPointActor();
+
+ //
+ // Sets the x,y,z position to the actual point. Establishes a range of the points respect
+ // to the final coordinate.
+ // @param x - double
+ // @param y - double
+ // @param z - double
+ // @param range - double
+ //
void SetPositionXY(double x, double y, double range, double posZ);
+
+ //
+ // Get ViewPoint VtkActor
+ // @return vtkActor*
+ //
vtkActor* GetVtkActor();
+
+ //
+ // Updates the color and width of the actual point if the VTK Actor has been created
+ //
void UpdateColorActor();
+
+ //
+ // Updates the point normal color of the actual point.
+ //
+ void UpdateColorActor(double nR, double nG, double nB);
+
void GetSpacing(double spc[3]);
void SetSpacing(double spc[3]);
void SetWidthLine( double width);
private:
+
+ //
+ // Is point selected
+ //
bool _selected;
bool _posibleSelected;
+
vtkPoints *_pts;
+
+ //
+ // Point VTK PolyData object
+ //
vtkPolyData *_pd;
+
+ //
+ // Point VTK Actor
+ //
vtkActor *_pointVtkActor;
+
+ //
+ // Point VTK PolyData mapper
+ //
vtkPolyDataMapper *_bboxMapper;
+
+ //
+ // Reference to VtkBaseView
+ //
wxVtkBaseView *_wxvtkbaseview;
+
+ //
+ // Line Width (def=1)
+ //
double _widthline;
protected:
- double _spc[3];
+
+ //
+ // Point spacing (def=1)
+ //
+ double _spc[3];
+
+ // Point normal color
+ double _colorNormal_r;
+ double _colorNormal_g;
+ double _colorNormal_b;
+
+ // Posible selected point color
+ double _colorPosibleSelected_r;
+ double _colorPosibleSelected_g;
+ double _colorPosibleSelected_b;
};
#endif // manualViewPoint_h